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()) {