From cc107cf1b652c796b908dcdabca65588ebf83182 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 30 Oct 2024 11:19:12 -0700 Subject: [PATCH 01/13] add major verison blurb to changelog (#1915) --- CHANGELOG.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 83384751e03..ed2bc51c6b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,11 @@ # Changelog ## 28.0.0 - 2024-10-29 + +Historically, when upgrading webhooks to a new API version, you also had to upgrade your SDK version. Your webhook's API version needed to match the API version pinned by the SDK you were using to ensure successful deserialization of events. With the `2024-09-30.acacia` release, Stripe follows a [new API release process](https://stripe.com/blog/introducing-stripes-new-api-release-process). As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like `acacia`) without upgrading the SDK. + +However, [a bug](https://github.com/stripe/stripe-java/pull/1906) in the `27.x.y` SDK releases meant that webhook version upgrades from the SDK's pinned `2024-09-30.acacia` version to the new `2024-10-28.acacia` version would fail. Therefore, we are shipping SDK support for `2024-10-28.acacia` as a major version to enforce the idea that an SDK upgrade is also required. Future API versions in the `acacia` line will be released as minor versions. + * [#1896](https://github.com/stripe/stripe-java/pull/1896) This release changes the pinned API version to `2024-10-28.acacia`. * Add support for new resource `V2.EventDestinations` * Add support for `create`, `retrieve`, `update`, `list`, `delete`, `disable`, `enable` and `ping` methods on resource `V2.EventDestinations` From 48d4fb9ff352eb67b5f550053881b5db967d86c5 Mon Sep 17 00:00:00 2001 From: David Brownman <109395161+xavdid-stripe@users.noreply.github.com> Date: Wed, 30 Oct 2024 12:09:02 -0700 Subject: [PATCH 02/13] uncomment test (#1916) --- src/test/java/com/stripe/StripeClientTest.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/test/java/com/stripe/StripeClientTest.java b/src/test/java/com/stripe/StripeClientTest.java index 01b05adb2f4..fd8b82e0477 100644 --- a/src/test/java/com/stripe/StripeClientTest.java +++ b/src/test/java/com/stripe/StripeClientTest.java @@ -60,8 +60,7 @@ public void testReportsStripeClientUsageTelemetry() throws StripeException { }); } - // TODO: https://go/j/DEVSDK-2178 - // @Test + @Test public void testReportsRawRequestUsageTelemetry() throws StripeException { mockClient.rawRequest( com.stripe.net.ApiResource.RequestMethod.POST, "/v1/customers", "description=foo", null); From 1b9cf576e97c7ef695bec8420d727f2c5ed9f862 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Thu, 31 Oct 2024 16:25:52 +0000 Subject: [PATCH 03/13] Update generated code for v1321 --- OPENAPI_VERSION | 2 +- .../com/stripe/model/billing/CreditGrant.java | 17 ++++----- .../param/PaymentIntentCreateParams.java | 5 ++- .../stripe/param/SetupIntentCreateParams.java | 3 +- .../stripe/param/SetupIntentUpdateParams.java | 3 +- .../CreditBalanceSummaryRetrieveParams.java | 8 ++--- .../billing/CreditGrantCreateParams.java | 36 +++++++++---------- .../billing/CreditGrantUpdateParams.java | 16 ++++----- 8 files changed, 42 insertions(+), 48 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a3271488716..a1ae6d8842d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1320 \ No newline at end of file +v1321 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/billing/CreditGrant.java b/src/main/java/com/stripe/model/billing/CreditGrant.java index 64563a07182..091662a63a4 100644 --- a/src/main/java/com/stripe/model/billing/CreditGrant.java +++ b/src/main/java/com/stripe/model/billing/CreditGrant.java @@ -32,7 +32,7 @@ * *

Related guide: Billing - * credits end + * credits */ @Getter @Setter @@ -45,8 +45,8 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStoreOne of {@code paid}, or {@code promotional}. */ @@ -57,20 +57,17 @@ public class CreditGrant extends ApiResource implements HasId, MetadataStore customer; - /** The time when the billing credits become effective i.e when they are eligible to be used. */ + /** The time when the billing credits become effective—when they're eligible for use. */ @SerializedName("effective_at") Long effectiveAt; - /** - * The time when the billing credits will expire. If not present, the billing credits will never - * expire. - */ + /** The time when the billing credits expire. If not present, the billing credits don't expire. */ @SerializedName("expires_at") Long expiresAt; @@ -454,7 +451,7 @@ public static class ApplicabilityConfig extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Scope extends StripeObject { /** - * The price type to which credit grants can apply to. We currently only support {@code + * The price type for which credit grants can apply. We currently only support the {@code * metered} price type. This refers to prices that have a Billing Meter attached to them. * diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a1b5decf810..9887d2c419f 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -209,9 +209,8 @@ public class PaymentIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, a card) that this PaymentIntent can use. If you - * don't provide this, it defaults to ["card"]. Use {@code automatic_payment_methods} to - * manage payment methods from the Stripe Dashboard. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 3815f378563..c9d5dfcb128 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -129,7 +129,8 @@ public class SetupIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can use. If you - * don't provide this, it defaults to ["card"]. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 477d4402bbc..81c075960ac 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -93,7 +93,8 @@ public class SetupIntentUpdateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can set up. If you - * don't provide this array, it defaults to ["card"]. + * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. */ @SerializedName("payment_method_types") List paymentMethodTypes; diff --git a/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java b/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java index a56cf342eb3..90edb084feb 100644 --- a/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java +++ b/src/main/java/com/stripe/param/billing/CreditBalanceSummaryRetrieveParams.java @@ -236,8 +236,8 @@ public static class ApplicabilityScope { Map extraParams; /** - * Required. The price type to which credit grants can apply to. We currently - * only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ @SerializedName("price_type") PriceType priceType; @@ -291,8 +291,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. The price type to which credit grants can apply to. We - * currently only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ public Builder setPriceType( CreditBalanceSummaryRetrieveParams.Filter.ApplicabilityScope.PriceType priceType) { diff --git a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java index 2efeb965b30..a00472e10e3 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java @@ -23,15 +23,13 @@ public class CreditGrantCreateParams extends ApiRequestParams { @SerializedName("category") Category category; - /** - * Required. ID of the customer to whom the billing credits should be granted. - */ + /** Required. ID of the customer to receive the billing credits. */ @SerializedName("customer") String customer; /** - * The time when the billing credits become effective i.e when they are eligible to be used. - * Defaults to the current timestamp if not specified. + * The time when the billing credits become effective—when they're eligible for use. Defaults to + * the current timestamp if not specified. */ @SerializedName("effective_at") Long effectiveAt; @@ -41,7 +39,7 @@ public class CreditGrantCreateParams extends ApiRequestParams { List expand; /** - * The time when the billing credits will expire. If not specified, the billing credits will never + * The time when the billing credits will expire. If not specified, the billing credits don't * expire. */ @SerializedName("expires_at") @@ -58,12 +56,12 @@ public class CreditGrantCreateParams extends ApiRequestParams { /** * Set of key-value pairs that you can attach to an object. This can be useful for storing - * additional information about the object (ex: cost basis) in a structured format. + * additional information about the object (for example, cost basis) in a structured format. */ @SerializedName("metadata") Map metadata; - /** A descriptive name shown in dashboard. */ + /** A descriptive name shown in the Dashboard. */ @SerializedName("name") String name; @@ -149,17 +147,15 @@ public Builder setCategory(CreditGrantCreateParams.Category category) { return this; } - /** - * Required. ID of the customer to whom the billing credits should be granted. - */ + /** Required. ID of the customer to receive the billing credits. */ public Builder setCustomer(String customer) { this.customer = customer; return this; } /** - * The time when the billing credits become effective i.e when they are eligible to be used. - * Defaults to the current timestamp if not specified. + * The time when the billing credits become effective—when they're eligible for use. Defaults to + * the current timestamp if not specified. */ public Builder setEffectiveAt(Long effectiveAt) { this.effectiveAt = effectiveAt; @@ -193,8 +189,8 @@ public Builder addAllExpand(List elements) { } /** - * The time when the billing credits will expire. If not specified, the billing credits will - * never expire. + * The time when the billing credits will expire. If not specified, the billing credits don't + * expire. */ public Builder setExpiresAt(Long expiresAt) { this.expiresAt = expiresAt; @@ -253,7 +249,7 @@ public Builder putAllMetadata(Map map) { return this; } - /** A descriptive name shown in dashboard. */ + /** A descriptive name shown in the Dashboard. */ public Builder setName(String name) { this.name = name; return this; @@ -534,8 +530,8 @@ public static class Scope { Map extraParams; /** - * Required. The price type to which credit grants can apply to. We currently - * only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ @SerializedName("price_type") PriceType priceType; @@ -589,8 +585,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. The price type to which credit grants can apply to. We - * currently only support {@code metered} price type. + * Required. The price type for which credit grants can apply. We currently + * only support the {@code metered} price type. */ public Builder setPriceType( CreditGrantCreateParams.ApplicabilityConfig.Scope.PriceType priceType) { diff --git a/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java index a4a2020e00c..cde992e155d 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantUpdateParams.java @@ -17,8 +17,8 @@ public class CreditGrantUpdateParams extends ApiRequestParams { List expand; /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ @SerializedName("expires_at") Object expiresAt; @@ -33,8 +33,8 @@ public class CreditGrantUpdateParams extends ApiRequestParams { Map extraParams; /** - * Set of key-value pairs that you can attach to an object. This can be useful for storing - * additional information about the object (ex: cost basis) in a structured format. + * Set of key-value pairs you can attach to an object. This can be useful for storing additional + * information about the object (for example, cost basis) in a structured format. */ @SerializedName("metadata") Map metadata; @@ -96,8 +96,8 @@ public Builder addAllExpand(List elements) { } /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ public Builder setExpiresAt(Long expiresAt) { this.expiresAt = expiresAt; @@ -105,8 +105,8 @@ public Builder setExpiresAt(Long expiresAt) { } /** - * The time when the billing credits created by this credit grant will expire. If set to empty, - * the billing credits will never expire. + * The time when the billing credits created by this credit grant expire. If set to empty, the + * billing credits never expire. */ public Builder setExpiresAt(EmptyParam expiresAt) { this.expiresAt = expiresAt; From 2a270593b18bf032e28886a56d7ea42b555c58ad Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 08:36:00 +0000 Subject: [PATCH 04/13] Update generated code for v1322 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/Charge.java | 15 +- .../com/stripe/model/ConfirmationToken.java | 13 +- src/main/java/com/stripe/model/Dispute.java | 3 +- .../java/com/stripe/model/PaymentIntent.java | 6 +- .../java/com/stripe/model/PaymentMethod.java | 11 +- .../java/com/stripe/model/SetupAttempt.java | 6 +- .../java/com/stripe/model/SetupIntent.java | 6 +- .../param/PaymentIntentConfirmParams.java | 3 + .../param/PaymentIntentCreateParams.java | 13 +- ...entIntentIncrementAuthorizationParams.java | 154 ++++++++++++++++++ .../param/PaymentIntentUpdateParams.java | 18 +- .../param/SetupIntentConfirmParams.java | 3 + .../stripe/param/SetupIntentCreateParams.java | 13 +- .../stripe/param/SetupIntentUpdateParams.java | 18 +- .../param/SubscriptionCreateParams.java | 3 + .../param/SubscriptionUpdateParams.java | 3 + 17 files changed, 259 insertions(+), 31 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index a1ae6d8842d..fd414534fa3 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1321 \ No newline at end of file +v1322 \ 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 3b04c751c3d..95f47a4bd4e 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1696,7 +1696,8 @@ public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -1803,7 +1804,8 @@ public static class Card extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; @@ -2259,7 +2261,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -2371,7 +2374,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; @@ -2878,7 +2882,8 @@ public static class InteracPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index 1480b899a9d..0abf7f14cf1 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -632,7 +632,8 @@ public static class Boleto extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -829,7 +830,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. */ @SerializedName("brand") String brand; @@ -942,8 +944,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * interac}, {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code - * unknown}. + * interac}, {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code + * visa}, or {@code unknown}. */ @SerializedName("network") String network; @@ -1299,7 +1301,8 @@ public static class VisaCheckout extends StripeObject { public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 790d5a5a542..e8c6c92ebd8 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -1113,7 +1113,8 @@ public static class AmazonPay extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 2d228b0a2cd..03a72f7c709 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -259,7 +259,11 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

paymentMethod; - /** Information about the payment method configuration used for this PaymentIntent. */ + /** + * Information about the payment method + * configuration used for this PaymentIntent. + */ @SerializedName("payment_method_configuration_details") PaymentMethodConfigurationDetails paymentMethodConfigurationDetails; diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 4782c3741da..90a963225f8 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -866,7 +866,7 @@ public static class Boleto extends StripeObject { public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. */ @SerializedName("brand") String brand; @@ -1062,7 +1062,8 @@ public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. */ @SerializedName("brand") String brand; @@ -1174,8 +1175,8 @@ public static class CardPresent extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * interac}, {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code - * unknown}. + * interac}, {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code + * visa}, or {@code unknown}. */ @SerializedName("network") String network; @@ -1526,7 +1527,7 @@ public static class VisaCheckout extends StripeObject { public static class CardPresent extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code - * jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. */ @SerializedName("brand") String brand; diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 253acfb9e02..b311cc8ee8f 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -491,7 +491,8 @@ public static class Boleto extends StripeObject {} public static class Card extends StripeObject { /** * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("brand") String brand; @@ -562,7 +563,8 @@ public static class Card extends StripeObject { /** * Identifies which network this charge was processed on. Can be {@code amex}, {@code * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, - * {@code jcb}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code unknown}. + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. */ @SerializedName("network") String network; diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 93e790078b1..c64243283f1 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -193,7 +193,11 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore paymentMethod; - /** Information about the payment method configuration used for this Setup Intent. */ + /** + * Information about the payment method + * configuration used for this Setup Intent. + */ @SerializedName("payment_method_configuration_details") PaymentMethodConfigurationDetails paymentMethodConfigurationDetails; diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index f42753c7d4e..474664d9fae 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -16978,6 +16978,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 9887d2c419f..83bd8be78f6 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -190,7 +190,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @SerializedName("payment_method") String paymentMethod; - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ @SerializedName("payment_method_configuration") String paymentMethodConfiguration; @@ -810,7 +813,10 @@ public Builder setPaymentMethod(String paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -17446,6 +17452,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 6fab44e774c..b89401237e3 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -59,6 +59,10 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams @SerializedName("metadata") Map 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,144 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class PaymentMethodOptions { + /** Configuration for any card payments attempted on this PaymentIntent. */ + @SerializedName("card") + Object 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(Object card, Map extraParams) { + this.card = card; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object 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; + } + + /** Configuration for any card payments attempted on this PaymentIntent. */ + public Builder setCard(EmptyParam 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; + + private Card(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 PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card( + 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 + * 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; + } + } + } + } + @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 d8e37fb2d12..4e6e3a20398 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -103,7 +103,10 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { @SerializedName("payment_method") Object paymentMethod; - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ @SerializedName("payment_method_configuration") Object paymentMethodConfiguration; @@ -587,13 +590,19 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; } - /** The ID of the payment method configuration to use with this PaymentIntent. */ + /** + * The ID of the payment + * method configuration to use with this PaymentIntent. + */ public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -17790,6 +17799,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index d301f9418aa..21113063c12 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -8222,6 +8222,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index c9d5dfcb128..42ee87f9309 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -111,7 +111,10 @@ public class SetupIntentCreateParams extends ApiRequestParams { @SerializedName("payment_method") String paymentMethod; - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ @SerializedName("payment_method_configuration") String paymentMethodConfiguration; @@ -487,7 +490,10 @@ public Builder setPaymentMethod(String paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -8675,6 +8681,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 81c075960ac..12fd5a23a67 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -75,7 +75,10 @@ public class SetupIntentUpdateParams extends ApiRequestParams { @SerializedName("payment_method") Object paymentMethod; - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ @SerializedName("payment_method_configuration") Object paymentMethodConfiguration; @@ -368,13 +371,19 @@ public Builder setPaymentMethod(EmptyParam paymentMethod) { return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; } - /** The ID of the payment method configuration to use with this SetupIntent. */ + /** + * The ID of the payment + * method configuration to use with this SetupIntent. + */ public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { this.paymentMethodConfiguration = paymentMethodConfiguration; return this; @@ -8238,6 +8247,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 2879505800f..7e0162f236b 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -5212,6 +5212,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index f3ab62e46ef..34fb3b199ab 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -5468,6 +5468,9 @@ public enum Network implements ApiRequestParams.EnumParam { @SerializedName("jcb") JCB("jcb"), + @SerializedName("link") + LINK("link"), + @SerializedName("mastercard") MASTERCARD("mastercard"), From c7dfa91b40e5d450ba1738480ada3ae1f5ede55a Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 09:30:07 +0000 Subject: [PATCH 05/13] Update generated code for v1323 --- OPENAPI_VERSION | 2 +- .../stripe/param/PaymentLinkUpdateParams.java | 46 +++++++++++++++++++ 2 files changed, 47 insertions(+), 1 deletion(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index fd414534fa3..572902faa9c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1322 \ No newline at end of file +v1323 \ No newline at end of file diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 6d02bebea81..7c39cb40899 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -131,6 +131,15 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { @SerializedName("shipping_address_collection") Object shippingAddressCollection; + /** + * Describes the type of transaction being performed in order to customize relevant text on the + * page, such as the submit button. Changing this value will also affect the hostname in the url property + * (example: {@code donate.stripe.com}). + */ + @SerializedName("submit_type") + SubmitType submitType; + /** * When creating a subscription, the specified configuration data will be used. There must be at * least one line item with a recurring price to use {@code subscription_data}. @@ -162,6 +171,7 @@ private PaymentLinkUpdateParams( Object paymentMethodTypes, Object restrictions, Object shippingAddressCollection, + SubmitType submitType, SubscriptionData subscriptionData, TaxIdCollection taxIdCollection) { this.active = active; @@ -183,6 +193,7 @@ private PaymentLinkUpdateParams( this.paymentMethodTypes = paymentMethodTypes; this.restrictions = restrictions; this.shippingAddressCollection = shippingAddressCollection; + this.submitType = submitType; this.subscriptionData = subscriptionData; this.taxIdCollection = taxIdCollection; } @@ -230,6 +241,8 @@ public static class Builder { private Object shippingAddressCollection; + private SubmitType submitType; + private SubscriptionData subscriptionData; private TaxIdCollection taxIdCollection; @@ -256,6 +269,7 @@ public PaymentLinkUpdateParams build() { this.paymentMethodTypes, this.restrictions, this.shippingAddressCollection, + this.submitType, this.subscriptionData, this.taxIdCollection); } @@ -580,6 +594,17 @@ public Builder setShippingAddressCollection(EmptyParam shippingAddressCollection return this; } + /** + * Describes the type of transaction being performed in order to customize relevant text on the + * page, such as the submit button. Changing this value will also affect the hostname in the url property + * (example: {@code donate.stripe.com}). + */ + public Builder setSubmitType(PaymentLinkUpdateParams.SubmitType submitType) { + this.submitType = submitType; + return this; + } + /** * When creating a subscription, the specified configuration data will be used. There must be at * least one line item with a recurring price to use {@code subscription_data}. @@ -5254,4 +5279,25 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum SubmitType implements ApiRequestParams.EnumParam { + @SerializedName("auto") + AUTO("auto"), + + @SerializedName("book") + BOOK("book"), + + @SerializedName("donate") + DONATE("donate"), + + @SerializedName("pay") + PAY("pay"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SubmitType(String value) { + this.value = value; + } + } } From ca8034f3fb02f98c5ae7181a4375bda57f884bd2 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Fri, 1 Nov 2024 22:29:14 +0000 Subject: [PATCH 06/13] Update generated code for v1324 --- OPENAPI_VERSION | 2 +- .../java/com/stripe/model/PaymentRecord.java | 69 ++++--- .../com/stripe/model/checkout/Session.java | 46 +++++ .../param/checkout/SessionCreateParams.java | 190 ++++++++++++++++++ 4 files changed, 278 insertions(+), 29 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 572902faa9c..0c15657b399 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1323 \ No newline at end of file +v1324 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index ed54c0253ab..9597ac70757 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -7,28 +7,34 @@ import lombok.Getter; import lombok.Setter; -/** A PaymentRecord represents a payment that happened on or off Stripe. */ +/** + * A Payment Record is a resource that allows you to represent payments that occur on- or + * off-Stripe. For example, you can create a Payment Record to model a payment made on a different + * payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment + * Records consist of one or more Payment Attempt Records, which represent individual attempts made + * on a payment network. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public class PaymentRecord extends StripeObject implements HasId { - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_canceled") AmountCanceled amountCanceled; - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_failed") AmountFailed amountFailed; - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_guaranteed") AmountGuaranteed amountGuaranteed; - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_refunded") AmountRefunded amountRefunded; - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_requested") AmountRequested amountRequested; @@ -41,7 +47,7 @@ public class PaymentRecord extends StripeObject implements HasId { CustomerDetails customerDetails; /** - * Whether the customer was present during the transaction. + * Indicates whether the customer was present in your checkout flow during this payment. * *

One of {@code off_session}, or {@code on_session}. */ @@ -57,7 +63,7 @@ public class PaymentRecord extends StripeObject implements HasId { @SerializedName("id") String id; - /** ID of the latest PaymentAttemptRecord attached to this PaymentRecord. */ + /** ID of the latest Payment Attempt Record attached to this Payment Record. */ @SerializedName("latest_payment_attempt_record") String latestPaymentAttemptRecord; @@ -84,11 +90,14 @@ public class PaymentRecord extends StripeObject implements HasId { @SerializedName("object") String object; - /** Information about the method used to make this payment. */ + /** Information about the Payment Method debited for this payment. */ @SerializedName("payment_method_details") PaymentMethodDetails paymentMethodDetails; - /** An opaque string for manual reconciliation of this payment, for example a check number. */ + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ @SerializedName("payment_reference") String paymentReference; @@ -96,7 +105,7 @@ public class PaymentRecord extends StripeObject implements HasId { @SerializedName("shipping_details") ShippingDetails shippingDetails; - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -118,7 +127,7 @@ public static class AmountCanceled extends StripeObject { Long value; } - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -140,7 +149,7 @@ public static class AmountFailed extends StripeObject { Long value; } - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -162,7 +171,7 @@ public static class AmountGuaranteed extends StripeObject { Long value; } - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -184,7 +193,7 @@ public static class AmountRefunded extends StripeObject { Long value; } - /** Amount object. */ + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -211,7 +220,7 @@ public static class AmountRequested extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class CustomerDetails extends StripeObject { - /** ID of the Stripe customer for this payment. */ + /** ID of the Stripe Customer associated with this payment. */ @SerializedName("customer") String customer; @@ -228,7 +237,7 @@ public static class CustomerDetails extends StripeObject { String phone; } - /** Details about the method used to make this payment. */ + /** Details about the Payment Method used in this payment attempt. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -246,19 +255,19 @@ public static class PaymentMethodDetails extends StripeObject { String paymentMethod; /** - * The type of payment method used for this payment attempt. + * The type of Payment Method used for this payment attempt. * *

Equal to {@code custom}. */ @SerializedName("type") String type; - /** Billing details used for this payment. */ + /** Billing details used by the customer for this payment. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class BillingDetails extends StripeObject { - /** Address data. */ + /** A representation of a physical address. */ @SerializedName("address") Address address; @@ -274,7 +283,7 @@ public static class BillingDetails extends StripeObject { @SerializedName("phone") String phone; - /** Address data. */ + /** A representation of a physical address. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -308,7 +317,11 @@ public static class Address extends StripeObject { } } - /** Details about the custom payment method used in this payment. */ + /** + * Custom Payment Methods represent Payment Method types not modeled directly in the Stripe API. + * This resource consists of details about the custom payment method used for this payment + * attempt. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -319,30 +332,30 @@ public static class Custom extends StripeObject { @SerializedName("display_name") String displayName; - /** The Custom Payment Method Type associated with this payment. */ + /** The custom payment method type associated with this payment. */ @SerializedName("type") String type; } } - /** Shipping information for this payment. */ + /** The customer's shipping information associated with this payment. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) public static class ShippingDetails extends StripeObject { - /** Address data. */ + /** A representation of a physical address. */ @SerializedName("address") Address address; - /** The recipient's name. */ + /** The shipping recipient's name. */ @SerializedName("name") String name; - /** The recipient's phone number. */ + /** The shipping recipient's phone number. */ @SerializedName("phone") String phone; - /** Address data. */ + /** A representation of a physical address. */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 2a658df4328..cf993314f18 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -2127,6 +2127,52 @@ public static class Card extends StripeObject { @SerializedName("installments") Installments installments; + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_decremental_authorization") + String requestDecrementalAuthorization; + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_extended_authorization") + String requestExtendedAuthorization; + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_incremental_authorization") + String requestIncrementalAuthorization; + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_multicapture") + String requestMulticapture; + + /** + * Request ability to overcapture for + * this CheckoutSession. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_overcapture") + String requestOvercapture; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + @SerializedName("request_decremental_authorization") + RequestDecrementalAuthorization requestDecrementalAuthorization; + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + @SerializedName("request_extended_authorization") + RequestExtendedAuthorization requestExtendedAuthorization; + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + */ + @SerializedName("request_incremental_authorization") + RequestIncrementalAuthorization requestIncrementalAuthorization; + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + */ + @SerializedName("request_multicapture") + RequestMulticapture requestMulticapture; + + /** + * Request ability to overcapture for + * this CheckoutSession. + */ + @SerializedName("request_overcapture") + RequestOvercapture requestOvercapture; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and extraParams, Installments installments, + RequestDecrementalAuthorization requestDecrementalAuthorization, + RequestExtendedAuthorization requestExtendedAuthorization, + RequestIncrementalAuthorization requestIncrementalAuthorization, + RequestMulticapture requestMulticapture, + RequestOvercapture requestOvercapture, RequestThreeDSecure requestThreeDSecure, SetupFutureUsage setupFutureUsage, String statementDescriptorSuffixKana, String statementDescriptorSuffixKanji) { this.extraParams = extraParams; this.installments = installments; + this.requestDecrementalAuthorization = requestDecrementalAuthorization; + this.requestExtendedAuthorization = requestExtendedAuthorization; + this.requestIncrementalAuthorization = requestIncrementalAuthorization; + this.requestMulticapture = requestMulticapture; + this.requestOvercapture = requestOvercapture; this.requestThreeDSecure = requestThreeDSecure; this.setupFutureUsage = setupFutureUsage; this.statementDescriptorSuffixKana = statementDescriptorSuffixKana; @@ -7892,6 +7938,16 @@ public static class Builder { private Installments installments; + private RequestDecrementalAuthorization requestDecrementalAuthorization; + + private RequestExtendedAuthorization requestExtendedAuthorization; + + private RequestIncrementalAuthorization requestIncrementalAuthorization; + + private RequestMulticapture requestMulticapture; + + private RequestOvercapture requestOvercapture; + private RequestThreeDSecure requestThreeDSecure; private SetupFutureUsage setupFutureUsage; @@ -7905,6 +7961,11 @@ public SessionCreateParams.PaymentMethodOptions.Card build() { return new SessionCreateParams.PaymentMethodOptions.Card( this.extraParams, this.installments, + this.requestDecrementalAuthorization, + this.requestExtendedAuthorization, + this.requestIncrementalAuthorization, + this.requestMulticapture, + this.requestOvercapture, this.requestThreeDSecure, this.setupFutureUsage, this.statementDescriptorSuffixKana, @@ -7946,6 +8007,60 @@ public Builder setInstallments( return this; } + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + public Builder setRequestDecrementalAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestDecrementalAuthorization + requestDecrementalAuthorization) { + this.requestDecrementalAuthorization = requestDecrementalAuthorization; + return this; + } + + /** + * Request ability to capture + * beyond the standard authorization validity window for this CheckoutSession. + */ + public Builder setRequestExtendedAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestExtendedAuthorization + requestExtendedAuthorization) { + this.requestExtendedAuthorization = requestExtendedAuthorization; + return this; + } + + /** + * Request ability to increment the + * authorization for this CheckoutSession. + */ + public Builder setRequestIncrementalAuthorization( + SessionCreateParams.PaymentMethodOptions.Card.RequestIncrementalAuthorization + requestIncrementalAuthorization) { + this.requestIncrementalAuthorization = requestIncrementalAuthorization; + return this; + } + + /** + * Request ability to make multiple + * captures for this CheckoutSession. + */ + public Builder setRequestMulticapture( + SessionCreateParams.PaymentMethodOptions.Card.RequestMulticapture requestMulticapture) { + this.requestMulticapture = requestMulticapture; + return this; + } + + /** + * Request ability to overcapture for + * this CheckoutSession. + */ + public Builder setRequestOvercapture( + SessionCreateParams.PaymentMethodOptions.Card.RequestOvercapture requestOvercapture) { + this.requestOvercapture = requestOvercapture; + return this; + } + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and map) { } } + public enum RequestDecrementalAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestDecrementalAuthorization(String value) { + this.value = value; + } + } + + public enum RequestExtendedAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestExtendedAuthorization(String value) { + this.value = value; + } + } + + public enum RequestIncrementalAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestIncrementalAuthorization(String value) { + this.value = value; + } + } + + public enum RequestMulticapture implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestMulticapture(String value) { + this.value = value; + } + } + + public enum RequestOvercapture implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestOvercapture(String value) { + this.value = value; + } + } + public enum RequestThreeDSecure implements ApiRequestParams.EnumParam { @SerializedName("any") ANY("any"), From 5c2bcd0c423710da37fc4abd6c76c990eb84e9dd Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Mon, 4 Nov 2024 23:45:39 +0000 Subject: [PATCH 07/13] Update generated code for v1329 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/StripeClient.java | 8 + .../stripe/model/EventDataClassLookup.java | 1 + .../stripe/model/PaymentAttemptRecord.java | 457 ++++++ .../model/PaymentAttemptRecordCollection.java | 4 + .../java/com/stripe/model/PaymentRecord.java | 303 +++- .../param/PaymentAttemptRecordListParams.java | 112 ++ .../PaymentAttemptRecordRetrieveParams.java | 98 ++ ...ordReportPaymentAttemptCanceledParams.java | 156 ++ ...ecordReportPaymentAttemptFailedParams.java | 156 ++ ...dReportPaymentAttemptGuaranteedParams.java | 156 ++ ...ymentRecordReportPaymentAttemptParams.java | 1175 +++++++++++++ .../PaymentRecordReportPaymentParams.java | 1456 +++++++++++++++++ .../param/PaymentRecordRetrieveParams.java | 98 ++ .../service/PaymentAttemptRecordService.java | 69 + .../stripe/service/PaymentRecordService.java | 172 ++ 16 files changed, 4421 insertions(+), 2 deletions(-) create mode 100644 src/main/java/com/stripe/model/PaymentAttemptRecord.java create mode 100644 src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java create mode 100644 src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java create mode 100644 src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java create mode 100644 src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java create mode 100644 src/main/java/com/stripe/service/PaymentAttemptRecordService.java create mode 100644 src/main/java/com/stripe/service/PaymentRecordService.java diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 0c15657b399..954be9b75ef 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1324 \ No newline at end of file +v1329 \ No newline at end of file diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index e0245c7c44b..a90e6d113b2 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -273,6 +273,10 @@ public com.stripe.service.OrderService orders() { return new com.stripe.service.OrderService(this.getResponseGetter()); } + public com.stripe.service.PaymentAttemptRecordService paymentAttemptRecords() { + return new com.stripe.service.PaymentAttemptRecordService(this.getResponseGetter()); + } + public com.stripe.service.PaymentIntentService paymentIntents() { return new com.stripe.service.PaymentIntentService(this.getResponseGetter()); } @@ -293,6 +297,10 @@ public com.stripe.service.PaymentMethodService paymentMethods() { return new com.stripe.service.PaymentMethodService(this.getResponseGetter()); } + public com.stripe.service.PaymentRecordService paymentRecords() { + return new com.stripe.service.PaymentRecordService(this.getResponseGetter()); + } + public com.stripe.service.PayoutService payouts() { return new com.stripe.service.PayoutService(this.getResponseGetter()); } diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index ea11b929c9f..b273c4ab8a1 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -57,6 +57,7 @@ public final class EventDataClassLookup { classLookup.put("mandate", Mandate.class); classLookup.put("margin", Margin.class); classLookup.put("order", Order.class); + classLookup.put("payment_attempt_record", PaymentAttemptRecord.class); classLookup.put("payment_intent", PaymentIntent.class); classLookup.put("payment_link", PaymentLink.class); classLookup.put("payment_method", PaymentMethod.class); diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java new file mode 100644 index 00000000000..391fac0ce7d --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -0,0 +1,457 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +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.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordRetrieveParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A Payment Attempt Record represents an individual attempt at making a payment, on or off Stripe. + * Each payment attempt tries to collect a fixed amount of money from a fixed customer and payment + * method. Payment Attempt Records are attached to Payment Records. Only one attempt per Payment + * Record can have guaranteed funds. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentAttemptRecord extends ApiResource implements HasId { + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_canceled") + AmountCanceled amountCanceled; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_failed") + AmountFailed amountFailed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_guaranteed") + AmountGuaranteed amountGuaranteed; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ + @SerializedName("created") + Long created; + + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** + * Indicates whether the customer was present in your checkout flow during this payment. + * + *

One of {@code off_session}, or {@code on_session}. + */ + @SerializedName("customer_presence") + String customerPresence; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + String description; + + /** Unique identifier for the object. */ + @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; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code payment_attempt_record}. + */ + @SerializedName("object") + String object; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** ID of the Payment Record this Payment Attempt Record belongs to. */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list(Map params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list( + Map params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list(PaymentAttemptRecordListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public static PaymentAttemptRecordCollection list( + PaymentAttemptRecordListParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecordCollection.class); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve(String id, RequestOptions options) + throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** Retrieves a Payment Attempt Record with the given ID. */ + public static PaymentAttemptRecord retrieve( + String id, PaymentAttemptRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentAttemptRecord.class); + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountCanceled extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountFailed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountGuaranteed extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmountRequested extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + } + + /** Information about the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerDetails extends StripeObject { + /** ID of the Stripe Customer associated with this payment. */ + @SerializedName("customer") + String customer; + + /** The customer's email address. */ + @SerializedName("email") + String email; + + /** The customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + } + + /** Details about the Payment Method used in this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodDetails extends StripeObject { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @SerializedName("custom") + Custom custom; + + /** ID of the Stripe PaymentMethod used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of Payment Method used for this payment attempt. + * + *

Equal to {@code custom}. + */ + @SerializedName("type") + String type; + + /** Billing details used by the customer for this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @SerializedName("email") + String email; + + /** The billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + /** + * Custom Payment Methods represent Payment Method types not modeled directly in the Stripe API. + * This resource consists of details about the custom payment method used for this payment + * attempt. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * Display name for the custom (user-defined) payment method type used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** The custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + } + } + + /** The customer's shipping information associated with this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ShippingDetails extends StripeObject { + /** A representation of a physical address. */ + @SerializedName("address") + Address address; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + /** A representation of a physical address. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** Address line 1 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + } + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(shippingDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java b/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java new file mode 100644 index 00000000000..4ed311a29ca --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentAttemptRecordCollection.java @@ -0,0 +1,4 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +public class PaymentAttemptRecordCollection extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index 9597ac70757..da2ac2f2011 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -2,6 +2,19 @@ package com.stripe.model; import com.google.gson.annotations.SerializedName; +import com.stripe.exception.StripeException; +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.PaymentRecordReportPaymentAttemptCanceledParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptFailedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptGuaranteedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordRetrieveParams; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -17,7 +30,7 @@ @Getter @Setter @EqualsAndHashCode(callSuper = false) -public class PaymentRecord extends StripeObject implements HasId { +public class PaymentRecord extends ApiResource implements HasId { /** A representation of an amount of money, consisting of an amount and a currency. */ @SerializedName("amount_canceled") AmountCanceled amountCanceled; @@ -105,6 +118,281 @@ public class PaymentRecord extends StripeObject implements HasId { @SerializedName("shipping_details") ShippingDetails shippingDetails; + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(Map params) throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(Map params, RequestOptions options) + throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment(PaymentRecordReportPaymentParams params) + throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public static PaymentRecord reportPayment( + PaymentRecordReportPaymentParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(Map params) throws StripeException { + return reportPaymentAttempt(params, (RequestOptions) null); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt(PaymentRecordReportPaymentAttemptParams params) + throws StripeException { + return reportPaymentAttempt(params, (RequestOptions) null); + } + + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + PaymentRecordReportPaymentAttemptParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled(Map params) + throws StripeException { + return reportPaymentAttemptCanceled(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_canceled", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + PaymentRecordReportPaymentAttemptCanceledParams params) throws StripeException { + return reportPaymentAttemptCanceled(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + PaymentRecordReportPaymentAttemptCanceledParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_canceled", + ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed(Map params) + throws StripeException { + return reportPaymentAttemptFailed(params, (RequestOptions) null); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_failed", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + PaymentRecordReportPaymentAttemptFailedParams params) throws StripeException { + return reportPaymentAttemptFailed(params, (RequestOptions) null); + } + + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + PaymentRecordReportPaymentAttemptFailedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_failed", + ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed(Map params) + throws StripeException { + return reportPaymentAttemptGuaranteed(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_guaranteed", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + PaymentRecordReportPaymentAttemptGuaranteedParams params) throws StripeException { + return reportPaymentAttemptGuaranteed(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + PaymentRecordReportPaymentAttemptGuaranteedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_guaranteed", + ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve(String id) throws StripeException { + return retrieve(id, (Map) null, (RequestOptions) null); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (Map) null, options); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve( + String id, Map params, RequestOptions options) throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + + /** Retrieves a Payment Record with the given ID. */ + public static PaymentRecord retrieve( + String id, PaymentRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter().request(request, PaymentRecord.class); + } + /** A representation of an amount of money, consisting of an amount and a currency. */ @Getter @Setter @@ -388,4 +676,17 @@ public static class Address extends StripeObject { String state; } } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRefunded, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(shippingDetails, responseGetter); + } } diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java new file mode 100644 index 00000000000..771fcdd9330 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java @@ -0,0 +1,112 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentAttemptRecordListParams 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; + + /** Required. The ID of the Payment Record. */ + @SerializedName("payment_record") + String paymentRecord; + + private PaymentAttemptRecordListParams( + List expand, Map extraParams, String paymentRecord) { + this.expand = expand; + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private String paymentRecord; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordListParams build() { + return new PaymentAttemptRecordListParams(this.expand, this.extraParams, this.paymentRecord); + } + + /** + * 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 + * PaymentAttemptRecordListParams#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 + * PaymentAttemptRecordListParams#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 + * PaymentAttemptRecordListParams#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 PaymentAttemptRecordListParams#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 ID of the Payment Record. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java new file mode 100644 index 00000000000..b33fda4ba39 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentAttemptRecordRetrieveParams 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 PaymentAttemptRecordRetrieveParams(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 PaymentAttemptRecordRetrieveParams build() { + return new PaymentAttemptRecordRetrieveParams(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 + * PaymentAttemptRecordRetrieveParams#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 + * PaymentAttemptRecordRetrieveParams#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 + * PaymentAttemptRecordRetrieveParams#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 PaymentAttemptRecordRetrieveParams#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/PaymentRecordReportPaymentAttemptCanceledParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java new file mode 100644 index 00000000000..5bc2dbf116b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptCanceledParams extends ApiRequestParams { + /** + * Required. When the reported payment was canceled. Measured in seconds since + * the Unix epoch. + */ + @SerializedName("canceled_at") + Long canceledAt; + + /** 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; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptCanceledParams( + Long canceledAt, + List expand, + Map extraParams, + Map metadata) { + this.canceledAt = canceledAt; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long canceledAt; + + private List expand; + + private Map extraParams; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptCanceledParams build() { + return new PaymentRecordReportPaymentAttemptCanceledParams( + this.canceledAt, this.expand, this.extraParams, this.metadata); + } + + /** + * Required. When the reported payment was canceled. Measured in seconds since + * the Unix epoch. + */ + public Builder setCanceledAt(Long canceledAt) { + this.canceledAt = canceledAt; + 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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 PaymentRecordReportPaymentAttemptCanceledParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add 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 + * PaymentRecordReportPaymentAttemptCanceledParams#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 PaymentRecordReportPaymentAttemptCanceledParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java new file mode 100644 index 00000000000..e35a090ac43 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptFailedParams 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; + + /** + * Required. When the reported payment failed. Measured in seconds since the Unix + * epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptFailedParams( + List expand, + Map extraParams, + Long failedAt, + Map metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.failedAt = failedAt; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long failedAt; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptFailedParams build() { + return new PaymentRecordReportPaymentAttemptFailedParams( + this.expand, this.extraParams, this.failedAt, this.metadata); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptFailedParams#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 + * PaymentRecordReportPaymentAttemptFailedParams#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 + * PaymentRecordReportPaymentAttemptFailedParams#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 PaymentRecordReportPaymentAttemptFailedParams#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. When the reported payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + 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 + * PaymentRecordReportPaymentAttemptFailedParams#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 PaymentRecordReportPaymentAttemptFailedParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java new file mode 100644 index 00000000000..d5c0d9b3f9b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java @@ -0,0 +1,156 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptGuaranteedParams 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; + + /** + * Required. When the reported payment was guaranteed. Measured in seconds since + * the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + @SerializedName("metadata") + Map metadata; + + private PaymentRecordReportPaymentAttemptGuaranteedParams( + List expand, + Map extraParams, + Long guaranteedAt, + Map metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long guaranteedAt; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptGuaranteedParams build() { + return new PaymentRecordReportPaymentAttemptGuaranteedParams( + this.expand, this.extraParams, this.guaranteedAt, this.metadata); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 PaymentRecordReportPaymentAttemptGuaranteedParams#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. When the reported payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + 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 + * PaymentRecordReportPaymentAttemptGuaranteedParams#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 PaymentRecordReportPaymentAttemptGuaranteedParams#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java new file mode 100644 index 00000000000..2b015eac4c6 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java @@ -0,0 +1,1175 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentAttemptParams extends ApiRequestParams { + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @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; + + /** Information about the payment attempt failure. */ + @SerializedName("failed") + Failed failed; + + /** Information about the payment attempt guarantee. */ + @SerializedName("guaranteed") + Guaranteed guaranteed; + + /** + * Required. When the reported payment was initiated. Measured in seconds since + * the Unix epoch. + */ + @SerializedName("initiated_at") + Long initiatedAt; + + /** + * 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 outcome of the reported payment. */ + @SerializedName("outcome") + Outcome outcome; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + private PaymentRecordReportPaymentAttemptParams( + String description, + List expand, + Map extraParams, + Failed failed, + Guaranteed guaranteed, + Long initiatedAt, + Map metadata, + Outcome outcome, + PaymentMethodDetails paymentMethodDetails, + ShippingDetails shippingDetails) { + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.failed = failed; + this.guaranteed = guaranteed; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.paymentMethodDetails = paymentMethodDetails; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String description; + + private List expand; + + private Map extraParams; + + private Failed failed; + + private Guaranteed guaranteed; + + private Long initiatedAt; + + private Map metadata; + + private Outcome outcome; + + private PaymentMethodDetails paymentMethodDetails; + + private ShippingDetails shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams build() { + return new PaymentRecordReportPaymentAttemptParams( + this.description, + this.expand, + this.extraParams, + this.failed, + this.guaranteed, + this.initiatedAt, + this.metadata, + this.outcome, + this.paymentMethodDetails, + this.shippingDetails); + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + 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 + * PaymentRecordReportPaymentAttemptParams#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 + * PaymentRecordReportPaymentAttemptParams#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 + * PaymentRecordReportPaymentAttemptParams#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 PaymentRecordReportPaymentAttemptParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Information about the payment attempt failure. */ + public Builder setFailed(PaymentRecordReportPaymentAttemptParams.Failed failed) { + this.failed = failed; + return this; + } + + /** Information about the payment attempt guarantee. */ + public Builder setGuaranteed(PaymentRecordReportPaymentAttemptParams.Guaranteed guaranteed) { + this.guaranteed = guaranteed; + return this; + } + + /** + * Required. When the reported payment was initiated. Measured in seconds since + * the Unix epoch. + */ + public Builder setInitiatedAt(Long initiatedAt) { + this.initiatedAt = initiatedAt; + 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 + * PaymentRecordReportPaymentAttemptParams#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 PaymentRecordReportPaymentAttemptParams#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 outcome of the reported payment. */ + public Builder setOutcome(PaymentRecordReportPaymentAttemptParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Information about the Payment Method debited for this payment. */ + public Builder setPaymentMethodDetails( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentAttemptParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + public static class Failed { + /** + * 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. When the reported payment failed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + private Failed(Map extraParams, Long failedAt) { + this.extraParams = extraParams; + this.failedAt = failedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long failedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.Failed build() { + return new PaymentRecordReportPaymentAttemptParams.Failed(this.extraParams, this.failedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.Failed#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 PaymentRecordReportPaymentAttemptParams.Failed#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. When the reported payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + return this; + } + } + } + + @Getter + public static class Guaranteed { + /** + * 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. When the reported payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + private Guaranteed(Map extraParams, Long guaranteedAt) { + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long guaranteedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.Guaranteed build() { + return new PaymentRecordReportPaymentAttemptParams.Guaranteed( + this.extraParams, this.guaranteedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.Guaranteed#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 PaymentRecordReportPaymentAttemptParams.Guaranteed#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. When the reported payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + return this; + } + } + } + + @Getter + public static class PaymentMethodDetails { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @SerializedName("custom") + Custom custom; + + /** + * 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; + + /** ID of the Stripe Payment Method used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + @SerializedName("type") + Type type; + + private PaymentMethodDetails( + BillingDetails billingDetails, + Custom custom, + Map extraParams, + String paymentMethod, + Type type) { + this.billingDetails = billingDetails; + this.custom = custom; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Custom custom; + + private Map extraParams; + + private String paymentMethod; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails( + this.billingDetails, this.custom, this.extraParams, this.paymentMethod, this.type); + } + + /** The billing details associated with the method of payment. */ + public Builder setBillingDetails( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails + billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** Information about the custom (user-defined) payment method used to make this payment. */ + public Builder setCustom( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom custom) { + this.custom = custom; + 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails#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 PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the Stripe Payment Method used to make this payment. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + public Builder setType( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + public static class BillingDetails { + /** The billing address associated with the method of payment. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @SerializedName("email") + String email; + + /** + * 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 billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The billing address associated with the method of payment. */ + public Builder setAddress( + PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.Address + address) { + this.address = address; + return this; + } + + /** The billing email associated with the method of payment. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails#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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails#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 billing name associated with the method of payment. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The billing phone number associated with the method of payment. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String 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 String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.Address + build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails + .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; + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.BillingDetails.Address#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + public static class Custom { + /** + * Required. Display name for the custom (user-defined) payment method type + * used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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 Custom(String displayName, Map extraParams) { + this.displayName = displayName; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom build() { + return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom( + this.displayName, this.extraParams); + } + + /** + * Required. Display name for the custom (user-defined) payment method type + * used to make this payment. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom#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 + * PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom#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 Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + public static class ShippingDetails { + /** The physical shipping address. */ + @SerializedName("address") + Address address; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + private ShippingDetails( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.ShippingDetails build() { + return new PaymentRecordReportPaymentAttemptParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress( + PaymentRecordReportPaymentAttemptParams.ShippingDetails.Address address) { + this.address = address; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportPaymentAttemptParams.ShippingDetails#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 PaymentRecordReportPaymentAttemptParams.ShippingDetails#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 shipping recipient's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The shipping recipient's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String 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 String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptParams.ShippingDetails.Address build() { + return new PaymentRecordReportPaymentAttemptParams.ShippingDetails.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; + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptParams.ShippingDetails.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 + * PaymentRecordReportPaymentAttemptParams.ShippingDetails.Address#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("failed") + FAILED("failed"), + + @SerializedName("guaranteed") + GUARANTEED("guaranteed"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java new file mode 100644 index 00000000000..d0ded600144 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java @@ -0,0 +1,1456 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordReportPaymentParams extends ApiRequestParams { + /** Required. The amount you intend to collect for this payment. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** Indicates whether the customer was present in your checkout flow during this payment. */ + @SerializedName("customer_presence") + CustomerPresence customerPresence; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @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; + + /** Information about the payment attempt failure. */ + @SerializedName("failed") + Failed failed; + + /** Information about the payment attempt guarantee. */ + @SerializedName("guaranteed") + Guaranteed guaranteed; + + /** + * Required. When the reported payment was initiated. Measured in seconds since + * the Unix epoch. + */ + @SerializedName("initiated_at") + Long initiatedAt; + + /** + * 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 outcome of the reported payment. */ + @SerializedName("outcome") + Outcome outcome; + + /** Required. Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** + * Required. An opaque string for manual reconciliation of this payment, for + * example a check number or a payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + ShippingDetails shippingDetails; + + private PaymentRecordReportPaymentParams( + AmountRequested amountRequested, + CustomerDetails customerDetails, + CustomerPresence customerPresence, + String description, + List expand, + Map extraParams, + Failed failed, + Guaranteed guaranteed, + Long initiatedAt, + Map metadata, + Outcome outcome, + PaymentMethodDetails paymentMethodDetails, + String paymentReference, + ShippingDetails shippingDetails) { + this.amountRequested = amountRequested; + this.customerDetails = customerDetails; + this.customerPresence = customerPresence; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.failed = failed; + this.guaranteed = guaranteed; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.paymentMethodDetails = paymentMethodDetails; + this.paymentReference = paymentReference; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AmountRequested amountRequested; + + private CustomerDetails customerDetails; + + private CustomerPresence customerPresence; + + private String description; + + private List expand; + + private Map extraParams; + + private Failed failed; + + private Guaranteed guaranteed; + + private Long initiatedAt; + + private Map metadata; + + private Outcome outcome; + + private PaymentMethodDetails paymentMethodDetails; + + private String paymentReference; + + private ShippingDetails shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams build() { + return new PaymentRecordReportPaymentParams( + this.amountRequested, + this.customerDetails, + this.customerPresence, + this.description, + this.expand, + this.extraParams, + this.failed, + this.guaranteed, + this.initiatedAt, + this.metadata, + this.outcome, + this.paymentMethodDetails, + this.paymentReference, + this.shippingDetails); + } + + /** Required. The amount you intend to collect for this payment. */ + public Builder setAmountRequested( + PaymentRecordReportPaymentParams.AmountRequested amountRequested) { + this.amountRequested = amountRequested; + return this; + } + + /** Customer information for this payment. */ + public Builder setCustomerDetails( + PaymentRecordReportPaymentParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + return this; + } + + /** Indicates whether the customer was present in your checkout flow during this payment. */ + public Builder setCustomerPresence( + PaymentRecordReportPaymentParams.CustomerPresence customerPresence) { + this.customerPresence = customerPresence; + return this; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + 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 + * PaymentRecordReportPaymentParams#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 + * PaymentRecordReportPaymentParams#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 + * PaymentRecordReportPaymentParams#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 PaymentRecordReportPaymentParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Information about the payment attempt failure. */ + public Builder setFailed(PaymentRecordReportPaymentParams.Failed failed) { + this.failed = failed; + return this; + } + + /** Information about the payment attempt guarantee. */ + public Builder setGuaranteed(PaymentRecordReportPaymentParams.Guaranteed guaranteed) { + this.guaranteed = guaranteed; + return this; + } + + /** + * Required. When the reported payment was initiated. Measured in seconds since + * the Unix epoch. + */ + public Builder setInitiatedAt(Long initiatedAt) { + this.initiatedAt = initiatedAt; + 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 + * PaymentRecordReportPaymentParams#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 PaymentRecordReportPaymentParams#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 outcome of the reported payment. */ + public Builder setOutcome(PaymentRecordReportPaymentParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Required. Information about the Payment Method debited for this payment. */ + public Builder setPaymentMethodDetails( + PaymentRecordReportPaymentParams.PaymentMethodDetails paymentMethodDetails) { + this.paymentMethodDetails = paymentMethodDetails; + return this; + } + + /** + * Required. An opaque string for manual reconciliation of this payment, for + * example a check number or a payment processor ID. + */ + public Builder setPaymentReference(String paymentReference) { + this.paymentReference = paymentReference; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + public static class AmountRequested { + /** + * 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 positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + @SerializedName("value") + Long value; + + private AmountRequested(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 PaymentRecordReportPaymentParams.AmountRequested build() { + return new PaymentRecordReportPaymentParams.AmountRequested( + 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 + * PaymentRecordReportPaymentParams.AmountRequested#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 PaymentRecordReportPaymentParams.AmountRequested#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 positive integer representing the amount in the smallest currency unit e.g., 100 + * cents for $1.00 or 100 for ¥100, a zero-decimal currency). + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + public static class CustomerDetails { + /** The customer who made the payment. */ + @SerializedName("customer") + String customer; + + /** The customer's phone number. */ + @SerializedName("email") + String email; + + /** + * 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 customer's name. */ + @SerializedName("name") + String name; + + /** The customer's phone number. */ + @SerializedName("phone") + String phone; + + private CustomerDetails( + String customer, String email, Map extraParams, String name, String phone) { + this.customer = customer; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String customer; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.CustomerDetails build() { + return new PaymentRecordReportPaymentParams.CustomerDetails( + this.customer, this.email, this.extraParams, this.name, this.phone); + } + + /** The customer who made the payment. */ + public Builder setCustomer(String customer) { + this.customer = customer; + return this; + } + + /** The customer's phone number. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentRecordReportPaymentParams.CustomerDetails#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 PaymentRecordReportPaymentParams.CustomerDetails#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 customer's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The customer's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + } + + @Getter + public static class Failed { + /** + * 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. When the reported payment failed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("failed_at") + Long failedAt; + + private Failed(Map extraParams, Long failedAt) { + this.extraParams = extraParams; + this.failedAt = failedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long failedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.Failed build() { + return new PaymentRecordReportPaymentParams.Failed(this.extraParams, this.failedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentParams.Failed#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 PaymentRecordReportPaymentParams.Failed#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. When the reported payment failed. Measured in seconds since the + * Unix epoch. + */ + public Builder setFailedAt(Long failedAt) { + this.failedAt = failedAt; + return this; + } + } + } + + @Getter + public static class Guaranteed { + /** + * 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. When the reported payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + @SerializedName("guaranteed_at") + Long guaranteedAt; + + private Guaranteed(Map extraParams, Long guaranteedAt) { + this.extraParams = extraParams; + this.guaranteedAt = guaranteedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long guaranteedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.Guaranteed build() { + return new PaymentRecordReportPaymentParams.Guaranteed(this.extraParams, this.guaranteedAt); + } + + /** + * 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 + * PaymentRecordReportPaymentParams.Guaranteed#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 PaymentRecordReportPaymentParams.Guaranteed#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. When the reported payment was guaranteed. Measured in seconds + * since the Unix epoch. + */ + public Builder setGuaranteedAt(Long guaranteedAt) { + this.guaranteedAt = guaranteedAt; + return this; + } + } + } + + @Getter + public static class PaymentMethodDetails { + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + /** Information about the custom (user-defined) payment method used to make this payment. */ + @SerializedName("custom") + Custom custom; + + /** + * 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; + + /** ID of the Stripe Payment Method used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + @SerializedName("type") + Type type; + + private PaymentMethodDetails( + BillingDetails billingDetails, + Custom custom, + Map extraParams, + String paymentMethod, + Type type) { + this.billingDetails = billingDetails; + this.custom = custom; + this.extraParams = extraParams; + this.paymentMethod = paymentMethod; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingDetails billingDetails; + + private Custom custom; + + private Map extraParams; + + private String paymentMethod; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails( + this.billingDetails, this.custom, this.extraParams, this.paymentMethod, this.type); + } + + /** The billing details associated with the method of payment. */ + public Builder setBillingDetails( + PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails billingDetails) { + this.billingDetails = billingDetails; + return this; + } + + /** Information about the custom (user-defined) payment method used to make this payment. */ + public Builder setCustom( + PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom custom) { + this.custom = custom; + 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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails#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 PaymentRecordReportPaymentParams.PaymentMethodDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of the Stripe Payment Method used to make this payment. */ + public Builder setPaymentMethod(String paymentMethod) { + this.paymentMethod = paymentMethod; + return this; + } + + /** + * The type of the payment method details. An additional hash is included on the + * payment_method_details with a name matching this value. It contains additional information + * specific to the type. + */ + public Builder setType(PaymentRecordReportPaymentParams.PaymentMethodDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + public static class BillingDetails { + /** The billing address associated with the method of payment. */ + @SerializedName("address") + Address address; + + /** The billing email associated with the method of payment. */ + @SerializedName("email") + String email; + + /** + * 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 billing name associated with the method of payment. */ + @SerializedName("name") + String name; + + /** The billing phone number associated with the method of payment. */ + @SerializedName("phone") + String phone; + + private BillingDetails( + Address address, + String email, + Map extraParams, + String name, + String phone) { + this.address = address; + this.email = email; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private String email; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails( + this.address, this.email, this.extraParams, this.name, this.phone); + } + + /** The billing address associated with the method of payment. */ + public Builder setAddress( + PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.Address address) { + this.address = address; + return this; + } + + /** The billing email associated with the method of payment. */ + public Builder setEmail(String email) { + this.email = email; + 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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails#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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails#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 billing name associated with the method of payment. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The billing phone number associated with the method of payment. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String 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 String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.Address + build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.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; + } + + /** + * 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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.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 + * PaymentRecordReportPaymentParams.PaymentMethodDetails.BillingDetails.Address#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + @Getter + public static class Custom { + /** + * Required. Display name for the custom (user-defined) payment method type + * used to make this payment. + */ + @SerializedName("display_name") + String displayName; + + /** + * 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 Custom(String displayName, Map extraParams) { + this.displayName = displayName; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom build() { + return new PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom( + this.displayName, this.extraParams); + } + + /** + * Required. Display name for the custom (user-defined) payment method type + * used to make this payment. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + 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 PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom#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 PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom#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 Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + public static class ShippingDetails { + /** The physical shipping address. */ + @SerializedName("address") + Address address; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The shipping recipient's name. */ + @SerializedName("name") + String name; + + /** The shipping recipient's phone number. */ + @SerializedName("phone") + String phone; + + private ShippingDetails( + Address address, Map extraParams, String name, String phone) { + this.address = address; + this.extraParams = extraParams; + this.name = name; + this.phone = phone; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Address address; + + private Map extraParams; + + private String name; + + private String phone; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.ShippingDetails build() { + return new PaymentRecordReportPaymentParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress(PaymentRecordReportPaymentParams.ShippingDetails.Address address) { + this.address = address; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportPaymentParams.ShippingDetails#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 PaymentRecordReportPaymentParams.ShippingDetails#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 shipping recipient's name. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The shipping recipient's phone number. */ + public Builder setPhone(String phone) { + this.phone = phone; + return this; + } + } + + @Getter + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String 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 (e.g., street, PO Box, or company name). */ + @SerializedName("line1") + String line1; + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + @SerializedName("line2") + String line2; + + /** ZIP or postal code. */ + @SerializedName("postal_code") + String postalCode; + + /** State, county, province, or region. */ + @SerializedName("state") + String state; + + private Address( + String city, + String country, + Map extraParams, + String line1, + String line2, + String postalCode, + String 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 String city; + + private String country; + + private Map extraParams; + + private String line1; + + private String line2; + + private String postalCode; + + private String state; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.ShippingDetails.Address build() { + return new PaymentRecordReportPaymentParams.ShippingDetails.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; + } + + /** + * 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 PaymentRecordReportPaymentParams.ShippingDetails.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 PaymentRecordReportPaymentParams.ShippingDetails.Address#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Address line 1 (e.g., street, PO Box, or company name). */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2 (e.g., apartment, suite, unit, or building). */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** ZIP or postal code. */ + public Builder setPostalCode(String postalCode) { + this.postalCode = postalCode; + return this; + } + + /** State, county, province, or region. */ + public Builder setState(String state) { + this.state = state; + return this; + } + } + } + } + + public enum CustomerPresence implements ApiRequestParams.EnumParam { + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CustomerPresence(String value) { + this.value = value; + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("failed") + FAILED("failed"), + + @SerializedName("guaranteed") + GUARANTEED("guaranteed"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java b/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java new file mode 100644 index 00000000000..f7445ed145b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.Getter; + +@Getter +public class PaymentRecordRetrieveParams 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 PaymentRecordRetrieveParams(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 PaymentRecordRetrieveParams build() { + return new PaymentRecordRetrieveParams(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 + * PaymentRecordRetrieveParams#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 + * PaymentRecordRetrieveParams#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 + * PaymentRecordRetrieveParams#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 PaymentRecordRetrieveParams#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/service/PaymentAttemptRecordService.java b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java new file mode 100644 index 00000000000..e27811829a2 --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentAttemptRecordService.java @@ -0,0 +1,69 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.google.gson.reflect.TypeToken; +import com.stripe.exception.StripeException; +import com.stripe.model.PaymentAttemptRecord; +import com.stripe.model.StripeCollection; +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.PaymentAttemptRecordListParams; +import com.stripe.param.PaymentAttemptRecordRetrieveParams; + +public final class PaymentAttemptRecordService extends ApiService { + public PaymentAttemptRecordService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public StripeCollection list(PaymentAttemptRecordListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** List all the Payment Attempt Records attached to the specified Payment Record. */ + public StripeCollection list( + PaymentAttemptRecordListParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_attempt_records"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, new TypeToken>() {}.getType()); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id, PaymentAttemptRecordRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PaymentAttemptRecordRetrieveParams) null, options); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve(String id) throws StripeException { + return retrieve(id, (PaymentAttemptRecordRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves a Payment Attempt Record with the given ID. */ + public PaymentAttemptRecord retrieve( + String id, PaymentAttemptRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_attempt_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentAttemptRecord.class); + } +} diff --git a/src/main/java/com/stripe/service/PaymentRecordService.java b/src/main/java/com/stripe/service/PaymentRecordService.java new file mode 100644 index 00000000000..7c62b0d39af --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentRecordService.java @@ -0,0 +1,172 @@ +// File generated from our OpenAPI spec +package com.stripe.service; + +import com.stripe.exception.StripeException; +import com.stripe.model.PaymentRecord; +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.PaymentRecordReportPaymentAttemptCanceledParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptFailedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptGuaranteedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordRetrieveParams; + +public final class PaymentRecordService extends ApiService { + public PaymentRecordService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id, PaymentRecordRetrieveParams params) + throws StripeException { + return retrieve(id, params, (RequestOptions) null); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id, RequestOptions options) throws StripeException { + return retrieve(id, (PaymentRecordRetrieveParams) null, options); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve(String id) throws StripeException { + return retrieve(id, (PaymentRecordRetrieveParams) null, (RequestOptions) null); + } + /** Retrieves a Payment Record with the given ID. */ + public PaymentRecord retrieve( + String id, PaymentRecordRetrieveParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/payment_records/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + String id, PaymentRecordReportPaymentAttemptParams params) throws StripeException { + return reportPaymentAttempt(id, params, (RequestOptions) null); + } + /** + * Report a new payment attempt on the specified Payment Record. A new payment attempt can only be + * specified if all other payment attempts are canceled or failed. + */ + public PaymentRecord reportPaymentAttempt( + String id, PaymentRecordReportPaymentAttemptParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/payment_records/%s/report_payment_attempt", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + String id, PaymentRecordReportPaymentAttemptCanceledParams params) throws StripeException { + return reportPaymentAttemptCanceled(id, params, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was canceled. */ + public PaymentRecord reportPaymentAttemptCanceled( + String id, PaymentRecordReportPaymentAttemptCanceledParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_canceled", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + String id, PaymentRecordReportPaymentAttemptFailedParams params) throws StripeException { + return reportPaymentAttemptFailed(id, params, (RequestOptions) null); + } + /** + * Report that the most recent payment attempt on the specified Payment Record failed or errored. + */ + public PaymentRecord reportPaymentAttemptFailed( + String id, PaymentRecordReportPaymentAttemptFailedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_failed", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + String id, PaymentRecordReportPaymentAttemptGuaranteedParams params) throws StripeException { + return reportPaymentAttemptGuaranteed(id, params, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was guaranteed. */ + public PaymentRecord reportPaymentAttemptGuaranteed( + String id, PaymentRecordReportPaymentAttemptGuaranteedParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_guaranteed", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public PaymentRecord reportPayment(PaymentRecordReportPaymentParams params) + throws StripeException { + return reportPayment(params, (RequestOptions) null); + } + /** + * Report a new Payment Record. You may report a Payment Record as it is initialized and later + * report updates through the other report_* methods, or report Payment Records in a terminal + * state directly, through this method. + */ + public PaymentRecord reportPayment( + PaymentRecordReportPaymentParams params, RequestOptions options) throws StripeException { + String path = "/v1/payment_records/report_payment"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } +} From 057906c73eefee29a580d40953c5d62494b16e68 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 17:09:21 +0000 Subject: [PATCH 08/13] Update generated code for v1330 --- OPENAPI_VERSION | 2 +- .../param/AccountSessionCreateParams.java | 83 +++++++++++++++---- 2 files changed, 67 insertions(+), 18 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 954be9b75ef..3101629250c 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1329 \ No newline at end of file +v1330 \ No newline at end of file diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index f2ee16b3bd3..55880118c46 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -2467,10 +2467,6 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow money movement features. */ - @SerializedName("money_movement") - Boolean moneyMovement; - /** Whether to allow sending money. */ @SerializedName("send_money") Boolean sendMoney; @@ -2483,13 +2479,11 @@ private Features( Boolean disableStripeUserAuthentication, Boolean externalAccountCollection, Map extraParams, - Boolean moneyMovement, Boolean sendMoney, Boolean transferBalance) { this.disableStripeUserAuthentication = disableStripeUserAuthentication; this.externalAccountCollection = externalAccountCollection; this.extraParams = extraParams; - this.moneyMovement = moneyMovement; this.sendMoney = sendMoney; this.transferBalance = transferBalance; } @@ -2505,8 +2499,6 @@ public static class Builder { private Map extraParams; - private Boolean moneyMovement; - private Boolean sendMoney; private Boolean transferBalance; @@ -2517,7 +2509,6 @@ public AccountSessionCreateParams.Components.FinancialAccount.Features build() { this.disableStripeUserAuthentication, this.externalAccountCollection, this.extraParams, - this.moneyMovement, this.sendMoney, this.transferBalance); } @@ -2571,12 +2562,6 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow money movement features. */ - public Builder setMoneyMovement(Boolean moneyMovement) { - this.moneyMovement = moneyMovement; - return this; - } - /** Whether to allow sending money. */ public Builder setSendMoney(Boolean sendMoney) { this.sendMoney = sendMoney; @@ -2607,6 +2592,7 @@ public static class FinancialAccountTransactions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** The list of features enabled in the embedded component. */ @SerializedName("features") Features features; @@ -2670,6 +2656,7 @@ public Builder putAllExtraParam(Map map) { return this; } + /** The list of features enabled in the embedded component. */ public Builder setFeatures( AccountSessionCreateParams.Components.FinancialAccountTransactions.Features features) { this.features = features; @@ -2839,6 +2826,18 @@ public Builder setFeatures( @Getter public static class Features { + /** Whether to allow card management features. */ + @SerializedName("card_management") + Boolean cardManagement; + + /** Whether to allow card spend dispute management features. */ + @SerializedName("card_spend_dispute_management") + Boolean cardSpendDisputeManagement; + + /** Whether to allow cardholder management features. */ + @SerializedName("cardholder_management") + Boolean cardholderManagement; + /** * 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. @@ -2849,8 +2848,21 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Features(Map extraParams) { + /** Whether to allow spend control management features. */ + @SerializedName("spend_control_management") + Boolean spendControlManagement; + + private Features( + Boolean cardManagement, + Boolean cardSpendDisputeManagement, + Boolean cardholderManagement, + Map extraParams, + Boolean spendControlManagement) { + this.cardManagement = cardManagement; + this.cardSpendDisputeManagement = cardSpendDisputeManagement; + this.cardholderManagement = cardholderManagement; this.extraParams = extraParams; + this.spendControlManagement = spendControlManagement; } public static Builder builder() { @@ -2858,11 +2870,42 @@ public static Builder builder() { } public static class Builder { + private Boolean cardManagement; + + private Boolean cardSpendDisputeManagement; + + private Boolean cardholderManagement; + private Map extraParams; + private Boolean spendControlManagement; + /** Finalize and obtain parameter instance from this builder. */ public AccountSessionCreateParams.Components.IssuingCard.Features build() { - return new AccountSessionCreateParams.Components.IssuingCard.Features(this.extraParams); + return new AccountSessionCreateParams.Components.IssuingCard.Features( + this.cardManagement, + this.cardSpendDisputeManagement, + this.cardholderManagement, + this.extraParams, + this.spendControlManagement); + } + + /** Whether to allow card management features. */ + public Builder setCardManagement(Boolean cardManagement) { + this.cardManagement = cardManagement; + return this; + } + + /** Whether to allow card spend dispute management features. */ + public Builder setCardSpendDisputeManagement(Boolean cardSpendDisputeManagement) { + this.cardSpendDisputeManagement = cardSpendDisputeManagement; + return this; + } + + /** Whether to allow cardholder management features. */ + public Builder setCardholderManagement(Boolean cardholderManagement) { + this.cardholderManagement = cardholderManagement; + return this; } /** @@ -2892,6 +2935,12 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** Whether to allow spend control management features. */ + public Builder setSpendControlManagement(Boolean spendControlManagement) { + this.spendControlManagement = spendControlManagement; + return this; + } } } } From 22a13ba7727f58782eebcb9e0a82b91893952b53 Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 19:51:17 +0000 Subject: [PATCH 09/13] Update generated code for v1331 --- OPENAPI_VERSION | 2 +- src/main/java/com/stripe/model/TaxRate.java | 2 +- src/main/java/com/stripe/model/tax/Calculation.java | 5 +++-- src/main/java/com/stripe/model/tax/CalculationLineItem.java | 2 +- src/main/java/com/stripe/model/tax/Transaction.java | 3 ++- src/main/java/com/stripe/param/InvoiceAddLinesParams.java | 3 +++ .../java/com/stripe/param/InvoiceLineItemUpdateParams.java | 3 +++ src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java | 3 +++ src/main/java/com/stripe/param/TaxRateCreateParams.java | 3 +++ src/main/java/com/stripe/param/TaxRateUpdateParams.java | 3 +++ 10 files changed, 23 insertions(+), 6 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3101629250c..e975766f307 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1330 \ No newline at end of file +v1331 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/TaxRate.java b/src/main/java/com/stripe/model/TaxRate.java index 2e2f6797c35..84195dd5852 100644 --- a/src/main/java/com/stripe/model/TaxRate.java +++ b/src/main/java/com/stripe/model/TaxRate.java @@ -160,7 +160,7 @@ public class TaxRate extends ApiResource implements HasId, MetadataStoreOne 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}, or {@code vat}. + * {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Calculation.java b/src/main/java/com/stripe/model/tax/Calculation.java index 5fadc7b6d33..744945f8f30 100644 --- a/src/main/java/com/stripe/model/tax/Calculation.java +++ b/src/main/java/com/stripe/model/tax/Calculation.java @@ -562,7 +562,8 @@ public static class TaxRateDetails extends StripeObject { * *

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}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code + * vat}. */ @SerializedName("tax_type") String taxType; @@ -658,7 +659,7 @@ public static class TaxRateDetails extends StripeObject { * *

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}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_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 0d231fcacab..041f16d431a 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -199,7 +199,7 @@ public static class TaxRateDetails extends StripeObject { * *

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}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/model/tax/Transaction.java b/src/main/java/com/stripe/model/tax/Transaction.java index 3cf65286ee9..718a73b9080 100644 --- a/src/main/java/com/stripe/model/tax/Transaction.java +++ b/src/main/java/com/stripe/model/tax/Transaction.java @@ -623,7 +623,8 @@ public static class TaxRateDetails extends StripeObject { * *

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}, or {@code vat}. + * retail_delivery_fee}, {@code rst}, {@code sales_tax}, {@code service_tax}, or {@code + * vat}. */ @SerializedName("tax_type") String taxType; diff --git a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java index a0b44f4bdab..df2056cb9eb 100644 --- a/src/main/java/com/stripe/param/InvoiceAddLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceAddLinesParams.java @@ -1982,6 +1982,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java index 9dab5179833..96433b10712 100644 --- a/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceLineItemUpdateParams.java @@ -1927,6 +1927,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java index 7a02eb9a5e7..09624419acf 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateLinesParams.java @@ -2009,6 +2009,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/TaxRateCreateParams.java b/src/main/java/com/stripe/param/TaxRateCreateParams.java index 6dfde76285c..a3df1a13942 100644 --- a/src/main/java/com/stripe/param/TaxRateCreateParams.java +++ b/src/main/java/com/stripe/param/TaxRateCreateParams.java @@ -347,6 +347,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); diff --git a/src/main/java/com/stripe/param/TaxRateUpdateParams.java b/src/main/java/com/stripe/param/TaxRateUpdateParams.java index 3ad5c153a02..7e24c42954b 100644 --- a/src/main/java/com/stripe/param/TaxRateUpdateParams.java +++ b/src/main/java/com/stripe/param/TaxRateUpdateParams.java @@ -381,6 +381,9 @@ public enum TaxType implements ApiRequestParams.EnumParam { @SerializedName("sales_tax") SALES_TAX("sales_tax"), + @SerializedName("service_tax") + SERVICE_TAX("service_tax"), + @SerializedName("vat") VAT("vat"); From 65353b8fbf9b1ccfb126ece56ac61c2c0f326f8e Mon Sep 17 00:00:00 2001 From: Stripe OpenAPI <105521251+stripe-openapi[bot]@users.noreply.github.com> Date: Tue, 5 Nov 2024 20:47:51 +0000 Subject: [PATCH 10/13] Update generated code for v1332 --- OPENAPI_VERSION | 2 +- ...ymentRecordReportPaymentAttemptParams.java | 39 ++++++++++++------- .../PaymentRecordReportPaymentParams.java | 39 ++++++++++++------- 3 files changed, 51 insertions(+), 29 deletions(-) diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index e975766f307..10859b1ceaf 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1331 \ No newline at end of file +v1332 \ No newline at end of file diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java index 2b015eac4c6..3bb9dfb8f64 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java @@ -656,8 +656,8 @@ public static class Address { String city; /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ @SerializedName("country") String country; @@ -745,8 +745,8 @@ public Builder setCity(String city) { } /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ public Builder setCountry(String country) { this.country = country; @@ -813,8 +813,7 @@ public Builder setState(String state) { @Getter public static class Custom { /** - * Required. Display name for the custom (user-defined) payment method type - * used to make this payment. + * Display name for the custom (user-defined) payment method type used to make this payment. */ @SerializedName("display_name") String displayName; @@ -828,9 +827,14 @@ public static class Custom { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Custom(String displayName, Map extraParams) { + /** The custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + + private Custom(String displayName, Map extraParams, String type) { this.displayName = displayName; this.extraParams = extraParams; + this.type = type; } public static Builder builder() { @@ -842,15 +846,16 @@ public static class Builder { private Map extraParams; + private String type; + /** Finalize and obtain parameter instance from this builder. */ public PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom build() { return new PaymentRecordReportPaymentAttemptParams.PaymentMethodDetails.Custom( - this.displayName, this.extraParams); + this.displayName, this.extraParams, this.type); } /** - * Required. Display name for the custom (user-defined) payment method type - * used to make this payment. + * Display name for the custom (user-defined) payment method type used to make this payment. */ public Builder setDisplayName(String displayName) { this.displayName = displayName; @@ -886,6 +891,12 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + return this; + } } } @@ -1007,8 +1018,8 @@ public static class Address { String city; /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ @SerializedName("country") String country; @@ -1093,8 +1104,8 @@ public Builder setCity(String city) { } /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ public Builder setCountry(String country) { this.country = country; diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java index d0ded600144..2798d2bc67c 100644 --- a/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java @@ -929,8 +929,8 @@ public static class Address { String city; /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ @SerializedName("country") String country; @@ -1017,8 +1017,8 @@ public Builder setCity(String city) { } /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ public Builder setCountry(String country) { this.country = country; @@ -1085,8 +1085,7 @@ public Builder setState(String state) { @Getter public static class Custom { /** - * Required. Display name for the custom (user-defined) payment method type - * used to make this payment. + * Display name for the custom (user-defined) payment method type used to make this payment. */ @SerializedName("display_name") String displayName; @@ -1100,9 +1099,14 @@ public static class Custom { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Custom(String displayName, Map extraParams) { + /** The custom payment method type associated with this payment. */ + @SerializedName("type") + String type; + + private Custom(String displayName, Map extraParams, String type) { this.displayName = displayName; this.extraParams = extraParams; + this.type = type; } public static Builder builder() { @@ -1114,15 +1118,16 @@ public static class Builder { private Map extraParams; + private String type; + /** Finalize and obtain parameter instance from this builder. */ public PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom build() { return new PaymentRecordReportPaymentParams.PaymentMethodDetails.Custom( - this.displayName, this.extraParams); + this.displayName, this.extraParams, this.type); } /** - * Required. Display name for the custom (user-defined) payment method type - * used to make this payment. + * Display name for the custom (user-defined) payment method type used to make this payment. */ public Builder setDisplayName(String displayName) { this.displayName = displayName; @@ -1156,6 +1161,12 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + return this; + } } } @@ -1275,8 +1286,8 @@ public static class Address { String city; /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ @SerializedName("country") String country; @@ -1361,8 +1372,8 @@ public Builder setCity(String city) { } /** - * Required. Two-letter country code (ISO 3166-1 alpha-2). + * Two-letter country code (ISO + * 3166-1 alpha-2). */ public Builder setCountry(String country) { this.country = country; From 0f94acf2438d540185b93efab743a2664ebaf872 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Wed, 6 Nov 2024 13:49:02 -0800 Subject: [PATCH 11/13] Catch `JsonSyntaxException` when processing all errors (#1919) * Catch JsonSyntaxExceptions when processing errors as well * spotless --- .../stripe/net/LiveStripeResponseGetter.java | 36 ++++++++++--------- .../LiveStripeResponseGetterTest.java | 15 ++++++++ 2 files changed, 35 insertions(+), 16 deletions(-) diff --git a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java index 0caba0cfd38..f11e94b87d1 100644 --- a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java +++ b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java @@ -6,7 +6,6 @@ import com.google.gson.JsonSyntaxException; import com.stripe.Stripe; import com.stripe.exception.*; -import com.stripe.exception.ApiKeyMissingException; import com.stripe.exception.oauth.InvalidClientException; import com.stripe.exception.oauth.InvalidGrantException; import com.stripe.exception.oauth.InvalidScopeException; @@ -289,22 +288,27 @@ private StripeError parseStripeError( } private void handleError(StripeResponse response, ApiMode apiMode) throws StripeException { - JsonObject responseBody = ApiResource.GSON.fromJson(response.body(), JsonObject.class); - - /* - OAuth errors are JSON objects where `error` is a string. In - contrast, in API errors, `error` is a hash with sub-keys. We use - this property to distinguish between OAuth and API errors. - */ - if (responseBody.has("error") && responseBody.get("error").isJsonPrimitive()) { - JsonPrimitive error = responseBody.getAsJsonPrimitive("error"); - if (error.isString()) { - handleOAuthError(response); + try { + /* + OAuth errors are JSON objects where `error` is a string. In + contrast, in API errors, `error` is a hash with sub-keys. We use + this property to distinguish between OAuth and API errors. + + Try to read the response body to see if it must be + */ + JsonObject responseBody = ApiResource.GSON.fromJson(response.body(), JsonObject.class); + if (responseBody.has("error") && responseBody.get("error").isJsonPrimitive()) { + JsonPrimitive error = responseBody.getAsJsonPrimitive("error"); + if (error.isString()) { + handleOAuthError(response); + } + } else if (apiMode == ApiMode.V2) { + handleV2ApiError(response); + } else { + handleV1ApiError(response); } - } else if (apiMode == ApiMode.V2) { - handleV2ApiError(response); - } else { - handleV1ApiError(response); + } catch (JsonSyntaxException e) { + throw makeMalformedJsonError(response.body(), response.code(), response.requestId(), e); } } diff --git a/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java b/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java index afc1f623ff4..8a470940027 100644 --- a/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java +++ b/src/test/java/com/stripe/functional/LiveStripeResponseGetterTest.java @@ -63,4 +63,19 @@ public void testIdempotencyError() throws StripeException { }); assertThat(exception.getMessage(), CoreMatchers.containsString("idempotency")); } + + @Test + public void testErrorWithJsonSyntaxException() throws Exception { + HttpClient spy = Mockito.spy(new HttpURLConnectionClient()); + StripeResponseGetter srg = new LiveStripeResponseGetter(spy); + ApiResource.setGlobalResponseGetter(srg); + StripeResponse response = + new StripeResponse(400, HttpHeaders.of(Collections.emptyMap()), "I am not JSON :)"); + Mockito.doReturn(response).when(spy).requestWithRetries(Mockito.any()); + assertThrows( + StripeException.class, + () -> { + Subscription.retrieve("sub_123"); + }); + } } From 85c25d793bcb6403ac80e145f8566fd7fba109d4 Mon Sep 17 00:00:00 2001 From: Helen Ye Date: Wed, 6 Nov 2024 17:00:40 -0500 Subject: [PATCH 12/13] Bump version to 28.0.1 --- CHANGELOG.md | 5 +++++ README.md | 8 ++++---- VERSION | 2 +- gradle.properties | 2 +- src/main/java/com/stripe/Stripe.java | 2 +- 5 files changed, 12 insertions(+), 7 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ed2bc51c6b1..7fee7466aa6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Changelog +## 28.0.1 - 2024-11-06 +* [#1919](https://github.com/stripe/stripe-java/pull/1919) Catch `JsonSyntaxException` when processing all errors +* [#1916](https://github.com/stripe/stripe-java/pull/1916) Restore `testReportsRawRequestUsageTelemetry` test +* [#1915](https://github.com/stripe/stripe-java/pull/1915) add major version blurb to changelog + ## 28.0.0 - 2024-10-29 Historically, when upgrading webhooks to a new API version, you also had to upgrade your SDK version. Your webhook's API version needed to match the API version pinned by the SDK you were using to ensure successful deserialization of events. With the `2024-09-30.acacia` release, Stripe follows a [new API release process](https://stripe.com/blog/introducing-stripes-new-api-release-process). As a result, you can safely upgrade your webhook endpoints to any API version within a biannual release (like `acacia`) without upgrading the SDK. diff --git a/README.md b/README.md index 65d2a34f5c3..e78b81e07fb 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Stripe Java client library -[![Maven Central](https://img.shields.io/badge/maven--central-v28.0.0-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) +[![Maven Central](https://img.shields.io/badge/maven--central-v28.0.1-blue)](https://mvnrepository.com/artifact/com.stripe/stripe-java) [![JavaDoc](http://img.shields.io/badge/javadoc-reference-blue.svg)](https://stripe.dev/stripe-java) [![Build Status](https://github.com/stripe/stripe-java/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/stripe/stripe-java/actions?query=branch%3Amaster) [![Coverage Status](https://coveralls.io/repos/github/stripe/stripe-java/badge.svg?branch=master)](https://coveralls.io/github/stripe/stripe-java?branch=master) @@ -18,7 +18,7 @@ The official [Stripe][stripe] Java client library. Add this dependency to your project's build file: ```groovy -implementation "com.stripe:stripe-java:28.0.0" +implementation "com.stripe:stripe-java:28.0.1" ``` ### Maven users @@ -29,7 +29,7 @@ Add this dependency to your project's POM: com.stripe stripe-java - 28.0.0 + 28.0.1 ``` @@ -37,7 +37,7 @@ Add this dependency to your project's POM: You'll need to manually install the following JARs: -- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/28.0.0/stripe-java-28.0.0.jar) +- [The Stripe JAR](https://search.maven.org/remotecontent?filepath=com/stripe/stripe-java/28.0.1/stripe-java-28.0.1.jar) - [Google Gson][gson] from . ### [ProGuard][proguard] diff --git a/VERSION b/VERSION index 0b4dfcf095f..eebc120d380 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -28.0.0 +28.0.1 diff --git a/gradle.properties b/gradle.properties index 95d64a9796f..f63c1cf9c56 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,5 +1,5 @@ GROUP=com.stripe -VERSION_NAME=28.0.0 +VERSION_NAME=28.0.1 POM_URL=https://github.com/stripe/stripe-java POM_SCM_URL=git@github.com:stripe/stripe-java.git diff --git a/src/main/java/com/stripe/Stripe.java b/src/main/java/com/stripe/Stripe.java index 2e341bef4a5..9b90f76fa03 100644 --- a/src/main/java/com/stripe/Stripe.java +++ b/src/main/java/com/stripe/Stripe.java @@ -14,7 +14,7 @@ public abstract class Stripe { public static final String LIVE_API_BASE = "https://api.stripe.com"; public static final String UPLOAD_API_BASE = "https://files.stripe.com"; public static final String METER_EVENTS_API_BASE = "https://meter-events.stripe.com"; - public static final String VERSION = "28.0.0"; + public static final String VERSION = "28.0.1"; public static volatile String apiKey; public static volatile String clientId; From 27bf7cfb21b707f616546b0b9f27deb8ee19ee52 Mon Sep 17 00:00:00 2001 From: helenye-stripe <111009531+helenye-stripe@users.noreply.github.com> Date: Thu, 7 Nov 2024 09:30:00 -0800 Subject: [PATCH 13/13] fix comment (#1920) --- src/main/java/com/stripe/net/LiveStripeResponseGetter.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java index f11e94b87d1..0df78fddf24 100644 --- a/src/main/java/com/stripe/net/LiveStripeResponseGetter.java +++ b/src/main/java/com/stripe/net/LiveStripeResponseGetter.java @@ -293,8 +293,6 @@ private void handleError(StripeResponse response, ApiMode apiMode) throws Stripe OAuth errors are JSON objects where `error` is a string. In contrast, in API errors, `error` is a hash with sub-keys. We use this property to distinguish between OAuth and API errors. - - Try to read the response body to see if it must be */ JsonObject responseBody = ApiResource.GSON.fromJson(response.body(), JsonObject.class); if (responseBody.has("error") && responseBody.get("error").isJsonPrimitive()) {