From ed6509f86649c7206577f2c7cfdd354377b6c87b Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 10 Dec 2024 01:16:47 +0000 Subject: [PATCH] Update generated code for v1400 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 26 +++ .../java/com/stripe/model/PaymentIntent.java | 8 + .../param/PaymentIntentConfirmParams.java | 32 ++++ .../param/PaymentIntentCreateParams.java | 32 ++++ ...entIntentIncrementAuthorizationParams.java | 181 ++++++++++++++++++ .../param/PaymentIntentUpdateParams.java | 32 ++++ 7 files changed, 312 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 030963bfb20..801f5f8b6ee 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1398 \ No newline at end of file +v1400 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index c456da1f11f..2b99be05443 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1770,6 +1770,10 @@ public static class Card extends StripeObject { @SerializedName("amount_authorized") Long amountAuthorized; + /** The latest amount intended to be authorized by this charge. */ + @SerializedName("amount_requested") + Long amountRequested; + /** Authorization code on the charge. */ @SerializedName("authorization_code") String authorizationCode; @@ -1900,6 +1904,9 @@ public static class Card extends StripeObject { @SerializedName("overcapture") Overcapture overcapture; + @SerializedName("partial_authorization") + PartialAuthorization partialAuthorization; + /** * Status of a card based on the card issuer. * @@ -2092,6 +2099,25 @@ public static class Overcapture extends StripeObject { String status; } + /** + * For more details about PartialAuthorization, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PartialAuthorization extends StripeObject { + /** + * Indicates whether the transaction requested for partial authorization feature and the + * authorization outcome. + * + *

One of {@code declined}, {@code fully_authorized}, {@code not_requested}, or {@code + * partially_authorized}. + */ + @SerializedName("status") + String status; + } + /** * For more details about ThreeDSecure, 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 a0a74841f28..ed06a71fe73 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -3745,6 +3745,14 @@ public static class Card extends StripeObject { @SerializedName("request_overcapture") String requestOvercapture; + /** + * Request partial authorization on this PaymentIntent. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_partial_authorization") + String requestPartialAuthorization; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and metadata; + /** Payment method-specific configuration for this PaymentIntent. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -85,6 +89,7 @@ private PaymentIntentIncrementAuthorizationParams( List expand, Map extraParams, Map metadata, + PaymentMethodOptions paymentMethodOptions, String statementDescriptor, TransferData transferData) { this.amount = amount; @@ -94,6 +99,7 @@ private PaymentIntentIncrementAuthorizationParams( this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; + this.paymentMethodOptions = paymentMethodOptions; this.statementDescriptor = statementDescriptor; this.transferData = transferData; } @@ -117,6 +123,8 @@ public static class Builder { private Map metadata; + private PaymentMethodOptions paymentMethodOptions; + private String statementDescriptor; private TransferData transferData; @@ -131,6 +139,7 @@ public PaymentIntentIncrementAuthorizationParams build() { this.expand, this.extraParams, this.metadata, + this.paymentMethodOptions, this.statementDescriptor, this.transferData); } @@ -248,6 +257,13 @@ public Builder putAllMetadata(Map map) { return this; } + /** Payment method-specific configuration for this PaymentIntent. */ + public Builder setPaymentMethodOptions( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -507,6 +523,171 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class PaymentMethodOptions { + /** Configuration for any card payments attempted on this PaymentIntent. */ + @SerializedName("card") + Card card; + + /** + * 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 PaymentMethodOptions(Card card, Map extraParams) { + this.card = card; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions( + this.card, this.extraParams); + } + + /** Configuration for any card payments attempted on this PaymentIntent. */ + public Builder setCard( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card card) { + this.card = card; + 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.PaymentMethodOptions#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.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + public static class Card { + /** + * 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; + + /** Request partial authorization on this PaymentIntent. */ + @SerializedName("request_partial_authorization") + RequestPartialAuthorization requestPartialAuthorization; + + private Card( + Map extraParams, + RequestPartialAuthorization requestPartialAuthorization) { + this.extraParams = extraParams; + this.requestPartialAuthorization = requestPartialAuthorization; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private RequestPartialAuthorization requestPartialAuthorization; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card( + this.extraParams, this.requestPartialAuthorization); + } + + /** + * 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.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 + * PaymentIntentIncrementAuthorizationParams.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; + } + + /** Request partial authorization on this PaymentIntent. */ + public Builder setRequestPartialAuthorization( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card + .RequestPartialAuthorization + requestPartialAuthorization) { + this.requestPartialAuthorization = requestPartialAuthorization; + return this; + } + } + + public enum RequestPartialAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestPartialAuthorization(String value) { + this.value = value; + } + } + } + } + @Getter public static class TransferData { /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index fccfc205735..5e6a947c891 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -15783,6 +15783,10 @@ public static class Card { @SerializedName("request_overcapture") RequestOvercapture requestOvercapture; + /** Request partial authorization on this PaymentIntent. */ + @SerializedName("request_partial_authorization") + RequestPartialAuthorization requestPartialAuthorization; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and