diff --git a/API_VERSION b/API_VERSION index fb725068586..7fa3a2d3c56 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2025-09-30.clover \ No newline at end of file +577fcb57736b925392ea563c0284df9002c75ac9 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f0bb0d526f9..edaae7f4520 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2028 \ No newline at end of file +v2099 \ No newline at end of file diff --git a/src/main/java/com/stripe/ApiVersion.java b/src/main/java/com/stripe/ApiVersion.java index 23d4cc98162..933e22b0b18 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,6 +2,6 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-09-30.clover"; + public static final String CURRENT = "2025-10-29.clover"; public static final String CURRENT_MAJOR = "clover"; } diff --git a/src/main/java/com/stripe/StripeClient.java b/src/main/java/com/stripe/StripeClient.java index e7143089ae3..360b3c26b09 100644 --- a/src/main/java/com/stripe/StripeClient.java +++ b/src/main/java/com/stripe/StripeClient.java @@ -541,6 +541,18 @@ public com.stripe.service.MandateService mandates() { return new com.stripe.service.MandateService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.paymentAttemptRecords() is deprecated, use + * StripeClient.v1().paymentAttemptRecords() instead. All functionality under it has been + * copied over to StripeClient.v1().paymentAttemptRecords(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.PaymentAttemptRecordService paymentAttemptRecords() { + return new com.stripe.service.PaymentAttemptRecordService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.paymentIntents() is deprecated, use StripeClient.v1().paymentIntents() * instead. All functionality under it has been copied over to @@ -601,6 +613,18 @@ public com.stripe.service.PaymentMethodService paymentMethods() { return new com.stripe.service.PaymentMethodService(this.getResponseGetter()); } + /** + * @deprecated StripeClient.paymentRecords() is deprecated, use StripeClient.v1().paymentRecords() + * instead. All functionality under it has been copied over to + * StripeClient.v1().paymentRecords(). See migration + * guide for more on this and tips on migrating to the new v1 namespace. + */ + @Deprecated + public com.stripe.service.PaymentRecordService paymentRecords() { + return new com.stripe.service.PaymentRecordService(this.getResponseGetter()); + } + /** * @deprecated StripeClient.payouts() is deprecated, use StripeClient.v1().payouts() instead. All * functionality under it has been copied over to StripeClient.v1().payouts(). See API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration extends StripeObject { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** The IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user-agent string from the browser where the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + } + /** * For more details about Verification, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index ba9efcaf66b..c5c6e994c56 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -2690,7 +2690,7 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

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

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. */ @SerializedName("network") String network; diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index b4eaa24b022..8af3bf46de1 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -442,14 +442,14 @@ public static class PaymentMethodPreview extends StripeObject { *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code * bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cashapp}, {@code crypto}, {@code customer_balance}, {@code eps}, {@code - * fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code - * kakao_pay}, {@code klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, - * {@code mobilepay}, {@code multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code - * oxxo}, {@code p24}, {@code pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, - * {@code pix}, {@code promptpay}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, - * {@code sepa_debit}, {@code sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, - * {@code wechat_pay}, or {@code zip}. + * card_present}, {@code cashapp}, {@code crypto}, {@code custom}, {@code customer_balance}, + * {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code + * interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code kr_card}, {@code + * link}, {@code mb_way}, {@code mobilepay}, {@code multibanco}, {@code naver_pay}, {@code + * nz_bank_account}, {@code oxxo}, {@code p24}, {@code pay_by_bank}, {@code payco}, {@code + * paynow}, {@code paypal}, {@code pix}, {@code promptpay}, {@code revolut_pay}, {@code + * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code sofort}, {@code swish}, {@code + * twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index 8576cb7d60e..b64f4a8674e 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -739,12 +739,20 @@ public static class Refund extends StripeObject { @SerializedName("amount_refunded") Long amountRefunded; + /** The PaymentRecord refund details associated with this credit note refund. */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** ID of the refund. */ @SerializedName("refund") @Getter(lombok.AccessLevel.NONE) @Setter(lombok.AccessLevel.NONE) ExpandableField refund; + /** Type of the refund, one of {@code refund} or {@code payment_record_refund}. */ + @SerializedName("type") + String type; + /** Get ID of expandable {@code refund} object. */ public String getRefund() { return (this.refund != null) ? this.refund.getId() : null; @@ -763,6 +771,23 @@ public void setRefundObject(com.stripe.model.Refund expandableObject) { this.refund = new ExpandableField(expandableObject.getId(), expandableObject); } + + /** + * For more details about PaymentRecordRefund, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund extends StripeObject { + /** ID of the payment record. */ + @SerializedName("payment_record") + String paymentRecord; + + /** ID of the refund group. */ + @SerializedName("refund_group") + String refundGroup; + } } /** diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index 2cb7a88927e..2683a73c42b 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -979,6 +979,15 @@ public static class Tax extends StripeObject { @SerializedName("location") Location location; + /** + * The tax calculation provider used for location resolution. Defaults to {@code stripe} when + * not using a third-party provider. + * + *

One of {@code anrok}, {@code avalara}, {@code sphere}, or {@code stripe}. + */ + @SerializedName("provider") + String provider; + /** * For more details about Location, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/CustomerSession.java b/src/main/java/com/stripe/model/CustomerSession.java index 534a5a172e7..031e0b4c448 100644 --- a/src/main/java/com/stripe/model/CustomerSession.java +++ b/src/main/java/com/stripe/model/CustomerSession.java @@ -149,6 +149,17 @@ public static class Components extends StripeObject { @SerializedName("buy_button") BuyButton buyButton; + /** This hash contains whether the customer sheet is enabled and the features it supports. */ + @SerializedName("customer_sheet") + CustomerSheet customerSheet; + + /** + * This hash contains whether the mobile payment element is enabled and the features it + * supports. + */ + @SerializedName("mobile_payment_element") + MobilePaymentElement mobilePaymentElement; + /** This hash contains whether the Payment Element is enabled and the features it supports. */ @SerializedName("payment_element") PaymentElement paymentElement; @@ -167,6 +178,144 @@ public static class BuyButton extends StripeObject { Boolean enabled; } + /** This hash contains whether the customer sheet is enabled and the features it supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerSheet extends StripeObject { + /** Whether the customer sheet is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** This hash defines whether the customer sheet supports certain features. */ + @SerializedName("features") + Features features; + + /** This hash contains the features the customer sheet supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the customer sheet + * displays by filtering to only show payment methods with an {@code allow_redisplay} value + * that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List paymentMethodAllowRedisplayFilters; + + /** + * Controls whether the customer sheet displays the option to remove a saved payment + * method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_remove") + String paymentMethodRemove; + } + } + + /** + * This hash contains whether the mobile payment element is enabled and the features it + * supports. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MobilePaymentElement extends StripeObject { + /** Whether the mobile payment element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** This hash defines whether the mobile payment element supports certain features. */ + @SerializedName("features") + Features features; + + /** This hash contains the features the mobile payment element supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the mobile payment + * element displays by filtering to only show payment methods with an {@code + * allow_redisplay} value that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List paymentMethodAllowRedisplayFilters; + + /** + * Controls whether or not the mobile payment element shows saved payment methods. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_redisplay") + String paymentMethodRedisplay; + + /** + * Controls whether the mobile payment element displays the option to remove a saved payment + * method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_remove") + String paymentMethodRemove; + + /** + * Controls whether the mobile payment element displays a checkbox offering to save a new + * payment method. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("payment_method_save") + String paymentMethodSave; + + /** + * Allows overriding the value of allow_override when saving a new payment method when + * payment_method_save is set to disabled. Use values: "always", + * "limited", or "unspecified". + * + *

If not specified, defaults to {@code nil} (no override value). + * + *

One of {@code always}, {@code limited}, or {@code unspecified}. + */ + @SerializedName("payment_method_save_allow_redisplay_override") + String paymentMethodSaveAllowRedisplayOverride; + } + } + /** This hash contains whether the Payment Element is enabled and the features it supports. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index 46b57125e94..8f0b0911e4e 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -104,7 +104,7 @@ public class Event extends ApiResource implements HasId { * {@code account.external_account.created}, {@code account.external_account.deleted}, {@code * account.external_account.updated}, {@code account.updated}, {@code application_fee.created}, * {@code application_fee.refund.updated}, {@code application_fee.refunded}, {@code - * balance.available}, {@code billing.alert.triggered}, {@code + * balance.available}, {@code balance_settings.updated}, {@code billing.alert.triggered}, {@code * billing_portal.configuration.created}, {@code billing_portal.configuration.updated}, {@code * billing_portal.session.created}, {@code capability.updated}, {@code * cash_balance.funds_available}, {@code charge.captured}, {@code charge.dispute.closed}, {@code @@ -141,7 +141,8 @@ public class Event extends ApiResource implements HasId { * identity.verification_session.verified}, {@code invoice.created}, {@code invoice.deleted}, * {@code invoice.finalization_failed}, {@code invoice.finalized}, {@code * invoice.marked_uncollectible}, {@code invoice.overdue}, {@code invoice.overpaid}, {@code - * invoice.paid}, {@code invoice.payment_action_required}, {@code invoice.payment_failed}, {@code + * invoice.paid}, {@code invoice.payment_action_required}, {@code + * invoice.payment_attempt_required}, {@code invoice.payment_failed}, {@code * invoice.payment_succeeded}, {@code invoice.sent}, {@code invoice.upcoming}, {@code * invoice.updated}, {@code invoice.voided}, {@code invoice.will_be_due}, {@code * invoice_payment.paid}, {@code invoiceitem.created}, {@code invoiceitem.deleted}, {@code diff --git a/src/main/java/com/stripe/model/EventDataClassLookup.java b/src/main/java/com/stripe/model/EventDataClassLookup.java index 20b214eed72..7449b2bf619 100644 --- a/src/main/java/com/stripe/model/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/EventDataClassLookup.java @@ -58,12 +58,17 @@ public final class EventDataClassLookup { classLookup.put("line_item", com.stripe.model.InvoiceLineItem.class); classLookup.put("login_link", com.stripe.model.LoginLink.class); classLookup.put("mandate", com.stripe.model.Mandate.class); + classLookup.put("payment_attempt_record", com.stripe.model.PaymentAttemptRecord.class); classLookup.put("payment_intent", com.stripe.model.PaymentIntent.class); + classLookup.put( + "payment_intent_amount_details_line_item", + com.stripe.model.PaymentIntentAmountDetailsLineItem.class); classLookup.put("payment_link", com.stripe.model.PaymentLink.class); classLookup.put("payment_method", com.stripe.model.PaymentMethod.class); classLookup.put( "payment_method_configuration", com.stripe.model.PaymentMethodConfiguration.class); classLookup.put("payment_method_domain", com.stripe.model.PaymentMethodDomain.class); + classLookup.put("payment_record", com.stripe.model.PaymentRecord.class); classLookup.put("payout", com.stripe.model.Payout.class); classLookup.put("person", com.stripe.model.Person.class); classLookup.put("plan", com.stripe.model.Plan.class); diff --git a/src/main/java/com/stripe/model/File.java b/src/main/java/com/stripe/model/File.java index 39b436af72a..f11567995b5 100644 --- a/src/main/java/com/stripe/model/File.java +++ b/src/main/java/com/stripe/model/File.java @@ -70,8 +70,9 @@ public class File extends ApiResource implements HasId { * document_provider_identity_document}, {@code finance_report_run}, {@code * financial_account_statement}, {@code identity_document}, {@code * identity_document_downloadable}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, {@code - * terminal_android_apk}, or {@code terminal_reader_splashscreen}. + * {@code platform_terms_of_service}, {@code selfie}, {@code sigma_scheduled_query}, {@code + * tax_document_user_upload}, {@code terminal_android_apk}, or {@code + * terminal_reader_splashscreen}. */ @SerializedName("purpose") String purpose; diff --git a/src/main/java/com/stripe/model/InvoicePayment.java b/src/main/java/com/stripe/model/InvoicePayment.java index eba29cef181..300ebea267f 100644 --- a/src/main/java/com/stripe/model/InvoicePayment.java +++ b/src/main/java/com/stripe/model/InvoicePayment.java @@ -232,6 +232,15 @@ public static class Payment extends StripeObject { @Setter(lombok.AccessLevel.NONE) ExpandableField paymentIntent; + /** + * ID of the PaymentRecord associated with this payment when {@code type} is {@code + * payment_record}. + */ + @SerializedName("payment_record") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentRecord; + /** * Type of payment object associated with this invoice payment. * @@ -276,6 +285,25 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { this.paymentIntent = new ExpandableField(expandableObject.getId(), expandableObject); } + + /** Get ID of expandable {@code paymentRecord} object. */ + public String getPaymentRecord() { + return (this.paymentRecord != null) ? this.paymentRecord.getId() : null; + } + + public void setPaymentRecord(String id) { + this.paymentRecord = ApiResource.setExpandableFieldId(id, this.paymentRecord); + } + + /** Get expanded {@code paymentRecord}. */ + public PaymentRecord getPaymentRecordObject() { + return (this.paymentRecord != null) ? this.paymentRecord.getExpanded() : null; + } + + public void setPaymentRecordObject(PaymentRecord expandableObject) { + this.paymentRecord = + new ExpandableField(expandableObject.getId(), expandableObject); + } } /** 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..9162a9c2ebf --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -0,0 +1,3089 @@ +// 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.List; +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") + Amount amount; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_authorized") + AmountAuthorized amountAuthorized; + + /** 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_refunded") + AmountRefunded amountRefunded; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** ID of the Connect application that created the PaymentAttemptRecord. */ + @SerializedName("application") + String application; + + /** 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; + + /** Processor information associated with this payment. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** + * Indicates who reported the payment. + * + *

One of {@code self}, or {@code stripe}. + */ + @SerializedName("reported_by") + String reportedBy; + + /** 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 Amount 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 AmountAuthorized 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 AmountRefunded 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 { + @SerializedName("ach_credit_transfer") + AchCreditTransfer achCreditTransfer; + + @SerializedName("ach_debit") + AchDebit achDebit; + + @SerializedName("acss_debit") + AcssDebit acssDebit; + + @SerializedName("affirm") + Affirm affirm; + + @SerializedName("afterpay_clearpay") + AfterpayClearpay afterpayClearpay; + + @SerializedName("alipay") + Alipay alipay; + + @SerializedName("alma") + Alma alma; + + @SerializedName("amazon_pay") + AmazonPay amazonPay; + + @SerializedName("au_becs_debit") + AuBecsDebit auBecsDebit; + + @SerializedName("bacs_debit") + BacsDebit bacsDebit; + + @SerializedName("bancontact") + Bancontact bancontact; + + @SerializedName("billie") + Billie billie; + + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + @SerializedName("blik") + Blik blik; + + @SerializedName("boleto") + Boleto boleto; + + /** Details of the card used for this payment attempt. */ + @SerializedName("card") + Card card; + + @SerializedName("card_present") + CardPresent cardPresent; + + @SerializedName("cashapp") + Cashapp cashapp; + + @SerializedName("crypto") + Crypto crypto; + + /** + * 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. + */ + @SerializedName("custom") + Custom custom; + + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + @SerializedName("eps") + Eps eps; + + @SerializedName("fpx") + Fpx fpx; + + @SerializedName("giropay") + Giropay giropay; + + @SerializedName("grabpay") + Grabpay grabpay; + + @SerializedName("ideal") + Ideal ideal; + + @SerializedName("interac_present") + InteracPresent interacPresent; + + @SerializedName("kakao_pay") + KakaoPay kakaoPay; + + @SerializedName("klarna") + Klarna klarna; + + @SerializedName("konbini") + Konbini konbini; + + @SerializedName("kr_card") + KrCard krCard; + + @SerializedName("link") + Link link; + + @SerializedName("mb_way") + MbWay mbWay; + + @SerializedName("mobilepay") + Mobilepay mobilepay; + + @SerializedName("multibanco") + Multibanco multibanco; + + @SerializedName("naver_pay") + NaverPay naverPay; + + @SerializedName("nz_bank_account") + NzBankAccount nzBankAccount; + + @SerializedName("oxxo") + Oxxo oxxo; + + @SerializedName("p24") + P24 p24; + + @SerializedName("pay_by_bank") + PayByBank payByBank; + + @SerializedName("payco") + Payco payco; + + /** ID of the Stripe PaymentMethod used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + @SerializedName("paynow") + Paynow paynow; + + @SerializedName("paypal") + Paypal paypal; + + @SerializedName("pix") + Pix pix; + + @SerializedName("promptpay") + Promptpay promptpay; + + @SerializedName("revolut_pay") + RevolutPay revolutPay; + + @SerializedName("samsung_pay") + SamsungPay samsungPay; + + @SerializedName("satispay") + Satispay satispay; + + @SerializedName("sepa_credit_transfer") + SepaCreditTransfer sepaCreditTransfer; + + @SerializedName("sepa_debit") + SepaDebit sepaDebit; + + @SerializedName("sofort") + Sofort sofort; + + @SerializedName("stripe_account") + StripeAccount stripeAccount; + + @SerializedName("swish") + Swish swish; + + @SerializedName("twint") + Twint twint; + + /** + * The type of transaction-specific details of the payment method used in the payment. See PaymentMethod.type + * for the full list of possible types. An additional hash is included on {@code + * payment_method_details} with a name matching this value. It contains information specific to + * the payment method. + */ + @SerializedName("type") + String type; + + /** Details of the US Bank Account used for this payment attempt. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + @SerializedName("wechat") + Wechat wechat; + + @SerializedName("wechat_pay") + WechatPay wechatPay; + + @SerializedName("zip") + Zip zip; + + /** + * For more details about AchCreditTransfer, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AchCreditTransfer extends StripeObject { + /** Account number to transfer funds to. */ + @SerializedName("account_number") + String accountNumber; + + /** Name of the bank associated with the routing number. */ + @SerializedName("bank_name") + String bankName; + + /** Routing transit number for the bank account to transfer funds to. */ + @SerializedName("routing_number") + String routingNumber; + + /** SWIFT code of the bank associated with the routing number. */ + @SerializedName("swift_code") + String swiftCode; + } + + /** + * For more details about AchDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AchDebit extends StripeObject { + /** + * Type of entity that holds the account. This can be either {@code individual} or {@code + * company}. + * + *

One of {@code company}, or {@code individual}. + */ + @SerializedName("account_holder_type") + String accountHolderType; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** Routing transit number of the bank account. */ + @SerializedName("routing_number") + String routingNumber; + } + + /** + * For more details about AcssDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit extends StripeObject { + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Institution number of the bank account. */ + @SerializedName("institution_number") + String institutionNumber; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + + /** Transit number of the bank account. */ + @SerializedName("transit_number") + String transitNumber; + } + + /** + * For more details about Affirm, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Affirm extends StripeObject { + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** The Affirm transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about AfterpayClearpay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AfterpayClearpay extends StripeObject { + /** The Afterpay order ID associated with this payment intent. */ + @SerializedName("order_id") + String orderId; + + /** Order identifier shown to the merchant in Afterpay’s online portal. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about Alipay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Alipay extends StripeObject { + /** + * Uniquely identifies this particular Alipay account. You can use this attribute to check + * whether two Alipay accounts are the same. + */ + @SerializedName("buyer_id") + String buyerId; + + /** + * Uniquely identifies this particular Alipay account. You can use this attribute to check + * whether two Alipay accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Transaction ID of this particular Alipay transaction. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Alma, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Alma extends StripeObject { + @SerializedName("installments") + Installments installments; + + /** The Alma transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Installments, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Installments extends StripeObject { + /** The number of installments. */ + @SerializedName("count") + Long count; + } + } + + /** + * For more details about AmazonPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmazonPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** The Amazon Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } + + /** + * For more details about AuBecsDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AuBecsDebit extends StripeObject { + /** Bank-State-Branch number of the bank account. */ + @SerializedName("bsb_number") + String bsbNumber; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + } + + /** + * For more details about BacsDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BacsDebit extends StripeObject { + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + + /** Sort code of the bank account. (e.g., {@code 10-20-30}) */ + @SerializedName("sort_code") + String sortCode; + } + + /** + * For more details about Bancontact, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + * Can be one of {@code en}, {@code de}, {@code fr}, or {@code nl} + */ + @SerializedName("preferred_language") + String preferredLanguage; + + /** + * Owner's verified full name. Values are verified or provided by Bancontact directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about Billie, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Billie extends StripeObject { + /** The Billie transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** 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, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + } + + /** + * For more details about Blik, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Blik extends StripeObject { + /** A unique and immutable identifier assigned by BLIK to every buyer. */ + @SerializedName("buyer_id") + String buyerId; + } + + /** + * For more details about Boleto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Boleto extends StripeObject { + /** + * The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses + * consumers). + */ + @SerializedName("tax_id") + String taxId; + } + + /** Details of the card used for this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * When using manual capture, a future timestamp at which the charge will be automatically + * refunded if uncaptured. + */ + @SerializedName("capture_before") + Long captureBefore; + + /** Check results by Card networks on Card address and CVC at time of payment. */ + @SerializedName("checks") + Checks checks; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** True if this payment was marked as MOTO and out of scope for SCA. */ + @SerializedName("moto") + Boolean moto; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * If this card has network token credentials, this contains the details of the network token + * credentials. + */ + @SerializedName("network_token") + NetworkToken networkToken; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** Populated if this transaction used 3D Secure authentication. */ + @SerializedName("three_d_secure") + ThreeDSecure threeDSecure; + + /** If this Card is part of a card wallet, this contains the details of the card wallet. */ + @SerializedName("wallet") + Wallet wallet; + + /** + * For more details about Checks, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Checks extends StripeObject { + @SerializedName("address_line1_check") + String addressLine1Check; + + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + @SerializedName("cvc_check") + String cvcCheck; + } + + /** + * For more details about NetworkToken, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NetworkToken extends StripeObject { + /** + * Indicates if Stripe used a network token, either user provided or Stripe managed when + * processing the transaction. + */ + @SerializedName("used") + Boolean used; + } + + /** + * For more details about ThreeDSecure, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ThreeDSecure extends StripeObject { + @SerializedName("authentication_flow") + String authenticationFlow; + + @SerializedName("result") + String result; + + @SerializedName("result_reason") + String resultReason; + + @SerializedName("version") + String version; + } + + /** + * For more details about Wallet, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wallet extends StripeObject { + @SerializedName("apple_pay") + ApplePay applePay; + + /** (For tokenized numbers only.) The last four digits of the device account number. */ + @SerializedName("dynamic_last4") + String dynamicLast4; + + @SerializedName("google_pay") + GooglePay googlePay; + + /** + * The type of the card wallet, one of {@code apple_pay} or {@code google_pay}. An + * additional hash is included on the Wallet subhash with a name matching this value. It + * contains additional information specific to the card wallet type. + */ + @SerializedName("type") + String type; + + /** + * For more details about ApplePay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplePay extends StripeObject { + /** + * Type of the apple_pay transaction, one of {@code apple_pay} or {@code apple_pay_later}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about GooglePay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GooglePay extends StripeObject {} + } + } + + /** + * For more details about CardPresent, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent extends StripeObject { + /** The authorized amount. */ + @SerializedName("amount_authorized") + Long amountAuthorized; + + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * The product code that identifies + * the specific program or product associated with a card. + */ + @SerializedName("brand_product") + String brandProduct; + + /** + * When using manual capture, a future timestamp after which the charge will be automatically + * refunded if uncaptured. + */ + @SerializedName("capture_before") + Long captureBefore; + + /** + * The cardholder name as read from the card, in ISO 7813 format. May include + * alphanumeric characters, special characters and first/last name separator ({@code /}). In + * some cases, the cardholder name may not be available depending on how the issuer has + * configured the card. Cardholder name is typically not available on swipe or contactless + * payments, such as those made with Apple Pay and Google Pay. + */ + @SerializedName("cardholder_name") + String cardholderName; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** + * A high-level description of the type of cards issued in this range. (For internal use only + * and not typically available in standard API requests.) + */ + @SerializedName("description") + String description; + + /** Authorization response cryptogram. */ + @SerializedName("emv_auth_data") + String emvAuthData; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** + * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be + * attached to a Customer for future transactions. Only present if it was possible to generate + * a card PaymentMethod. + */ + @SerializedName("generated_card") + String generatedCard; + + /** + * Issuer identification number of the card. (For internal use only and not typically + * available in standard API requests.) + */ + @SerializedName("iin") + String iin; + + /** + * Whether this PaymentIntent is + * eligible for incremental authorizations. Request support using request_incremental_authorization_support. + */ + @SerializedName("incremental_authorization_supported") + Boolean incrementalAuthorizationSupported; + + /** + * The name of the card's issuing bank. (For internal use only and not typically available in + * standard API requests.) + */ + @SerializedName("issuer") + String issuer; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** Details about payments collected offline. */ + @SerializedName("offline") + Offline offline; + + /** Defines whether the authorized amount can be over-captured or not. */ + @SerializedName("overcapture_supported") + Boolean overcaptureSupported; + + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ + @SerializedName("preferred_locales") + List preferredLocales; + + /** + * How card details were read in this transaction. + * + *

One of {@code contact_emv}, {@code contactless_emv}, {@code contactless_magstripe_mode}, + * {@code magnetic_stripe_fallback}, or {@code magnetic_stripe_track2}. + */ + @SerializedName("read_method") + String readMethod; + + /** + * A collection of fields required to be displayed on receipts. Only required for EMV + * transactions. + */ + @SerializedName("receipt") + Receipt receipt; + + @SerializedName("wallet") + Wallet wallet; + + /** + * For more details about Offline, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Offline extends StripeObject { + /** Time at which the payment was collected while offline. */ + @SerializedName("stored_at") + Long storedAt; + + /** + * The method used to process this payment method offline. Only deferred is allowed. + * + *

Equal to {@code deferred}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Receipt, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Receipt extends StripeObject { + /** + * The type of account being debited or credited + * + *

One of {@code checking}, {@code credit}, {@code prepaid}, or {@code unknown}. + */ + @SerializedName("account_type") + String accountType; + + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ + @SerializedName("application_cryptogram") + String applicationCryptogram; + + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ + @SerializedName("application_preferred_name") + String applicationPreferredName; + + /** Identifier for this transaction. */ + @SerializedName("authorization_code") + String authorizationCode; + + /** EMV tag 8A. A code returned by the card issuer. */ + @SerializedName("authorization_response_code") + String authorizationResponseCode; + + /** + * Describes the method used by the cardholder to verify ownership of the card. One of the + * following: {@code approval}, {@code failure}, {@code none}, {@code offline_pin}, {@code + * offline_pin_and_signature}, {@code online_pin}, or {@code signature}. + */ + @SerializedName("cardholder_verification_method") + String cardholderVerificationMethod; + + /** + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. + */ + @SerializedName("dedicated_file_name") + String dedicatedFileName; + + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ + @SerializedName("terminal_verification_results") + String terminalVerificationResults; + + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ + @SerializedName("transaction_status_information") + String transactionStatusInformation; + } + + /** + * For more details about Wallet, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wallet extends StripeObject { + /** + * The type of mobile wallet, one of {@code apple_pay}, {@code google_pay}, {@code + * samsung_pay}, or {@code unknown}. + */ + @SerializedName("type") + String type; + } + } + + /** + * For more details about Cashapp, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Cashapp extends StripeObject { + /** A unique and immutable identifier assigned by Cash App to every buyer. */ + @SerializedName("buyer_id") + String buyerId; + + /** A public identifier for buyers using Cash App. */ + @SerializedName("cashtag") + String cashtag; + + /** A unique and immutable identifier of payments assigned by Cash App. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** The wallet address of the customer. */ + @SerializedName("buyer_address") + String buyerAddress; + + /** + * The blockchain network that the transaction was sent on. + * + *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + */ + @SerializedName("network") + String network; + + /** + * The token currency that the transaction was sent with. + * + *

One of {@code usdc}, {@code usdg}, or {@code usdp}. + */ + @SerializedName("token_currency") + String tokenCurrency; + + /** The blockchain transaction hash of the crypto payment. */ + @SerializedName("transaction_hash") + String transactionHash; + } + + /** + * 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; + } + + /** + * For more details about CustomerBalance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance extends StripeObject {} + + /** + * For more details about Eps, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Eps extends StripeObject { + /** + * The customer's bank. Should be one of {@code arzte_und_apotheker_bank}, {@code + * austrian_anadi_bank_ag}, {@code bank_austria}, {@code bankhaus_carl_spangler}, {@code + * bankhaus_schelhammer_und_schattera_ag}, {@code bawag_psk_ag}, {@code bks_bank_ag}, {@code + * brull_kallmus_bank_ag}, {@code btv_vier_lander_bank}, {@code capital_bank_grawe_gruppe_ag}, + * {@code deutsche_bank_ag}, {@code dolomitenbank}, {@code easybank_ag}, {@code + * erste_bank_und_sparkassen}, {@code hypo_alpeadriabank_international_ag}, {@code + * hypo_noe_lb_fur_niederosterreich_u_wien}, {@code hypo_oberosterreich_salzburg_steiermark}, + * {@code hypo_tirol_bank_ag}, {@code hypo_vorarlberg_bank_ag}, {@code + * hypo_bank_burgenland_aktiengesellschaft}, {@code marchfelder_bank}, {@code oberbank_ag}, + * {@code raiffeisen_bankengruppe_osterreich}, {@code schoellerbank_ag}, {@code + * sparda_bank_wien}, {@code volksbank_gruppe}, {@code volkskreditbank_ag}, or {@code + * vr_bank_braunau}. + */ + @SerializedName("bank") + String bank; + + /** + * Owner's verified full name. Values are verified or provided by EPS directly (if supported) + * at the time of authorization or settlement. They cannot be set or mutated. EPS rarely + * provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about Fpx, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Fpx extends StripeObject { + /** Account holder type, if provided. Can be one of {@code individual} or {@code company}. */ + @SerializedName("account_holder_type") + String accountHolderType; + + /** + * The customer's bank. Can be one of {@code affin_bank}, {@code agrobank}, {@code + * alliance_bank}, {@code ambank}, {@code bank_islam}, {@code bank_muamalat}, {@code + * bank_rakyat}, {@code bsn}, {@code cimb}, {@code hong_leong_bank}, {@code hsbc}, {@code + * kfh}, {@code maybank2u}, {@code ocbc}, {@code public_bank}, {@code rhb}, {@code + * standard_chartered}, {@code uob}, {@code deutsche_bank}, {@code maybank2e}, {@code + * pb_enterprise}, or {@code bank_of_china}. + */ + @SerializedName("bank") + String bank; + + /** Unique transaction id generated by FPX for every request from the merchant. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Giropay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Giropay extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** + * Owner's verified full name. Values are verified or provided by Giropay directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + * Giropay rarely provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about Grabpay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Grabpay extends StripeObject { + /** Unique transaction id generated by GrabPay. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Ideal, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Ideal extends StripeObject { + /** + * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code + * buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, + * {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code + * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. + */ + @SerializedName("bank") + String bank; + + /** + * The Bank Identifier Code of the customer's bank. + * + *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + */ + @SerializedName("bic") + String bic; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Owner's verified full name. Values are verified or provided by iDEAL directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about InteracPresent, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InteracPresent extends StripeObject { + /** Card brand. Can be {@code interac}, {@code mastercard} or {@code visa}. */ + @SerializedName("brand") + String brand; + + /** + * The cardholder name as read from the card, in ISO 7813 format. May include + * alphanumeric characters, special characters and first/last name separator ({@code /}). In + * some cases, the cardholder name may not be available depending on how the issuer has + * configured the card. Cardholder name is typically not available on swipe or contactless + * payments, such as those made with Apple Pay and Google Pay. + */ + @SerializedName("cardholder_name") + String cardholderName; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** + * A high-level description of the type of cards issued in this range. (For internal use only + * and not typically available in standard API requests.) + */ + @SerializedName("description") + String description; + + /** Authorization response cryptogram. */ + @SerializedName("emv_auth_data") + String emvAuthData; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** + * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be + * attached to a Customer for future transactions. Only present if it was possible to generate + * a card PaymentMethod. + */ + @SerializedName("generated_card") + String generatedCard; + + /** + * Issuer identification number of the card. (For internal use only and not typically + * available in standard API requests.) + */ + @SerializedName("iin") + String iin; + + /** + * The name of the card's issuing bank. (For internal use only and not typically available in + * standard API requests.) + */ + @SerializedName("issuer") + String issuer; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ + @SerializedName("preferred_locales") + List preferredLocales; + + /** + * How card details were read in this transaction. + * + *

One of {@code contact_emv}, {@code contactless_emv}, {@code contactless_magstripe_mode}, + * {@code magnetic_stripe_fallback}, or {@code magnetic_stripe_track2}. + */ + @SerializedName("read_method") + String readMethod; + + /** + * A collection of fields required to be displayed on receipts. Only required for EMV + * transactions. + */ + @SerializedName("receipt") + Receipt receipt; + + /** + * For more details about Receipt, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Receipt extends StripeObject { + /** + * The type of account being debited or credited + * + *

One of {@code checking}, {@code savings}, or {@code unknown}. + */ + @SerializedName("account_type") + String accountType; + + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ + @SerializedName("application_cryptogram") + String applicationCryptogram; + + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ + @SerializedName("application_preferred_name") + String applicationPreferredName; + + /** Identifier for this transaction. */ + @SerializedName("authorization_code") + String authorizationCode; + + /** EMV tag 8A. A code returned by the card issuer. */ + @SerializedName("authorization_response_code") + String authorizationResponseCode; + + /** + * Describes the method used by the cardholder to verify ownership of the card. One of the + * following: {@code approval}, {@code failure}, {@code none}, {@code offline_pin}, {@code + * offline_pin_and_signature}, {@code online_pin}, or {@code signature}. + */ + @SerializedName("cardholder_verification_method") + String cardholderVerificationMethod; + + /** + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. + */ + @SerializedName("dedicated_file_name") + String dedicatedFileName; + + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ + @SerializedName("terminal_verification_results") + String terminalVerificationResults; + + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ + @SerializedName("transaction_status_information") + String transactionStatusInformation; + } + } + + /** + * For more details about KakaoPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KakaoPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Kakao Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Klarna, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Klarna extends StripeObject { + /** The payer details for this transaction. */ + @SerializedName("payer_details") + PayerDetails payerDetails; + + /** + * The Klarna payment method used for this transaction. Can be one of {@code pay_later}, + * {@code pay_now}, {@code pay_with_financing}, or {@code pay_in_installments} + */ + @SerializedName("payment_method_category") + String paymentMethodCategory; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to. Can + * be one of {@code de-AT}, {@code en-AT}, {@code nl-BE}, {@code fr-BE}, {@code en-BE}, {@code + * de-DE}, {@code en-DE}, {@code da-DK}, {@code en-DK}, {@code es-ES}, {@code en-ES}, {@code + * fi-FI}, {@code sv-FI}, {@code en-FI}, {@code en-GB}, {@code en-IE}, {@code it-IT}, {@code + * en-IT}, {@code nl-NL}, {@code en-NL}, {@code nb-NO}, {@code en-NO}, {@code sv-SE}, {@code + * en-SE}, {@code en-US}, {@code es-US}, {@code fr-FR}, {@code en-FR}, {@code cs-CZ}, {@code + * en-CZ}, {@code ro-RO}, {@code en-RO}, {@code el-GR}, {@code en-GR}, {@code en-AU}, {@code + * en-NZ}, {@code en-CA}, {@code fr-CA}, {@code pl-PL}, {@code en-PL}, {@code pt-PT}, {@code + * en-PT}, {@code de-CH}, {@code fr-CH}, {@code it-CH}, or {@code en-CH} + */ + @SerializedName("preferred_locale") + String preferredLocale; + + /** + * For more details about PayerDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayerDetails extends StripeObject { + /** The payer's address. */ + @SerializedName("address") + Address address; + + /** + * For more details about Address, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** The payer address country. */ + @SerializedName("country") + String country; + } + } + } + + /** + * For more details about Konbini, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Konbini extends StripeObject { + /** + * If the payment succeeded, this contains the details of the convenience store where the + * payment was completed. + */ + @SerializedName("store") + Store store; + + /** + * For more details about Store, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Store extends StripeObject { + /** + * The name of the convenience store chain where the payment was completed. + * + *

One of {@code familymart}, {@code lawson}, {@code ministop}, or {@code seicomart}. + */ + @SerializedName("chain") + String chain; + } + } + + /** + * For more details about KrCard, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KrCard extends StripeObject { + /** + * The local credit or debit card brand. + * + *

One of {@code bc}, {@code citi}, {@code hana}, {@code hyundai}, {@code jeju}, {@code + * jeonbuk}, {@code kakaobank}, {@code kbank}, {@code kdbbank}, {@code kookmin}, {@code + * kwangju}, {@code lotte}, {@code mg}, {@code nh}, {@code post}, {@code samsung}, {@code + * savingsbank}, {@code shinhan}, {@code shinhyup}, {@code suhyup}, {@code tossbank}, or + * {@code woori}. + */ + @SerializedName("brand") + String brand; + + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The last four digits of the card. This may not be present for American Express cards. */ + @SerializedName("last4") + String last4; + + /** The Korean Card transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Link, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Link extends StripeObject { + /** + * Two-letter ISO code representing the funding source country beneath the Link payment. You + * could use this attribute to get a sense of international fees. + */ + @SerializedName("country") + String country; + } + + /** + * For more details about MbWay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MbWay extends StripeObject {} + + /** + * For more details about Mobilepay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Mobilepay extends StripeObject { + /** Internal card details. */ + @SerializedName("card") + Card card; + + /** + * For more details about Card, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** Brand of the card used in the transaction. */ + @SerializedName("brand") + String brand; + + /** Two-letter ISO code representing the country of the card. */ + @SerializedName("country") + String country; + + /** Two digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Two digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** The last 4 digits of the card. */ + @SerializedName("last4") + String last4; + } + } + + /** + * For more details about Multibanco, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Multibanco extends StripeObject { + /** Entity number associated with this Multibanco payment. */ + @SerializedName("entity") + String entity; + + /** Reference number associated with this Multibanco payment. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about NaverPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NaverPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Naver Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about NzBankAccount, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NzBankAccount extends StripeObject { + /** + * The name on the bank account. Only present if the account holder name is different from the + * name of the authorized signatory collected in the PaymentMethod’s billing details. + */ + @SerializedName("account_holder_name") + String accountHolderName; + + /** The numeric code for the bank account's bank. */ + @SerializedName("bank_code") + String bankCode; + + /** The name of the bank. */ + @SerializedName("bank_name") + String bankName; + + /** The numeric code for the bank account's bank branch. */ + @SerializedName("branch_code") + String branchCode; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** The suffix of the bank account number. */ + @SerializedName("suffix") + String suffix; + } + + /** + * For more details about Oxxo, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Oxxo extends StripeObject { + /** OXXO reference number. */ + @SerializedName("number") + String number; + } + + /** + * For more details about P24, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class P24 extends StripeObject { + /** + * The customer's bank. Can be one of {@code ing}, {@code citi_handlowy}, {@code + * tmobile_usbugi_bankowe}, {@code plus_bank}, {@code etransfer_pocztowy24}, {@code + * banki_spbdzielcze}, {@code bank_nowy_bfg_sa}, {@code getin_bank}, {@code velobank}, {@code + * blik}, {@code noble_pay}, {@code ideabank}, {@code envelobank}, {@code + * santander_przelew24}, {@code nest_przelew}, {@code mbank_mtransfer}, {@code inteligo}, + * {@code pbac_z_ipko}, {@code bnp_paribas}, {@code credit_agricole}, {@code toyota_bank}, + * {@code bank_pekao_sa}, {@code volkswagen_bank}, {@code bank_millennium}, {@code + * alior_bank}, or {@code boz}. + */ + @SerializedName("bank") + String bank; + + /** Unique reference for this Przelewy24 payment. */ + @SerializedName("reference") + String reference; + + /** + * Owner's verified full name. Values are verified or provided by Przelewy24 directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + * Przelewy24 rarely provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about PayByBank, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayByBank extends StripeObject {} + + /** + * For more details about Payco, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Payco extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Payco transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Paynow, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Paynow extends StripeObject { + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** Reference number associated with this PayNow payment. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about Paypal, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Paypal extends StripeObject { + /** + * Two-letter ISO code representing the buyer's country. Values are provided by PayPal + * directly (if supported) at the time of authorization or settlement. They cannot be set or + * mutated. + */ + @SerializedName("country") + String country; + + /** + * Owner's email. Values are provided by PayPal directly (if supported) at the time of + * authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("payer_email") + String payerEmail; + + /** PayPal account PayerID. This identifier uniquely identifies the PayPal customer. */ + @SerializedName("payer_id") + String payerId; + + /** + * Owner's full name. Values provided by PayPal directly (if supported) at the time of + * authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("payer_name") + String payerName; + + /** + * The level of protection offered as defined by PayPal Seller Protection for Merchants, for + * this transaction. + */ + @SerializedName("seller_protection") + SellerProtection sellerProtection; + + /** A unique ID generated by PayPal for this transaction. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about SellerProtection, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SellerProtection extends StripeObject { + /** An array of conditions that are covered for the transaction, if applicable. */ + @SerializedName("dispute_categories") + List disputeCategories; + + /** + * Indicates whether the transaction is eligible for PayPal's seller protection. + * + *

One of {@code eligible}, {@code not_eligible}, or {@code partially_eligible}. + */ + @SerializedName("status") + String status; + } + } + + /** + * For more details about Pix, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** Unique transaction id generated by BCB. */ + @SerializedName("bank_transaction_id") + String bankTransactionId; + } + + /** + * For more details about Promptpay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Promptpay extends StripeObject { + /** Bill reference generated by PromptPay. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about RevolutPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RevolutPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** The Revolut Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } + + /** + * For more details about SamsungPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SamsungPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Samsung Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Satispay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Satispay extends StripeObject { + /** The Satispay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about SepaCreditTransfer, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaCreditTransfer extends StripeObject { + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** IBAN of the bank account to transfer funds to. */ + @SerializedName("iban") + String iban; + } + + /** + * For more details about SepaDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaDebit extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Branch code of bank associated with the bank account. */ + @SerializedName("branch_code") + String branchCode; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four characters of the IBAN. */ + @SerializedName("last4") + String last4; + + /** + * Find the ID of the mandate used for this payment under the payment_method_details.sepa_debit.mandate + * property on the Charge. Use this mandate ID to retrieve the Mandate. + */ + @SerializedName("mandate") + String mandate; + } + + /** + * For more details about Sofort, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Sofort extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Preferred language of the SOFORT authorization page that the customer is redirected to. Can + * be one of {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code nl}, or {@code + * pl} + */ + @SerializedName("preferred_language") + String preferredLanguage; + + /** + * Owner's verified full name. Values are verified or provided by SOFORT directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about StripeAccount, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StripeAccount extends StripeObject {} + + /** + * For more details about Swish, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Swish extends StripeObject { + /** + * Uniquely identifies the payer's Swish account. You can use this attribute to check whether + * two Swish transactions were paid for by the same payer + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Payer bank reference number for the payment. */ + @SerializedName("payment_reference") + String paymentReference; + + /** The last four digits of the Swish account phone number. */ + @SerializedName("verified_phone_last4") + String verifiedPhoneLast4; + } + + /** + * For more details about Twint, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Twint extends StripeObject {} + + /** Details of the US Bank Account used for this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount extends StripeObject { + @SerializedName("account_holder_type") + String accountHolderType; + + @SerializedName("account_type") + String accountType; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField mandate; + + /** Reference number to locate ACH payments with customer’s bank. */ + @SerializedName("payment_reference") + String paymentReference; + + /** Routing number of the bank account. */ + @SerializedName("routing_number") + String routingNumber; + + /** Get ID of expandable {@code mandate} object. */ + public String getMandate() { + return (this.mandate != null) ? this.mandate.getId() : null; + } + + public void setMandate(String id) { + this.mandate = ApiResource.setExpandableFieldId(id, this.mandate); + } + + /** Get expanded {@code mandate}. */ + public Mandate getMandateObject() { + return (this.mandate != null) ? this.mandate.getExpanded() : null; + } + + public void setMandateObject(Mandate expandableObject) { + this.mandate = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about Wechat, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wechat extends StripeObject {} + + /** + * For more details about WechatPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class WechatPay extends StripeObject { + /** + * Uniquely identifies this particular WeChat Pay account. You can use this attribute to check + * whether two WeChat accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** Transaction ID of this particular WeChat Pay transaction. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Zip, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Zip extends StripeObject {} + } + + /** Processor information associated with this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails extends StripeObject { + /** + * Custom processors represent payment processors not modeled directly in the Stripe API. This + * resource consists of details about the custom processor used for this payment attempt. + */ + @SerializedName("custom") + Custom custom; + + /** + * The processor used for this payment attempt. + * + *

Equal to {@code custom}. + */ + @SerializedName("type") + String type; + + /** + * Custom processors represent payment processors not modeled directly in the Stripe API. This + * resource consists of details about the custom processor used for this payment attempt. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + } + } + + /** 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, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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(amount, responseGetter); + trySetResponseGetter(amountAuthorized, responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRefunded, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(processorDetails, 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/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index f2b0bf19aff..9daec974dfd 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -244,6 +244,9 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

onBehalfOf; + @SerializedName("payment_details") + PaymentDetails paymentDetails; + /** ID of the payment method used in this PaymentIntent. */ @SerializedName("payment_method") @Getter(lombok.AccessLevel.NONE) @@ -1516,9 +1519,60 @@ public PaymentIntent verifyMicrodeposits( @Setter @EqualsAndHashCode(callSuper = false) public static class AmountDetails extends StripeObject { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + PaymentIntentAmountDetailsLineItemCollection lineItems; + + @SerializedName("shipping") + Shipping shipping; + + @SerializedName("tax") + Tax tax; + @SerializedName("tip") Tip tip; + /** + * For more details about Shipping, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Shipping extends StripeObject { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Long amount; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + String fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + String toPostalCode; + } + + /** + * For more details about Tax, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + } + /** * For more details about Tip, please refer to the API * Reference. @@ -2497,6 +2551,26 @@ public static class WechatPayRedirectToIosApp extends StripeObject { } } + /** + * For more details about PaymentDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails extends StripeObject { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + String customerReference; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + String orderReference; + } + /** * For more details about PaymentMethodConfigurationDetails, please refer to the API Reference. @@ -5139,6 +5213,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(latestCharge, responseGetter); trySetResponseGetter(nextAction, responseGetter); trySetResponseGetter(onBehalfOf, responseGetter); + trySetResponseGetter(paymentDetails, responseGetter); trySetResponseGetter(paymentMethod, responseGetter); trySetResponseGetter(paymentMethodConfigurationDetails, responseGetter); trySetResponseGetter(paymentMethodOptions, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItem.java b/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItem.java new file mode 100644 index 00000000000..6ca0911d59a --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItem.java @@ -0,0 +1,225 @@ +// 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.PaymentIntentAmountDetailsLineItemListParams; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentIntentAmountDetailsLineItem extends ApiResource implements HasId { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** Unique identifier for the object. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * String representing the object's type. Objects of the same type share the same value. + * + *

Equal to {@code payment_intent_amount_details_line_item}. + */ + @SerializedName("object") + String object; + + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; + + /** Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; + + /** Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + /** Lists all LineItems of a given PaymentIntent. */ + public static PaymentIntentAmountDetailsLineItemCollection list( + String intent, Map params) throws StripeException { + return list(intent, params, (RequestOptions) null); + } + + /** Lists all LineItems of a given PaymentIntent. */ + public static PaymentIntentAmountDetailsLineItemCollection list( + String intent, Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_intents/%s/amount_details_line_items", ApiResource.urlEncodeId(intent)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, params, options); + return getGlobalResponseGetter() + .request(request, PaymentIntentAmountDetailsLineItemCollection.class); + } + + /** Lists all LineItems of a given PaymentIntent. */ + public static PaymentIntentAmountDetailsLineItemCollection list( + String intent, PaymentIntentAmountDetailsLineItemListParams params) throws StripeException { + return list(intent, params, (RequestOptions) null); + } + + /** Lists all LineItems of a given PaymentIntent. */ + public static PaymentIntentAmountDetailsLineItemCollection list( + String intent, PaymentIntentAmountDetailsLineItemListParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_intents/%s/amount_details_line_items", ApiResource.urlEncodeId(intent)); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return getGlobalResponseGetter() + .request(request, PaymentIntentAmountDetailsLineItemCollection.class); + } + + /** + * For more details about PaymentMethodOptions, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions extends StripeObject { + @SerializedName("card") + Card card; + + @SerializedName("card_present") + CardPresent cardPresent; + + @SerializedName("klarna") + Klarna klarna; + + @SerializedName("paypal") + Paypal paypal; + + /** + * For more details about Card, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + @SerializedName("commodity_code") + String commodityCode; + } + + /** + * For more details about CardPresent, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent extends StripeObject { + @SerializedName("commodity_code") + String commodityCode; + } + + /** + * For more details about Klarna, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Klarna extends StripeObject { + @SerializedName("image_url") + String imageUrl; + + @SerializedName("product_url") + String productUrl; + + @SerializedName("reference") + String reference; + + @SerializedName("subscription_reference") + String subscriptionReference; + } + + /** + * For more details about Paypal, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Paypal extends StripeObject { + /** + * Type of the line item. + * + *

One of {@code digital_goods}, {@code donation}, or {@code physical_goods}. + */ + @SerializedName("category") + String category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * The Stripe account ID of the connected account that sells the item. This is only needed + * when using Separate Charges and + * Transfers. + */ + @SerializedName("sold_by") + String soldBy; + } + } + + /** + * For more details about Tax, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tax extends StripeObject { + /** Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + } + + @Override + public void setResponseGetter(StripeResponseGetter responseGetter) { + super.setResponseGetter(responseGetter); + trySetResponseGetter(paymentMethodOptions, responseGetter); + trySetResponseGetter(tax, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItemCollection.java b/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItemCollection.java new file mode 100644 index 00000000000..a83124044e4 --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentIntentAmountDetailsLineItemCollection.java @@ -0,0 +1,5 @@ +// File generated from our OpenAPI spec +package com.stripe.model; + +public class PaymentIntentAmountDetailsLineItemCollection + extends StripeCollection {} diff --git a/src/main/java/com/stripe/model/PaymentLink.java b/src/main/java/com/stripe/model/PaymentLink.java index ba8c5adeca8..dcd309e9b9b 100644 --- a/src/main/java/com/stripe/model/PaymentLink.java +++ b/src/main/java/com/stripe/model/PaymentLink.java @@ -145,6 +145,9 @@ public class PaymentLink extends ApiResource implements HasId, MetadataStore metadata; + @SerializedName("name_collection") + NameCollection nameCollection; + /** * String representing the object's type. Objects of the same type share the same value. * @@ -1040,6 +1043,61 @@ public static class RenderingOptions extends StripeObject { } } + /** + * For more details about NameCollection, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection extends StripeObject { + @SerializedName("business") + Business business; + + @SerializedName("individual") + Individual individual; + + /** + * For more details about Business, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Business extends StripeObject { + /** Indicates whether business name collection is enabled for the payment link. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Whether the customer is required to complete the field before checking out. Defaults to + * {@code false}. + */ + @SerializedName("optional") + Boolean optional; + } + + /** + * For more details about Individual, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Individual extends StripeObject { + /** Indicates whether individual name collection is enabled for the payment link. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Whether the customer is required to complete the field before checking out. Defaults to + * {@code false}. + */ + @SerializedName("optional") + Boolean optional; + } + } + /** * For more details about OptionalItem, please refer to the API Reference. @@ -1433,6 +1491,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(customText, responseGetter); trySetResponseGetter(invoiceCreation, responseGetter); trySetResponseGetter(lineItems, responseGetter); + trySetResponseGetter(nameCollection, responseGetter); trySetResponseGetter(onBehalfOf, responseGetter); trySetResponseGetter(paymentIntentData, responseGetter); trySetResponseGetter(phoneNumberCollection, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index f6bfa2b5a95..fa5e6cbe2c5 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -99,6 +99,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, {@code * alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code bancontact}, * {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code card_present}, {@code - * cashapp}, {@code crypto}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code giropay}, - * {@code grabpay}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, - * {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code - * multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code - * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code pix}, {@code promptpay}, - * {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code sofort}, - * {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. + * cashapp}, {@code crypto}, {@code custom}, {@code customer_balance}, {@code eps}, {@code fpx}, + * {@code giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, + * {@code klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code + * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, + * {@code p24}, {@code pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code pix}, + * {@code promptpay}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code + * sepa_debit}, {@code sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code + * wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; @@ -1768,6 +1772,44 @@ public static class Cashapp extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Crypto extends StripeObject {} + /** + * For more details about Custom, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** Display name of the Dashboard-only CustomPaymentMethodType. */ + @SerializedName("display_name") + String displayName; + + /** Contains information about the Dashboard-only CustomPaymentMethodType logo. */ + @SerializedName("logo") + Logo logo; + + /** ID of the Dashboard-only CustomPaymentMethodType. Not expandable. */ + @SerializedName("type") + String type; + + /** + * For more details about Logo, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Logo extends StripeObject { + /** Content type of the Dashboard-only CustomPaymentMethodType logo. */ + @SerializedName("content_type") + String contentType; + + /** URL of the Dashboard-only CustomPaymentMethodType logo. */ + @SerializedName("url") + String url; + } + } + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -2602,6 +2644,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(cardPresent, responseGetter); trySetResponseGetter(cashapp, responseGetter); trySetResponseGetter(crypto, responseGetter); + trySetResponseGetter(custom, responseGetter); trySetResponseGetter(customer, responseGetter); trySetResponseGetter(customerBalance, responseGetter); trySetResponseGetter(eps, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java index ad21e06edf3..833a54b6497 100644 --- a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java +++ b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java @@ -108,6 +108,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("cashapp") Cashapp cashapp; + @SerializedName("crypto") + Crypto crypto; + @SerializedName("customer_balance") CustomerBalance customerBalance; @@ -163,6 +166,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("livemode") Boolean livemode; + @SerializedName("mb_way") + MbWay mbWay; + @SerializedName("mobilepay") Mobilepay mobilepay; @@ -1215,6 +1221,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** + * Whether this payment method may be offered at checkout. True if {@code display_preference} is + * {@code on} and the payment method's capability is active. + */ + @SerializedName("available") + Boolean available; + + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * For more details about DisplayPreference, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference extends StripeObject { + /** + * For child configs, whether or not the account's preference will be observed. If {@code + * false}, the parent configuration's default is used. + */ + @SerializedName("overridable") + Boolean overridable; + + /** + * The account's display preference. + * + *

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

One of {@code off}, or {@code on}. + */ + @SerializedName("value") + String value; + } + } + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -1878,6 +1935,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about MbWay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MbWay extends StripeObject { + /** + * Whether this payment method may be offered at checkout. True if {@code display_preference} is + * {@code on} and the payment method's capability is active. + */ + @SerializedName("available") + Boolean available; + + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * For more details about DisplayPreference, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference extends StripeObject { + /** + * For child configs, whether or not the account's preference will be observed. If {@code + * false}, the parent configuration's default is used. + */ + @SerializedName("overridable") + Boolean overridable; + + /** + * The account's display preference. + * + *

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

One of {@code off}, or {@code on}. + */ + @SerializedName("value") + String value; + } + } + /** * For more details about Mobilepay, please refer to the API * Reference. @@ -3019,6 +3127,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(card, responseGetter); trySetResponseGetter(cartesBancaires, responseGetter); trySetResponseGetter(cashapp, responseGetter); + trySetResponseGetter(crypto, responseGetter); trySetResponseGetter(customerBalance, responseGetter); trySetResponseGetter(eps, responseGetter); trySetResponseGetter(fpx, responseGetter); @@ -3032,6 +3141,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(konbini, responseGetter); trySetResponseGetter(krCard, responseGetter); trySetResponseGetter(link, responseGetter); + trySetResponseGetter(mbWay, responseGetter); trySetResponseGetter(mobilepay, responseGetter); trySetResponseGetter(multibanco, responseGetter); trySetResponseGetter(naverPay, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java new file mode 100644 index 00000000000..26756e7f90c --- /dev/null +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -0,0 +1,3383 @@ +// 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.PaymentRecordReportPaymentAttemptCanceledParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptFailedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptGuaranteedParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptInformationalParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordReportRefundParams; +import com.stripe.param.PaymentRecordRetrieveParams; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; +import lombok.Setter; + +/** + * A Payment Record is a resource that allows you to represent payments that occur on- or + * off-Stripe. For example, you can create a Payment Record to model a payment made on a different + * payment processor, in order to mark an Invoice as paid and a Subscription as active. Payment + * Records consist of one or more Payment Attempt Records, which represent individual attempts made + * on a payment network. + */ +@Getter +@Setter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecord extends ApiResource implements HasId { + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount") + Amount amount; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_authorized") + AmountAuthorized amountAuthorized; + + /** 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_refunded") + AmountRefunded amountRefunded; + + /** A representation of an amount of money, consisting of an amount and a currency. */ + @SerializedName("amount_requested") + AmountRequested amountRequested; + + /** ID of the Connect application that created the PaymentRecord. */ + @SerializedName("application") + String application; + + /** 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; + + /** ID of the latest Payment Attempt Record attached to this Payment Record. */ + @SerializedName("latest_payment_attempt_record") + String latestPaymentAttemptRecord; + + /** + * Has the value {@code true} if the object exists in live mode or the value {@code false} if the + * object exists in test mode. + */ + @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_record}. + */ + @SerializedName("object") + String object; + + /** Information about the Payment Method debited for this payment. */ + @SerializedName("payment_method_details") + PaymentMethodDetails paymentMethodDetails; + + /** Processor information associated with this payment. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** Shipping information for this payment. */ + @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); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational() throws StripeException { + return reportPaymentAttemptInformational((Map) null, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational(RequestOptions options) + throws StripeException { + return reportPaymentAttemptInformational((Map) null, options); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational(Map params) + throws StripeException { + return reportPaymentAttemptInformational(params, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational( + Map params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_informational", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational( + PaymentRecordReportPaymentAttemptInformationalParams params) throws StripeException { + return reportPaymentAttemptInformational(params, (RequestOptions) null); + } + + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational( + PaymentRecordReportPaymentAttemptInformationalParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_informational", + 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 refunded. */ + public PaymentRecord reportRefund(Map params) throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_refund", 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 refunded. */ + public PaymentRecord reportRefund(PaymentRecordReportRefundParams params) throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(PaymentRecordReportRefundParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_refund", 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 + @EqualsAndHashCode(callSuper = false) + public static class Amount extends StripeObject { + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + /** + * A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 AmountAuthorized 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 AmountRefunded 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 { + @SerializedName("ach_credit_transfer") + AchCreditTransfer achCreditTransfer; + + @SerializedName("ach_debit") + AchDebit achDebit; + + @SerializedName("acss_debit") + AcssDebit acssDebit; + + @SerializedName("affirm") + Affirm affirm; + + @SerializedName("afterpay_clearpay") + AfterpayClearpay afterpayClearpay; + + @SerializedName("alipay") + Alipay alipay; + + @SerializedName("alma") + Alma alma; + + @SerializedName("amazon_pay") + AmazonPay amazonPay; + + @SerializedName("au_becs_debit") + AuBecsDebit auBecsDebit; + + @SerializedName("bacs_debit") + BacsDebit bacsDebit; + + @SerializedName("bancontact") + Bancontact bancontact; + + @SerializedName("billie") + Billie billie; + + /** The billing details associated with the method of payment. */ + @SerializedName("billing_details") + BillingDetails billingDetails; + + @SerializedName("blik") + Blik blik; + + @SerializedName("boleto") + Boleto boleto; + + /** Details of the card used for this payment attempt. */ + @SerializedName("card") + Card card; + + @SerializedName("card_present") + CardPresent cardPresent; + + @SerializedName("cashapp") + Cashapp cashapp; + + @SerializedName("crypto") + Crypto crypto; + + /** + * 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. + */ + @SerializedName("custom") + Custom custom; + + @SerializedName("customer_balance") + CustomerBalance customerBalance; + + @SerializedName("eps") + Eps eps; + + @SerializedName("fpx") + Fpx fpx; + + @SerializedName("giropay") + Giropay giropay; + + @SerializedName("grabpay") + Grabpay grabpay; + + @SerializedName("ideal") + Ideal ideal; + + @SerializedName("interac_present") + InteracPresent interacPresent; + + @SerializedName("kakao_pay") + KakaoPay kakaoPay; + + @SerializedName("klarna") + Klarna klarna; + + @SerializedName("konbini") + Konbini konbini; + + @SerializedName("kr_card") + KrCard krCard; + + @SerializedName("link") + Link link; + + @SerializedName("mb_way") + MbWay mbWay; + + @SerializedName("mobilepay") + Mobilepay mobilepay; + + @SerializedName("multibanco") + Multibanco multibanco; + + @SerializedName("naver_pay") + NaverPay naverPay; + + @SerializedName("nz_bank_account") + NzBankAccount nzBankAccount; + + @SerializedName("oxxo") + Oxxo oxxo; + + @SerializedName("p24") + P24 p24; + + @SerializedName("pay_by_bank") + PayByBank payByBank; + + @SerializedName("payco") + Payco payco; + + /** ID of the Stripe PaymentMethod used to make this payment. */ + @SerializedName("payment_method") + String paymentMethod; + + @SerializedName("paynow") + Paynow paynow; + + @SerializedName("paypal") + Paypal paypal; + + @SerializedName("pix") + Pix pix; + + @SerializedName("promptpay") + Promptpay promptpay; + + @SerializedName("revolut_pay") + RevolutPay revolutPay; + + @SerializedName("samsung_pay") + SamsungPay samsungPay; + + @SerializedName("satispay") + Satispay satispay; + + @SerializedName("sepa_credit_transfer") + SepaCreditTransfer sepaCreditTransfer; + + @SerializedName("sepa_debit") + SepaDebit sepaDebit; + + @SerializedName("sofort") + Sofort sofort; + + @SerializedName("stripe_account") + StripeAccount stripeAccount; + + @SerializedName("swish") + Swish swish; + + @SerializedName("twint") + Twint twint; + + /** + * The type of transaction-specific details of the payment method used in the payment. See PaymentMethod.type + * for the full list of possible types. An additional hash is included on {@code + * payment_method_details} with a name matching this value. It contains information specific to + * the payment method. + */ + @SerializedName("type") + String type; + + /** Details of the US Bank Account used for this payment attempt. */ + @SerializedName("us_bank_account") + UsBankAccount usBankAccount; + + @SerializedName("wechat") + Wechat wechat; + + @SerializedName("wechat_pay") + WechatPay wechatPay; + + @SerializedName("zip") + Zip zip; + + /** + * For more details about AchCreditTransfer, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AchCreditTransfer extends StripeObject { + /** Account number to transfer funds to. */ + @SerializedName("account_number") + String accountNumber; + + /** Name of the bank associated with the routing number. */ + @SerializedName("bank_name") + String bankName; + + /** Routing transit number for the bank account to transfer funds to. */ + @SerializedName("routing_number") + String routingNumber; + + /** SWIFT code of the bank associated with the routing number. */ + @SerializedName("swift_code") + String swiftCode; + } + + /** + * For more details about AchDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AchDebit extends StripeObject { + /** + * Type of entity that holds the account. This can be either {@code individual} or {@code + * company}. + * + *

One of {@code company}, or {@code individual}. + */ + @SerializedName("account_holder_type") + String accountHolderType; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** Routing transit number of the bank account. */ + @SerializedName("routing_number") + String routingNumber; + } + + /** + * For more details about AcssDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AcssDebit extends StripeObject { + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Institution number of the bank account. */ + @SerializedName("institution_number") + String institutionNumber; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + + /** Transit number of the bank account. */ + @SerializedName("transit_number") + String transitNumber; + } + + /** + * For more details about Affirm, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Affirm extends StripeObject { + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** The Affirm transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about AfterpayClearpay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AfterpayClearpay extends StripeObject { + /** The Afterpay order ID associated with this payment intent. */ + @SerializedName("order_id") + String orderId; + + /** Order identifier shown to the merchant in Afterpay’s online portal. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about Alipay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Alipay extends StripeObject { + /** + * Uniquely identifies this particular Alipay account. You can use this attribute to check + * whether two Alipay accounts are the same. + */ + @SerializedName("buyer_id") + String buyerId; + + /** + * Uniquely identifies this particular Alipay account. You can use this attribute to check + * whether two Alipay accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Transaction ID of this particular Alipay transaction. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Alma, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Alma extends StripeObject { + @SerializedName("installments") + Installments installments; + + /** The Alma transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Installments, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Installments extends StripeObject { + /** The number of installments. */ + @SerializedName("count") + Long count; + } + } + + /** + * For more details about AmazonPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AmazonPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** The Amazon Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } + + /** + * For more details about AuBecsDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AuBecsDebit extends StripeObject { + /** Bank-State-Branch number of the bank account. */ + @SerializedName("bsb_number") + String bsbNumber; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + } + + /** + * For more details about BacsDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BacsDebit extends StripeObject { + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + String mandate; + + /** Sort code of the bank account. (e.g., {@code 10-20-30}) */ + @SerializedName("sort_code") + String sortCode; + } + + /** + * For more details about Bancontact, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Bancontact extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Preferred language of the Bancontact authorization page that the customer is redirected to. + * Can be one of {@code en}, {@code de}, {@code fr}, or {@code nl} + */ + @SerializedName("preferred_language") + String preferredLanguage; + + /** + * Owner's verified full name. Values are verified or provided by Bancontact directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about Billie, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Billie extends StripeObject { + /** The Billie transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** 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, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + } + + /** + * For more details about Blik, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Blik extends StripeObject { + /** A unique and immutable identifier assigned by BLIK to every buyer. */ + @SerializedName("buyer_id") + String buyerId; + } + + /** + * For more details about Boleto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Boleto extends StripeObject { + /** + * The tax ID of the customer (CPF for individuals consumers or CNPJ for businesses + * consumers). + */ + @SerializedName("tax_id") + String taxId; + } + + /** Details of the card used for this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * When using manual capture, a future timestamp at which the charge will be automatically + * refunded if uncaptured. + */ + @SerializedName("capture_before") + Long captureBefore; + + /** Check results by Card networks on Card address and CVC at time of payment. */ + @SerializedName("checks") + Checks checks; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** True if this payment was marked as MOTO and out of scope for SCA. */ + @SerializedName("moto") + Boolean moto; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * If this card has network token credentials, this contains the details of the network token + * credentials. + */ + @SerializedName("network_token") + NetworkToken networkToken; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** Populated if this transaction used 3D Secure authentication. */ + @SerializedName("three_d_secure") + ThreeDSecure threeDSecure; + + /** If this Card is part of a card wallet, this contains the details of the card wallet. */ + @SerializedName("wallet") + Wallet wallet; + + /** + * For more details about Checks, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Checks extends StripeObject { + @SerializedName("address_line1_check") + String addressLine1Check; + + @SerializedName("address_postal_code_check") + String addressPostalCodeCheck; + + @SerializedName("cvc_check") + String cvcCheck; + } + + /** + * For more details about NetworkToken, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NetworkToken extends StripeObject { + /** + * Indicates if Stripe used a network token, either user provided or Stripe managed when + * processing the transaction. + */ + @SerializedName("used") + Boolean used; + } + + /** + * For more details about ThreeDSecure, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ThreeDSecure extends StripeObject { + @SerializedName("authentication_flow") + String authenticationFlow; + + @SerializedName("result") + String result; + + @SerializedName("result_reason") + String resultReason; + + @SerializedName("version") + String version; + } + + /** + * For more details about Wallet, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wallet extends StripeObject { + @SerializedName("apple_pay") + ApplePay applePay; + + /** (For tokenized numbers only.) The last four digits of the device account number. */ + @SerializedName("dynamic_last4") + String dynamicLast4; + + @SerializedName("google_pay") + GooglePay googlePay; + + /** + * The type of the card wallet, one of {@code apple_pay} or {@code google_pay}. An + * additional hash is included on the Wallet subhash with a name matching this value. It + * contains additional information specific to the card wallet type. + */ + @SerializedName("type") + String type; + + /** + * For more details about ApplePay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ApplePay extends StripeObject { + /** + * Type of the apple_pay transaction, one of {@code apple_pay} or {@code apple_pay_later}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about GooglePay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class GooglePay extends StripeObject {} + } + } + + /** + * For more details about CardPresent, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent extends StripeObject { + /** The authorized amount. */ + @SerializedName("amount_authorized") + Long amountAuthorized; + + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * The product code that identifies + * the specific program or product associated with a card. + */ + @SerializedName("brand_product") + String brandProduct; + + /** + * When using manual capture, a future timestamp after which the charge will be automatically + * refunded if uncaptured. + */ + @SerializedName("capture_before") + Long captureBefore; + + /** + * The cardholder name as read from the card, in ISO 7813 format. May include + * alphanumeric characters, special characters and first/last name separator ({@code /}). In + * some cases, the cardholder name may not be available depending on how the issuer has + * configured the card. Cardholder name is typically not available on swipe or contactless + * payments, such as those made with Apple Pay and Google Pay. + */ + @SerializedName("cardholder_name") + String cardholderName; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** + * A high-level description of the type of cards issued in this range. (For internal use only + * and not typically available in standard API requests.) + */ + @SerializedName("description") + String description; + + /** Authorization response cryptogram. */ + @SerializedName("emv_auth_data") + String emvAuthData; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** + * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be + * attached to a Customer for future transactions. Only present if it was possible to generate + * a card PaymentMethod. + */ + @SerializedName("generated_card") + String generatedCard; + + /** + * Issuer identification number of the card. (For internal use only and not typically + * available in standard API requests.) + */ + @SerializedName("iin") + String iin; + + /** + * Whether this PaymentIntent is + * eligible for incremental authorizations. Request support using request_incremental_authorization_support. + */ + @SerializedName("incremental_authorization_supported") + Boolean incrementalAuthorizationSupported; + + /** + * The name of the card's issuing bank. (For internal use only and not typically available in + * standard API requests.) + */ + @SerializedName("issuer") + String issuer; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** Details about payments collected offline. */ + @SerializedName("offline") + Offline offline; + + /** Defines whether the authorized amount can be over-captured or not. */ + @SerializedName("overcapture_supported") + Boolean overcaptureSupported; + + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ + @SerializedName("preferred_locales") + List preferredLocales; + + /** + * How card details were read in this transaction. + * + *

One of {@code contact_emv}, {@code contactless_emv}, {@code contactless_magstripe_mode}, + * {@code magnetic_stripe_fallback}, or {@code magnetic_stripe_track2}. + */ + @SerializedName("read_method") + String readMethod; + + /** + * A collection of fields required to be displayed on receipts. Only required for EMV + * transactions. + */ + @SerializedName("receipt") + Receipt receipt; + + @SerializedName("wallet") + Wallet wallet; + + /** + * For more details about Offline, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Offline extends StripeObject { + /** Time at which the payment was collected while offline. */ + @SerializedName("stored_at") + Long storedAt; + + /** + * The method used to process this payment method offline. Only deferred is allowed. + * + *

Equal to {@code deferred}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Receipt, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Receipt extends StripeObject { + /** + * The type of account being debited or credited + * + *

One of {@code checking}, {@code credit}, {@code prepaid}, or {@code unknown}. + */ + @SerializedName("account_type") + String accountType; + + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ + @SerializedName("application_cryptogram") + String applicationCryptogram; + + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ + @SerializedName("application_preferred_name") + String applicationPreferredName; + + /** Identifier for this transaction. */ + @SerializedName("authorization_code") + String authorizationCode; + + /** EMV tag 8A. A code returned by the card issuer. */ + @SerializedName("authorization_response_code") + String authorizationResponseCode; + + /** + * Describes the method used by the cardholder to verify ownership of the card. One of the + * following: {@code approval}, {@code failure}, {@code none}, {@code offline_pin}, {@code + * offline_pin_and_signature}, {@code online_pin}, or {@code signature}. + */ + @SerializedName("cardholder_verification_method") + String cardholderVerificationMethod; + + /** + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. + */ + @SerializedName("dedicated_file_name") + String dedicatedFileName; + + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ + @SerializedName("terminal_verification_results") + String terminalVerificationResults; + + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ + @SerializedName("transaction_status_information") + String transactionStatusInformation; + } + + /** + * For more details about Wallet, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wallet extends StripeObject { + /** + * The type of mobile wallet, one of {@code apple_pay}, {@code google_pay}, {@code + * samsung_pay}, or {@code unknown}. + */ + @SerializedName("type") + String type; + } + } + + /** + * For more details about Cashapp, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Cashapp extends StripeObject { + /** A unique and immutable identifier assigned by Cash App to every buyer. */ + @SerializedName("buyer_id") + String buyerId; + + /** A public identifier for buyers using Cash App. */ + @SerializedName("cashtag") + String cashtag; + + /** A unique and immutable identifier of payments assigned by Cash App. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** The wallet address of the customer. */ + @SerializedName("buyer_address") + String buyerAddress; + + /** + * The blockchain network that the transaction was sent on. + * + *

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. + */ + @SerializedName("network") + String network; + + /** + * The token currency that the transaction was sent with. + * + *

One of {@code usdc}, {@code usdg}, or {@code usdp}. + */ + @SerializedName("token_currency") + String tokenCurrency; + + /** The blockchain transaction hash of the crypto payment. */ + @SerializedName("transaction_hash") + String transactionHash; + } + + /** + * 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; + } + + /** + * For more details about CustomerBalance, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomerBalance extends StripeObject {} + + /** + * For more details about Eps, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Eps extends StripeObject { + /** + * The customer's bank. Should be one of {@code arzte_und_apotheker_bank}, {@code + * austrian_anadi_bank_ag}, {@code bank_austria}, {@code bankhaus_carl_spangler}, {@code + * bankhaus_schelhammer_und_schattera_ag}, {@code bawag_psk_ag}, {@code bks_bank_ag}, {@code + * brull_kallmus_bank_ag}, {@code btv_vier_lander_bank}, {@code capital_bank_grawe_gruppe_ag}, + * {@code deutsche_bank_ag}, {@code dolomitenbank}, {@code easybank_ag}, {@code + * erste_bank_und_sparkassen}, {@code hypo_alpeadriabank_international_ag}, {@code + * hypo_noe_lb_fur_niederosterreich_u_wien}, {@code hypo_oberosterreich_salzburg_steiermark}, + * {@code hypo_tirol_bank_ag}, {@code hypo_vorarlberg_bank_ag}, {@code + * hypo_bank_burgenland_aktiengesellschaft}, {@code marchfelder_bank}, {@code oberbank_ag}, + * {@code raiffeisen_bankengruppe_osterreich}, {@code schoellerbank_ag}, {@code + * sparda_bank_wien}, {@code volksbank_gruppe}, {@code volkskreditbank_ag}, or {@code + * vr_bank_braunau}. + */ + @SerializedName("bank") + String bank; + + /** + * Owner's verified full name. Values are verified or provided by EPS directly (if supported) + * at the time of authorization or settlement. They cannot be set or mutated. EPS rarely + * provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about Fpx, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Fpx extends StripeObject { + /** Account holder type, if provided. Can be one of {@code individual} or {@code company}. */ + @SerializedName("account_holder_type") + String accountHolderType; + + /** + * The customer's bank. Can be one of {@code affin_bank}, {@code agrobank}, {@code + * alliance_bank}, {@code ambank}, {@code bank_islam}, {@code bank_muamalat}, {@code + * bank_rakyat}, {@code bsn}, {@code cimb}, {@code hong_leong_bank}, {@code hsbc}, {@code + * kfh}, {@code maybank2u}, {@code ocbc}, {@code public_bank}, {@code rhb}, {@code + * standard_chartered}, {@code uob}, {@code deutsche_bank}, {@code maybank2e}, {@code + * pb_enterprise}, or {@code bank_of_china}. + */ + @SerializedName("bank") + String bank; + + /** Unique transaction id generated by FPX for every request from the merchant. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Giropay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Giropay extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** + * Owner's verified full name. Values are verified or provided by Giropay directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + * Giropay rarely provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about Grabpay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Grabpay extends StripeObject { + /** Unique transaction id generated by GrabPay. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Ideal, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Ideal extends StripeObject { + /** + * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code + * buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, + * {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code + * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. + */ + @SerializedName("bank") + String bank; + + /** + * The Bank Identifier Code of the customer's bank. + * + *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + */ + @SerializedName("bic") + String bic; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Owner's verified full name. Values are verified or provided by iDEAL directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about InteracPresent, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class InteracPresent extends StripeObject { + /** Card brand. Can be {@code interac}, {@code mastercard} or {@code visa}. */ + @SerializedName("brand") + String brand; + + /** + * The cardholder name as read from the card, in ISO 7813 format. May include + * alphanumeric characters, special characters and first/last name separator ({@code /}). In + * some cases, the cardholder name may not be available depending on how the issuer has + * configured the card. Cardholder name is typically not available on swipe or contactless + * payments, such as those made with Apple Pay and Google Pay. + */ + @SerializedName("cardholder_name") + String cardholderName; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute to + * get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** + * A high-level description of the type of cards issued in this range. (For internal use only + * and not typically available in standard API requests.) + */ + @SerializedName("description") + String description; + + /** Authorization response cryptogram. */ + @SerializedName("emv_auth_data") + String emvAuthData; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Uniquely identifies this particular card number. You can use this attribute to check + * whether two customers who’ve signed up with you are using the same card number, for + * example. For payment methods that tokenize card information (Apple Pay, Google Pay), the + * tokenized number might be provided instead of the underlying card number. + * + *

As of May 1, 2021, card fingerprint in India for Connect changed to allow two + * fingerprints for the same card---one for India and one for the rest of the world. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** + * ID of a card PaymentMethod generated from the card_present PaymentMethod that may be + * attached to a Customer for future transactions. Only present if it was possible to generate + * a card PaymentMethod. + */ + @SerializedName("generated_card") + String generatedCard; + + /** + * Issuer identification number of the card. (For internal use only and not typically + * available in standard API requests.) + */ + @SerializedName("iin") + String iin; + + /** + * The name of the card's issuing bank. (For internal use only and not typically available in + * standard API requests.) + */ + @SerializedName("issuer") + String issuer; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + + /** + * Identifies which network this charge was processed on. Can be {@code amex}, {@code + * cartes_bancaires}, {@code diners}, {@code discover}, {@code eftpos_au}, {@code interac}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or {@code + * unknown}. + */ + @SerializedName("network") + String network; + + /** + * This is used by the financial networks to identify a transaction. Visa calls this the + * Transaction ID, Mastercard calls this the Trace ID, and American Express calls this the + * Acquirer Reference Data. This value will be present if it is returned by the financial + * network in the authorization response, and null otherwise. + */ + @SerializedName("network_transaction_id") + String networkTransactionId; + + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ + @SerializedName("preferred_locales") + List preferredLocales; + + /** + * How card details were read in this transaction. + * + *

One of {@code contact_emv}, {@code contactless_emv}, {@code contactless_magstripe_mode}, + * {@code magnetic_stripe_fallback}, or {@code magnetic_stripe_track2}. + */ + @SerializedName("read_method") + String readMethod; + + /** + * A collection of fields required to be displayed on receipts. Only required for EMV + * transactions. + */ + @SerializedName("receipt") + Receipt receipt; + + /** + * For more details about Receipt, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Receipt extends StripeObject { + /** + * The type of account being debited or credited + * + *

One of {@code checking}, {@code savings}, or {@code unknown}. + */ + @SerializedName("account_type") + String accountType; + + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ + @SerializedName("application_cryptogram") + String applicationCryptogram; + + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ + @SerializedName("application_preferred_name") + String applicationPreferredName; + + /** Identifier for this transaction. */ + @SerializedName("authorization_code") + String authorizationCode; + + /** EMV tag 8A. A code returned by the card issuer. */ + @SerializedName("authorization_response_code") + String authorizationResponseCode; + + /** + * Describes the method used by the cardholder to verify ownership of the card. One of the + * following: {@code approval}, {@code failure}, {@code none}, {@code offline_pin}, {@code + * offline_pin_and_signature}, {@code online_pin}, or {@code signature}. + */ + @SerializedName("cardholder_verification_method") + String cardholderVerificationMethod; + + /** + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. + */ + @SerializedName("dedicated_file_name") + String dedicatedFileName; + + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ + @SerializedName("terminal_verification_results") + String terminalVerificationResults; + + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ + @SerializedName("transaction_status_information") + String transactionStatusInformation; + } + } + + /** + * For more details about KakaoPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KakaoPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Kakao Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Klarna, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Klarna extends StripeObject { + /** The payer details for this transaction. */ + @SerializedName("payer_details") + PayerDetails payerDetails; + + /** + * The Klarna payment method used for this transaction. Can be one of {@code pay_later}, + * {@code pay_now}, {@code pay_with_financing}, or {@code pay_in_installments} + */ + @SerializedName("payment_method_category") + String paymentMethodCategory; + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to. Can + * be one of {@code de-AT}, {@code en-AT}, {@code nl-BE}, {@code fr-BE}, {@code en-BE}, {@code + * de-DE}, {@code en-DE}, {@code da-DK}, {@code en-DK}, {@code es-ES}, {@code en-ES}, {@code + * fi-FI}, {@code sv-FI}, {@code en-FI}, {@code en-GB}, {@code en-IE}, {@code it-IT}, {@code + * en-IT}, {@code nl-NL}, {@code en-NL}, {@code nb-NO}, {@code en-NO}, {@code sv-SE}, {@code + * en-SE}, {@code en-US}, {@code es-US}, {@code fr-FR}, {@code en-FR}, {@code cs-CZ}, {@code + * en-CZ}, {@code ro-RO}, {@code en-RO}, {@code el-GR}, {@code en-GR}, {@code en-AU}, {@code + * en-NZ}, {@code en-CA}, {@code fr-CA}, {@code pl-PL}, {@code en-PL}, {@code pt-PT}, {@code + * en-PT}, {@code de-CH}, {@code fr-CH}, {@code it-CH}, or {@code en-CH} + */ + @SerializedName("preferred_locale") + String preferredLocale; + + /** + * For more details about PayerDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayerDetails extends StripeObject { + /** The payer's address. */ + @SerializedName("address") + Address address; + + /** + * For more details about Address, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Address extends StripeObject { + /** The payer address country. */ + @SerializedName("country") + String country; + } + } + } + + /** + * For more details about Konbini, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Konbini extends StripeObject { + /** + * If the payment succeeded, this contains the details of the convenience store where the + * payment was completed. + */ + @SerializedName("store") + Store store; + + /** + * For more details about Store, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Store extends StripeObject { + /** + * The name of the convenience store chain where the payment was completed. + * + *

One of {@code familymart}, {@code lawson}, {@code ministop}, or {@code seicomart}. + */ + @SerializedName("chain") + String chain; + } + } + + /** + * For more details about KrCard, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KrCard extends StripeObject { + /** + * The local credit or debit card brand. + * + *

One of {@code bc}, {@code citi}, {@code hana}, {@code hyundai}, {@code jeju}, {@code + * jeonbuk}, {@code kakaobank}, {@code kbank}, {@code kdbbank}, {@code kookmin}, {@code + * kwangju}, {@code lotte}, {@code mg}, {@code nh}, {@code post}, {@code samsung}, {@code + * savingsbank}, {@code shinhan}, {@code shinhyup}, {@code suhyup}, {@code tossbank}, or + * {@code woori}. + */ + @SerializedName("brand") + String brand; + + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The last four digits of the card. This may not be present for American Express cards. */ + @SerializedName("last4") + String last4; + + /** The Korean Card transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Link, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Link extends StripeObject { + /** + * Two-letter ISO code representing the funding source country beneath the Link payment. You + * could use this attribute to get a sense of international fees. + */ + @SerializedName("country") + String country; + } + + /** + * For more details about MbWay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MbWay extends StripeObject {} + + /** + * For more details about Mobilepay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Mobilepay extends StripeObject { + /** Internal card details. */ + @SerializedName("card") + Card card; + + /** + * For more details about Card, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** Brand of the card used in the transaction. */ + @SerializedName("brand") + String brand; + + /** Two-letter ISO code representing the country of the card. */ + @SerializedName("country") + String country; + + /** Two digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Two digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** The last 4 digits of the card. */ + @SerializedName("last4") + String last4; + } + } + + /** + * For more details about Multibanco, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Multibanco extends StripeObject { + /** Entity number associated with this Multibanco payment. */ + @SerializedName("entity") + String entity; + + /** Reference number associated with this Multibanco payment. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about NaverPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NaverPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Naver Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about NzBankAccount, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NzBankAccount extends StripeObject { + /** + * The name on the bank account. Only present if the account holder name is different from the + * name of the authorized signatory collected in the PaymentMethod’s billing details. + */ + @SerializedName("account_holder_name") + String accountHolderName; + + /** The numeric code for the bank account's bank. */ + @SerializedName("bank_code") + String bankCode; + + /** The name of the bank. */ + @SerializedName("bank_name") + String bankName; + + /** The numeric code for the bank account's bank branch. */ + @SerializedName("branch_code") + String branchCode; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** The suffix of the bank account number. */ + @SerializedName("suffix") + String suffix; + } + + /** + * For more details about Oxxo, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Oxxo extends StripeObject { + /** OXXO reference number. */ + @SerializedName("number") + String number; + } + + /** + * For more details about P24, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class P24 extends StripeObject { + /** + * The customer's bank. Can be one of {@code ing}, {@code citi_handlowy}, {@code + * tmobile_usbugi_bankowe}, {@code plus_bank}, {@code etransfer_pocztowy24}, {@code + * banki_spbdzielcze}, {@code bank_nowy_bfg_sa}, {@code getin_bank}, {@code velobank}, {@code + * blik}, {@code noble_pay}, {@code ideabank}, {@code envelobank}, {@code + * santander_przelew24}, {@code nest_przelew}, {@code mbank_mtransfer}, {@code inteligo}, + * {@code pbac_z_ipko}, {@code bnp_paribas}, {@code credit_agricole}, {@code toyota_bank}, + * {@code bank_pekao_sa}, {@code volkswagen_bank}, {@code bank_millennium}, {@code + * alior_bank}, or {@code boz}. + */ + @SerializedName("bank") + String bank; + + /** Unique reference for this Przelewy24 payment. */ + @SerializedName("reference") + String reference; + + /** + * Owner's verified full name. Values are verified or provided by Przelewy24 directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + * Przelewy24 rarely provides this information so the attribute is usually empty. + */ + @SerializedName("verified_name") + String verifiedName; + } + + /** + * For more details about PayByBank, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayByBank extends StripeObject {} + + /** + * For more details about Payco, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Payco extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Payco transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Paynow, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Paynow extends StripeObject { + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** Reference number associated with this PayNow payment. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about Paypal, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Paypal extends StripeObject { + /** + * Two-letter ISO code representing the buyer's country. Values are provided by PayPal + * directly (if supported) at the time of authorization or settlement. They cannot be set or + * mutated. + */ + @SerializedName("country") + String country; + + /** + * Owner's email. Values are provided by PayPal directly (if supported) at the time of + * authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("payer_email") + String payerEmail; + + /** PayPal account PayerID. This identifier uniquely identifies the PayPal customer. */ + @SerializedName("payer_id") + String payerId; + + /** + * Owner's full name. Values provided by PayPal directly (if supported) at the time of + * authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("payer_name") + String payerName; + + /** + * The level of protection offered as defined by PayPal Seller Protection for Merchants, for + * this transaction. + */ + @SerializedName("seller_protection") + SellerProtection sellerProtection; + + /** A unique ID generated by PayPal for this transaction. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about SellerProtection, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SellerProtection extends StripeObject { + /** An array of conditions that are covered for the transaction, if applicable. */ + @SerializedName("dispute_categories") + List disputeCategories; + + /** + * Indicates whether the transaction is eligible for PayPal's seller protection. + * + *

One of {@code eligible}, {@code not_eligible}, or {@code partially_eligible}. + */ + @SerializedName("status") + String status; + } + } + + /** + * For more details about Pix, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pix extends StripeObject { + /** Unique transaction id generated by BCB. */ + @SerializedName("bank_transaction_id") + String bankTransactionId; + } + + /** + * For more details about Promptpay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Promptpay extends StripeObject { + /** Bill reference generated by PromptPay. */ + @SerializedName("reference") + String reference; + } + + /** + * For more details about RevolutPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RevolutPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** The Revolut Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code cartes_bancaires}, {@code diners}, {@code + * discover}, {@code eftpos_au}, {@code jcb}, {@code link}, {@code mastercard}, {@code + * unionpay}, {@code visa} or {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } + + /** + * For more details about SamsungPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SamsungPay extends StripeObject { + /** A unique identifier for the buyer as determined by the local payment processor. */ + @SerializedName("buyer_id") + String buyerId; + + /** The Samsung Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Satispay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Satispay extends StripeObject { + /** The Satispay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about SepaCreditTransfer, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaCreditTransfer extends StripeObject { + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** IBAN of the bank account to transfer funds to. */ + @SerializedName("iban") + String iban; + } + + /** + * For more details about SepaDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SepaDebit extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Branch code of bank associated with the bank account. */ + @SerializedName("branch_code") + String branchCode; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four characters of the IBAN. */ + @SerializedName("last4") + String last4; + + /** + * Find the ID of the mandate used for this payment under the payment_method_details.sepa_debit.mandate + * property on the Charge. Use this mandate ID to retrieve the Mandate. + */ + @SerializedName("mandate") + String mandate; + } + + /** + * For more details about Sofort, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Sofort extends StripeObject { + /** Bank code of bank associated with the bank account. */ + @SerializedName("bank_code") + String bankCode; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** Bank Identifier Code of the bank associated with the bank account. */ + @SerializedName("bic") + String bic; + + /** Two-letter ISO code representing the country the bank account is located in. */ + @SerializedName("country") + String country; + + /** The ID of the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebit; + + /** The mandate for the SEPA Direct Debit PaymentMethod which was generated by this Charge. */ + @SerializedName("generated_sepa_debit_mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField generatedSepaDebitMandate; + + /** Last four characters of the IBAN. */ + @SerializedName("iban_last4") + String ibanLast4; + + /** + * Preferred language of the SOFORT authorization page that the customer is redirected to. Can + * be one of {@code de}, {@code en}, {@code es}, {@code fr}, {@code it}, {@code nl}, or {@code + * pl} + */ + @SerializedName("preferred_language") + String preferredLanguage; + + /** + * Owner's verified full name. Values are verified or provided by SOFORT directly (if + * supported) at the time of authorization or settlement. They cannot be set or mutated. + */ + @SerializedName("verified_name") + String verifiedName; + + /** Get ID of expandable {@code generatedSepaDebit} object. */ + public String getGeneratedSepaDebit() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getId() : null; + } + + public void setGeneratedSepaDebit(String id) { + this.generatedSepaDebit = ApiResource.setExpandableFieldId(id, this.generatedSepaDebit); + } + + /** Get expanded {@code generatedSepaDebit}. */ + public PaymentMethod getGeneratedSepaDebitObject() { + return (this.generatedSepaDebit != null) ? this.generatedSepaDebit.getExpanded() : null; + } + + public void setGeneratedSepaDebitObject(PaymentMethod expandableObject) { + this.generatedSepaDebit = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Get ID of expandable {@code generatedSepaDebitMandate} object. */ + public String getGeneratedSepaDebitMandate() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getId() + : null; + } + + public void setGeneratedSepaDebitMandate(String id) { + this.generatedSepaDebitMandate = + ApiResource.setExpandableFieldId(id, this.generatedSepaDebitMandate); + } + + /** Get expanded {@code generatedSepaDebitMandate}. */ + public Mandate getGeneratedSepaDebitMandateObject() { + return (this.generatedSepaDebitMandate != null) + ? this.generatedSepaDebitMandate.getExpanded() + : null; + } + + public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { + this.generatedSepaDebitMandate = + new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about StripeAccount, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StripeAccount extends StripeObject {} + + /** + * For more details about Swish, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Swish extends StripeObject { + /** + * Uniquely identifies the payer's Swish account. You can use this attribute to check whether + * two Swish transactions were paid for by the same payer + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Payer bank reference number for the payment. */ + @SerializedName("payment_reference") + String paymentReference; + + /** The last four digits of the Swish account phone number. */ + @SerializedName("verified_phone_last4") + String verifiedPhoneLast4; + } + + /** + * For more details about Twint, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Twint extends StripeObject {} + + /** Details of the US Bank Account used for this payment attempt. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class UsBankAccount extends StripeObject { + @SerializedName("account_holder_type") + String accountHolderType; + + @SerializedName("account_type") + String accountType; + + /** Name of the bank associated with the bank account. */ + @SerializedName("bank_name") + String bankName; + + /** + * Uniquely identifies this particular bank account. You can use this attribute to check + * whether two bank accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** Last four digits of the bank account number. */ + @SerializedName("last4") + String last4; + + /** ID of the mandate used to make this payment. */ + @SerializedName("mandate") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField mandate; + + /** Reference number to locate ACH payments with customer’s bank. */ + @SerializedName("payment_reference") + String paymentReference; + + /** Routing number of the bank account. */ + @SerializedName("routing_number") + String routingNumber; + + /** Get ID of expandable {@code mandate} object. */ + public String getMandate() { + return (this.mandate != null) ? this.mandate.getId() : null; + } + + public void setMandate(String id) { + this.mandate = ApiResource.setExpandableFieldId(id, this.mandate); + } + + /** Get expanded {@code mandate}. */ + public Mandate getMandateObject() { + return (this.mandate != null) ? this.mandate.getExpanded() : null; + } + + public void setMandateObject(Mandate expandableObject) { + this.mandate = new ExpandableField(expandableObject.getId(), expandableObject); + } + } + + /** + * For more details about Wechat, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Wechat extends StripeObject {} + + /** + * For more details about WechatPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class WechatPay extends StripeObject { + /** + * Uniquely identifies this particular WeChat Pay account. You can use this attribute to check + * whether two WeChat accounts are the same. + */ + @SerializedName("fingerprint") + String fingerprint; + + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + + /** Transaction ID of this particular WeChat Pay transaction. */ + @SerializedName("transaction_id") + String transactionId; + } + + /** + * For more details about Zip, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Zip extends StripeObject {} + } + + /** Processor information associated with this payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails extends StripeObject { + /** + * Custom processors represent payment processors not modeled directly in the Stripe API. This + * resource consists of details about the custom processor used for this payment attempt. + */ + @SerializedName("custom") + Custom custom; + + /** + * The processor used for this payment attempt. + * + *

Equal to {@code custom}. + */ + @SerializedName("type") + String type; + + /** + * Custom processors represent payment processors not modeled directly in the Stripe API. This + * resource consists of details about the custom processor used for this payment attempt. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Custom extends StripeObject { + /** + * An opaque string for manual reconciliation of this payment, for example a check number or a + * payment processor ID. + */ + @SerializedName("payment_reference") + String paymentReference; + } + } + + /** 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, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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(amount, responseGetter); + trySetResponseGetter(amountAuthorized, responseGetter); + trySetResponseGetter(amountCanceled, responseGetter); + trySetResponseGetter(amountFailed, responseGetter); + trySetResponseGetter(amountGuaranteed, responseGetter); + trySetResponseGetter(amountRefunded, responseGetter); + trySetResponseGetter(amountRequested, responseGetter); + trySetResponseGetter(customerDetails, responseGetter); + trySetResponseGetter(paymentMethodDetails, responseGetter); + trySetResponseGetter(processorDetails, responseGetter); + trySetResponseGetter(shippingDetails, responseGetter); + } +} diff --git a/src/main/java/com/stripe/model/Payout.java b/src/main/java/com/stripe/model/Payout.java index 8285426488d..05b7d4ec829 100644 --- a/src/main/java/com/stripe/model/Payout.java +++ b/src/main/java/com/stripe/model/Payout.java @@ -573,8 +573,8 @@ public static Payout retrieve(String payout, PayoutRetrieveParams params, Reques /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -586,8 +586,8 @@ public Payout reverse() throws StripeException { /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -599,8 +599,8 @@ public Payout reverse(RequestOptions options) throws StripeException { /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -612,8 +612,8 @@ public Payout reverse(Map params) throws StripeException { /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -628,8 +628,8 @@ public Payout reverse(Map params, RequestOptions options) throws /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -641,8 +641,8 @@ public Payout reverse(PayoutReverseParams params) throws StripeException { /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and diff --git a/src/main/java/com/stripe/model/Refund.java b/src/main/java/com/stripe/model/Refund.java index d4fde53341b..86641f8018f 100644 --- a/src/main/java/com/stripe/model/Refund.java +++ b/src/main/java/com/stripe/model/Refund.java @@ -625,6 +625,9 @@ public static class DestinationDetails extends StripeObject { @SerializedName("cashapp") Cashapp cashapp; + @SerializedName("crypto") + Crypto crypto; + @SerializedName("customer_cash_balance") CustomerCashBalance customerCashBalance; @@ -841,6 +844,19 @@ public static class Card extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Cashapp extends StripeObject {} + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** The transaction hash of the refund. */ + @SerializedName("reference") + String reference; + } + /** * For more details about CustomerCashBalance, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 7593c837533..1c077101075 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -113,6 +113,10 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore excludedPaymentMethodTypes; + /** * Indicates the directions of money movement for which this payment method is intended to be * used. diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index 6ca0e963796..1232c78dc62 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -74,12 +74,12 @@ public class StripeError extends StripeObject { * {@code payment_intent_invalid_parameter}, {@code * payment_intent_konbini_rejected_confirmation_number}, {@code payment_intent_mandate_invalid}, * {@code payment_intent_payment_attempt_expired}, {@code payment_intent_payment_attempt_failed}, - * {@code payment_intent_unexpected_state}, {@code payment_method_bank_account_already_verified}, - * {@code payment_method_bank_account_blocked}, {@code - * payment_method_billing_details_address_missing}, {@code payment_method_configuration_failures}, - * {@code payment_method_currency_mismatch}, {@code payment_method_customer_decline}, {@code - * payment_method_invalid_parameter}, {@code payment_method_invalid_parameter_testmode}, {@code - * payment_method_microdeposit_failed}, {@code + * {@code payment_intent_rate_limit_exceeded}, {@code payment_intent_unexpected_state}, {@code + * payment_method_bank_account_already_verified}, {@code payment_method_bank_account_blocked}, + * {@code payment_method_billing_details_address_missing}, {@code + * payment_method_configuration_failures}, {@code payment_method_currency_mismatch}, {@code + * payment_method_customer_decline}, {@code payment_method_invalid_parameter}, {@code + * payment_method_invalid_parameter_testmode}, {@code payment_method_microdeposit_failed}, {@code * payment_method_microdeposit_verification_amounts_invalid}, {@code * payment_method_microdeposit_verification_amounts_mismatch}, {@code * payment_method_microdeposit_verification_attempts_exceeded}, {@code diff --git a/src/main/java/com/stripe/model/billingportal/Configuration.java b/src/main/java/com/stripe/model/billingportal/Configuration.java index 3a3b455e6d8..917bad09db9 100644 --- a/src/main/java/com/stripe/model/billingportal/Configuration.java +++ b/src/main/java/com/stripe/model/billingportal/Configuration.java @@ -24,7 +24,11 @@ import lombok.Getter; import lombok.Setter; -/** A portal configuration describes the functionality and behavior of a portal session. */ +/** + * A portal configuration describes the functionality and behavior you embed in a portal session. + * Related guide: Configure the + * customer portal. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 5aa92c00b43..764aa836ffb 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -2081,6 +2081,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("swish") Swish swish; + @SerializedName("twint") + Twint twint; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -3732,6 +3735,39 @@ public static class Swish extends StripeObject { String reference; } + /** + * For more details about Twint, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Twint extends StripeObject { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

Equal to {@code none}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + } + /** * For more details about UsBankAccount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/financialconnections/Account.java b/src/main/java/com/stripe/model/financialconnections/Account.java index 3e79be1330e..46ce0ad5ea6 100644 --- a/src/main/java/com/stripe/model/financialconnections/Account.java +++ b/src/main/java/com/stripe/model/financialconnections/Account.java @@ -393,7 +393,7 @@ public static com.stripe.model.financialconnections.Account retrieve( /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public com.stripe.model.financialconnections.Account subscribe(Map params) throws StripeException { @@ -402,7 +402,7 @@ public com.stripe.model.financialconnections.Account subscribe(Map params, RequestOptions options) throws StripeException { @@ -418,7 +418,7 @@ public com.stripe.model.financialconnections.Account subscribe( /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public com.stripe.model.financialconnections.Account subscribe(AccountSubscribeParams params) throws StripeException { @@ -427,7 +427,7 @@ public com.stripe.model.financialconnections.Account subscribe(AccountSubscribeP /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public com.stripe.model.financialconnections.Account subscribe( AccountSubscribeParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index 9c69492f51e..0e5aa4d4ea7 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -522,6 +522,9 @@ public static class CountryOptions extends StripeObject { @SerializedName("tr") Tr tr; + @SerializedName("tw") + Tw tw; + @SerializedName("tz") Tz tz; @@ -2784,6 +2787,23 @@ public static class Tr extends StripeObject { String type; } + /** + * For more details about Tw, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tw extends StripeObject { + /** + * Type of registration in {@code country}. + * + *

Equal to {@code simplified}. + */ + @SerializedName("type") + String type; + } + /** * For more details about Tz, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index 75dbbd4a3b4..b6adb662df1 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -428,6 +428,9 @@ public static class Tipping extends StripeObject { @SerializedName("gbp") Gbp gbp; + @SerializedName("gip") + Gip gip; + @SerializedName("hkd") Hkd hkd; @@ -680,6 +683,30 @@ public static class Gbp extends StripeObject { Long smartTipThreshold; } + /** + * For more details about Gip, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Gip extends StripeObject { + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + } + /** * For more details about Hkd, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/terminal/Reader.java b/src/main/java/com/stripe/model/terminal/Reader.java index 578dab1b198..0d68b8073b6 100644 --- a/src/main/java/com/stripe/model/terminal/Reader.java +++ b/src/main/java/com/stripe/model/terminal/Reader.java @@ -84,6 +84,10 @@ public class Reader extends ApiResource implements HasId, MetadataStore @SerializedName("label") String label; + /** The last time this reader reported to Stripe backend. */ + @SerializedName("last_seen_at") + Long lastSeenAt; + /** * Has the value {@code true} if the object exists in live mode or the value {@code false} if the * object exists in test mode. @@ -145,22 +149,38 @@ public void setLocationObject(Location expandableObject) { this.location = new ExpandableField(expandableObject.getId(), expandableObject); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction() throws StripeException { return cancelAction((Map) null, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(RequestOptions options) throws StripeException { return cancelAction((Map) null, options); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(Map params) throws StripeException { return cancelAction(params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(Map params, RequestOptions options) throws StripeException { String path = @@ -171,12 +191,20 @@ public Reader cancelAction(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(ReaderCancelActionParams params) throws StripeException { return cancelAction(params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(ReaderCancelActionParams params, RequestOptions options) throws StripeException { String path = @@ -193,12 +221,20 @@ public Reader cancelAction(ReaderCancelActionParams params, RequestOptions optio return getResponseGetter().request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(Map params) throws StripeException { return collectInputs(params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(Map params, RequestOptions options) throws StripeException { String path = @@ -209,12 +245,20 @@ public Reader collectInputs(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(ReaderCollectInputsParams params) throws StripeException { return collectInputs(params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions options) throws StripeException { String path = @@ -233,7 +277,9 @@ public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions opt /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(Map params) throws StripeException { return collectPaymentMethod(params, (RequestOptions) null); @@ -241,7 +287,9 @@ public Reader collectPaymentMethod(Map params) throws StripeExce /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(Map params, RequestOptions options) throws StripeException { @@ -256,7 +304,9 @@ public Reader collectPaymentMethod(Map params, RequestOptions op /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params) throws StripeException { @@ -265,7 +315,9 @@ public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params) /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod( ReaderCollectPaymentMethodParams params, RequestOptions options) throws StripeException { @@ -284,12 +336,20 @@ public Reader collectPaymentMethod( return getResponseGetter().request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(Map params) throws StripeException { return confirmPaymentIntent(params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -301,13 +361,21 @@ public Reader confirmPaymentIntent(Map params, RequestOptions op return getResponseGetter().request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(ReaderConfirmPaymentIntentParams params) throws StripeException { return confirmPaymentIntent(params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent( ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException { String path = @@ -416,12 +484,20 @@ public static ReaderCollection list(ReaderListParams params, RequestOptions opti return getGlobalResponseGetter().request(request, ReaderCollection.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(Map params) throws StripeException { return processPaymentIntent(params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -433,13 +509,21 @@ public Reader processPaymentIntent(Map params, RequestOptions op return getResponseGetter().request(request, Reader.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(ReaderProcessPaymentIntentParams params) throws StripeException { return processPaymentIntent(params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent( ReaderProcessPaymentIntentParams params, RequestOptions options) throws StripeException { String path = @@ -457,12 +541,20 @@ public Reader processPaymentIntent( return getResponseGetter().request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(Map params) throws StripeException { return processSetupIntent(params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -473,12 +565,20 @@ public Reader processSetupIntent(Map params, RequestOptions opti return getResponseGetter().request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(ReaderProcessSetupIntentParams params) throws StripeException { return processSetupIntent(params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestOptions options) throws StripeException { String path = @@ -495,22 +595,38 @@ public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestO return getResponseGetter().request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment() throws StripeException { return refundPayment((Map) null, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(RequestOptions options) throws StripeException { return refundPayment((Map) null, options); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(Map params) throws StripeException { return refundPayment(params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(Map params, RequestOptions options) throws StripeException { String path = @@ -521,12 +637,20 @@ public Reader refundPayment(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(ReaderRefundPaymentParams params) throws StripeException { return refundPayment(params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(ReaderRefundPaymentParams params, RequestOptions options) throws StripeException { String path = @@ -577,12 +701,18 @@ public static Reader retrieve(String reader, ReaderRetrieveParams params, Reques return getGlobalResponseGetter().request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(Map params) throws StripeException { return setReaderDisplay(params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(Map params, RequestOptions options) throws StripeException { String path = @@ -593,12 +723,18 @@ public Reader setReaderDisplay(Map params, RequestOptions option return getResponseGetter().request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(ReaderSetReaderDisplayParams params) throws StripeException { return setReaderDisplay(params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(ReaderSetReaderDisplayParams params, RequestOptions options) throws StripeException { String path = @@ -866,20 +1002,16 @@ public static class Selection extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class Choice extends StripeObject implements HasId { - /** The id to be selected. */ + /** The identifier for the selected choice. Maximum 50 characters. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") String id; - /** - * The button style for the choice - * - *

One of {@code primary}, or {@code secondary}. - */ + /** The button style for the choice. Can be {@code primary} or {@code secondary}. */ @SerializedName("style") String style; - /** The text to be selected. */ + /** The text to be selected. Maximum 30 characters. */ @SerializedName("text") String text; } @@ -910,27 +1042,19 @@ public static class Text extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Toggle extends StripeObject { - /** - * The toggle's default value - * - *

One of {@code disabled}, or {@code enabled}. - */ + /** The toggle's default value. Can be {@code enabled} or {@code disabled}. */ @SerializedName("default_value") String defaultValue; - /** The toggle's description text. */ + /** The toggle's description text. Maximum 50 characters. */ @SerializedName("description") String description; - /** The toggle's title text. */ + /** The toggle's title text. Maximum 50 characters. */ @SerializedName("title") String title; - /** - * The toggle's collected value - * - *

One of {@code disabled}, or {@code enabled}. - */ + /** The toggle's collected value. Can be {@code enabled} or {@code disabled}. */ @SerializedName("value") String value; } @@ -1328,12 +1452,13 @@ public static class RefundPaymentConfig extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SetReaderDisplay extends StripeObject { - /** Cart object to be displayed by the reader. */ + /** Cart object to be displayed by the reader, including line items, amounts, and currency. */ @SerializedName("cart") Cart cart; /** - * Type of information to be displayed by the reader. + * Type of information to be displayed by the reader. Only {@code cart} is currently + * supported. * *

Equal to {@code cart}. */ diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 10d09fd38da..c3016cdefe9 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -7185,6 +7185,13 @@ public static class Company { @SerializedName("registration_number") String registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -7234,6 +7241,7 @@ private Company( String phone, Object registrationDate, String registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, @@ -7257,6 +7265,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -7305,6 +7314,8 @@ public static class Builder { private String registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -7336,6 +7347,7 @@ public AccountCreateParams.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -7529,6 +7541,16 @@ public Builder setRegistrationNumber(String registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountCreateParams.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -8379,6 +8401,111 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * 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 IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Company.RepresentativeDeclaration build() { + return new AccountCreateParams.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** The Unix timestamp marking when the representative declaration attestation was made. */ + public Builder setDate(Long date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Company.RepresentativeDeclaration#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 IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 11d4ac97776..a9e3228a67c 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -7282,6 +7282,13 @@ public static class Company { @SerializedName("registration_number") Object registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -7331,6 +7338,7 @@ private Company( Object phone, Object registrationDate, Object registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, Object taxId, Object taxIdRegistrar, @@ -7354,6 +7362,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -7402,6 +7411,8 @@ public static class Builder { private Object registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private Object taxId; @@ -7433,6 +7444,7 @@ public AccountUpdateParams.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -7674,6 +7686,16 @@ public Builder setRegistrationNumber(EmptyParam registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountUpdateParams.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -8704,6 +8726,126 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * 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 IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + Object ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + Object userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, Object ip, Object userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private Object ip; + + private Object userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Company.RepresentativeDeclaration build() { + return new AccountUpdateParams.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** The Unix timestamp marking when the representative declaration attestation was made. */ + public Builder setDate(Long date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Company.RepresentativeDeclaration#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 IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The IP address from which the representative declaration attestation was made. */ + public Builder setIp(EmptyParam ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(EmptyParam userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index 6c4828056bf..53c7738c60f 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -883,6 +883,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -890,10 +897,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -905,12 +926,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNoteCreateParams.Refund build() { return new CreditNoteCreateParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -948,6 +977,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNoteCreateParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -956,6 +995,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNoteCreateParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * 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 PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNoteCreateParams.Refund.PaymentRecordRefund build() { + return new CreditNoteCreateParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * 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 CreditNoteCreateParams.Refund.PaymentRecordRefund#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 CreditNoteCreateParams.Refund.PaymentRecordRefund#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 PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index dd6aeabb1ac..4445a387a6b 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -956,6 +956,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -963,10 +970,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -978,12 +999,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNotePreviewLinesListParams.Refund build() { return new CreditNotePreviewLinesListParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -1022,6 +1051,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -1030,6 +1069,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNotePreviewLinesListParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * 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 PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund build() { + return new CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * 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 CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund#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 CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund#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 PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index 65db4a6c8cf..1ca061957bc 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -883,6 +883,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -890,10 +897,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -905,12 +926,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNotePreviewParams.Refund build() { return new CreditNotePreviewParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -948,6 +977,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNotePreviewParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -956,6 +995,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNotePreviewParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * 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 PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNotePreviewParams.Refund.PaymentRecordRefund build() { + return new CreditNotePreviewParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * 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 CreditNotePreviewParams.Refund.PaymentRecordRefund#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 CreditNotePreviewParams.Refund.PaymentRecordRefund#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 PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index dbb8572498c..1ef7256bbc5 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -285,6 +285,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index 66b1285304b..a9cbb227bb5 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -285,6 +285,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java index d69fb2456b9..ee7be3686a9 100644 --- a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java @@ -148,6 +148,10 @@ public static class Components { @SerializedName("buy_button") BuyButton buyButton; + /** Configuration for the customer sheet. */ + @SerializedName("customer_sheet") + CustomerSheet customerSheet; + /** * 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 @@ -157,6 +161,10 @@ public static class Components { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Configuration for the mobile payment element. */ + @SerializedName("mobile_payment_element") + MobilePaymentElement mobilePaymentElement; + /** Configuration for the Payment Element. */ @SerializedName("payment_element") PaymentElement paymentElement; @@ -167,11 +175,15 @@ public static class Components { private Components( BuyButton buyButton, + CustomerSheet customerSheet, Map extraParams, + MobilePaymentElement mobilePaymentElement, PaymentElement paymentElement, PricingTable pricingTable) { this.buyButton = buyButton; + this.customerSheet = customerSheet; this.extraParams = extraParams; + this.mobilePaymentElement = mobilePaymentElement; this.paymentElement = paymentElement; this.pricingTable = pricingTable; } @@ -183,8 +195,12 @@ public static Builder builder() { public static class Builder { private BuyButton buyButton; + private CustomerSheet customerSheet; + private Map extraParams; + private MobilePaymentElement mobilePaymentElement; + private PaymentElement paymentElement; private PricingTable pricingTable; @@ -192,7 +208,12 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public CustomerSessionCreateParams.Components build() { return new CustomerSessionCreateParams.Components( - this.buyButton, this.extraParams, this.paymentElement, this.pricingTable); + this.buyButton, + this.customerSheet, + this.extraParams, + this.mobilePaymentElement, + this.paymentElement, + this.pricingTable); } /** Configuration for buy button. */ @@ -201,6 +222,13 @@ public Builder setBuyButton(CustomerSessionCreateParams.Components.BuyButton buy return this; } + /** Configuration for the customer sheet. */ + public Builder setCustomerSheet( + CustomerSessionCreateParams.Components.CustomerSheet customerSheet) { + this.customerSheet = customerSheet; + 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 @@ -227,6 +255,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Configuration for the mobile payment element. */ + public Builder setMobilePaymentElement( + CustomerSessionCreateParams.Components.MobilePaymentElement mobilePaymentElement) { + this.mobilePaymentElement = mobilePaymentElement; + return this; + } + /** Configuration for the Payment Element. */ public Builder setPaymentElement( CustomerSessionCreateParams.Components.PaymentElement paymentElement) { @@ -314,6 +349,707 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerSheet { + /** Required. Whether the customer sheet is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** This hash defines whether the customer sheet supports certain features. */ + @SerializedName("features") + Features features; + + private CustomerSheet(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.CustomerSheet build() { + return new CustomerSessionCreateParams.Components.CustomerSheet( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the customer sheet is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.CustomerSheet#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 CustomerSessionCreateParams.Components.CustomerSheet#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This hash defines whether the customer sheet supports certain features. */ + public Builder setFeatures( + CustomerSessionCreateParams.Components.CustomerSheet.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the customer sheet + * displays by filtering to only show payment methods with an {@code allow_redisplay} value + * that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List< + CustomerSessionCreateParams.Components.CustomerSheet.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + /** + * Controls whether the customer sheet displays the option to remove a saved payment + * method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + @SerializedName("payment_method_remove") + PaymentMethodRemove paymentMethodRemove; + + private Features( + Map extraParams, + List< + CustomerSessionCreateParams.Components.CustomerSheet.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters, + PaymentMethodRemove paymentMethodRemove) { + this.extraParams = extraParams; + this.paymentMethodAllowRedisplayFilters = paymentMethodAllowRedisplayFilters; + this.paymentMethodRemove = paymentMethodRemove; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List< + CustomerSessionCreateParams.Components.CustomerSheet.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + private PaymentMethodRemove paymentMethodRemove; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.CustomerSheet.Features build() { + return new CustomerSessionCreateParams.Components.CustomerSheet.Features( + this.extraParams, + this.paymentMethodAllowRedisplayFilters, + this.paymentMethodRemove); + } + + /** + * 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 + * CustomerSessionCreateParams.Components.CustomerSheet.Features#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 + * CustomerSessionCreateParams.Components.CustomerSheet.Features#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 an element to `paymentMethodAllowRedisplayFilters` list. A list is initialized for + * the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.CustomerSheet.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addPaymentMethodAllowRedisplayFilter( + CustomerSessionCreateParams.Components.CustomerSheet.Features + .PaymentMethodAllowRedisplayFilter + element) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.add(element); + return this; + } + + /** + * Add all elements to `paymentMethodAllowRedisplayFilters` list. A list is initialized + * for the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.CustomerSheet.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addAllPaymentMethodAllowRedisplayFilter( + List< + CustomerSessionCreateParams.Components.CustomerSheet.Features + .PaymentMethodAllowRedisplayFilter> + elements) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.addAll(elements); + return this; + } + + /** + * Controls whether the customer sheet displays the option to remove a saved payment + * method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + public Builder setPaymentMethodRemove( + CustomerSessionCreateParams.Components.CustomerSheet.Features.PaymentMethodRemove + paymentMethodRemove) { + this.paymentMethodRemove = paymentMethodRemove; + return this; + } + } + + public enum PaymentMethodAllowRedisplayFilter implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodAllowRedisplayFilter(String value) { + this.value = value; + } + } + + public enum PaymentMethodRemove implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRemove(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MobilePaymentElement { + /** Required. Whether the mobile payment element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** This hash defines whether the mobile payment element supports certain features. */ + @SerializedName("features") + Features features; + + private MobilePaymentElement( + Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.MobilePaymentElement build() { + return new CustomerSessionCreateParams.Components.MobilePaymentElement( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the mobile payment element is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.MobilePaymentElement#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 CustomerSessionCreateParams.Components.MobilePaymentElement#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This hash defines whether the mobile payment element supports certain features. */ + public Builder setFeatures( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the mobile payment + * element displays by filtering to only show payment methods with an {@code + * allow_redisplay} value that is present in this list. + * + *

If not specified, defaults to ["always"]. In order to display all saved + * payment methods, specify ["always", "limited", + * "unspecified"]. + */ + @SerializedName("payment_method_allow_redisplay_filters") + List< + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + /** Controls whether or not the mobile payment element shows saved payment methods. */ + @SerializedName("payment_method_redisplay") + PaymentMethodRedisplay paymentMethodRedisplay; + + /** + * Controls whether the mobile payment element displays the option to remove a saved payment + * method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + @SerializedName("payment_method_remove") + PaymentMethodRemove paymentMethodRemove; + + /** + * Controls whether the mobile payment element displays a checkbox offering to save a new + * payment method. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + */ + @SerializedName("payment_method_save") + PaymentMethodSave paymentMethodSave; + + /** + * Allows overriding the value of allow_override when saving a new payment method when + * payment_method_save is set to disabled. Use values: "always", + * "limited", or "unspecified". + * + *

If not specified, defaults to {@code nil} (no override value). + */ + @SerializedName("payment_method_save_allow_redisplay_override") + PaymentMethodSaveAllowRedisplayOverride paymentMethodSaveAllowRedisplayOverride; + + private Features( + Map extraParams, + List< + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters, + PaymentMethodRedisplay paymentMethodRedisplay, + PaymentMethodRemove paymentMethodRemove, + PaymentMethodSave paymentMethodSave, + PaymentMethodSaveAllowRedisplayOverride paymentMethodSaveAllowRedisplayOverride) { + this.extraParams = extraParams; + this.paymentMethodAllowRedisplayFilters = paymentMethodAllowRedisplayFilters; + this.paymentMethodRedisplay = paymentMethodRedisplay; + this.paymentMethodRemove = paymentMethodRemove; + this.paymentMethodSave = paymentMethodSave; + this.paymentMethodSaveAllowRedisplayOverride = paymentMethodSaveAllowRedisplayOverride; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List< + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + paymentMethodAllowRedisplayFilters; + + private PaymentMethodRedisplay paymentMethodRedisplay; + + private PaymentMethodRemove paymentMethodRemove; + + private PaymentMethodSave paymentMethodSave; + + private PaymentMethodSaveAllowRedisplayOverride paymentMethodSaveAllowRedisplayOverride; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.MobilePaymentElement.Features build() { + return new CustomerSessionCreateParams.Components.MobilePaymentElement.Features( + this.extraParams, + this.paymentMethodAllowRedisplayFilters, + this.paymentMethodRedisplay, + this.paymentMethodRemove, + this.paymentMethodSave, + this.paymentMethodSaveAllowRedisplayOverride); + } + + /** + * 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 + * CustomerSessionCreateParams.Components.MobilePaymentElement.Features#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 + * CustomerSessionCreateParams.Components.MobilePaymentElement.Features#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 an element to `paymentMethodAllowRedisplayFilters` list. A list is initialized for + * the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.MobilePaymentElement.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addPaymentMethodAllowRedisplayFilter( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodAllowRedisplayFilter + element) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.add(element); + return this; + } + + /** + * Add all elements to `paymentMethodAllowRedisplayFilters` list. A list is initialized + * for the first `add/addAll` call, and subsequent calls adds additional elements to the + * original list. See {@link + * CustomerSessionCreateParams.Components.MobilePaymentElement.Features#paymentMethodAllowRedisplayFilters} + * for the field documentation. + */ + public Builder addAllPaymentMethodAllowRedisplayFilter( + List< + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodAllowRedisplayFilter> + elements) { + if (this.paymentMethodAllowRedisplayFilters == null) { + this.paymentMethodAllowRedisplayFilters = new ArrayList<>(); + } + this.paymentMethodAllowRedisplayFilters.addAll(elements); + return this; + } + + /** Controls whether or not the mobile payment element shows saved payment methods. */ + public Builder setPaymentMethodRedisplay( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodRedisplay + paymentMethodRedisplay) { + this.paymentMethodRedisplay = paymentMethodRedisplay; + return this; + } + + /** + * Controls whether the mobile payment element displays the option to remove a saved + * payment method." + * + *

Allowing buyers to remove their saved payment methods impacts subscriptions that + * depend on that payment method. Removing the payment method detaches the {@code + * customer} object from that PaymentMethod. + */ + public Builder setPaymentMethodRemove( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodRemove + paymentMethodRemove) { + this.paymentMethodRemove = paymentMethodRemove; + return this; + } + + /** + * Controls whether the mobile payment element displays a checkbox offering to save a new + * payment method. + * + *

If a customer checks the box, the {@code + * allow_redisplay} value on the PaymentMethod is set to {@code 'always'} at + * confirmation time. For PaymentIntents, the {@code + * setup_future_usage} value is also set to the value defined in {@code + * payment_method_save_usage}. + */ + public Builder setPaymentMethodSave( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features.PaymentMethodSave + paymentMethodSave) { + this.paymentMethodSave = paymentMethodSave; + return this; + } + + /** + * Allows overriding the value of allow_override when saving a new payment method when + * payment_method_save is set to disabled. Use values: "always", + * "limited", or "unspecified". + * + *

If not specified, defaults to {@code nil} (no override value). + */ + public Builder setPaymentMethodSaveAllowRedisplayOverride( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodSaveAllowRedisplayOverride + paymentMethodSaveAllowRedisplayOverride) { + this.paymentMethodSaveAllowRedisplayOverride = paymentMethodSaveAllowRedisplayOverride; + return this; + } + } + + public enum PaymentMethodAllowRedisplayFilter implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodAllowRedisplayFilter(String value) { + this.value = value; + } + } + + public enum PaymentMethodRedisplay implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRedisplay(String value) { + this.value = value; + } + } + + public enum PaymentMethodRemove implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRemove(String value) { + this.value = value; + } + } + + public enum PaymentMethodSave implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSave(String value) { + this.value = value; + } + } + + public enum PaymentMethodSaveAllowRedisplayOverride implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSaveAllowRedisplayOverride(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentElement { diff --git a/src/main/java/com/stripe/param/FileCreateParams.java b/src/main/java/com/stripe/param/FileCreateParams.java index 55026b17719..665a984b1b9 100644 --- a/src/main/java/com/stripe/param/FileCreateParams.java +++ b/src/main/java/com/stripe/param/FileCreateParams.java @@ -361,6 +361,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("pci_document") PCI_DOCUMENT("pci_document"), + @SerializedName("platform_terms_of_service") + PLATFORM_TERMS_OF_SERVICE("platform_terms_of_service"), + @SerializedName("tax_document_user_upload") TAX_DOCUMENT_USER_UPLOAD("tax_document_user_upload"), diff --git a/src/main/java/com/stripe/param/FileListParams.java b/src/main/java/com/stripe/param/FileListParams.java index ad1192cacea..f0085ee3138 100644 --- a/src/main/java/com/stripe/param/FileListParams.java +++ b/src/main/java/com/stripe/param/FileListParams.java @@ -363,6 +363,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("pci_document") PCI_DOCUMENT("pci_document"), + @SerializedName("platform_terms_of_service") + PLATFORM_TERMS_OF_SERVICE("platform_terms_of_service"), + @SerializedName("selfie") SELFIE("selfie"), diff --git a/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java index 3cfd7b21ed9..50caccd07a0 100644 --- a/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java +++ b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java @@ -30,11 +30,19 @@ public class InvoiceAttachPaymentParams extends ApiRequestParams { @SerializedName("payment_intent") String paymentIntent; + /** The ID of the PaymentRecord to attach to the invoice. */ + @SerializedName("payment_record") + String paymentRecord; + private InvoiceAttachPaymentParams( - List expand, Map extraParams, String paymentIntent) { + List expand, + Map extraParams, + String paymentIntent, + String paymentRecord) { this.expand = expand; this.extraParams = extraParams; this.paymentIntent = paymentIntent; + this.paymentRecord = paymentRecord; } public static Builder builder() { @@ -48,9 +56,12 @@ public static class Builder { private String paymentIntent; + private String paymentRecord; + /** Finalize and obtain parameter instance from this builder. */ public InvoiceAttachPaymentParams build() { - return new InvoiceAttachPaymentParams(this.expand, this.extraParams, this.paymentIntent); + return new InvoiceAttachPaymentParams( + this.expand, this.extraParams, this.paymentIntent, this.paymentRecord); } /** @@ -110,5 +121,11 @@ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; } + + /** The ID of the PaymentRecord to attach to the invoice. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } } } diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index aa776ea067d..9d170d2ed84 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -3619,6 +3619,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/InvoicePaymentListParams.java b/src/main/java/com/stripe/param/InvoicePaymentListParams.java index 40853b0e930..bfc2be62b7e 100644 --- a/src/main/java/com/stripe/param/InvoicePaymentListParams.java +++ b/src/main/java/com/stripe/param/InvoicePaymentListParams.java @@ -234,13 +234,19 @@ public static class Payment { @SerializedName("payment_intent") String paymentIntent; + /** Only return invoice payments associated by this payment record ID. */ + @SerializedName("payment_record") + String paymentRecord; + /** Required. Only return invoice payments associated by this payment type. */ @SerializedName("type") Type type; - private Payment(Map extraParams, String paymentIntent, Type type) { + private Payment( + Map extraParams, String paymentIntent, String paymentRecord, Type type) { this.extraParams = extraParams; this.paymentIntent = paymentIntent; + this.paymentRecord = paymentRecord; this.type = type; } @@ -253,12 +259,14 @@ public static class Builder { private String paymentIntent; + private String paymentRecord; + private Type type; /** Finalize and obtain parameter instance from this builder. */ public InvoicePaymentListParams.Payment build() { return new InvoicePaymentListParams.Payment( - this.extraParams, this.paymentIntent, this.type); + this.extraParams, this.paymentIntent, this.paymentRecord, this.type); } /** @@ -293,6 +301,12 @@ public Builder setPaymentIntent(String paymentIntent) { return this; } + /** Only return invoice payments associated by this payment record ID. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + /** * Required. Only return invoice payments associated by this payment type. */ @@ -304,7 +318,10 @@ public Builder setType(InvoicePaymentListParams.Payment.Type type) { public enum Type implements ApiRequestParams.EnumParam { @SerializedName("payment_intent") - PAYMENT_INTENT("payment_intent"); + PAYMENT_INTENT("payment_intent"), + + @SerializedName("payment_record") + PAYMENT_RECORD("payment_record"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index c246f64335f..302531429c1 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -3628,6 +3628,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), 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..3a68f81ca90 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java @@ -0,0 +1,161 @@ +// 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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +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; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** Required. The ID of the Payment Record. */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private PaymentAttemptRecordListParams( + List expand, + Map extraParams, + Long limit, + String paymentRecord, + String startingAfter) { + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.paymentRecord = paymentRecord; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private Long limit; + + private String paymentRecord; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentAttemptRecordListParams build() { + return new PaymentAttemptRecordListParams( + this.expand, this.extraParams, this.limit, this.paymentRecord, this.startingAfter); + } + + /** + * 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; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** Required. The ID of the Payment Record. */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } +} 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..8fa6681e502 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordRetrieveParams.java @@ -0,0 +1,100 @@ +// 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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +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/PaymentIntentAmountDetailsLineItemListParams.java b/src/main/java/com/stripe/param/PaymentIntentAmountDetailsLineItemListParams.java new file mode 100644 index 00000000000..d7cb7e21ee7 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentIntentAmountDetailsLineItemListParams.java @@ -0,0 +1,172 @@ +// 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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentIntentAmountDetailsLineItemListParams extends ApiRequestParams { + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + @SerializedName("ending_before") + String endingBefore; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + @SerializedName("limit") + Long limit; + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + + private PaymentIntentAmountDetailsLineItemListParams( + String endingBefore, + List expand, + Map extraParams, + Long limit, + String startingAfter) { + this.endingBefore = endingBefore; + this.expand = expand; + this.extraParams = extraParams; + this.limit = limit; + this.startingAfter = startingAfter; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String endingBefore; + + private List expand; + + private Map extraParams; + + private Long limit; + + private String startingAfter; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentAmountDetailsLineItemListParams build() { + return new PaymentIntentAmountDetailsLineItemListParams( + this.endingBefore, this.expand, this.extraParams, this.limit, this.startingAfter); + } + + /** + * A cursor for use in pagination. {@code ending_before} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, starting with + * {@code obj_bar}, your subsequent call can include {@code ending_before=obj_bar} in order to + * fetch the previous page of the list. + */ + public Builder setEndingBefore(String endingBefore) { + this.endingBefore = endingBefore; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentAmountDetailsLineItemListParams#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 + * PaymentIntentAmountDetailsLineItemListParams#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 + * PaymentIntentAmountDetailsLineItemListParams#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 PaymentIntentAmountDetailsLineItemListParams#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A limit on the number of objects to be returned. Limit can range between 1 and 100, and the + * default is 10. + */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index 554c0d016ec..b88a516eb9f 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -14,6 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class PaymentIntentCaptureParams extends ApiRequestParams { + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** * The amount to capture from the PaymentIntent, which must be less than or equal to the original * amount. Defaults to the full {@code amount_capturable} if it's not provided. @@ -63,6 +67,10 @@ public class PaymentIntentCaptureParams extends ApiRequestParams { @SerializedName("metadata") Object metadata; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + Object paymentDetails; + /** * Text that appears on the customer's statement as the statement descriptor for a non-card * charge. This value overrides the account's default statement descriptor. For information about @@ -95,21 +103,25 @@ public class PaymentIntentCaptureParams extends ApiRequestParams { TransferData transferData; private PaymentIntentCaptureParams( + AmountDetails amountDetails, Long amountToCapture, Long applicationFeeAmount, List expand, Map extraParams, Boolean finalCapture, Object metadata, + Object paymentDetails, String statementDescriptor, String statementDescriptorSuffix, TransferData transferData) { + this.amountDetails = amountDetails; this.amountToCapture = amountToCapture; this.applicationFeeAmount = applicationFeeAmount; this.expand = expand; this.extraParams = extraParams; this.finalCapture = finalCapture; this.metadata = metadata; + this.paymentDetails = paymentDetails; this.statementDescriptor = statementDescriptor; this.statementDescriptorSuffix = statementDescriptorSuffix; this.transferData = transferData; @@ -120,6 +132,8 @@ public static Builder builder() { } public static class Builder { + private AmountDetails amountDetails; + private Long amountToCapture; private Long applicationFeeAmount; @@ -132,6 +146,8 @@ public static class Builder { private Object metadata; + private Object paymentDetails; + private String statementDescriptor; private String statementDescriptorSuffix; @@ -141,17 +157,25 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCaptureParams build() { return new PaymentIntentCaptureParams( + this.amountDetails, this.amountToCapture, this.applicationFeeAmount, this.expand, this.extraParams, this.finalCapture, this.metadata, + this.paymentDetails, this.statementDescriptor, this.statementDescriptorSuffix, this.transferData); } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(PaymentIntentCaptureParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** * The amount to capture from the PaymentIntent, which must be less than or equal to the * original amount. Defaults to the full {@code amount_capturable} if it's not provided. @@ -287,6 +311,18 @@ public Builder setMetadata(Map metadata) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(PaymentIntentCaptureParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(EmptyParam paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * Text that appears on the customer's statement as the statement descriptor for a non-card * charge. This value overrides the account's default statement descriptor. For information @@ -326,6 +362,1310 @@ public Builder setTransferData(PaymentIntentCaptureParams.TransferData transferD } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AmountDetails { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Object discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Map extraParams, + Object lineItems, + Object shipping, + Object tax) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object discountAmount; + + private Map extraParams; + + private Object lineItems; + + private Object shipping; + + private Object tax; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails build() { + return new PaymentIntentCaptureParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentCaptureParams.AmountDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentCaptureParams.AmountDetails#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 an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentCaptureParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem(PaymentIntentCaptureParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentCaptureParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).addAll(elements); + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(PaymentIntentCaptureParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentCaptureParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * 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; + + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; + + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; + + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + private LineItem( + Long discountAmount, + Map extraParams, + PaymentMethodOptions paymentMethodOptions, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost, + String unitOfMeasure) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long discountAmount; + + private Map extraParams; + + private PaymentMethodOptions paymentMethodOptions; + + private String productCode; + + private String productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + private String unitOfMeasure; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); + } + + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; + return this; + } + + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax(PaymentIntentCaptureParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + @SerializedName("card_present") + CardPresent cardPresent; + + /** + * 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; + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + @SerializedName("klarna") + Klarna klarna; + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; + this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private CardPresent cardPresent; + + private Map extraParams; + + private Klarna klarna; + + private Paypal paypal; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); + } + + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + public Builder setCard( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + public Builder setCardPresent( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + cardPresent) { + this.cardPresent = cardPresent; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + public Builder setKlarna( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + klarna) { + this.klarna = klarna; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + public Builder setPaypal( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + paypal) { + this.paypal = paypal; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Card(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Card + build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + .Card(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private CardPresent(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent + build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + String imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + String productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + String subscriptionReference; + + private Klarna( + Map extraParams, + String imageUrl, + String productUrl, + String reference, + String subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String imageUrl; + + private String productUrl; + + private String reference; + + private String subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + String soldBy; + + private Paypal( + Category category, + String description, + Map extraParams, + String soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private String description; + + private Map extraParams; + + private String soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal(this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + .Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The total tax on an item. Non-negative integer. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentCaptureParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The total tax on an item. Non-negative integer. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Object amount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.Shipping build() { + return new PaymentIntentCaptureParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.AmountDetails.Tax build() { + return new PaymentIntentCaptureParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCaptureParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCaptureParams.PaymentDetails build() { + return new PaymentIntentCaptureParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentCaptureParams.PaymentDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentCaptureParams.PaymentDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TransferData { diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 8429e073501..a313790c2e7 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -14,6 +14,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class PaymentIntentConfirmParams extends ApiRequestParams { + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + Object amountDetails; + /** Controls when the funds will be captured from the customer's account. */ @SerializedName("capture_method") CaptureMethod captureMethod; @@ -70,6 +74,10 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { @SerializedName("off_session") Object offSession; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + Object paymentDetails; + /** * ID of the payment method (a PaymentMethod, Card, or compatible @@ -165,6 +173,7 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { Boolean useStripeSdk; private PaymentIntentConfirmParams( + Object amountDetails, CaptureMethod captureMethod, String confirmationToken, Boolean errorOnRequiresAction, @@ -174,6 +183,7 @@ private PaymentIntentConfirmParams( String mandate, Object mandateData, Object offSession, + Object paymentDetails, String paymentMethod, PaymentMethodData paymentMethodData, PaymentMethodOptions paymentMethodOptions, @@ -184,6 +194,7 @@ private PaymentIntentConfirmParams( ApiRequestParams.EnumParam setupFutureUsage, Object shipping, Boolean useStripeSdk) { + this.amountDetails = amountDetails; this.captureMethod = captureMethod; this.confirmationToken = confirmationToken; this.errorOnRequiresAction = errorOnRequiresAction; @@ -193,6 +204,7 @@ private PaymentIntentConfirmParams( this.mandate = mandate; this.mandateData = mandateData; this.offSession = offSession; + this.paymentDetails = paymentDetails; this.paymentMethod = paymentMethod; this.paymentMethodData = paymentMethodData; this.paymentMethodOptions = paymentMethodOptions; @@ -210,6 +222,8 @@ public static Builder builder() { } public static class Builder { + private Object amountDetails; + private CaptureMethod captureMethod; private String confirmationToken; @@ -228,6 +242,8 @@ public static class Builder { private Object offSession; + private Object paymentDetails; + private String paymentMethod; private PaymentMethodData paymentMethodData; @@ -251,6 +267,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams build() { return new PaymentIntentConfirmParams( + this.amountDetails, this.captureMethod, this.confirmationToken, this.errorOnRequiresAction, @@ -260,6 +277,7 @@ public PaymentIntentConfirmParams build() { this.mandate, this.mandateData, this.offSession, + this.paymentDetails, this.paymentMethod, this.paymentMethodData, this.paymentMethodOptions, @@ -272,6 +290,18 @@ public PaymentIntentConfirmParams build() { this.useStripeSdk); } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(PaymentIntentConfirmParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(EmptyParam amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** Controls when the funds will be captured from the customer's account. */ public Builder setCaptureMethod(PaymentIntentConfirmParams.CaptureMethod captureMethod) { this.captureMethod = captureMethod; @@ -441,6 +471,18 @@ public Builder setOffSession(PaymentIntentConfirmParams.OffSession offSession) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(PaymentIntentConfirmParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(EmptyParam paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * ID of the payment method (a PaymentMethod, Card, or compatible @@ -620,10 +662,10 @@ public Builder setUseStripeSdk(Boolean useStripeSdk) { @Getter @EqualsAndHashCode(callSuper = false) - public static class MandateData { - /** This hash contains details about the customer acceptance of the Mandate. */ - @SerializedName("customer_acceptance") - CustomerAcceptance customerAcceptance; + public static class AmountDetails { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Object discountAmount; /** * Map of extra parameters for custom features not available in this client library. The content @@ -634,9 +676,32 @@ public static class MandateData { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private MandateData(CustomerAcceptance customerAcceptance, Map extraParams) { - this.customerAcceptance = customerAcceptance; + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Map extraParams, + Object lineItems, + Object shipping, + Object tax) { + this.discountAmount = discountAmount; this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; } public static Builder builder() { @@ -644,27 +709,38 @@ public static Builder builder() { } public static class Builder { - private CustomerAcceptance customerAcceptance; + private Object discountAmount; private Map extraParams; + private Object lineItems; + + private Object shipping; + + private Object tax; + /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentConfirmParams.MandateData build() { - return new PaymentIntentConfirmParams.MandateData( - this.customerAcceptance, this.extraParams); + public PaymentIntentConfirmParams.AmountDetails build() { + return new PaymentIntentConfirmParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); } - /** This hash contains details about the customer acceptance of the Mandate. */ - public Builder setCustomerAcceptance( - PaymentIntentConfirmParams.MandateData.CustomerAcceptance customerAcceptance) { - this.customerAcceptance = customerAcceptance; + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * PaymentIntentConfirmParams.MandateData#extraParams} for the field documentation. + * PaymentIntentConfirmParams.AmountDetails#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -677,7 +753,8 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link PaymentIntentConfirmParams.MandateData#extraParams} for the field documentation. + * See {@link PaymentIntentConfirmParams.AmountDetails#extraParams} for the field + * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -686,14 +763,86 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentConfirmParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem(PaymentIntentConfirmParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentConfirmParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).addAll(elements); + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(PaymentIntentConfirmParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentConfirmParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; + return this; + } } @Getter @EqualsAndHashCode(callSuper = false) - public static class CustomerAcceptance { - /** The time at which the customer accepted the Mandate. */ - @SerializedName("accepted_at") - Long acceptedAt; + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; /** * Map of extra parameters for custom features not available in this client library. The @@ -704,38 +853,53 @@ public static class CustomerAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * If this is a Mandate accepted offline, this hash contains details about the offline - * acceptance. - */ - @SerializedName("offline") - Offline offline; + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; - /** - * If this is a Mandate accepted online, this hash contains details about the online - * acceptance. - */ - @SerializedName("online") - Online online; + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; - /** - * Required. The type of customer acceptance information included with the - * Mandate. One of {@code online} or {@code offline}. - */ - @SerializedName("type") - Type type; + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; - private CustomerAcceptance( - Long acceptedAt, + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + private LineItem( + Long discountAmount, Map extraParams, - Offline offline, - Online online, - Type type) { - this.acceptedAt = acceptedAt; + PaymentMethodOptions paymentMethodOptions, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost, + String unitOfMeasure) { + this.discountAmount = discountAmount; this.extraParams = extraParams; - this.offline = offline; - this.online = online; - this.type = type; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; } public static Builder builder() { @@ -743,33 +907,49 @@ public static Builder builder() { } public static class Builder { - private Long acceptedAt; + private Long discountAmount; private Map extraParams; - private Offline offline; + private PaymentMethodOptions paymentMethodOptions; - private Online online; + private String productCode; - private Type type; + private String productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + private String unitOfMeasure; /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentConfirmParams.MandateData.CustomerAcceptance build() { - return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance( - this.acceptedAt, this.extraParams, this.offline, this.online, this.type); + public PaymentIntentConfirmParams.AmountDetails.LineItem build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); } - /** The time at which the customer accepted the Mandate. */ - public Builder setAcceptedAt(Long acceptedAt) { - this.acceptedAt = acceptedAt; + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentIntentConfirmParams.MandateData.CustomerAcceptance#extraParams} - * for the field documentation. + * map. See {@link PaymentIntentConfirmParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -782,8 +962,8 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentIntentConfirmParams.MandateData.CustomerAcceptance#extraParams} - * for the field documentation. + * map. See {@link PaymentIntentConfirmParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -793,40 +973,68 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * If this is a Mandate accepted offline, this hash contains details about the offline - * acceptance. - */ - public Builder setOffline( - PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline offline) { - this.offline = offline; + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; return this; } - /** - * If this is a Mandate accepted online, this hash contains details about the online - * acceptance. - */ - public Builder setOnline( - PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online online) { - this.online = online; + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; return this; } - /** - * Required. The type of customer acceptance information included with the - * Mandate. One of {@code online} or {@code offline}. - */ - public Builder setType( - PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Type type) { - this.type = type; + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax(PaymentIntentConfirmParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Offline { + public static class PaymentMethodOptions { + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + @SerializedName("card_present") + CardPresent cardPresent; + /** * 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. @@ -837,8 +1045,31 @@ public static class Offline { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Offline(Map extraParams) { + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + @SerializedName("klarna") + Klarna klarna; + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; } public static Builder builder() { @@ -846,20 +1077,49 @@ public static Builder builder() { } public static class Builder { + private Card card; + + private CardPresent cardPresent; + private Map extraParams; + private Klarna klarna; + + private Paypal paypal; + /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline build() { - return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline( - this.extraParams); + public PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); + } + + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + public Builder setCard( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + public Builder setCardPresent( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + cardPresent) { + this.cardPresent = cardPresent; + return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline#extraParams} for the - * field documentation. + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -873,8 +1133,8 @@ public Builder putExtraParam(String key, Object value) { * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original * map. See {@link - * PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline#extraParams} for the - * field documentation. + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -883,46 +1143,1026 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class Online { - /** - * 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 IP address from which the Mandate was accepted by the customer. */ - @SerializedName("ip_address") - String ipAddress; - - /** The user agent of the browser from which the Mandate was accepted by the customer. */ - @SerializedName("user_agent") - String userAgent; - private Online(Map extraParams, String ipAddress, String userAgent) { - this.extraParams = extraParams; - this.ipAddress = ipAddress; - this.userAgent = userAgent; - } + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + public Builder setKlarna( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + klarna) { + this.klarna = klarna; + return this; + } - public static Builder builder() { - return new Builder(); + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + public Builder setPaypal( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + paypal) { + this.paypal = paypal; + return this; + } } - public static class Builder { - private Map extraParams; - - private String ipAddress; - - private String userAgent; + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Card(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Card + build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + .Card(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private CardPresent(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent + build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + String imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + String productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + String subscriptionReference; + + private Klarna( + Map extraParams, + String imageUrl, + String productUrl, + String reference, + String subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String imageUrl; + + private String productUrl; + + private String reference; + + private String subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + String soldBy; + + private Paypal( + Category category, + String description, + Map extraParams, + String soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private String description; + + private Map extraParams; + + private String soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal(this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + .Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The total tax on an item. Non-negative integer. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentConfirmParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The total tax on an item. Non-negative integer. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Object amount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.Shipping build() { + return new PaymentIntentConfirmParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.AmountDetails.Tax build() { + return new PaymentIntentConfirmParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateData { + /** This hash contains details about the customer acceptance of the Mandate. */ + @SerializedName("customer_acceptance") + CustomerAcceptance customerAcceptance; + + /** + * 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 MandateData(CustomerAcceptance customerAcceptance, Map extraParams) { + this.customerAcceptance = customerAcceptance; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerAcceptance customerAcceptance; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.MandateData build() { + return new PaymentIntentConfirmParams.MandateData( + this.customerAcceptance, this.extraParams); + } + + /** This hash contains details about the customer acceptance of the Mandate. */ + public Builder setCustomerAcceptance( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance customerAcceptance) { + this.customerAcceptance = customerAcceptance; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentConfirmParams.MandateData#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentConfirmParams.MandateData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerAcceptance { + /** The time at which the customer accepted the Mandate. */ + @SerializedName("accepted_at") + Long acceptedAt; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline + * acceptance. + */ + @SerializedName("offline") + Offline offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online + * acceptance. + */ + @SerializedName("online") + Online online; + + /** + * Required. The type of customer acceptance information included with the + * Mandate. One of {@code online} or {@code offline}. + */ + @SerializedName("type") + Type type; + + private CustomerAcceptance( + Long acceptedAt, + Map extraParams, + Offline offline, + Online online, + Type type) { + this.acceptedAt = acceptedAt; + this.extraParams = extraParams; + this.offline = offline; + this.online = online; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long acceptedAt; + + private Map extraParams; + + private Offline offline; + + private Online online; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.MandateData.CustomerAcceptance build() { + return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance( + this.acceptedAt, this.extraParams, this.offline, this.online, this.type); + } + + /** The time at which the customer accepted the Mandate. */ + public Builder setAcceptedAt(Long acceptedAt) { + this.acceptedAt = acceptedAt; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.MandateData.CustomerAcceptance#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.MandateData.CustomerAcceptance#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline + * acceptance. + */ + public Builder setOffline( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline offline) { + this.offline = offline; + return this; + } + + /** + * If this is a Mandate accepted online, this hash contains details about the online + * acceptance. + */ + public Builder setOnline( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online online) { + this.online = online; + return this; + } + + /** + * Required. The type of customer acceptance information included with the + * Mandate. One of {@code online} or {@code offline}. + */ + public Builder setType( + PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Offline { + /** + * 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 Offline(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline build() { + return new PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline( + this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Offline#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Online { + /** + * 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 IP address from which the Mandate was accepted by the customer. */ + @SerializedName("ip_address") + String ipAddress; + + /** The user agent of the browser from which the Mandate was accepted by the customer. */ + @SerializedName("user_agent") + String userAgent; + + private Online(Map extraParams, String ipAddress, String userAgent) { + this.extraParams = extraParams; + this.ipAddress = ipAddress; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String ipAddress; + + private String userAgent; /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.MandateData.CustomerAcceptance.Online build() { @@ -991,6 +2231,112 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentDetails build() { + return new PaymentIntentConfirmParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentConfirmParams.PaymentDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentConfirmParams.PaymentDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodData { diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 61ec1c41e7b..67e16f7ca70 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -27,6 +27,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @SerializedName("amount") Long amount; + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** * The amount of the application fee (if any) that will be requested to be applied to the payment * and transferred to the application owner's Stripe account. The amount of the application fee @@ -175,6 +179,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @SerializedName("on_behalf_of") String onBehalfOf; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + /** * ID of the payment method (a PaymentMethod, Card, or compatible Source @@ -319,6 +327,7 @@ public class PaymentIntentCreateParams extends ApiRequestParams { private PaymentIntentCreateParams( Long amount, + AmountDetails amountDetails, Long applicationFeeAmount, AutomaticPaymentMethods automaticPaymentMethods, CaptureMethod captureMethod, @@ -337,6 +346,7 @@ private PaymentIntentCreateParams( Map metadata, Object offSession, String onBehalfOf, + PaymentDetails paymentDetails, String paymentMethod, String paymentMethodConfiguration, PaymentMethodData paymentMethodData, @@ -353,6 +363,7 @@ private PaymentIntentCreateParams( String transferGroup, Boolean useStripeSdk) { this.amount = amount; + this.amountDetails = amountDetails; this.applicationFeeAmount = applicationFeeAmount; this.automaticPaymentMethods = automaticPaymentMethods; this.captureMethod = captureMethod; @@ -371,6 +382,7 @@ private PaymentIntentCreateParams( this.metadata = metadata; this.offSession = offSession; this.onBehalfOf = onBehalfOf; + this.paymentDetails = paymentDetails; this.paymentMethod = paymentMethod; this.paymentMethodConfiguration = paymentMethodConfiguration; this.paymentMethodData = paymentMethodData; @@ -395,6 +407,8 @@ public static Builder builder() { public static class Builder { private Long amount; + private AmountDetails amountDetails; + private Long applicationFeeAmount; private AutomaticPaymentMethods automaticPaymentMethods; @@ -431,6 +445,8 @@ public static class Builder { private String onBehalfOf; + private PaymentDetails paymentDetails; + private String paymentMethod; private String paymentMethodConfiguration; @@ -465,6 +481,7 @@ public static class Builder { public PaymentIntentCreateParams build() { return new PaymentIntentCreateParams( this.amount, + this.amountDetails, this.applicationFeeAmount, this.automaticPaymentMethods, this.captureMethod, @@ -483,6 +500,7 @@ public PaymentIntentCreateParams build() { this.metadata, this.offSession, this.onBehalfOf, + this.paymentDetails, this.paymentMethod, this.paymentMethodConfiguration, this.paymentMethodData, @@ -515,6 +533,12 @@ public Builder setAmount(Long amount) { return this; } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(PaymentIntentCreateParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** * The amount of the application fee (if any) that will be requested to be applied to the * payment and transferred to the application owner's Stripe account. The amount of the @@ -800,6 +824,12 @@ public Builder setOnBehalfOf(String onBehalfOf) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(PaymentIntentCreateParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * ID of the payment method (a PaymentMethod, Card, or compatible Source @@ -993,22 +1023,10 @@ public Builder setUseStripeSdk(Boolean useStripeSdk) { @Getter @EqualsAndHashCode(callSuper = false) - public static class AutomaticPaymentMethods { - /** - * Controls whether this PaymentIntent will accept redirect-based payment methods. - * - *

Redirect-based payment methods may require your customer to be redirected to a payment - * method's app or site for authentication or additional steps. To confirm this PaymentIntent, - * you may be required to provide a {@code return_url} to redirect customers back to your site - * after they authenticate or complete the payment. - */ - @SerializedName("allow_redirects") - AllowRedirects allowRedirects; - - /** Required. Whether this feature is enabled. */ - @SerializedName("enabled") - Boolean enabled; + public static class AmountDetails { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Object discountAmount; /** * Map of extra parameters for custom features not available in this client library. The content @@ -1019,11 +1037,32 @@ public static class AutomaticPaymentMethods { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private AutomaticPaymentMethods( - AllowRedirects allowRedirects, Boolean enabled, Map extraParams) { - this.allowRedirects = allowRedirects; - this.enabled = enabled; + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Map extraParams, + Object lineItems, + Object shipping, + Object tax) { + this.discountAmount = discountAmount; this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; } public static Builder builder() { @@ -1031,43 +1070,38 @@ public static Builder builder() { } public static class Builder { - private AllowRedirects allowRedirects; - - private Boolean enabled; + private Object discountAmount; private Map extraParams; + private Object lineItems; + + private Object shipping; + + private Object tax; + /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentCreateParams.AutomaticPaymentMethods build() { - return new PaymentIntentCreateParams.AutomaticPaymentMethods( - this.allowRedirects, this.enabled, this.extraParams); + public PaymentIntentCreateParams.AmountDetails build() { + return new PaymentIntentCreateParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); } - /** - * Controls whether this PaymentIntent will accept redirect-based payment methods. - * - *

Redirect-based payment methods may require your customer to be redirected to a payment - * method's app or site for authentication or additional steps. To confirm this PaymentIntent, - * you may be required to provide a {@code return_url} to redirect customers back to your site - * after they authenticate or complete the payment. - */ - public Builder setAllowRedirects( - PaymentIntentCreateParams.AutomaticPaymentMethods.AllowRedirects allowRedirects) { - this.allowRedirects = allowRedirects; + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; return this; } - /** Required. Whether this feature is enabled. */ - public Builder setEnabled(Boolean enabled) { - this.enabled = enabled; + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * PaymentIntentCreateParams.AutomaticPaymentMethods#extraParams} for the field documentation. + * PaymentIntentCreateParams.AmountDetails#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -1080,7 +1114,7 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link PaymentIntentCreateParams.AutomaticPaymentMethods#extraParams} for the field + * See {@link PaymentIntentCreateParams.AmountDetails#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -1090,105 +1124,86 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } - } - - public enum AllowRedirects implements ApiRequestParams.EnumParam { - @SerializedName("always") - ALWAYS("always"), - - @SerializedName("never") - NEVER("never"); - - @Getter(onMethod_ = {@Override}) - private final String value; - - AllowRedirects(String value) { - this.value = value; - } - } - } - - @Getter - @EqualsAndHashCode(callSuper = false) - public static class MandateData { - /** - * Required. This hash contains details about the customer acceptance of the - * Mandate. - */ - @SerializedName("customer_acceptance") - CustomerAcceptance customerAcceptance; - - /** - * 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 MandateData(CustomerAcceptance customerAcceptance, Map extraParams) { - this.customerAcceptance = customerAcceptance; - this.extraParams = extraParams; - } - - public static Builder builder() { - return new Builder(); - } - - public static class Builder { - private CustomerAcceptance customerAcceptance; - - private Map extraParams; - /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentCreateParams.MandateData build() { - return new PaymentIntentCreateParams.MandateData(this.customerAcceptance, this.extraParams); + /** + * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentCreateParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem(PaymentIntentCreateParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).add(element); + return this; } /** - * Required. This hash contains details about the customer acceptance of the - * Mandate. + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentCreateParams.AmountDetails#lineItems} for the field documentation. */ - public Builder setCustomerAcceptance( - PaymentIntentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { - this.customerAcceptance = customerAcceptance; + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).addAll(elements); return this; } /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` - * call, and subsequent calls add additional key/value pairs to the original map. See {@link - * PaymentIntentCreateParams.MandateData#extraParams} for the field documentation. + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.put(key, value); + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; return this; } /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. - * See {@link PaymentIntentCreateParams.MandateData#extraParams} for the field documentation. + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); - } - this.extraParams.putAll(map); + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(PaymentIntentCreateParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentCreateParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class CustomerAcceptance { - /** The time at which the customer accepted the Mandate. */ - @SerializedName("accepted_at") - Long acceptedAt; + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; /** * Map of extra parameters for custom features not available in this client library. The @@ -1199,38 +1214,53 @@ public static class CustomerAcceptance { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** - * If this is a Mandate accepted offline, this hash contains details about the offline - * acceptance. - */ - @SerializedName("offline") - Offline offline; + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; - /** - * If this is a Mandate accepted online, this hash contains details about the online - * acceptance. - */ - @SerializedName("online") - Online online; + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; - /** - * Required. The type of customer acceptance information included with the - * Mandate. One of {@code online} or {@code offline}. - */ - @SerializedName("type") - Type type; + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; - private CustomerAcceptance( - Long acceptedAt, + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + private LineItem( + Long discountAmount, Map extraParams, - Offline offline, - Online online, - Type type) { - this.acceptedAt = acceptedAt; + PaymentMethodOptions paymentMethodOptions, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost, + String unitOfMeasure) { + this.discountAmount = discountAmount; this.extraParams = extraParams; - this.offline = offline; - this.online = online; - this.type = type; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; } public static Builder builder() { @@ -1238,33 +1268,49 @@ public static Builder builder() { } public static class Builder { - private Long acceptedAt; + private Long discountAmount; private Map extraParams; - private Offline offline; + private PaymentMethodOptions paymentMethodOptions; - private Online online; + private String productCode; - private Type type; + private String productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + private String unitOfMeasure; /** Finalize and obtain parameter instance from this builder. */ - public PaymentIntentCreateParams.MandateData.CustomerAcceptance build() { - return new PaymentIntentCreateParams.MandateData.CustomerAcceptance( - this.acceptedAt, this.extraParams, this.offline, this.online, this.type); + public PaymentIntentCreateParams.AmountDetails.LineItem build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); } - /** The time at which the customer accepted the Mandate. */ - public Builder setAcceptedAt(Long acceptedAt) { - this.acceptedAt = acceptedAt; + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; return this; } /** * Add a key/value pair to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentIntentCreateParams.MandateData.CustomerAcceptance#extraParams} for - * the field documentation. + * map. See {@link PaymentIntentCreateParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -1277,8 +1323,8 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentIntentCreateParams.MandateData.CustomerAcceptance#extraParams} for - * the field documentation. + * map. See {@link PaymentIntentCreateParams.AmountDetails.LineItem#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -1288,39 +1334,68 @@ public Builder putAllExtraParam(Map map) { return this; } - /** - * If this is a Mandate accepted offline, this hash contains details about the offline - * acceptance. - */ - public Builder setOffline( - PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline offline) { - this.offline = offline; + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; return this; } - /** - * If this is a Mandate accepted online, this hash contains details about the online - * acceptance. - */ - public Builder setOnline( - PaymentIntentCreateParams.MandateData.CustomerAcceptance.Online online) { - this.online = online; + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; return this; } - /** - * Required. The type of customer acceptance information included with the - * Mandate. One of {@code online} or {@code offline}. - */ - public Builder setType(PaymentIntentCreateParams.MandateData.CustomerAcceptance.Type type) { - this.type = type; + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax(PaymentIntentCreateParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; return this; } } @Getter @EqualsAndHashCode(callSuper = false) - public static class Offline { + public static class PaymentMethodOptions { + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + @SerializedName("card_present") + CardPresent cardPresent; + /** * 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. @@ -1331,11 +1406,1161 @@ public static class Offline { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Offline(Map extraParams) { - this.extraParams = extraParams; - } + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + @SerializedName("klarna") + Klarna klarna; - public static Builder builder() { + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; + this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private CardPresent cardPresent; + + private Map extraParams; + + private Klarna klarna; + + private Paypal paypal; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); + } + + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + public Builder setCard( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + public Builder setCardPresent( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + cardPresent) { + this.cardPresent = cardPresent; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + public Builder setKlarna( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna klarna) { + this.klarna = klarna; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + public Builder setPaypal( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Card(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Card + build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Card( + this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private CardPresent(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + String imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + String productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + String subscriptionReference; + + private Klarna( + Map extraParams, + String imageUrl, + String productUrl, + String reference, + String subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String imageUrl; + + private String productUrl; + + private String reference; + + private String subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + String soldBy; + + private Paypal( + Category category, + String description, + Map extraParams, + String soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private String description; + + private Map extraParams; + + private String soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal(this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + .Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The total tax on an item. Non-negative integer. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentCreateParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The total tax on an item. Non-negative integer. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Object amount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.Shipping build() { + return new PaymentIntentCreateParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AmountDetails.Tax build() { + return new PaymentIntentCreateParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AutomaticPaymentMethods { + /** + * Controls whether this PaymentIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this PaymentIntent, + * you may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the payment. + */ + @SerializedName("allow_redirects") + AllowRedirects allowRedirects; + + /** Required. Whether this feature is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private AutomaticPaymentMethods( + AllowRedirects allowRedirects, Boolean enabled, Map extraParams) { + this.allowRedirects = allowRedirects; + this.enabled = enabled; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AllowRedirects allowRedirects; + + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.AutomaticPaymentMethods build() { + return new PaymentIntentCreateParams.AutomaticPaymentMethods( + this.allowRedirects, this.enabled, this.extraParams); + } + + /** + * Controls whether this PaymentIntent will accept redirect-based payment methods. + * + *

Redirect-based payment methods may require your customer to be redirected to a payment + * method's app or site for authentication or additional steps. To confirm this PaymentIntent, + * you may be required to provide a {@code return_url} to redirect customers back to your site + * after they authenticate or complete the payment. + */ + public Builder setAllowRedirects( + PaymentIntentCreateParams.AutomaticPaymentMethods.AllowRedirects allowRedirects) { + this.allowRedirects = allowRedirects; + return this; + } + + /** Required. Whether this feature is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentCreateParams.AutomaticPaymentMethods#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentCreateParams.AutomaticPaymentMethods#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 AllowRedirects implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AllowRedirects(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MandateData { + /** + * Required. This hash contains details about the customer acceptance of the + * Mandate. + */ + @SerializedName("customer_acceptance") + CustomerAcceptance customerAcceptance; + + /** + * 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 MandateData(CustomerAcceptance customerAcceptance, Map extraParams) { + this.customerAcceptance = customerAcceptance; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerAcceptance customerAcceptance; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.MandateData build() { + return new PaymentIntentCreateParams.MandateData(this.customerAcceptance, this.extraParams); + } + + /** + * Required. This hash contains details about the customer acceptance of the + * Mandate. + */ + public Builder setCustomerAcceptance( + PaymentIntentCreateParams.MandateData.CustomerAcceptance customerAcceptance) { + this.customerAcceptance = customerAcceptance; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentCreateParams.MandateData#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentCreateParams.MandateData#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomerAcceptance { + /** The time at which the customer accepted the Mandate. */ + @SerializedName("accepted_at") + Long acceptedAt; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline + * acceptance. + */ + @SerializedName("offline") + Offline offline; + + /** + * If this is a Mandate accepted online, this hash contains details about the online + * acceptance. + */ + @SerializedName("online") + Online online; + + /** + * Required. The type of customer acceptance information included with the + * Mandate. One of {@code online} or {@code offline}. + */ + @SerializedName("type") + Type type; + + private CustomerAcceptance( + Long acceptedAt, + Map extraParams, + Offline offline, + Online online, + Type type) { + this.acceptedAt = acceptedAt; + this.extraParams = extraParams; + this.offline = offline; + this.online = online; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long acceptedAt; + + private Map extraParams; + + private Offline offline; + + private Online online; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.MandateData.CustomerAcceptance build() { + return new PaymentIntentCreateParams.MandateData.CustomerAcceptance( + this.acceptedAt, this.extraParams, this.offline, this.online, this.type); + } + + /** The time at which the customer accepted the Mandate. */ + public Builder setAcceptedAt(Long acceptedAt) { + this.acceptedAt = acceptedAt; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.MandateData.CustomerAcceptance#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.MandateData.CustomerAcceptance#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * If this is a Mandate accepted offline, this hash contains details about the offline + * acceptance. + */ + public Builder setOffline( + PaymentIntentCreateParams.MandateData.CustomerAcceptance.Offline offline) { + this.offline = offline; + return this; + } + + /** + * If this is a Mandate accepted online, this hash contains details about the online + * acceptance. + */ + public Builder setOnline( + PaymentIntentCreateParams.MandateData.CustomerAcceptance.Online online) { + this.online = online; + return this; + } + + /** + * Required. The type of customer acceptance information included with the + * Mandate. One of {@code online} or {@code offline}. + */ + public Builder setType(PaymentIntentCreateParams.MandateData.CustomerAcceptance.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Offline { + /** + * 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 Offline(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { return new Builder(); } @@ -1497,6 +2722,112 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentDetails build() { + return new PaymentIntentCreateParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentCreateParams.PaymentDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentCreateParams.PaymentDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodData { diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 84768928401..f10203ba281 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -3,6 +3,7 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; import java.util.ArrayList; import java.util.HashMap; import java.util.List; @@ -20,6 +21,10 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams @SerializedName("amount") Long amount; + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + AmountDetails amountDetails; + /** * The amount of the application fee (if any) that will be requested to be applied to the payment * and transferred to the application owner's Stripe account. The amount of the application fee @@ -56,6 +61,10 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams @SerializedName("metadata") Map metadata; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + PaymentDetails paymentDetails; + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -76,19 +85,23 @@ public class PaymentIntentIncrementAuthorizationParams extends ApiRequestParams private PaymentIntentIncrementAuthorizationParams( Long amount, + AmountDetails amountDetails, Long applicationFeeAmount, String description, List expand, Map extraParams, Map metadata, + PaymentDetails paymentDetails, String statementDescriptor, TransferData transferData) { this.amount = amount; + this.amountDetails = amountDetails; this.applicationFeeAmount = applicationFeeAmount; this.description = description; this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; + this.paymentDetails = paymentDetails; this.statementDescriptor = statementDescriptor; this.transferData = transferData; } @@ -100,6 +113,8 @@ public static Builder builder() { public static class Builder { private Long amount; + private AmountDetails amountDetails; + private Long applicationFeeAmount; private String description; @@ -110,6 +125,8 @@ public static class Builder { private Map metadata; + private PaymentDetails paymentDetails; + private String statementDescriptor; private TransferData transferData; @@ -118,11 +135,13 @@ public static class Builder { public PaymentIntentIncrementAuthorizationParams build() { return new PaymentIntentIncrementAuthorizationParams( this.amount, + this.amountDetails, this.applicationFeeAmount, this.description, this.expand, this.extraParams, this.metadata, + this.paymentDetails, this.statementDescriptor, this.transferData); } @@ -136,6 +155,13 @@ public Builder setAmount(Long amount) { return this; } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails( + PaymentIntentIncrementAuthorizationParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** * The amount of the application fee (if any) that will be requested to be applied to the * payment and transferred to the application owner's Stripe account. The amount of the @@ -233,6 +259,13 @@ public Builder putAllMetadata(Map map) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails( + PaymentIntentIncrementAuthorizationParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -257,6 +290,1339 @@ public Builder setTransferData( } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AmountDetails { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Object discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Map extraParams, + Object lineItems, + Object shipping, + Object tax) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object discountAmount; + + private Map extraParams; + + private Object lineItems; + + private Object shipping; + + private Object tax; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentIncrementAuthorizationParams.AmountDetails#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 an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails#lineItems} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = + new ArrayList(); + } + ((List) this.lineItems) + .add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails#lineItems} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = + new ArrayList(); + } + ((List) this.lineItems) + .addAll(elements); + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping( + PaymentIntentIncrementAuthorizationParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * 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; + + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + String productCode; + + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + String productName; + + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + String unitOfMeasure; + + private LineItem( + Long discountAmount, + Map extraParams, + PaymentMethodOptions paymentMethodOptions, + String productCode, + String productName, + Long quantity, + Tax tax, + Long unitCost, + String unitOfMeasure) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long discountAmount; + + private Map extraParams; + + private PaymentMethodOptions paymentMethodOptions; + + private String productCode; + + private String productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + private String unitOfMeasure; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); + } + + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; + return this; + } + + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + @SerializedName("card_present") + CardPresent cardPresent; + + /** + * 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; + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + @SerializedName("klarna") + Klarna klarna; + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; + this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private CardPresent cardPresent; + + private Map extraParams; + + private Klarna klarna; + + private Paypal paypal; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions + build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); + } + + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + public Builder setCard( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Card + card) { + this.card = card; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + public Builder setCardPresent( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent + cardPresent) { + this.cardPresent = cardPresent; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + public Builder setKlarna( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna + klarna) { + this.klarna = klarna; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + public Builder setPaypal( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal + paypal) { + this.paypal = paypal; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Card(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Card + build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Card(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + String commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private CardPresent(String commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.CardPresent + build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + String imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + String productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + String subscriptionReference; + + private Klarna( + Map extraParams, + String imageUrl, + String productUrl, + String reference, + String subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String imageUrl; + + private String productUrl; + + private String reference; + + private String subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Klarna + build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + String description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + String soldBy; + + private Paypal( + Category category, + String description, + Map extraParams, + String soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private String description; + + private Map extraParams; + + private String soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal + build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal( + this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem + .PaymentMethodOptions.Paypal.Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The total tax on an item. Non-negative integer. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The total tax on an item. Non-negative integer. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Object amount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.Shipping build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax build() { + return new PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentIncrementAuthorizationParams.AmountDetails.Tax#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.PaymentDetails build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentIncrementAuthorizationParams.PaymentDetails#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentIncrementAuthorizationParams.PaymentDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TransferData { diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 5639d9bdb44..f91131ee166 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -26,6 +26,10 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { @SerializedName("amount") Long amount; + /** Provides industry-specific information about the amount. */ + @SerializedName("amount_details") + Object amountDetails; + /** * The amount of the application fee (if any) that will be requested to be applied to the payment * and transferred to the application owner's Stripe account. The amount of the application fee @@ -94,6 +98,10 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { @SerializedName("metadata") Object metadata; + /** Provides industry-specific information about the charge. */ + @SerializedName("payment_details") + Object paymentDetails; + /** * ID of the payment method (a PaymentMethod, Card, or compatible @@ -211,6 +219,7 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { private PaymentIntentUpdateParams( Long amount, + Object amountDetails, Object applicationFeeAmount, CaptureMethod captureMethod, Object currency, @@ -220,6 +229,7 @@ private PaymentIntentUpdateParams( List expand, Map extraParams, Object metadata, + Object paymentDetails, Object paymentMethod, Object paymentMethodConfiguration, PaymentMethodData paymentMethodData, @@ -233,6 +243,7 @@ private PaymentIntentUpdateParams( TransferData transferData, Object transferGroup) { this.amount = amount; + this.amountDetails = amountDetails; this.applicationFeeAmount = applicationFeeAmount; this.captureMethod = captureMethod; this.currency = currency; @@ -242,6 +253,7 @@ private PaymentIntentUpdateParams( this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; + this.paymentDetails = paymentDetails; this.paymentMethod = paymentMethod; this.paymentMethodConfiguration = paymentMethodConfiguration; this.paymentMethodData = paymentMethodData; @@ -263,6 +275,8 @@ public static Builder builder() { public static class Builder { private Long amount; + private Object amountDetails; + private Object applicationFeeAmount; private CaptureMethod captureMethod; @@ -281,6 +295,8 @@ public static class Builder { private Object metadata; + private Object paymentDetails; + private Object paymentMethod; private Object paymentMethodConfiguration; @@ -309,6 +325,7 @@ public static class Builder { public PaymentIntentUpdateParams build() { return new PaymentIntentUpdateParams( this.amount, + this.amountDetails, this.applicationFeeAmount, this.captureMethod, this.currency, @@ -318,6 +335,7 @@ public PaymentIntentUpdateParams build() { this.expand, this.extraParams, this.metadata, + this.paymentDetails, this.paymentMethod, this.paymentMethodConfiguration, this.paymentMethodData, @@ -346,6 +364,18 @@ public Builder setAmount(Long amount) { return this; } + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(PaymentIntentUpdateParams.AmountDetails amountDetails) { + this.amountDetails = amountDetails; + return this; + } + + /** Provides industry-specific information about the amount. */ + public Builder setAmountDetails(EmptyParam amountDetails) { + this.amountDetails = amountDetails; + return this; + } + /** * The amount of the application fee (if any) that will be requested to be applied to the * payment and transferred to the application owner's Stripe account. The amount of the @@ -597,6 +627,18 @@ public Builder setMetadata(Map metadata) { return this; } + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(PaymentIntentUpdateParams.PaymentDetails paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + + /** Provides industry-specific information about the charge. */ + public Builder setPaymentDetails(EmptyParam paymentDetails) { + this.paymentDetails = paymentDetails; + return this; + } + /** * ID of the payment method (a PaymentMethod, Card, or compatible @@ -858,6 +900,1382 @@ public Builder setTransferGroup(EmptyParam transferGroup) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class AmountDetails { + /** The total discount applied on the transaction. */ + @SerializedName("discount_amount") + Object discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of line items, each containing information about a product in the PaymentIntent. There + * is a maximum of 100 line items. + */ + @SerializedName("line_items") + Object lineItems; + + /** Contains information about the shipping portion of the amount. */ + @SerializedName("shipping") + Object shipping; + + /** Contains information about the tax portion of the amount. */ + @SerializedName("tax") + Object tax; + + private AmountDetails( + Object discountAmount, + Map extraParams, + Object lineItems, + Object shipping, + Object tax) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.lineItems = lineItems; + this.shipping = shipping; + this.tax = tax; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object discountAmount; + + private Map extraParams; + + private Object lineItems; + + private Object shipping; + + private Object tax; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails build() { + return new PaymentIntentUpdateParams.AmountDetails( + this.discountAmount, this.extraParams, this.lineItems, this.shipping, this.tax); + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** The total discount applied on the transaction. */ + public Builder setDiscountAmount(EmptyParam discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentUpdateParams.AmountDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentUpdateParams.AmountDetails#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 an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentUpdateParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addLineItem(PaymentIntentUpdateParams.AmountDetails.LineItem element) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentUpdateParams.AmountDetails#lineItems} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllLineItem( + List elements) { + if (this.lineItems == null || this.lineItems instanceof EmptyParam) { + this.lineItems = new ArrayList(); + } + ((List) this.lineItems).addAll(elements); + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems(EmptyParam lineItems) { + this.lineItems = lineItems; + return this; + } + + /** + * A list of line items, each containing information about a product in the PaymentIntent. + * There is a maximum of 100 line items. + */ + public Builder setLineItems( + List lineItems) { + this.lineItems = lineItems; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(PaymentIntentUpdateParams.AmountDetails.Shipping shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the shipping portion of the amount. */ + public Builder setShipping(EmptyParam shipping) { + this.shipping = shipping; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(PaymentIntentUpdateParams.AmountDetails.Tax tax) { + this.tax = tax; + return this; + } + + /** Contains information about the tax portion of the amount. */ + public Builder setTax(EmptyParam tax) { + this.tax = tax; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class LineItem { + /** The amount an item was discounted for. Positive integer. */ + @SerializedName("discount_amount") + Long discountAmount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * 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; + + /** Payment method-specific information for line items. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + + /** Unique identifier of the product. At most 12 characters long. */ + @SerializedName("product_code") + Object productCode; + + /** Required. Name of the product. At most 100 characters long. */ + @SerializedName("product_name") + Object productName; + + /** Required. Number of items of the product. Positive integer. */ + @SerializedName("quantity") + Long quantity; + + /** Contains information about the tax on the item. */ + @SerializedName("tax") + Tax tax; + + /** Required. Cost of the product. Non-negative integer. */ + @SerializedName("unit_cost") + Long unitCost; + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + @SerializedName("unit_of_measure") + Object unitOfMeasure; + + private LineItem( + Long discountAmount, + Map extraParams, + PaymentMethodOptions paymentMethodOptions, + Object productCode, + Object productName, + Long quantity, + Tax tax, + Long unitCost, + Object unitOfMeasure) { + this.discountAmount = discountAmount; + this.extraParams = extraParams; + this.paymentMethodOptions = paymentMethodOptions; + this.productCode = productCode; + this.productName = productName; + this.quantity = quantity; + this.tax = tax; + this.unitCost = unitCost; + this.unitOfMeasure = unitOfMeasure; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long discountAmount; + + private Map extraParams; + + private PaymentMethodOptions paymentMethodOptions; + + private Object productCode; + + private Object productName; + + private Long quantity; + + private Tax tax; + + private Long unitCost; + + private Object unitOfMeasure; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem( + this.discountAmount, + this.extraParams, + this.paymentMethodOptions, + this.productCode, + this.productName, + this.quantity, + this.tax, + this.unitCost, + this.unitOfMeasure); + } + + /** The amount an item was discounted for. Positive integer. */ + public Builder setDiscountAmount(Long discountAmount) { + this.discountAmount = discountAmount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.LineItem#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Payment method-specific information for line items. */ + public Builder setPaymentMethodOptions( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions + paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(String productCode) { + this.productCode = productCode; + return this; + } + + /** Unique identifier of the product. At most 12 characters long. */ + public Builder setProductCode(EmptyParam productCode) { + this.productCode = productCode; + return this; + } + + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(String productName) { + this.productName = productName; + return this; + } + + /** Required. Name of the product. At most 100 characters long. */ + public Builder setProductName(EmptyParam productName) { + this.productName = productName; + return this; + } + + /** Required. Number of items of the product. Positive integer. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** Contains information about the tax on the item. */ + public Builder setTax(PaymentIntentUpdateParams.AmountDetails.LineItem.Tax tax) { + this.tax = tax; + return this; + } + + /** Required. Cost of the product. Non-negative integer. */ + public Builder setUnitCost(Long unitCost) { + this.unitCost = unitCost; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(String unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } + + /** A unit of measure for the line item, such as gallons, feet, meters, etc. */ + public Builder setUnitOfMeasure(EmptyParam unitOfMeasure) { + this.unitOfMeasure = unitOfMeasure; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentMethodOptions { + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + @SerializedName("card") + Card card; + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + @SerializedName("card_present") + CardPresent cardPresent; + + /** + * 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; + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + @SerializedName("klarna") + Klarna klarna; + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + @SerializedName("paypal") + Paypal paypal; + + private PaymentMethodOptions( + Card card, + CardPresent cardPresent, + Map extraParams, + Klarna klarna, + Paypal paypal) { + this.card = card; + this.cardPresent = cardPresent; + this.extraParams = extraParams; + this.klarna = klarna; + this.paypal = paypal; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private CardPresent cardPresent; + + private Map extraParams; + + private Klarna klarna; + + private Paypal paypal; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions( + this.card, this.cardPresent, this.extraParams, this.klarna, this.paypal); + } + + /** + * This sub-hash contains line item details that are specific to {@code card} payment + * method.". + */ + public Builder setCard( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code card_present} + * payment method.". + */ + public Builder setCardPresent( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + cardPresent) { + this.cardPresent = cardPresent; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code klarna} payment + * method.". + */ + public Builder setKlarna( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna klarna) { + this.klarna = klarna; + return this; + } + + /** + * This sub-hash contains line item details that are specific to {@code paypal} payment + * method.". + */ + public Builder setPaypal( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal paypal) { + this.paypal = paypal; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + Object commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Card(Object commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Card + build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Card( + this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(EmptyParam commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Card#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CardPresent { + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + @SerializedName("commodity_code") + Object commodityCode; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private CardPresent(Object commodityCode, Map extraParams) { + this.commodityCode = commodityCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object commodityCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent + build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions + .CardPresent(this.commodityCode, this.extraParams); + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(String commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Identifier that categorizes the items being purchased using a standardized commodity + * scheme such as (but not limited to) UNSPSC, NAICS, NAPCS, etc. + */ + public Builder setCommodityCode(EmptyParam commodityCode) { + this.commodityCode = commodityCode; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.CardPresent#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** URL to an image for the product. Max length, 4096 characters. */ + @SerializedName("image_url") + Object imageUrl; + + /** URL to the product page. Max length, 4096 characters. */ + @SerializedName("product_url") + Object productUrl; + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + Object reference; + + /** Reference for the subscription this line item is for. */ + @SerializedName("subscription_reference") + Object subscriptionReference; + + private Klarna( + Map extraParams, + Object imageUrl, + Object productUrl, + Object reference, + Object subscriptionReference) { + this.extraParams = extraParams; + this.imageUrl = imageUrl; + this.productUrl = productUrl; + this.reference = reference; + this.subscriptionReference = subscriptionReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Object imageUrl; + + private Object productUrl; + + private Object reference; + + private Object subscriptionReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna + build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions + .Klarna( + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Klarna#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(String imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to an image for the product. Max length, 4096 characters. */ + public Builder setImageUrl(EmptyParam imageUrl) { + this.imageUrl = imageUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(String productUrl) { + this.productUrl = productUrl; + return this; + } + + /** URL to the product page. Max length, 4096 characters. */ + public Builder setProductUrl(EmptyParam productUrl) { + this.productUrl = productUrl; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(EmptyParam reference) { + this.reference = reference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(String subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + + /** Reference for the subscription this line item is for. */ + public Builder setSubscriptionReference(EmptyParam subscriptionReference) { + this.subscriptionReference = subscriptionReference; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Paypal { + /** Type of the line item. */ + @SerializedName("category") + Category category; + + /** Description of the line item. */ + @SerializedName("description") + Object description; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The Stripe account ID of the connected account that sells the item. */ + @SerializedName("sold_by") + Object soldBy; + + private Paypal( + Category category, + Object description, + Map extraParams, + Object soldBy) { + this.category = category; + this.description = description; + this.extraParams = extraParams; + this.soldBy = soldBy; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Category category; + + private Object description; + + private Map extraParams; + + private Object soldBy; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions + .Paypal(this.category, this.description, this.extraParams, this.soldBy); + } + + /** Type of the line item. */ + public Builder setCategory( + PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal + .Category + category) { + this.category = category; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(String description) { + this.description = description; + return this; + } + + /** Description of the line item. */ + public Builder setDescription(EmptyParam description) { + this.description = description; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions.Paypal#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(String soldBy) { + this.soldBy = soldBy; + return this; + } + + /** The Stripe account ID of the connected account that sells the item. */ + public Builder setSoldBy(EmptyParam soldBy) { + this.soldBy = soldBy; + return this; + } + } + + public enum Category implements ApiRequestParams.EnumParam { + @SerializedName("digital_goods") + DIGITAL_GOODS("digital_goods"), + + @SerializedName("donation") + DONATION("donation"), + + @SerializedName("physical_goods") + PHYSICAL_GOODS("physical_goods"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Category(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The total tax on an item. Non-negative integer. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.LineItem.Tax build() { + return new PaymentIntentUpdateParams.AmountDetails.LineItem.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.LineItem.Tax#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The total tax on an item. Non-negative integer. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Shipping { + /** Portion of the amount that is for shipping. */ + @SerializedName("amount") + Object amount; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The postal code that represents the shipping source. */ + @SerializedName("from_postal_code") + Object fromPostalCode; + + /** The postal code that represents the shipping destination. */ + @SerializedName("to_postal_code") + Object toPostalCode; + + private Shipping( + Object amount, + Map extraParams, + Object fromPostalCode, + Object toPostalCode) { + this.amount = amount; + this.extraParams = extraParams; + this.fromPostalCode = fromPostalCode; + this.toPostalCode = toPostalCode; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object amount; + + private Map extraParams; + + private Object fromPostalCode; + + private Object toPostalCode; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.Shipping build() { + return new PaymentIntentUpdateParams.AmountDetails.Shipping( + this.amount, this.extraParams, this.fromPostalCode, this.toPostalCode); + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** Portion of the amount that is for shipping. */ + public Builder setAmount(EmptyParam amount) { + this.amount = amount; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.Shipping#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(String fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping source. */ + public Builder setFromPostalCode(EmptyParam fromPostalCode) { + this.fromPostalCode = fromPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(String toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + + /** The postal code that represents the shipping destination. */ + public Builder setToPostalCode(EmptyParam toPostalCode) { + this.toPostalCode = toPostalCode; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tax { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Total portion of the amount that is for tax. */ + @SerializedName("total_tax_amount") + Long totalTaxAmount; + + private Tax(Map extraParams, Long totalTaxAmount) { + this.extraParams = extraParams; + this.totalTaxAmount = totalTaxAmount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long totalTaxAmount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.AmountDetails.Tax build() { + return new PaymentIntentUpdateParams.AmountDetails.Tax( + this.extraParams, this.totalTaxAmount); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.AmountDetails.Tax#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Total portion of the amount that is for tax. */ + public Builder setTotalTaxAmount(Long totalTaxAmount) { + this.totalTaxAmount = totalTaxAmount; + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDetails { + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + @SerializedName("customer_reference") + Object customerReference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** A unique value assigned by the business to identify the transaction. */ + @SerializedName("order_reference") + Object orderReference; + + private PaymentDetails( + Object customerReference, Map extraParams, Object orderReference) { + this.customerReference = customerReference; + this.extraParams = extraParams; + this.orderReference = orderReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object customerReference; + + private Map extraParams; + + private Object orderReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentDetails build() { + return new PaymentIntentUpdateParams.PaymentDetails( + this.customerReference, this.extraParams, this.orderReference); + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(String customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Some customers might be required by their company or organization to provide this + * information. If so, provide this value. Otherwise you can ignore this field. + */ + public Builder setCustomerReference(EmptyParam customerReference) { + this.customerReference = customerReference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentUpdateParams.PaymentDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentUpdateParams.PaymentDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(String orderReference) { + this.orderReference = orderReference; + return this; + } + + /** A unique value assigned by the business to identify the transaction. */ + public Builder setOrderReference(EmptyParam orderReference) { + this.orderReference = orderReference; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentMethodData { diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 548080a5e27..b2557038eaa 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -119,6 +119,10 @@ public class PaymentLinkCreateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** Controls settings applied for collecting the customer's name. */ + @SerializedName("name_collection") + NameCollection nameCollection; + /** The account on behalf of which to charge. */ @SerializedName("on_behalf_of") String onBehalfOf; @@ -233,6 +237,7 @@ private PaymentLinkCreateParams( InvoiceCreation invoiceCreation, List lineItems, Map metadata, + NameCollection nameCollection, String onBehalfOf, List optionalItems, PaymentIntentData paymentIntentData, @@ -263,6 +268,7 @@ private PaymentLinkCreateParams( this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.metadata = metadata; + this.nameCollection = nameCollection; this.onBehalfOf = onBehalfOf; this.optionalItems = optionalItems; this.paymentIntentData = paymentIntentData; @@ -317,6 +323,8 @@ public static class Builder { private Map metadata; + private NameCollection nameCollection; + private String onBehalfOf; private List optionalItems; @@ -363,6 +371,7 @@ public PaymentLinkCreateParams build() { this.invoiceCreation, this.lineItems, this.metadata, + this.nameCollection, this.onBehalfOf, this.optionalItems, this.paymentIntentData, @@ -599,6 +608,12 @@ public Builder putAllMetadata(Map map) { return this; } + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(PaymentLinkCreateParams.NameCollection nameCollection) { + this.nameCollection = nameCollection; + return this; + } + /** The account on behalf of which to charge. */ public Builder setOnBehalfOf(String onBehalfOf) { this.onBehalfOf = onBehalfOf; @@ -4238,6 +4253,284 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection { + /** Controls settings applied for collecting the customer's business name. */ + @SerializedName("business") + Business business; + + /** + * 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; + + /** Controls settings applied for collecting the customer's individual name. */ + @SerializedName("individual") + Individual individual; + + private NameCollection( + Business business, Map extraParams, Individual individual) { + this.business = business; + this.extraParams = extraParams; + this.individual = individual; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Business business; + + private Map extraParams; + + private Individual individual; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection build() { + return new PaymentLinkCreateParams.NameCollection( + this.business, this.extraParams, this.individual); + } + + /** Controls settings applied for collecting the customer's business name. */ + public Builder setBusiness(PaymentLinkCreateParams.NameCollection.Business business) { + this.business = business; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLinkCreateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLinkCreateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Controls settings applied for collecting the customer's individual name. */ + public Builder setIndividual(PaymentLinkCreateParams.NameCollection.Individual individual) { + this.individual = individual; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Business { + /** + * Required. Enable business name collection on the payment link. Defaults to + * {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Business(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection.Business build() { + return new PaymentLinkCreateParams.NameCollection.Business( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable business name collection on the payment link. Defaults + * to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Individual { + /** + * Required. Enable individual name collection on the payment link. Defaults + * to {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Individual(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection.Individual build() { + return new PaymentLinkCreateParams.NameCollection.Individual( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable individual name collection on the payment link. + * Defaults to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class OptionalItem { @@ -6742,6 +7035,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("link") LINK("link"), + @SerializedName("mb_way") + MB_WAY("mb_way"), + @SerializedName("mobilepay") MOBILEPAY("mobilepay"), diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 62934fddc16..94282a144a5 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -96,6 +96,10 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** Controls settings applied for collecting the customer's name. */ + @SerializedName("name_collection") + Object nameCollection; + /** * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. @@ -176,6 +180,7 @@ private PaymentLinkUpdateParams( InvoiceCreation invoiceCreation, List lineItems, Map metadata, + Object nameCollection, PaymentIntentData paymentIntentData, PaymentMethodCollection paymentMethodCollection, Object paymentMethodTypes, @@ -199,6 +204,7 @@ private PaymentLinkUpdateParams( this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.metadata = metadata; + this.nameCollection = nameCollection; this.paymentIntentData = paymentIntentData; this.paymentMethodCollection = paymentMethodCollection; this.paymentMethodTypes = paymentMethodTypes; @@ -243,6 +249,8 @@ public static class Builder { private Map metadata; + private Object nameCollection; + private PaymentIntentData paymentIntentData; private PaymentMethodCollection paymentMethodCollection; @@ -278,6 +286,7 @@ public PaymentLinkUpdateParams build() { this.invoiceCreation, this.lineItems, this.metadata, + this.nameCollection, this.paymentIntentData, this.paymentMethodCollection, this.paymentMethodTypes, @@ -507,6 +516,18 @@ public Builder putAllMetadata(Map map) { return this; } + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(PaymentLinkUpdateParams.NameCollection nameCollection) { + this.nameCollection = nameCollection; + return this; + } + + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(EmptyParam nameCollection) { + this.nameCollection = nameCollection; + return this; + } + /** * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. @@ -3394,6 +3415,284 @@ public Builder setMinimum(Long minimum) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection { + /** Controls settings applied for collecting the customer's business name. */ + @SerializedName("business") + Business business; + + /** + * 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; + + /** Controls settings applied for collecting the customer's individual name. */ + @SerializedName("individual") + Individual individual; + + private NameCollection( + Business business, Map extraParams, Individual individual) { + this.business = business; + this.extraParams = extraParams; + this.individual = individual; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Business business; + + private Map extraParams; + + private Individual individual; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection build() { + return new PaymentLinkUpdateParams.NameCollection( + this.business, this.extraParams, this.individual); + } + + /** Controls settings applied for collecting the customer's business name. */ + public Builder setBusiness(PaymentLinkUpdateParams.NameCollection.Business business) { + this.business = business; + 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 + * PaymentLinkUpdateParams.NameCollection#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 PaymentLinkUpdateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Controls settings applied for collecting the customer's individual name. */ + public Builder setIndividual(PaymentLinkUpdateParams.NameCollection.Individual individual) { + this.individual = individual; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Business { + /** + * Required. Enable business name collection on the payment link. Defaults to + * {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Business(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection.Business build() { + return new PaymentLinkUpdateParams.NameCollection.Business( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable business name collection on the payment link. Defaults + * to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Business#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 PaymentLinkUpdateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Individual { + /** + * Required. Enable individual name collection on the payment link. Defaults + * to {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Individual(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection.Individual build() { + return new PaymentLinkUpdateParams.NameCollection.Individual( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable individual name collection on the payment link. + * Defaults to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Individual#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 PaymentLinkUpdateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentIntentData { @@ -5481,6 +5780,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("link") LINK("link"), + @SerializedName("mb_way") + MB_WAY("mb_way"), + @SerializedName("mobilepay") MOBILEPAY("mobilepay"), diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index 4d99b399601..a8afe38dca3 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -159,6 +159,13 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("cashapp") Cashapp cashapp; + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and Metamask. + */ + @SerializedName("crypto") + Crypto crypto; + /** * Uses a customer’s cash balance * for the payment. The cash balance can be funded via a bank transfer. Check this page for more details. + */ + @SerializedName("mb_way") + MbWay mbWay; + /** * MobilePay is a single-use * card wallet payment method used in Denmark and Finland. It allows customers to expand, @@ -523,6 +539,7 @@ private PaymentMethodConfigurationCreateParams( Konbini konbini, KrCard krCard, Link link, + MbWay mbWay, Mobilepay mobilepay, Multibanco multibanco, String name, @@ -564,6 +581,7 @@ private PaymentMethodConfigurationCreateParams( this.card = card; this.cartesBancaires = cartesBancaires; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.expand = expand; @@ -580,6 +598,7 @@ private PaymentMethodConfigurationCreateParams( this.konbini = konbini; this.krCard = krCard; this.link = link; + this.mbWay = mbWay; this.mobilepay = mobilepay; this.multibanco = multibanco; this.name = name; @@ -645,6 +664,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -677,6 +698,8 @@ public static class Builder { private Link link; + private MbWay mbWay; + private Mobilepay mobilepay; private Multibanco multibanco; @@ -745,6 +768,7 @@ public PaymentMethodConfigurationCreateParams build() { this.card, this.cartesBancaires, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.expand, @@ -761,6 +785,7 @@ public PaymentMethodConfigurationCreateParams build() { this.konbini, this.krCard, this.link, + this.mbWay, this.mobilepay, this.multibanco, this.name, @@ -970,6 +995,16 @@ public Builder setCashapp(PaymentMethodConfigurationCreateParams.Cashapp cashapp return this; } + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and + * Metamask. + */ + public Builder setCrypto(PaymentMethodConfigurationCreateParams.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * Uses a customer’s cash * balance for the payment. The cash balance can be funded via a bank transfer. Check this @@ -1175,6 +1210,16 @@ public Builder setLink(PaymentMethodConfigurationCreateParams.Link link) { return this; } + /** + * MB WAY is the most popular wallet in Portugal. After entering their phone number in your + * checkout, customers approve the payment directly in their MB WAY app. Check this page for more details. + */ + public Builder setMbWay(PaymentMethodConfigurationCreateParams.MbWay mbWay) { + this.mbWay = mbWay; + return this; + } + /** * MobilePay is a single-use card wallet @@ -4246,6 +4291,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Crypto build() { + return new PaymentMethodConfigurationCreateParams.Crypto( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationCreateParams.Crypto#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -6563,6 +6773,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MbWay { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MbWay(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.MbWay build() { + return new PaymentMethodConfigurationCreateParams.MbWay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationCreateParams.MbWay#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Mobilepay { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index df04c36daf4..357a3b6e0ba 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -164,6 +164,13 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("cashapp") Cashapp cashapp; + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and Metamask. + */ + @SerializedName("crypto") + Crypto crypto; + /** * Uses a customer’s cash balance * for the payment. The cash balance can be funded via a bank transfer. Check this page for more details. + */ + @SerializedName("mb_way") + MbWay mbWay; + /** * MobilePay is a single-use * card wallet payment method used in Denmark and Finland. It allows customers to expand, @@ -525,6 +541,7 @@ private PaymentMethodConfigurationUpdateParams( Konbini konbini, KrCard krCard, Link link, + MbWay mbWay, Mobilepay mobilepay, Multibanco multibanco, Object name, @@ -566,6 +583,7 @@ private PaymentMethodConfigurationUpdateParams( this.card = card; this.cartesBancaires = cartesBancaires; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.expand = expand; @@ -582,6 +600,7 @@ private PaymentMethodConfigurationUpdateParams( this.konbini = konbini; this.krCard = krCard; this.link = link; + this.mbWay = mbWay; this.mobilepay = mobilepay; this.multibanco = multibanco; this.name = name; @@ -648,6 +667,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -680,6 +701,8 @@ public static class Builder { private Link link; + private MbWay mbWay; + private Mobilepay mobilepay; private Multibanco multibanco; @@ -747,6 +770,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.card, this.cartesBancaires, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.expand, @@ -763,6 +787,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.konbini, this.krCard, this.link, + this.mbWay, this.mobilepay, this.multibanco, this.name, @@ -977,6 +1002,16 @@ public Builder setCashapp(PaymentMethodConfigurationUpdateParams.Cashapp cashapp return this; } + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and + * Metamask. + */ + public Builder setCrypto(PaymentMethodConfigurationUpdateParams.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * Uses a customer’s cash * balance for the payment. The cash balance can be funded via a bank transfer. Check this @@ -1182,6 +1217,16 @@ public Builder setLink(PaymentMethodConfigurationUpdateParams.Link link) { return this; } + /** + * MB WAY is the most popular wallet in Portugal. After entering their phone number in your + * checkout, customers approve the payment directly in their MB WAY app. Check this page for more details. + */ + public Builder setMbWay(PaymentMethodConfigurationUpdateParams.MbWay mbWay) { + this.mbWay = mbWay; + return this; + } + /** * MobilePay is a single-use card wallet @@ -4253,6 +4298,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Crypto build() { + return new PaymentMethodConfigurationUpdateParams.Crypto( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationUpdateParams.Crypto#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -6570,6 +6780,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MbWay { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MbWay(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.MbWay build() { + return new PaymentMethodConfigurationUpdateParams.MbWay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationUpdateParams.MbWay#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Mobilepay { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index c078566d69a..da7e11fdb17 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -135,6 +135,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("crypto") Crypto crypto; + /** + * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom payment + * method. + */ + @SerializedName("custom") + Custom custom; + /** The {@code Customer} to whom the original PaymentMethod is attached. */ @SerializedName("customer") String customer; @@ -440,6 +447,7 @@ private PaymentMethodCreateParams( Object card, Cashapp cashapp, Crypto crypto, + Custom custom, String customer, CustomerBalance customerBalance, Eps eps, @@ -499,6 +507,7 @@ private PaymentMethodCreateParams( this.card = card; this.cashapp = cashapp; this.crypto = crypto; + this.custom = custom; this.customer = customer; this.customerBalance = customerBalance; this.eps = eps; @@ -582,6 +591,8 @@ public static class Builder { private Crypto crypto; + private Custom custom; + private String customer; private CustomerBalance customerBalance; @@ -686,6 +697,7 @@ public PaymentMethodCreateParams build() { this.card, this.cashapp, this.crypto, + this.custom, this.customer, this.customerBalance, this.eps, @@ -902,6 +914,15 @@ public Builder setCrypto(PaymentMethodCreateParams.Crypto crypto) { return this; } + /** + * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom + * payment method. + */ + public Builder setCustom(PaymentMethodCreateParams.Custom custom) { + this.custom = custom; + return this; + } + /** The {@code Customer} to whom the original PaymentMethod is attached. */ public Builder setCustomer(String customer) { this.customer = customer; @@ -2770,6 +2791,81 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class 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; + + /** + * Required. ID of the Dashboard-only CustomPaymentMethodType. This field is + * used by Stripe products' internal code to support CPMs. + */ + @SerializedName("type") + String type; + + private Custom(Map extraParams, String type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Custom build() { + return new PaymentMethodCreateParams.Custom(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.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 PaymentMethodCreateParams.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; + } + + /** + * Required. ID of the Dashboard-only CustomPaymentMethodType. This field is + * used by Stripe products' internal code to support CPMs. + */ + public Builder setType(String type) { + this.type = type; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -5764,6 +5860,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 601afa01c3b..86903b802ea 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -56,9 +56,9 @@ public class PaymentMethodListParams extends ApiRequestParams { String startingAfter; /** - * An optional filter on the list, based on the object {@code type} field. Without the filter, the - * list includes all current and future payment method types. If your integration expects only one - * type of payment method in the response, make sure to provide a type value in the request. + * Filters the list by the object {@code type} field. Unfiltered, the list returns all payment + * method types except {@code custom}. If your integration expects only one type of payment method + * in the response, specify that type value in the request to reduce your payload. */ @SerializedName("type") Type type; @@ -201,10 +201,9 @@ public Builder setStartingAfter(String startingAfter) { } /** - * An optional filter on the list, based on the object {@code type} field. Without the filter, - * the list includes all current and future payment method types. If your integration expects - * only one type of payment method in the response, make sure to provide a type value in the - * request. + * Filters the list by the object {@code type} field. Unfiltered, the list returns all payment + * method types except {@code custom}. If your integration expects only one type of payment + * method in the response, specify that type value in the request to reduce your payload. */ public Builder setType(PaymentMethodListParams.Type type) { this.type = type; @@ -258,6 +257,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), 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..0aad0a5bcaa --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptCanceledParams.java @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class 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") + Object metadata; + + private PaymentRecordReportPaymentAttemptCanceledParams( + Long canceledAt, List expand, Map extraParams, Object 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 Object 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. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + 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..6ce79b2039b --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptFailedParams.java @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class 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") + Object metadata; + + private PaymentRecordReportPaymentAttemptFailedParams( + List expand, Map extraParams, Long failedAt, Object 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 Object 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. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + 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..34b62376aa8 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptGuaranteedParams.java @@ -0,0 +1,168 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class 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") + Object metadata; + + private PaymentRecordReportPaymentAttemptGuaranteedParams( + List expand, Map extraParams, Long guaranteedAt, Object 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 Object 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. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptInformationalParams.java b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptInformationalParams.java new file mode 100644 index 00000000000..1aaf61e2087 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptInformationalParams.java @@ -0,0 +1,604 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecordReportPaymentAttemptInformationalParams extends ApiRequestParams { + /** Customer information for this payment. */ + @SerializedName("customer_details") + CustomerDetails customerDetails; + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + @SerializedName("description") + Object 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; + + /** + * 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") + Object metadata; + + /** Shipping information for this payment. */ + @SerializedName("shipping_details") + Object shippingDetails; + + private PaymentRecordReportPaymentAttemptInformationalParams( + CustomerDetails customerDetails, + Object description, + List expand, + Map extraParams, + Object metadata, + Object shippingDetails) { + this.customerDetails = customerDetails; + this.description = description; + this.expand = expand; + this.extraParams = extraParams; + this.metadata = metadata; + this.shippingDetails = shippingDetails; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomerDetails customerDetails; + + private Object description; + + private List expand; + + private Map extraParams; + + private Object metadata; + + private Object shippingDetails; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentAttemptInformationalParams build() { + return new PaymentRecordReportPaymentAttemptInformationalParams( + this.customerDetails, + this.description, + this.expand, + this.extraParams, + this.metadata, + this.shippingDetails); + } + + /** Customer information for this payment. */ + public Builder setCustomerDetails( + PaymentRecordReportPaymentAttemptInformationalParams.CustomerDetails customerDetails) { + this.customerDetails = customerDetails; + 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; + } + + /** An arbitrary string attached to the object. Often useful for displaying to users. */ + public Builder setDescription(EmptyParam 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 + * PaymentRecordReportPaymentAttemptInformationalParams#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 + * PaymentRecordReportPaymentAttemptInformationalParams#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 + * PaymentRecordReportPaymentAttemptInformationalParams#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 PaymentRecordReportPaymentAttemptInformationalParams#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 + * PaymentRecordReportPaymentAttemptInformationalParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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 PaymentRecordReportPaymentAttemptInformationalParams#metadata} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentAttemptInformationalParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails(EmptyParam shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + 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 PaymentRecordReportPaymentAttemptInformationalParams.CustomerDetails build() { + return new PaymentRecordReportPaymentAttemptInformationalParams.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 + * PaymentRecordReportPaymentAttemptInformationalParams.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 + * PaymentRecordReportPaymentAttemptInformationalParams.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 + @EqualsAndHashCode(callSuper = false) + 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 PaymentRecordReportPaymentAttemptInformationalParams.ShippingDetails build() { + return new PaymentRecordReportPaymentAttemptInformationalParams.ShippingDetails( + this.address, this.extraParams, this.name, this.phone); + } + + /** The physical shipping address. */ + public Builder setAddress( + PaymentRecordReportPaymentAttemptInformationalParams.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 + * PaymentRecordReportPaymentAttemptInformationalParams.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 + * PaymentRecordReportPaymentAttemptInformationalParams.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 + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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 PaymentRecordReportPaymentAttemptInformationalParams.ShippingDetails.Address + build() { + return new PaymentRecordReportPaymentAttemptInformationalParams.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; + } + + /** + * 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 + * PaymentRecordReportPaymentAttemptInformationalParams.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 + * PaymentRecordReportPaymentAttemptInformationalParams.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, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** 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; + } + } + } + } +} 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..aedcfec9878 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentAttemptParams.java @@ -0,0 +1,1221 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class 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") + Object 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, + Object 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 Object 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. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + + /** + * 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, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** 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 + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * 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; + + /** 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() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + 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.type); + } + + /** + * 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; + } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + + /** + * 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, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** 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..9ec23aaca3d --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportPaymentParams.java @@ -0,0 +1,1681 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecordReportPaymentParams extends ApiRequestParams { + /** Required. The amount you initially requested 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") + Object 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; + + /** Processor information for this payment. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** 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, + Object metadata, + Outcome outcome, + PaymentMethodDetails paymentMethodDetails, + ProcessorDetails processorDetails, + 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.processorDetails = processorDetails; + 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 Object metadata; + + private Outcome outcome; + + private PaymentMethodDetails paymentMethodDetails; + + private ProcessorDetails processorDetails; + + 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.processorDetails, + this.shippingDetails); + } + + /** Required. The amount you initially requested 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. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + 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; + } + + /** Processor information for this payment. */ + public Builder setProcessorDetails( + PaymentRecordReportPaymentParams.ProcessorDetails processorDetails) { + this.processorDetails = processorDetails; + return this; + } + + /** Shipping information for this payment. */ + public Builder setShippingDetails( + PaymentRecordReportPaymentParams.ShippingDetails shippingDetails) { + this.shippingDetails = shippingDetails; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + 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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @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 currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + + /** + * 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, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** 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 + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * 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; + + /** 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() { + return new Builder(); + } + + public static class Builder { + private String displayName; + + 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.type); + } + + /** + * 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; + } + + /** The custom payment method type associated with this payment. */ + public Builder setType(String type) { + this.type = type; + 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 + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails { + /** Information about the custom processor 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; + + /** + * Required. The type of the processor details. An additional hash is included + * on processor_details with a name matching this value. It contains additional information + * specific to the processor. + */ + @SerializedName("type") + Type type; + + private ProcessorDetails(Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.ProcessorDetails build() { + return new PaymentRecordReportPaymentParams.ProcessorDetails( + this.custom, this.extraParams, this.type); + } + + /** Information about the custom processor used to make this payment. */ + public Builder setCustom(PaymentRecordReportPaymentParams.ProcessorDetails.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.ProcessorDetails#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.ProcessorDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The type of the processor details. An additional hash is + * included on processor_details with a name matching this value. It contains additional + * information specific to the processor. + */ + public Builder setType(PaymentRecordReportPaymentParams.ProcessorDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class 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; + + /** + * 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; + + private Custom(Map extraParams, String paymentReference) { + this.extraParams = extraParams; + this.paymentReference = paymentReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportPaymentParams.ProcessorDetails.Custom build() { + return new PaymentRecordReportPaymentParams.ProcessorDetails.Custom( + this.extraParams, this.paymentReference); + } + + /** + * 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.ProcessorDetails.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.ProcessorDetails.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; + } + + /** + * 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; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + 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 + @EqualsAndHashCode(callSuper = false) + public static class Address { + /** City, district, suburb, town, or village. */ + @SerializedName("city") + String city; + + /** + * Two-letter country code (ISO + * 3166-1 alpha-2). + */ + @SerializedName("country") + String country; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Address line 1, such as the street, PO Box, or company name. */ + @SerializedName("line1") + String line1; + + /** Address line 2, such as the 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; + } + + /** + * 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, such as the street, PO Box, or company name. */ + public Builder setLine1(String line1) { + this.line1 = line1; + return this; + } + + /** Address line 2, such as the apartment, suite, unit, or building. */ + public Builder setLine2(String line2) { + this.line2 = line2; + return this; + } + + /** 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/PaymentRecordReportRefundParams.java b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java new file mode 100644 index 00000000000..992e5c875ce --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java @@ -0,0 +1,622 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecordReportRefundParams extends ApiRequestParams { + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + @SerializedName("amount") + Amount amount; + + /** 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; + + /** When the reported refund 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") + Object metadata; + + /** Required. The outcome of the reported refund. */ + @SerializedName("outcome") + Outcome outcome; + + /** Required. Processor information for this refund. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** Required. Information about the payment attempt refund. */ + @SerializedName("refunded") + Refunded refunded; + + private PaymentRecordReportRefundParams( + Amount amount, + List expand, + Map extraParams, + Long initiatedAt, + Object metadata, + Outcome outcome, + ProcessorDetails processorDetails, + Refunded refunded) { + this.amount = amount; + this.expand = expand; + this.extraParams = extraParams; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.processorDetails = processorDetails; + this.refunded = refunded; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Amount amount; + + private List expand; + + private Map extraParams; + + private Long initiatedAt; + + private Object metadata; + + private Outcome outcome; + + private ProcessorDetails processorDetails; + + private Refunded refunded; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams build() { + return new PaymentRecordReportRefundParams( + this.amount, + this.expand, + this.extraParams, + this.initiatedAt, + this.metadata, + this.outcome, + this.processorDetails, + this.refunded); + } + + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + public Builder setAmount(PaymentRecordReportRefundParams.Amount amount) { + this.amount = amount; + 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 + * PaymentRecordReportRefundParams#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 + * PaymentRecordReportRefundParams#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 + * PaymentRecordReportRefundParams#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 PaymentRecordReportRefundParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** When the reported refund 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 + * PaymentRecordReportRefundParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) 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 PaymentRecordReportRefundParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * 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}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Required. The outcome of the reported refund. */ + public Builder setOutcome(PaymentRecordReportRefundParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Required. Processor information for this refund. */ + public Builder setProcessorDetails( + PaymentRecordReportRefundParams.ProcessorDetails processorDetails) { + this.processorDetails = processorDetails; + return this; + } + + /** Required. Information about the payment attempt refund. */ + public Builder setRefunded(PaymentRecordReportRefundParams.Refunded refunded) { + this.refunded = refunded; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Amount { + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @SerializedName("value") + Long value; + + private Amount(String currency, Map extraParams, Long value) { + this.currency = currency; + this.extraParams = extraParams; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private Long value; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.Amount build() { + return new PaymentRecordReportRefundParams.Amount( + this.currency, this.extraParams, this.value); + } + + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams.Amount#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams.Amount#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails { + /** Information about the custom processor used to make this refund. */ + @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; + + /** + * Required. The type of the processor details. An additional hash is included + * on processor_details with a name matching this value. It contains additional information + * specific to the processor. + */ + @SerializedName("type") + Type type; + + private ProcessorDetails(Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.ProcessorDetails build() { + return new PaymentRecordReportRefundParams.ProcessorDetails( + this.custom, this.extraParams, this.type); + } + + /** Information about the custom processor used to make this refund. */ + public Builder setCustom(PaymentRecordReportRefundParams.ProcessorDetails.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 + * PaymentRecordReportRefundParams.ProcessorDetails#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 PaymentRecordReportRefundParams.ProcessorDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The type of the processor details. An additional hash is + * included on processor_details with a name matching this value. It contains additional + * information specific to the processor. + */ + public Builder setType(PaymentRecordReportRefundParams.ProcessorDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class 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; + + /** + * Required. A reference to the external refund. This field must be unique + * across all refunds. + */ + @SerializedName("refund_reference") + String refundReference; + + private Custom(Map extraParams, String refundReference) { + this.extraParams = extraParams; + this.refundReference = refundReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String refundReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.ProcessorDetails.Custom build() { + return new PaymentRecordReportRefundParams.ProcessorDetails.Custom( + this.extraParams, this.refundReference); + } + + /** + * 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 PaymentRecordReportRefundParams.ProcessorDetails.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 PaymentRecordReportRefundParams.ProcessorDetails.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; + } + + /** + * Required. A reference to the external refund. This field must be unique + * across all refunds. + */ + public Builder setRefundReference(String refundReference) { + this.refundReference = refundReference; + 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 + @EqualsAndHashCode(callSuper = false) + public static class Refunded { + /** + * 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 refund completed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("refunded_at") + Long refundedAt; + + private Refunded(Map extraParams, Long refundedAt) { + this.extraParams = extraParams; + this.refundedAt = refundedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long refundedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.Refunded build() { + return new PaymentRecordReportRefundParams.Refunded(this.extraParams, this.refundedAt); + } + + /** + * 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 + * PaymentRecordReportRefundParams.Refunded#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 PaymentRecordReportRefundParams.Refunded#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 refund completed. Measured in seconds since + * the Unix epoch. + */ + public Builder setRefundedAt(Long refundedAt) { + this.refundedAt = refundedAt; + return this; + } + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("refunded") + REFUNDED("refunded"); + + @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..af7ec8a5fd3 --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordRetrieveParams.java @@ -0,0 +1,100 @@ +// 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.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +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/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index a621bb1a5c7..d0d72cddfcb 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -61,6 +61,10 @@ public class SetupIntentCreateParams extends ApiRequestParams { @SerializedName("description") String description; + /** The list of payment method types to exclude from use with this SetupIntent. */ + @SerializedName("excluded_payment_method_types") + List excludedPaymentMethodTypes; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -184,6 +188,7 @@ private SetupIntentCreateParams( String confirmationToken, String customer, String description, + List excludedPaymentMethodTypes, List expand, Map extraParams, List flowDirections, @@ -205,6 +210,7 @@ private SetupIntentCreateParams( this.confirmationToken = confirmationToken; this.customer = customer; this.description = description; + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; this.expand = expand; this.extraParams = extraParams; this.flowDirections = flowDirections; @@ -239,6 +245,8 @@ public static class Builder { private String description; + private List excludedPaymentMethodTypes; + private List expand; private Map extraParams; @@ -278,6 +286,7 @@ public SetupIntentCreateParams build() { this.confirmationToken, this.customer, this.description, + this.excludedPaymentMethodTypes, this.expand, this.extraParams, this.flowDirections, @@ -359,6 +368,34 @@ public Builder setDescription(String description) { return this; } + /** + * Add an element to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addExcludedPaymentMethodType( + SetupIntentCreateParams.ExcludedPaymentMethodType element) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.add(element); + return this; + } + + /** + * Add all elements to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addAllExcludedPaymentMethodType( + List elements) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.addAll(elements); + 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 @@ -10693,6 +10730,159 @@ public Builder putAllExtraParam(Map map) { } } + public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("acss_debit") + ACSS_DEBIT("acss_debit"), + + @SerializedName("affirm") + AFFIRM("affirm"), + + @SerializedName("afterpay_clearpay") + AFTERPAY_CLEARPAY("afterpay_clearpay"), + + @SerializedName("alipay") + ALIPAY("alipay"), + + @SerializedName("alma") + ALMA("alma"), + + @SerializedName("amazon_pay") + AMAZON_PAY("amazon_pay"), + + @SerializedName("au_becs_debit") + AU_BECS_DEBIT("au_becs_debit"), + + @SerializedName("bacs_debit") + BACS_DEBIT("bacs_debit"), + + @SerializedName("bancontact") + BANCONTACT("bancontact"), + + @SerializedName("billie") + BILLIE("billie"), + + @SerializedName("blik") + BLIK("blik"), + + @SerializedName("boleto") + BOLETO("boleto"), + + @SerializedName("card") + CARD("card"), + + @SerializedName("cashapp") + CASHAPP("cashapp"), + + @SerializedName("crypto") + CRYPTO("crypto"), + + @SerializedName("customer_balance") + CUSTOMER_BALANCE("customer_balance"), + + @SerializedName("eps") + EPS("eps"), + + @SerializedName("fpx") + FPX("fpx"), + + @SerializedName("giropay") + GIROPAY("giropay"), + + @SerializedName("grabpay") + GRABPAY("grabpay"), + + @SerializedName("ideal") + IDEAL("ideal"), + + @SerializedName("kakao_pay") + KAKAO_PAY("kakao_pay"), + + @SerializedName("klarna") + KLARNA("klarna"), + + @SerializedName("konbini") + KONBINI("konbini"), + + @SerializedName("kr_card") + KR_CARD("kr_card"), + + @SerializedName("mb_way") + MB_WAY("mb_way"), + + @SerializedName("mobilepay") + MOBILEPAY("mobilepay"), + + @SerializedName("multibanco") + MULTIBANCO("multibanco"), + + @SerializedName("naver_pay") + NAVER_PAY("naver_pay"), + + @SerializedName("nz_bank_account") + NZ_BANK_ACCOUNT("nz_bank_account"), + + @SerializedName("oxxo") + OXXO("oxxo"), + + @SerializedName("p24") + P24("p24"), + + @SerializedName("pay_by_bank") + PAY_BY_BANK("pay_by_bank"), + + @SerializedName("payco") + PAYCO("payco"), + + @SerializedName("paynow") + PAYNOW("paynow"), + + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + + @SerializedName("promptpay") + PROMPTPAY("promptpay"), + + @SerializedName("revolut_pay") + REVOLUT_PAY("revolut_pay"), + + @SerializedName("samsung_pay") + SAMSUNG_PAY("samsung_pay"), + + @SerializedName("satispay") + SATISPAY("satispay"), + + @SerializedName("sepa_debit") + SEPA_DEBIT("sepa_debit"), + + @SerializedName("sofort") + SOFORT("sofort"), + + @SerializedName("swish") + SWISH("swish"), + + @SerializedName("twint") + TWINT("twint"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"), + + @SerializedName("wechat_pay") + WECHAT_PAY("wechat_pay"), + + @SerializedName("zip") + ZIP("zip"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ExcludedPaymentMethodType(String value) { + this.value = value; + } + } + public enum FlowDirection implements ApiRequestParams.EnumParam { @SerializedName("inbound") INBOUND("inbound"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index 4e41f335ac2..693ef09c43f 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -37,6 +37,10 @@ public class SetupIntentUpdateParams extends ApiRequestParams { @SerializedName("description") Object description; + /** The list of payment method types to exclude from use with this SetupIntent. */ + @SerializedName("excluded_payment_method_types") + Object excludedPaymentMethodTypes; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -110,6 +114,7 @@ private SetupIntentUpdateParams( Boolean attachToSelf, Object customer, Object description, + Object excludedPaymentMethodTypes, List expand, Map extraParams, List flowDirections, @@ -122,6 +127,7 @@ private SetupIntentUpdateParams( this.attachToSelf = attachToSelf; this.customer = customer; this.description = description; + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; this.expand = expand; this.extraParams = extraParams; this.flowDirections = flowDirections; @@ -144,6 +150,8 @@ public static class Builder { private Object description; + private Object excludedPaymentMethodTypes; + private List expand; private Map extraParams; @@ -168,6 +176,7 @@ public SetupIntentUpdateParams build() { this.attachToSelf, this.customer, this.description, + this.excludedPaymentMethodTypes, this.expand, this.extraParams, this.flowDirections, @@ -229,6 +238,55 @@ public Builder setDescription(EmptyParam description) { return this; } + /** + * Add an element to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentUpdateParams#excludedPaymentMethodTypes} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addExcludedPaymentMethodType( + SetupIntentUpdateParams.ExcludedPaymentMethodType element) { + if (this.excludedPaymentMethodTypes == null + || this.excludedPaymentMethodTypes instanceof EmptyParam) { + this.excludedPaymentMethodTypes = + new ArrayList(); + } + ((List) this.excludedPaymentMethodTypes) + .add(element); + return this; + } + + /** + * Add all elements to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentUpdateParams#excludedPaymentMethodTypes} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllExcludedPaymentMethodType( + List elements) { + if (this.excludedPaymentMethodTypes == null + || this.excludedPaymentMethodTypes instanceof EmptyParam) { + this.excludedPaymentMethodTypes = + new ArrayList(); + } + ((List) this.excludedPaymentMethodTypes) + .addAll(elements); + return this; + } + + /** The list of payment method types to exclude from use with this SetupIntent. */ + public Builder setExcludedPaymentMethodTypes(EmptyParam excludedPaymentMethodTypes) { + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; + return this; + } + + /** The list of payment method types to exclude from use with this SetupIntent. */ + public Builder setExcludedPaymentMethodTypes( + List excludedPaymentMethodTypes) { + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; + 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 @@ -10222,6 +10280,159 @@ public enum VerificationMethod implements ApiRequestParams.EnumParam { } } + public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("acss_debit") + ACSS_DEBIT("acss_debit"), + + @SerializedName("affirm") + AFFIRM("affirm"), + + @SerializedName("afterpay_clearpay") + AFTERPAY_CLEARPAY("afterpay_clearpay"), + + @SerializedName("alipay") + ALIPAY("alipay"), + + @SerializedName("alma") + ALMA("alma"), + + @SerializedName("amazon_pay") + AMAZON_PAY("amazon_pay"), + + @SerializedName("au_becs_debit") + AU_BECS_DEBIT("au_becs_debit"), + + @SerializedName("bacs_debit") + BACS_DEBIT("bacs_debit"), + + @SerializedName("bancontact") + BANCONTACT("bancontact"), + + @SerializedName("billie") + BILLIE("billie"), + + @SerializedName("blik") + BLIK("blik"), + + @SerializedName("boleto") + BOLETO("boleto"), + + @SerializedName("card") + CARD("card"), + + @SerializedName("cashapp") + CASHAPP("cashapp"), + + @SerializedName("crypto") + CRYPTO("crypto"), + + @SerializedName("customer_balance") + CUSTOMER_BALANCE("customer_balance"), + + @SerializedName("eps") + EPS("eps"), + + @SerializedName("fpx") + FPX("fpx"), + + @SerializedName("giropay") + GIROPAY("giropay"), + + @SerializedName("grabpay") + GRABPAY("grabpay"), + + @SerializedName("ideal") + IDEAL("ideal"), + + @SerializedName("kakao_pay") + KAKAO_PAY("kakao_pay"), + + @SerializedName("klarna") + KLARNA("klarna"), + + @SerializedName("konbini") + KONBINI("konbini"), + + @SerializedName("kr_card") + KR_CARD("kr_card"), + + @SerializedName("mb_way") + MB_WAY("mb_way"), + + @SerializedName("mobilepay") + MOBILEPAY("mobilepay"), + + @SerializedName("multibanco") + MULTIBANCO("multibanco"), + + @SerializedName("naver_pay") + NAVER_PAY("naver_pay"), + + @SerializedName("nz_bank_account") + NZ_BANK_ACCOUNT("nz_bank_account"), + + @SerializedName("oxxo") + OXXO("oxxo"), + + @SerializedName("p24") + P24("p24"), + + @SerializedName("pay_by_bank") + PAY_BY_BANK("pay_by_bank"), + + @SerializedName("payco") + PAYCO("payco"), + + @SerializedName("paynow") + PAYNOW("paynow"), + + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + + @SerializedName("promptpay") + PROMPTPAY("promptpay"), + + @SerializedName("revolut_pay") + REVOLUT_PAY("revolut_pay"), + + @SerializedName("samsung_pay") + SAMSUNG_PAY("samsung_pay"), + + @SerializedName("satispay") + SATISPAY("satispay"), + + @SerializedName("sepa_debit") + SEPA_DEBIT("sepa_debit"), + + @SerializedName("sofort") + SOFORT("sofort"), + + @SerializedName("swish") + SWISH("swish"), + + @SerializedName("twint") + TWINT("twint"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"), + + @SerializedName("wechat_pay") + WECHAT_PAY("wechat_pay"), + + @SerializedName("zip") + ZIP("zip"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ExcludedPaymentMethodType(String value) { + this.value = value; + } + } + public enum FlowDirection implements ApiRequestParams.EnumParam { @SerializedName("inbound") INBOUND("inbound"), diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 70634b3ab31..1d972678574 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -5816,6 +5816,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 831d799f7eb..0223a1f5cbc 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -6034,6 +6034,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index 97f43408949..857516bf055 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -489,6 +489,13 @@ public static class Company { @SerializedName("registration_number") String registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -539,6 +546,7 @@ private Company( String phone, Object registrationDate, String registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, @@ -563,6 +571,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -613,6 +622,8 @@ public static class Builder { private String registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -645,6 +656,7 @@ public TokenCreateParams.Account.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -853,6 +865,16 @@ public Builder setRegistrationNumber(String registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + TokenCreateParams.Account.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -1712,6 +1734,116 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * 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 IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Account.Company.RepresentativeDeclaration build() { + return new TokenCreateParams.Account.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The Unix timestamp marking when the representative declaration attestation was made. + */ + public Builder setDate(Long date) { + this.date = date; + 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 + * TokenCreateParams.Account.Company.RepresentativeDeclaration#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 + * TokenCreateParams.Account.Company.RepresentativeDeclaration#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 IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 3ec04d0eb21..dc6aa7204ef 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -630,7 +630,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2025_08_27_BASIL("2025-08-27.basil"), @SerializedName("2025-09-30.clover") - VERSION_2025_09_30_CLOVER("2025-09-30.clover"); + VERSION_2025_09_30_CLOVER("2025-09-30.clover"), + + @SerializedName("2025-10-29.clover") + VERSION_2025_10_29_CLOVER("2025-10-29.clover"); @Getter(onMethod_ = {@Override}) private final String value; @@ -674,6 +677,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("balance.available") BALANCE__AVAILABLE("balance.available"), + @SerializedName("balance_settings.updated") + BALANCE_SETTINGS__UPDATED("balance_settings.updated"), + @SerializedName("billing.alert.triggered") BILLING__ALERT__TRIGGERED("billing.alert.triggered"), @@ -924,6 +930,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.payment_action_required") INVOICE__PAYMENT_ACTION_REQUIRED("invoice.payment_action_required"), + @SerializedName("invoice.payment_attempt_required") + INVOICE__PAYMENT_ATTEMPT_REQUIRED("invoice.payment_attempt_required"), + @SerializedName("invoice.payment_failed") INVOICE__PAYMENT_FAILED("invoice.payment_failed"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index c931493b081..6065deb5fa2 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -296,6 +296,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("balance.available") BALANCE__AVAILABLE("balance.available"), + @SerializedName("balance_settings.updated") + BALANCE_SETTINGS__UPDATED("balance_settings.updated"), + @SerializedName("billing.alert.triggered") BILLING__ALERT__TRIGGERED("billing.alert.triggered"), @@ -546,6 +549,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.payment_action_required") INVOICE__PAYMENT_ACTION_REQUIRED("invoice.payment_action_required"), + @SerializedName("invoice.payment_attempt_required") + INVOICE__PAYMENT_ATTEMPT_REQUIRED("invoice.payment_attempt_required"), + @SerializedName("invoice.payment_failed") INVOICE__PAYMENT_FAILED("invoice.payment_failed"), diff --git a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java index 0ae18b100e3..d6f3383a14c 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java @@ -25,7 +25,7 @@ public class CreditGrantCreateParams extends ApiRequestParams { @SerializedName("applicability_config") ApplicabilityConfig applicabilityConfig; - /** Required. The category of this credit grant. */ + /** The category of this credit grant. It defaults to {@code paid} if not specified. */ @SerializedName("category") Category category; @@ -162,7 +162,7 @@ public Builder setApplicabilityConfig( return this; } - /** Required. The category of this credit grant. */ + /** The category of this credit grant. It defaults to {@code paid} if not specified. */ public Builder setCategory(CreditGrantCreateParams.Category category) { this.category = category; return this; diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java index d6db907fe3a..2b6d5ac1d0f 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java @@ -752,9 +752,21 @@ public static class PaymentMethodUpdate { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodUpdate(Boolean enabled, Map extraParams) { + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able to + * update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + @SerializedName("payment_method_configuration") + Object paymentMethodConfiguration; + + private PaymentMethodUpdate( + Boolean enabled, Map extraParams, Object paymentMethodConfiguration) { this.enabled = enabled; this.extraParams = extraParams; + this.paymentMethodConfiguration = paymentMethodConfiguration; } public static Builder builder() { @@ -766,10 +778,12 @@ public static class Builder { private Map extraParams; + private Object paymentMethodConfiguration; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationCreateParams.Features.PaymentMethodUpdate build() { return new ConfigurationCreateParams.Features.PaymentMethodUpdate( - this.enabled, this.extraParams); + this.enabled, this.extraParams, this.paymentMethodConfiguration); } /** Required. Whether the feature is enabled. */ @@ -805,6 +819,30 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } } } diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java index f8937cb78fe..cc2c2da7c24 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java @@ -803,9 +803,21 @@ public static class PaymentMethodUpdate { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodUpdate(Boolean enabled, Map extraParams) { + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able to + * update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + @SerializedName("payment_method_configuration") + Object paymentMethodConfiguration; + + private PaymentMethodUpdate( + Boolean enabled, Map extraParams, Object paymentMethodConfiguration) { this.enabled = enabled; this.extraParams = extraParams; + this.paymentMethodConfiguration = paymentMethodConfiguration; } public static Builder builder() { @@ -817,10 +829,12 @@ public static class Builder { private Map extraParams; + private Object paymentMethodConfiguration; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationUpdateParams.Features.PaymentMethodUpdate build() { return new ConfigurationUpdateParams.Features.PaymentMethodUpdate( - this.enabled, this.extraParams); + this.enabled, this.extraParams, this.paymentMethodConfiguration); } /** Required. Whether the feature is enabled. */ @@ -856,6 +870,30 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } } } diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 8b23c41c1fb..338a542d7fb 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -1802,7 +1802,11 @@ public static class BrandingSettings { @SerializedName("button_color") Object buttonColor; - /** A string to override the business name shown on the Checkout Session. */ + /** + * A string to override the business name shown on the Checkout Session. This only shows at the + * top of the Checkout page, and your business name still appears in terms, receipts, and other + * places. + */ @SerializedName("display_name") String displayName; @@ -1823,11 +1827,11 @@ public static class BrandingSettings { @SerializedName("font_family") ApiRequestParams.EnumParam fontFamily; - /** The icon for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The icon for the Checkout Session. For best results, use a square image. */ @SerializedName("icon") Icon icon; - /** The logo for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The logo for the Checkout Session. */ @SerializedName("logo") Logo logo; @@ -1932,7 +1936,11 @@ public Builder setButtonColor(EmptyParam buttonColor) { return this; } - /** A string to override the business name shown on the Checkout Session. */ + /** + * A string to override the business name shown on the Checkout Session. This only shows at + * the top of the Checkout page, and your business name still appears in terms, receipts, and + * other places. + */ public Builder setDisplayName(String displayName) { this.displayName = displayName; return this; @@ -1984,13 +1992,13 @@ public Builder setFontFamily(EmptyParam fontFamily) { return this; } - /** The icon for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The icon for the Checkout Session. For best results, use a square image. */ public Builder setIcon(SessionCreateParams.BrandingSettings.Icon icon) { this.icon = icon; return this; } - /** The logo for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The logo for the Checkout Session. */ public Builder setLogo(SessionCreateParams.BrandingSettings.Logo logo) { this.logo = logo; return this; @@ -7247,6 +7255,10 @@ public static class PaymentMethodOptions { @SerializedName("swish") Swish swish; + /** contains details about the TWINT payment method options. */ + @SerializedName("twint") + Twint twint; + /** contains details about the Us Bank Account payment method options. */ @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -7298,6 +7310,7 @@ private PaymentMethodOptions( SepaDebit sepaDebit, Sofort sofort, Swish swish, + Twint twint, UsBankAccount usBankAccount, WechatPay wechatPay) { this.acssDebit = acssDebit; @@ -7342,6 +7355,7 @@ private PaymentMethodOptions( this.sepaDebit = sepaDebit; this.sofort = sofort; this.swish = swish; + this.twint = twint; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; } @@ -7435,6 +7449,8 @@ public static class Builder { private Swish swish; + private Twint twint; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -7484,6 +7500,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.sepaDebit, this.sofort, this.swish, + this.twint, this.usBankAccount, this.wechatPay); } @@ -7764,6 +7781,12 @@ public Builder setSwish(SessionCreateParams.PaymentMethodOptions.Swish swish) { return this; } + /** contains details about the TWINT payment method options. */ + public Builder setTwint(SessionCreateParams.PaymentMethodOptions.Twint twint) { + this.twint = twint; + return this; + } + /** contains details about the Us Bank Account payment method options. */ public Builder setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { @@ -15088,6 +15111,128 @@ public Builder setReference(String reference) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Twint { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

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

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

When processing card payments, Stripe uses {@code setup_future_usage} to help you + * comply with regional legislation and network rules, such as SCA. + */ + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Twint.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { @@ -19351,6 +19496,9 @@ public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("kr_card") KR_CARD("kr_card"), + @SerializedName("mb_way") + MB_WAY("mb_way"), + @SerializedName("mobilepay") MOBILEPAY("mobilepay"), @@ -19684,6 +19832,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("link") LINK("link"), + @SerializedName("mb_way") + MB_WAY("mb_way"), + @SerializedName("mobilepay") MOBILEPAY("mobilepay"), diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index 537c6f76860..52cfac9b0c1 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -566,6 +566,10 @@ public static class CountryOptions { @SerializedName("tr") Tr tr; + /** Options for the registration in TW. */ + @SerializedName("tw") + Tw tw; + /** Options for the registration in TZ. */ @SerializedName("tz") Tz tz; @@ -697,6 +701,7 @@ private CountryOptions( Th th, Tj tj, Tr tr, + Tw tw, Tz tz, Ua ua, Ug ug, @@ -797,6 +802,7 @@ private CountryOptions( this.th = th; this.tj = tj; this.tr = tr; + this.tw = tw; this.tz = tz; this.ua = ua; this.ug = ug; @@ -994,6 +1000,8 @@ public static class Builder { private Tr tr; + private Tw tw; + private Tz tz; private Ua ua; @@ -1107,6 +1115,7 @@ public RegistrationCreateParams.CountryOptions build() { this.th, this.tj, this.tr, + this.tw, this.tz, this.ua, this.ug, @@ -1680,6 +1689,12 @@ public Builder setTr(RegistrationCreateParams.CountryOptions.Tr tr) { return this; } + /** Options for the registration in TW. */ + public Builder setTw(RegistrationCreateParams.CountryOptions.Tw tw) { + this.tw = tw; + return this; + } + /** Options for the registration in TZ. */ public Builder setTz(RegistrationCreateParams.CountryOptions.Tz tz) { this.tz = tz; @@ -15278,6 +15293,89 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tw { + /** + * 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. Type of registration to be created in {@code country}. */ + @SerializedName("type") + Type type; + + private Tw(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Tw build() { + return new RegistrationCreateParams.CountryOptions.Tw(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Tw#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 RegistrationCreateParams.CountryOptions.Tw#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. Type of registration to be created in {@code country}. */ + public Builder setType(RegistrationCreateParams.CountryOptions.Tw.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("simplified") + SIMPLIFIED("simplified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tz { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index 6938612156a..3f3eab84c58 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -701,6 +701,10 @@ public static class Tipping { @SerializedName("gbp") Gbp gbp; + /** Tipping configuration for GIP. */ + @SerializedName("gip") + Gip gip; + /** Tipping configuration for HKD. */ @SerializedName("hkd") Hkd hkd; @@ -760,6 +764,7 @@ private Tipping( Eur eur, Map extraParams, Gbp gbp, + Gip gip, Hkd hkd, Huf huf, Jpy jpy, @@ -782,6 +787,7 @@ private Tipping( this.eur = eur; this.extraParams = extraParams; this.gbp = gbp; + this.gip = gip; this.hkd = hkd; this.huf = huf; this.jpy = jpy; @@ -821,6 +827,8 @@ public static class Builder { private Gbp gbp; + private Gip gip; + private Hkd hkd; private Huf huf; @@ -858,6 +866,7 @@ public ConfigurationCreateParams.Tipping build() { this.eur, this.extraParams, this.gbp, + this.gip, this.hkd, this.huf, this.jpy, @@ -952,6 +961,12 @@ public Builder setGbp(ConfigurationCreateParams.Tipping.Gbp gbp) { return this; } + /** Tipping configuration for GIP. */ + public Builder setGip(ConfigurationCreateParams.Tipping.Gip gip) { + this.gip = gip; + return this; + } + /** Tipping configuration for HKD. */ public Builder setHkd(ConfigurationCreateParams.Tipping.Hkd hkd) { this.hkd = hkd; @@ -2357,6 +2372,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Gip { + /** + * 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; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Gip( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationCreateParams.Tipping.Gip build() { + return new ConfigurationCreateParams.Tipping.Gip( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * 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 ConfigurationCreateParams.Tipping.Gip#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 ConfigurationCreateParams.Tipping.Gip#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Hkd { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 316df33104a..46b847bd319 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -737,6 +737,10 @@ public static class Tipping { @SerializedName("gbp") Gbp gbp; + /** Tipping configuration for GIP. */ + @SerializedName("gip") + Gip gip; + /** Tipping configuration for HKD. */ @SerializedName("hkd") Hkd hkd; @@ -796,6 +800,7 @@ private Tipping( Eur eur, Map extraParams, Gbp gbp, + Gip gip, Hkd hkd, Huf huf, Jpy jpy, @@ -818,6 +823,7 @@ private Tipping( this.eur = eur; this.extraParams = extraParams; this.gbp = gbp; + this.gip = gip; this.hkd = hkd; this.huf = huf; this.jpy = jpy; @@ -857,6 +863,8 @@ public static class Builder { private Gbp gbp; + private Gip gip; + private Hkd hkd; private Huf huf; @@ -894,6 +902,7 @@ public ConfigurationUpdateParams.Tipping build() { this.eur, this.extraParams, this.gbp, + this.gip, this.hkd, this.huf, this.jpy, @@ -988,6 +997,12 @@ public Builder setGbp(ConfigurationUpdateParams.Tipping.Gbp gbp) { return this; } + /** Tipping configuration for GIP. */ + public Builder setGip(ConfigurationUpdateParams.Tipping.Gip gip) { + this.gip = gip; + return this; + } + /** Tipping configuration for HKD. */ public Builder setHkd(ConfigurationUpdateParams.Tipping.Hkd hkd) { this.hkd = hkd; @@ -2393,6 +2408,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Gip { + /** + * 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; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Gip( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationUpdateParams.Tipping.Gip build() { + return new ConfigurationUpdateParams.Tipping.Gip( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * 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 ConfigurationUpdateParams.Tipping.Gip#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 ConfigurationUpdateParams.Tipping.Gip#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 an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Hkd { diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java index efe83e3e0e8..e7bcf72ca73 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java @@ -26,7 +26,10 @@ public class ReaderCollectInputsParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. List of inputs to be collected using the Reader */ + /** + * Required. List of inputs to be collected from the customer using the Reader. + * Maximum 5 inputs. + */ @SerializedName("inputs") List inputs; @@ -348,11 +351,11 @@ public static class CustomText { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The skip button text. */ + /** Custom text for the skip button. Maximum 14 characters. */ @SerializedName("skip_button") String skipButton; - /** The submit button text. */ + /** Custom text for the submit button. Maximum 30 characters. */ @SerializedName("submit_button") String submitButton; @@ -428,13 +431,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The skip button text. */ + /** Custom text for the skip button. Maximum 14 characters. */ public Builder setSkipButton(String skipButton) { this.skipButton = skipButton; return this; } - /** The submit button text. */ + /** Custom text for the submit button. Maximum 30 characters. */ public Builder setSubmitButton(String submitButton) { this.submitButton = submitButton; return this; @@ -560,7 +563,10 @@ public static class Choice { @SerializedName("id") String id; - /** The style of the button which will be shown for this choice. */ + /** + * The style of the button which will be shown for this choice. Can be {@code primary} or + * {@code secondary}. + */ @SerializedName("style") Style style; @@ -628,7 +634,10 @@ public Builder setId(String id) { return this; } - /** The style of the button which will be shown for this choice. */ + /** + * The style of the button which will be shown for this choice. Can be {@code primary} or + * {@code secondary}. + */ public Builder setStyle(ReaderCollectInputsParams.Input.Selection.Choice.Style style) { this.style = style; return this; @@ -663,11 +672,14 @@ public enum Style implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Toggle { - /** The default value of the toggle. */ + /** The default value of the toggle. Can be {@code enabled} or {@code disabled}. */ @SerializedName("default_value") DefaultValue defaultValue; - /** The description which will be displayed for the toggle. */ + /** + * The description which will be displayed for the toggle. Maximum 50 characters. At least one + * of title or description must be provided. + */ @SerializedName("description") String description; @@ -680,7 +692,10 @@ public static class Toggle { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The title which will be displayed for the toggle. */ + /** + * The title which will be displayed for the toggle. Maximum 50 characters. At least one of + * title or description must be provided. + */ @SerializedName("title") String title; @@ -714,14 +729,17 @@ public ReaderCollectInputsParams.Input.Toggle build() { this.defaultValue, this.description, this.extraParams, this.title); } - /** The default value of the toggle. */ + /** The default value of the toggle. Can be {@code enabled} or {@code disabled}. */ public Builder setDefaultValue( ReaderCollectInputsParams.Input.Toggle.DefaultValue defaultValue) { this.defaultValue = defaultValue; return this; } - /** The description which will be displayed for the toggle. */ + /** + * The description which will be displayed for the toggle. Maximum 50 characters. At least + * one of title or description must be provided. + */ public Builder setDescription(String description) { this.description = description; return this; @@ -755,7 +773,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The title which will be displayed for the toggle. */ + /** + * The title which will be displayed for the toggle. Maximum 50 characters. At least one of + * title or description must be provided. + */ public Builder setTitle(String title) { this.title = title; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java index 251ac892a71..19a0d2d5dd4 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java @@ -13,7 +13,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderCollectPaymentMethodParams extends ApiRequestParams { - /** Configuration overrides. */ + /** + * Configuration overrides for this collection, such as tipping, surcharging, and customer + * cancellation settings. + */ @SerializedName("collect_config") CollectConfig collectConfig; @@ -30,7 +33,7 @@ public class ReaderCollectPaymentMethodParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to collect a payment method for. */ @SerializedName("payment_intent") String paymentIntent; @@ -64,7 +67,10 @@ public ReaderCollectPaymentMethodParams build() { this.collectConfig, this.expand, this.extraParams, this.paymentIntent); } - /** Configuration overrides. */ + /** + * Configuration overrides for this collection, such as tipping, surcharging, and customer + * cancellation settings. + */ public Builder setCollectConfig(ReaderCollectPaymentMethodParams.CollectConfig collectConfig) { this.collectConfig = collectConfig; return this; @@ -122,7 +128,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to collect a payment method for. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java index 766dba8d1cf..978c59329a7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java @@ -13,7 +13,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderConfirmPaymentIntentParams extends ApiRequestParams { - /** Configuration overrides. */ + /** Configuration overrides for this confirmation, such as surcharge settings and return URL. */ @SerializedName("confirm_config") ConfirmConfig confirmConfig; @@ -30,7 +30,7 @@ public class ReaderConfirmPaymentIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to confirm. */ @SerializedName("payment_intent") String paymentIntent; @@ -64,7 +64,7 @@ public ReaderConfirmPaymentIntentParams build() { this.confirmConfig, this.expand, this.extraParams, this.paymentIntent); } - /** Configuration overrides. */ + /** Configuration overrides for this confirmation, such as surcharge settings and return URL. */ public Builder setConfirmConfig(ReaderConfirmPaymentIntentParams.ConfirmConfig confirmConfig) { this.confirmConfig = confirmConfig; return this; @@ -122,7 +122,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to confirm. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java index e2fb109db94..e1ff2e6accd 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -375,7 +375,7 @@ public static class InteracPresent { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Card Number. */ + /** The Interac card number. */ @SerializedName("number") String number; @@ -425,7 +425,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Card Number. */ + /** The Interac card number. */ public Builder setNumber(String number) { this.number = number; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java index 826c2e8bcc9..1c151700007 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java @@ -26,11 +26,14 @@ public class ReaderProcessPaymentIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID */ + /** Required. The ID of the PaymentIntent to process on the reader. */ @SerializedName("payment_intent") String paymentIntent; - /** Configuration overrides. */ + /** + * Configuration overrides for this transaction, such as tipping and customer cancellation + * settings. + */ @SerializedName("process_config") ProcessConfig processConfig; @@ -116,13 +119,16 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID */ + /** Required. The ID of the PaymentIntent to process on the reader. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; } - /** Configuration overrides. */ + /** + * Configuration overrides for this transaction, such as tipping and customer cancellation + * settings. + */ public Builder setProcessConfig(ReaderProcessPaymentIntentParams.ProcessConfig processConfig) { this.processConfig = processConfig; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java index 74272ee0f8a..cae1b068ad7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java @@ -35,11 +35,11 @@ public class ReaderProcessSetupIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Configuration overrides. */ + /** Configuration overrides for this setup, such as MOTO and customer cancellation settings. */ @SerializedName("process_config") ProcessConfig processConfig; - /** Required. SetupIntent ID */ + /** Required. The ID of the SetupIntent to process on the reader. */ @SerializedName("setup_intent") String setupIntent; @@ -140,13 +140,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Configuration overrides. */ + /** Configuration overrides for this setup, such as MOTO and customer cancellation settings. */ public Builder setProcessConfig(ReaderProcessSetupIntentParams.ProcessConfig processConfig) { this.processConfig = processConfig; return this; } - /** Required. SetupIntent ID */ + /** Required. The ID of the SetupIntent to process on the reader. */ public Builder setSetupIntent(String setupIntent) { this.setupIntent = setupIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java b/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java index 69eeb69343e..dbfd525ecb1 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java @@ -58,7 +58,7 @@ public class ReaderRefundPaymentParams extends ApiRequestParams { @SerializedName("refund_application_fee") Boolean refundApplicationFee; - /** Configuration overrides. */ + /** Configuration overrides for this refund, such as customer cancellation settings. */ @SerializedName("refund_payment_config") RefundPaymentConfig refundPaymentConfig; @@ -237,7 +237,7 @@ public Builder setRefundApplicationFee(Boolean refundApplicationFee) { return this; } - /** Configuration overrides. */ + /** Configuration overrides for this refund, such as customer cancellation settings. */ public Builder setRefundPaymentConfig( ReaderRefundPaymentParams.RefundPaymentConfig refundPaymentConfig) { this.refundPaymentConfig = refundPaymentConfig; diff --git a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java index 1c1c79b1b1a..aa22daaa933 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java @@ -13,7 +13,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderSetReaderDisplayParams extends ApiRequestParams { - /** Cart. */ + /** Cart details to display on the reader screen, including line items, amounts, and currency. */ @SerializedName("cart") Cart cart; @@ -30,7 +30,10 @@ public class ReaderSetReaderDisplayParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Type */ + /** + * Required. Type of information to display. Only {@code cart} is currently + * supported. + */ @SerializedName("type") Type type; @@ -60,7 +63,9 @@ public ReaderSetReaderDisplayParams build() { return new ReaderSetReaderDisplayParams(this.cart, this.expand, this.extraParams, this.type); } - /** Cart. */ + /** + * Cart details to display on the reader screen, including line items, amounts, and currency. + */ public Builder setCart(ReaderSetReaderDisplayParams.Cart cart) { this.cart = cart; return this; @@ -118,7 +123,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Type */ + /** + * Required. Type of information to display. Only {@code cart} is currently + * supported. + */ public Builder setType(ReaderSetReaderDisplayParams.Type type) { this.type = type; return this; @@ -145,15 +153,21 @@ public static class Cart { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Array of line items that were purchased. */ + /** Required. Array of line items to display. */ @SerializedName("line_items") List lineItems; - /** The amount of tax in cents. */ + /** + * The amount of tax in the smallest + * currency unit. + */ @SerializedName("tax") Long tax; - /** Required. Total balance of cart due in cents. */ + /** + * Required. Total balance of cart due in the smallest currency unit. + */ @SerializedName("total") Long total; @@ -253,13 +267,19 @@ public Builder addAllLineItem(List e return this; } - /** The amount of tax in cents. */ + /** + * The amount of tax in the smallest + * currency unit. + */ public Builder setTax(Long tax) { this.tax = tax; return this; } - /** Required. Total balance of cart due in cents. */ + /** + * Required. Total balance of cart due in the smallest currency unit. + */ public Builder setTotal(Long total) { this.total = total; return this; @@ -269,7 +289,10 @@ public Builder setTotal(Long total) { @Getter @EqualsAndHashCode(callSuper = false) public static class LineItem { - /** Required. The price of the item in cents. */ + /** + * Required. The price of the item in the smallest currency unit. + */ @SerializedName("amount") Long amount; @@ -317,7 +340,10 @@ public ReaderSetReaderDisplayParams.Cart.LineItem build() { this.amount, this.description, this.extraParams, this.quantity); } - /** Required. The price of the item in cents. */ + /** + * Required. The price of the item in the smallest currency unit. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; diff --git a/src/main/java/com/stripe/param/v2/core/EventListParams.java b/src/main/java/com/stripe/param/v2/core/EventListParams.java index b80d95056b9..be4f3b17dbd 100644 --- a/src/main/java/com/stripe/param/v2/core/EventListParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventListParams.java @@ -3,7 +3,10 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.time.Instant; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,18 +23,51 @@ public class EventListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Filter for events created after the specified timestamp. */ + @SerializedName("gt") + Instant gt; + + /** Filter for events created at or after the specified timestamp. */ + @SerializedName("gte") + Instant gte; + /** The page size. */ @SerializedName("limit") Long limit; - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + @SerializedName("lt") + Instant lt; + + /** Filter for events created at or before the specified timestamp. */ + @SerializedName("lte") + Instant lte; + + /** Primary object ID used to retrieve related events. */ @SerializedName("object_id") String objectId; - private EventListParams(Map extraParams, Long limit, String objectId) { + /** An array of up to 20 strings containing specific event names. */ + @SerializedName("types") + List types; + + private EventListParams( + Map extraParams, + Instant gt, + Instant gte, + Long limit, + Instant lt, + Instant lte, + String objectId, + List types) { this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; this.limit = limit; + this.lt = lt; + this.lte = lte; this.objectId = objectId; + this.types = types; } public static Builder builder() { @@ -41,13 +77,31 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Instant gt; + + private Instant gte; + private Long limit; + private Instant lt; + + private Instant lte; + private String objectId; + private List types; + /** Finalize and obtain parameter instance from this builder. */ public EventListParams build() { - return new EventListParams(this.extraParams, this.limit, this.objectId); + return new EventListParams( + this.extraParams, + this.gt, + this.gte, + this.limit, + this.lt, + this.lte, + this.objectId, + this.types); } /** @@ -76,16 +130,66 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Filter for events created after the specified timestamp. */ + public Builder setGt(Instant gt) { + this.gt = gt; + return this; + } + + /** Filter for events created at or after the specified timestamp. */ + public Builder setGte(Instant gte) { + this.gte = gte; + return this; + } + /** The page size. */ public Builder setLimit(Long limit) { this.limit = limit; return this; } - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + public Builder setLt(Instant lt) { + this.lt = lt; + return this; + } + + /** Filter for events created at or before the specified timestamp. */ + public Builder setLte(Instant lte) { + this.lte = lte; + return this; + } + + /** Primary object ID used to retrieve related events. */ public Builder setObjectId(String objectId) { this.objectId = objectId; return this; } + + /** + * Add an element to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addType(String element) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.add(element); + return this; + } + + /** + * Add all elements to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addAllType(List elements) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.addAll(elements); + 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/PaymentIntentAmountDetailsLineItemService.java b/src/main/java/com/stripe/service/PaymentIntentAmountDetailsLineItemService.java new file mode 100644 index 00000000000..87f4a66d2b4 --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentIntentAmountDetailsLineItemService.java @@ -0,0 +1,55 @@ +// 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.PaymentIntentAmountDetailsLineItem; +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.PaymentIntentAmountDetailsLineItemListParams; + +public final class PaymentIntentAmountDetailsLineItemService extends ApiService { + public PaymentIntentAmountDetailsLineItemService(StripeResponseGetter responseGetter) { + super(responseGetter); + } + + /** Lists all LineItems of a given PaymentIntent. */ + public StripeCollection list( + String intent, PaymentIntentAmountDetailsLineItemListParams params) throws StripeException { + return list(intent, params, (RequestOptions) null); + } + /** Lists all LineItems of a given PaymentIntent. */ + public StripeCollection list( + String intent, RequestOptions options) throws StripeException { + return list(intent, (PaymentIntentAmountDetailsLineItemListParams) null, options); + } + /** Lists all LineItems of a given PaymentIntent. */ + public StripeCollection list(String intent) + throws StripeException { + return list(intent, (PaymentIntentAmountDetailsLineItemListParams) null, (RequestOptions) null); + } + /** Lists all LineItems of a given PaymentIntent. */ + public StripeCollection list( + String intent, PaymentIntentAmountDetailsLineItemListParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_intents/%s/amount_details_line_items", ApiResource.urlEncodeId(intent)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request( + request, + new TypeToken>() {}.getType()); + } +} diff --git a/src/main/java/com/stripe/service/PaymentIntentService.java b/src/main/java/com/stripe/service/PaymentIntentService.java index 4c5f5ce95b4..4baa049de19 100644 --- a/src/main/java/com/stripe/service/PaymentIntentService.java +++ b/src/main/java/com/stripe/service/PaymentIntentService.java @@ -667,4 +667,9 @@ public PaymentIntent verifyMicrodeposits( options); return this.request(request, PaymentIntent.class); } + + public com.stripe.service.PaymentIntentAmountDetailsLineItemService amountDetailsLineItems() { + return new com.stripe.service.PaymentIntentAmountDetailsLineItemService( + this.getResponseGetter()); + } } 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..8ab61a4ef4d --- /dev/null +++ b/src/main/java/com/stripe/service/PaymentRecordService.java @@ -0,0 +1,230 @@ +// 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.PaymentRecordReportPaymentAttemptInformationalParams; +import com.stripe.param.PaymentRecordReportPaymentAttemptParams; +import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordReportRefundParams; +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 informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational( + String id, PaymentRecordReportPaymentAttemptInformationalParams params) + throws StripeException { + return reportPaymentAttemptInformational(id, params, (RequestOptions) null); + } + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational(String id, RequestOptions options) + throws StripeException { + return reportPaymentAttemptInformational( + id, (PaymentRecordReportPaymentAttemptInformationalParams) null, options); + } + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational(String id) throws StripeException { + return reportPaymentAttemptInformational( + id, (PaymentRecordReportPaymentAttemptInformationalParams) null, (RequestOptions) null); + } + /** Report informational updates on the specified Payment Record. */ + public PaymentRecord reportPaymentAttemptInformational( + String id, + PaymentRecordReportPaymentAttemptInformationalParams params, + RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_payment_attempt_informational", + 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 refunded. */ + public PaymentRecord reportRefund(String id, PaymentRecordReportRefundParams params) + throws StripeException { + return reportRefund(id, params, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund( + String id, PaymentRecordReportRefundParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/payment_records/%s/report_refund", 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); + } +} diff --git a/src/main/java/com/stripe/service/PayoutService.java b/src/main/java/com/stripe/service/PayoutService.java index 5b0df02199a..b46edd7bcb7 100644 --- a/src/main/java/com/stripe/service/PayoutService.java +++ b/src/main/java/com/stripe/service/PayoutService.java @@ -218,8 +218,8 @@ public Payout cancel(String payout, PayoutCancelParams params, RequestOptions op } /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -230,8 +230,8 @@ public Payout reverse(String payout, PayoutReverseParams params) throws StripeEx } /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -242,8 +242,8 @@ public Payout reverse(String payout, RequestOptions options) throws StripeExcept } /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and @@ -254,8 +254,8 @@ public Payout reverse(String payout) throws StripeException { } /** * Reverses a payout by debiting the destination bank account. At this time, you can only reverse - * payouts for connected accounts to US bank accounts. If the payout is manual and in the {@code - * pending} status, use {@code /v1/payouts/:id/cancel} instead. + * payouts for connected accounts to US and Canadian bank accounts. If the payout is manual and in + * the {@code pending} status, use {@code /v1/payouts/:id/cancel} instead. * *

By requesting a reversal through {@code /v1/payouts/:id/reverse}, you confirm that the * authorized signatory of the selected bank account authorizes the debit on the bank account and diff --git a/src/main/java/com/stripe/service/V1Services.java b/src/main/java/com/stripe/service/V1Services.java index 0498022220d..1801908a9c6 100644 --- a/src/main/java/com/stripe/service/V1Services.java +++ b/src/main/java/com/stripe/service/V1Services.java @@ -153,6 +153,10 @@ public com.stripe.service.MandateService mandates() { return new com.stripe.service.MandateService(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()); } @@ -173,6 +177,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/service/financialconnections/AccountService.java b/src/main/java/com/stripe/service/financialconnections/AccountService.java index 6976aef0222..7a9d5421601 100644 --- a/src/main/java/com/stripe/service/financialconnections/AccountService.java +++ b/src/main/java/com/stripe/service/financialconnections/AccountService.java @@ -135,14 +135,14 @@ public Account refresh(String account, AccountRefreshParams params, RequestOptio } /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public Account subscribe(String account, AccountSubscribeParams params) throws StripeException { return subscribe(account, params, (RequestOptions) null); } /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public Account subscribe(String account, AccountSubscribeParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/terminal/ReaderService.java b/src/main/java/com/stripe/service/terminal/ReaderService.java index 6bd247bddbc..b96fc85fd5b 100644 --- a/src/main/java/com/stripe/service/terminal/ReaderService.java +++ b/src/main/java/com/stripe/service/terminal/ReaderService.java @@ -144,20 +144,36 @@ public Reader create(ReaderCreateParams params, RequestOptions options) throws S options); return this.request(request, Reader.class); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, ReaderCancelActionParams params) throws StripeException { return cancelAction(reader, params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, RequestOptions options) throws StripeException { return cancelAction(reader, (ReaderCancelActionParams) null, options); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader) throws StripeException { return cancelAction(reader, (ReaderCancelActionParams) null, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, ReaderCancelActionParams params, RequestOptions options) throws StripeException { String path = @@ -171,12 +187,20 @@ public Reader cancelAction(String reader, ReaderCancelActionParams params, Reque options); return this.request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(String reader, ReaderCollectInputsParams params) throws StripeException { return collectInputs(reader, params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs( String reader, ReaderCollectInputsParams params, RequestOptions options) throws StripeException { @@ -193,7 +217,9 @@ public Reader collectInputs( } /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodParams params) throws StripeException { @@ -201,7 +227,9 @@ public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodPara } /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod( String reader, ReaderCollectPaymentMethodParams params, RequestOptions options) @@ -218,12 +246,20 @@ public Reader collectPaymentMethod( options); return this.request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(String reader, ReaderConfirmPaymentIntentParams params) throws StripeException { return confirmPaymentIntent(reader, params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent( String reader, ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException { @@ -239,12 +275,20 @@ public Reader confirmPaymentIntent( options); return this.request(request, Reader.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(String reader, ReaderProcessPaymentIntentParams params) throws StripeException { return processPaymentIntent(reader, params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent( String reader, ReaderProcessPaymentIntentParams params, RequestOptions options) throws StripeException { @@ -260,12 +304,20 @@ public Reader processPaymentIntent( options); return this.request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(String reader, ReaderProcessSetupIntentParams params) throws StripeException { return processSetupIntent(reader, params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent( String reader, ReaderProcessSetupIntentParams params, RequestOptions options) throws StripeException { @@ -281,20 +333,36 @@ public Reader processSetupIntent( options); return this.request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader, ReaderRefundPaymentParams params) throws StripeException { return refundPayment(reader, params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader, RequestOptions options) throws StripeException { return refundPayment(reader, (ReaderRefundPaymentParams) null, options); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader) throws StripeException { return refundPayment(reader, (ReaderRefundPaymentParams) null, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment( String reader, ReaderRefundPaymentParams params, RequestOptions options) throws StripeException { @@ -309,12 +377,18 @@ public Reader refundPayment( options); return this.request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(String reader, ReaderSetReaderDisplayParams params) throws StripeException { return setReaderDisplay(reader, params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay( String reader, ReaderSetReaderDisplayParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/v2/core/EventService.java b/src/main/java/com/stripe/service/v2/core/EventService.java index 6a2cae51bbf..c461aa97db6 100644 --- a/src/main/java/com/stripe/service/v2/core/EventService.java +++ b/src/main/java/com/stripe/service/v2/core/EventService.java @@ -24,6 +24,14 @@ public StripeCollection list(EventListParams params) throws StripeExcepti return list(params, (RequestOptions) null); } /** List events, going back up to 30 days. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((EventListParams) null, options); + } + /** List events, going back up to 30 days. */ + public StripeCollection list() throws StripeException { + return list((EventListParams) null, (RequestOptions) null); + } + /** List events, going back up to 30 days. */ public StripeCollection list(EventListParams params, RequestOptions options) throws StripeException { String path = "/v2/core/events"; diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 0415b48e08e..c0a666945d2 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -24503,7 +24503,7 @@ public void testV2CoreEventGetServices() throws StripeException { StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.EventListParams params = - com.stripe.param.v2.core.EventListParams.builder().setObjectId("object_id").build(); + com.stripe.param.v2.core.EventListParams.builder().build(); com.stripe.model.v2.StripeCollection stripeCollection = client.v2().core().events().list(params);