diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 3fdaa4ab05d..e69de29bb2d 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +0,0 @@ -v1719 \ 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 69b0987197a..02176b8db3c 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,5 +2,5 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-04-30.basil"; + public static final String CURRENT = "2025-05-28.basil"; } diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index b15cbcc39d8..043a04fa4da 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1225,6 +1225,15 @@ public static class Capabilities extends StripeObject { @SerializedName("paynow_payments") String paynowPayments; + /** + * The status of the pix payments capability of the account, or whether the account can directly + * process pix charges. + * + *

One of {@code active}, {@code inactive}, or {@code pending}. + */ + @SerializedName("pix_payments") + String pixPayments; + /** * The status of the promptpay payments capability of the account, or whether the account can * directly process promptpay charges. diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index ec1f6523fcc..e40ef491a1b 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -135,6 +135,9 @@ public static class Components extends StripeObject { @SerializedName("balances") Balances balances; + @SerializedName("disputes_list") + DisputesList disputesList; + @SerializedName("documents") Documents documents; @@ -156,6 +159,9 @@ public static class Components extends StripeObject { @SerializedName("payment_details") PaymentDetails paymentDetails; + @SerializedName("payment_disputes") + PaymentDisputes paymentDisputes; + @SerializedName("payments") Payments payments; @@ -327,6 +333,56 @@ public static class Features extends StripeObject { } } + /** + * For more details about DisputesList, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class DisputesList extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * Whether to allow capturing and cancelling payment intents. This is {@code true} by + * default. + */ + @SerializedName("capture_payments") + Boolean capturePayments; + + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + @SerializedName("destination_on_behalf_of_charge_management") + Boolean destinationOnBehalfOfChargeManagement; + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + @SerializedName("dispute_management") + Boolean disputeManagement; + + /** Whether to allow sending refunds. This is {@code true} by default. */ + @SerializedName("refund_management") + Boolean refundManagement; + } + } + /** * For more details about Documents, please refer to the API Reference. @@ -613,6 +669,49 @@ public static class Features extends StripeObject { } } + /** + * For more details about PaymentDisputes, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDisputes extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + @SerializedName("destination_on_behalf_of_charge_management") + Boolean destinationOnBehalfOfChargeManagement; + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + @SerializedName("dispute_management") + Boolean disputeManagement; + + /** Whether to allow sending refunds. This is {@code true} by default. */ + @SerializedName("refund_management") + Boolean refundManagement; + } + } + /** * For more details about Payments, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/Balance.java b/src/main/java/com/stripe/model/Balance.java index 1e0c70549d6..217563f689f 100644 --- a/src/main/java/com/stripe/model/Balance.java +++ b/src/main/java/com/stripe/model/Balance.java @@ -81,6 +81,9 @@ public class Balance extends ApiResource { @SerializedName("pending") List pending; + @SerializedName("refund_and_dispute_prefunding") + RefundAndDisputePrefunding refundAndDisputePrefunding; + /** * Retrieves the current account balance, based on the authentication that was used to make the * request. For a sample request, see API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RefundAndDisputePrefunding extends StripeObject { + /** Funds that are available for use. */ + @SerializedName("available") + List available; + + /** Funds that are pending. */ + @SerializedName("pending") + List pending; + + /** + * For more details about Available, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Available extends StripeObject { + /** Balance amount. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + @SerializedName("source_types") + SourceTypes sourceTypes; + + /** + * For more details about SourceTypes, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SourceTypes extends StripeObject { + /** + * Amount coming from legacy US ACH + * payments. + */ + @SerializedName("bank_account") + Long bankAccount; + + /** + * Amount coming from most payment methods, including cards as well as non-legacy bank debits. + */ + @SerializedName("card") + Long card; + + /** + * Amount coming from FPX, a Malaysian + * payment method. + */ + @SerializedName("fpx") + Long fpx; + } + } + + /** + * For more details about Pending, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Pending extends StripeObject { + /** Balance amount. */ + @SerializedName("amount") + Long amount; + + /** + * Three-letter ISO currency + * code, in lowercase. Must be a supported + * currency. + */ + @SerializedName("currency") + String currency; + + @SerializedName("source_types") + SourceTypes sourceTypes; + + /** + * For more details about SourceTypes, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SourceTypes extends StripeObject { + /** + * Amount coming from legacy US ACH + * payments. + */ + @SerializedName("bank_account") + Long bankAccount; + + /** + * Amount coming from most payment methods, including cards as well as non-legacy bank debits. + */ + @SerializedName("card") + Long card; + + /** + * Amount coming from FPX, a Malaysian + * payment method. + */ + @SerializedName("fpx") + Long fpx; + } + } + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(issuing, responseGetter); + trySetResponseGetter(refundAndDisputePrefunding, responseGetter); } } diff --git a/src/main/java/com/stripe/model/BalanceTransaction.java b/src/main/java/com/stripe/model/BalanceTransaction.java index 5ea1c65f439..2c195229c91 100644 --- a/src/main/java/com/stripe/model/BalanceTransaction.java +++ b/src/main/java/com/stripe/model/BalanceTransaction.java @@ -40,6 +40,14 @@ public class BalanceTransaction extends ApiResource implements HasId { @SerializedName("available_on") Long availableOn; + /** + * The balance that this transaction impacts. + * + *

One of {@code issuing}, {@code payments}, or {@code refund_and_dispute_prefunding}. + */ + @SerializedName("balance_type") + String balanceType; + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ @SerializedName("created") Long created; diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java index 9ee8106dfbe..75dd78dfcbf 100644 --- a/src/main/java/com/stripe/model/Capability.java +++ b/src/main/java/com/stripe/model/Capability.java @@ -340,9 +340,11 @@ public static class Requirements extends StripeObject { List alternatives; /** - * Date by which the fields in {@code currently_due} must be collected to keep the capability - * enabled for the account. These fields may disable the capability sooner if the next threshold - * is reached before they are collected. + * The date by which all required account information must be both submitted and verified. This + * includes fields listed in {@code currently_due} as well as those in {@code + * pending_verification}. If any required information is missing or unverified by this date, the + * account may be disabled. Note that {@code current_deadline} may change if additional {@code + * currently_due} requirements are requested. */ @SerializedName("current_deadline") Long currentDeadline; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 5099bc9d71c..bb47e3291e7 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1431,6 +1431,20 @@ public static class AcssDebit extends StripeObject { @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; @@ -3827,6 +3841,20 @@ public static class WechatPay extends StripeObject { @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; diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index c064b70e851..8576cb7d60e 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -143,6 +143,20 @@ public class CreditNote extends ApiResource implements HasId, MetadataStore pretaxCreditAmounts; @@ -274,56 +288,58 @@ public void setInvoiceObject(Invoice expandableObject) { } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public static CreditNote create(Map params) throws StripeException { return create(params, (RequestOptions) null); } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public static CreditNote create(Map params, RequestOptions options) throws StripeException { @@ -334,56 +350,58 @@ public static CreditNote create(Map params, RequestOptions optio } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public static CreditNote create(CreditNoteCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public static CreditNote create(CreditNoteCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index 2e2b58447e1..e5bb2ce2a77 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -125,9 +125,10 @@ public class Dispute extends ApiResource * Reason given by cardholder for dispute. Possible values are {@code bank_cannot_process}, {@code * check_returned}, {@code credit_not_processed}, {@code customer_initiated}, {@code * debit_not_authorized}, {@code duplicate}, {@code fraudulent}, {@code general}, {@code - * incorrect_account_details}, {@code insufficient_funds}, {@code product_not_received}, {@code - * product_unacceptable}, {@code subscription_canceled}, or {@code unrecognized}. Learn more about - * dispute reasons. + * incorrect_account_details}, {@code insufficient_funds}, {@code noncompliant}, {@code + * product_not_received}, {@code product_unacceptable}, {@code subscription_canceled}, or {@code + * unrecognized}. Learn more about dispute + * reasons. */ @SerializedName("reason") String reason; diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index bf9c9585259..8259eb58f5c 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -62,6 +62,7 @@ public class Event extends ApiResource implements HasId { @SerializedName("api_version") String apiVersion; + /** Authentication context needed to fetch the event or related object. */ @SerializedName("context") String context; @@ -150,11 +151,12 @@ public class Event extends ApiResource implements HasId { * invoice.paid}, {@code invoice.payment_action_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 - * invoiceitem.created}, {@code invoiceitem.deleted}, {@code issuing_authorization.created}, - * {@code issuing_authorization.request}, {@code issuing_authorization.updated}, {@code - * issuing_card.created}, {@code issuing_card.updated}, {@code issuing_cardholder.created}, {@code - * issuing_cardholder.updated}, {@code issuing_dispute.closed}, {@code issuing_dispute.created}, - * {@code issuing_dispute.funds_reinstated}, {@code issuing_dispute.funds_rescinded}, {@code + * invoice_payment.paid}, {@code invoiceitem.created}, {@code invoiceitem.deleted}, {@code + * issuing_authorization.created}, {@code issuing_authorization.request}, {@code + * issuing_authorization.updated}, {@code issuing_card.created}, {@code issuing_card.updated}, + * {@code issuing_cardholder.created}, {@code issuing_cardholder.updated}, {@code + * issuing_dispute.closed}, {@code issuing_dispute.created}, {@code + * issuing_dispute.funds_reinstated}, {@code issuing_dispute.funds_rescinded}, {@code * issuing_dispute.submitted}, {@code issuing_dispute.updated}, {@code * issuing_personalization_design.activated}, {@code issuing_personalization_design.deactivated}, * {@code issuing_personalization_design.rejected}, {@code diff --git a/src/main/java/com/stripe/model/Invoice.java b/src/main/java/com/stripe/model/Invoice.java index 8bfbd15e59d..1e44d0a03d4 100644 --- a/src/main/java/com/stripe/model/Invoice.java +++ b/src/main/java/com/stripe/model/Invoice.java @@ -12,6 +12,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.InvoiceAddLinesParams; +import com.stripe.param.InvoiceAttachPaymentParams; import com.stripe.param.InvoiceCreateParams; import com.stripe.param.InvoiceCreatePreviewParams; import com.stripe.param.InvoiceFinalizeInvoiceParams; @@ -357,9 +358,9 @@ public class Invoice extends ApiResource implements HasId, MetadataStoreRetrieve an - * upcoming invoice for more details. + * Unique identifier for the object. For preview invoices created using the create preview endpoint, this id + * will be prefixed with {@code upcoming_in}. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -842,6 +843,130 @@ public Invoice addLines(InvoiceAddLinesParams params, RequestOptions options) return getResponseGetter().request(request, Invoice.class); } + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment() throws StripeException { + return attachPayment((Map) null, (RequestOptions) null); + } + + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(RequestOptions options) throws StripeException { + return attachPayment((Map) null, options); + } + + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(Map params) throws StripeException { + return attachPayment(params, (RequestOptions) null); + } + + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoices/%s/attach_payment", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Invoice.class); + } + + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(InvoiceAttachPaymentParams params) throws StripeException { + return attachPayment(params, (RequestOptions) null); + } + + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(InvoiceAttachPaymentParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/invoices/%s/attach_payment", 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, Invoice.class); + } + /** * This endpoint creates a draft invoice for a given customer. The invoice remains a draft until * you finalize the invoice, which @@ -902,19 +1027,20 @@ public static Invoice create(InvoiceCreateParams params, RequestOptions options) * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -929,19 +1055,20 @@ public static Invoice createPreview() throws StripeException { * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -956,19 +1083,20 @@ public static Invoice createPreview(RequestOptions options) throws StripeExcepti * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -983,19 +1111,20 @@ public static Invoice createPreview(Map params) throws StripeExc * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -1014,19 +1143,20 @@ public static Invoice createPreview(Map params, RequestOptions o * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -1041,19 +1171,20 @@ public static Invoice createPreview(InvoiceCreatePreviewParams params) throws St * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index 807afb0a190..d18f3752852 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -123,7 +123,7 @@ public class InvoiceItem extends ApiResource implements HasId, MetadataStoreInvoice resource. 2. By using the Invoice Payment + * retrieve and list endpoints. + * + *

Invoice Payments include the mapping between payment objects, such as Payment Intent, and + * Invoices. This resource and its endpoints allows you to easily track if a payment is associated + * with a specific invoice and monitor the allocation details of the payments. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -203,7 +212,11 @@ public static InvoicePayment retrieve( @Setter @EqualsAndHashCode(callSuper = false) public static class Payment extends StripeObject { - /** ID of the successful charge for this payment when {@code type} is {@code charge}. */ + /** + * ID of the successful charge for this payment when {@code type} is {@code charge}.Note: charge + * is only surfaced if the charge object is not associated with a payment intent. If the charge + * object does have a payment intent, the Invoice Payment surfaces the payment intent instead. + */ @SerializedName("charge") @Getter(lombok.AccessLevel.NONE) @Setter(lombok.AccessLevel.NONE) diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 62dc2725a3f..eb203e8210f 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -1562,8 +1562,9 @@ public static class NextAction extends StripeObject { SwishHandleRedirectOrDisplayQrCode swishHandleRedirectOrDisplayQrCode; /** - * Type of the next action to perform, one of {@code redirect_to_url}, {@code use_stripe_sdk}, - * {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code + * Type of the next action to perform. Refer to the other child attributes under {@code + * next_action} for available values. Examples include: {@code redirect_to_url}, {@code + * use_stripe_sdk}, {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code * verify_with_microdeposits}. */ @SerializedName("type") @@ -2599,6 +2600,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("samsung_pay") SamsungPay samsungPay; + @SerializedName("satispay") + Satispay satispay; + @SerializedName("sepa_debit") SepaDebit sepaDebit; @@ -3043,7 +3047,15 @@ public static class Bancontact extends StripeObject { @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Billie extends StripeObject {} + public static class Billie extends StripeObject { + /** + * Controls when the funds will be captured from the customer's account. + * + *

Equal to {@code manual}. + */ + @SerializedName("capture_method") + String captureMethod; + } /** * For more details about Blik, please refer to the API @@ -4471,6 +4483,23 @@ public static class SamsungPay extends StripeObject { String captureMethod; } + /** + * For more details about Satispay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Satispay extends StripeObject { + /** + * Controls when the funds will be captured from the customer's account. + * + *

Equal to {@code manual}. + */ + @SerializedName("capture_method") + String captureMethod; + } + /** * For more details about SepaDebit, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java index fa8e07d57e4..ad21e06edf3 100644 --- a/src/main/java/com/stripe/model/PaymentMethodConfiguration.java +++ b/src/main/java/com/stripe/model/PaymentMethodConfiguration.java @@ -141,12 +141,18 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("jcb") Jcb jcb; + @SerializedName("kakao_pay") + KakaoPay kakaoPay; + @SerializedName("klarna") Klarna klarna; @SerializedName("konbini") Konbini konbini; + @SerializedName("kr_card") + KrCard krCard; + @SerializedName("link") Link link; @@ -167,6 +173,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("name") String name; + @SerializedName("naver_pay") + NaverPay naverPay; + @SerializedName("nz_bank_account") NzBankAccount nzBankAccount; @@ -191,6 +200,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("pay_by_bank") PayByBank payByBank; + @SerializedName("payco") + Payco payco; + @SerializedName("paynow") Paynow paynow; @@ -206,6 +218,9 @@ public class PaymentMethodConfiguration extends ApiResource implements HasId { @SerializedName("revolut_pay") RevolutPay revolutPay; + @SerializedName("samsung_pay") + SamsungPay samsungPay; + @SerializedName("satispay") Satispay satispay; @@ -1608,6 +1623,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about KakaoPay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KakaoPay 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 Klarna, please refer to the API * Reference. @@ -1710,6 +1776,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about KrCard, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class KrCard 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 Link, please refer to the API * Reference. @@ -1863,6 +1980,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about NaverPay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NaverPay 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 NzBankAccount, please refer to the API Reference. @@ -2067,6 +2235,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about Payco, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Payco 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 Paynow, please refer to the API * Reference. @@ -2322,6 +2541,57 @@ public static class DisplayPreference extends StripeObject { } } + /** + * For more details about SamsungPay, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class SamsungPay 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 Satispay, please refer to the API * Reference. @@ -2757,20 +3027,25 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(grabpay, responseGetter); trySetResponseGetter(ideal, responseGetter); trySetResponseGetter(jcb, responseGetter); + trySetResponseGetter(kakaoPay, responseGetter); trySetResponseGetter(klarna, responseGetter); trySetResponseGetter(konbini, responseGetter); + trySetResponseGetter(krCard, responseGetter); trySetResponseGetter(link, responseGetter); trySetResponseGetter(mobilepay, responseGetter); trySetResponseGetter(multibanco, responseGetter); + trySetResponseGetter(naverPay, responseGetter); trySetResponseGetter(nzBankAccount, responseGetter); trySetResponseGetter(oxxo, responseGetter); trySetResponseGetter(p24, responseGetter); trySetResponseGetter(payByBank, responseGetter); + trySetResponseGetter(payco, responseGetter); trySetResponseGetter(paynow, responseGetter); trySetResponseGetter(paypal, responseGetter); trySetResponseGetter(pix, responseGetter); trySetResponseGetter(promptpay, responseGetter); trySetResponseGetter(revolutPay, responseGetter); + trySetResponseGetter(samsungPay, responseGetter); trySetResponseGetter(satispay, responseGetter); trySetResponseGetter(sepaDebit, responseGetter); trySetResponseGetter(sofort, responseGetter); diff --git a/src/main/java/com/stripe/model/Refund.java b/src/main/java/com/stripe/model/Refund.java index 32601a7a0c5..e8c42536368 100644 --- a/src/main/java/com/stripe/model/Refund.java +++ b/src/main/java/com/stripe/model/Refund.java @@ -1031,7 +1031,14 @@ public static class Paynow extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Paypal extends StripeObject {} + public static class Paypal extends StripeObject { + /** + * For refunds declined by the network, a decline code provided by the network which indicates + * the reason the refund failed. + */ + @SerializedName("network_decline_code") + String networkDeclineCode; + } /** * For more details about Pix, please refer to the API diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index d2526771c0e..937eccac83c 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -864,8 +864,9 @@ public static class NextAction extends StripeObject { RedirectToUrl redirectToUrl; /** - * Type of the next action to perform, one of {@code redirect_to_url}, {@code use_stripe_sdk}, - * {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code + * Type of the next action to perform. Refer to the other child attributes under {@code + * next_action} for available values. Examples include: {@code redirect_to_url}, {@code + * use_stripe_sdk}, {@code alipay_handle_redirect}, {@code oxxo_display_details}, or {@code * verify_with_microdeposits}. */ @SerializedName("type") diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index 71bfa902b8a..d258c52348d 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -49,20 +49,20 @@ public class StripeError extends StripeObject { * financial_connections_no_successful_transaction_refresh}, {@code forwarding_api_inactive}, * {@code forwarding_api_invalid_parameter}, {@code forwarding_api_retryable_upstream_error}, * {@code forwarding_api_upstream_connection_error}, {@code - * forwarding_api_upstream_connection_timeout}, {@code idempotency_key_in_use}, {@code - * incorrect_address}, {@code incorrect_cvc}, {@code incorrect_number}, {@code incorrect_zip}, - * {@code instant_payouts_config_disabled}, {@code instant_payouts_currency_disabled}, {@code - * instant_payouts_limit_exceeded}, {@code instant_payouts_unsupported}, {@code - * insufficient_funds}, {@code intent_invalid_state}, {@code intent_verification_method_missing}, - * {@code invalid_card_type}, {@code invalid_characters}, {@code invalid_charge_amount}, {@code - * invalid_cvc}, {@code invalid_expiry_month}, {@code invalid_expiry_year}, {@code - * invalid_mandate_reference_prefix_format}, {@code invalid_number}, {@code invalid_source_usage}, - * {@code invalid_tax_location}, {@code invoice_no_customer_line_items}, {@code - * invoice_no_payment_method_types}, {@code invoice_no_subscription_line_items}, {@code - * invoice_not_editable}, {@code invoice_on_behalf_of_not_editable}, {@code - * invoice_payment_intent_requires_action}, {@code invoice_upcoming_none}, {@code - * livemode_mismatch}, {@code lock_timeout}, {@code missing}, {@code no_account}, {@code - * not_allowed_on_standard_account}, {@code out_of_inventory}, {@code + * forwarding_api_upstream_connection_timeout}, {@code forwarding_api_upstream_error}, {@code + * idempotency_key_in_use}, {@code incorrect_address}, {@code incorrect_cvc}, {@code + * incorrect_number}, {@code incorrect_zip}, {@code instant_payouts_config_disabled}, {@code + * instant_payouts_currency_disabled}, {@code instant_payouts_limit_exceeded}, {@code + * instant_payouts_unsupported}, {@code insufficient_funds}, {@code intent_invalid_state}, {@code + * intent_verification_method_missing}, {@code invalid_card_type}, {@code invalid_characters}, + * {@code invalid_charge_amount}, {@code invalid_cvc}, {@code invalid_expiry_month}, {@code + * invalid_expiry_year}, {@code invalid_mandate_reference_prefix_format}, {@code invalid_number}, + * {@code invalid_source_usage}, {@code invalid_tax_location}, {@code + * invoice_no_customer_line_items}, {@code invoice_no_payment_method_types}, {@code + * invoice_no_subscription_line_items}, {@code invoice_not_editable}, {@code + * invoice_on_behalf_of_not_editable}, {@code invoice_payment_intent_requires_action}, {@code + * invoice_upcoming_none}, {@code livemode_mismatch}, {@code lock_timeout}, {@code missing}, + * {@code no_account}, {@code not_allowed_on_standard_account}, {@code out_of_inventory}, {@code * ownership_declaration_not_allowed}, {@code parameter_invalid_empty}, {@code * parameter_invalid_integer}, {@code parameter_invalid_string_blank}, {@code * parameter_invalid_string_empty}, {@code parameter_missing}, {@code parameter_unknown}, {@code diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index db7f3c93578..ee52d6fb3c1 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -65,13 +65,21 @@ public class Subscription extends ApiResource implements HasId, MetadataStoreAPI Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds extends StripeObject { + /** Monetary threshold that triggers the subscription to create an invoice. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Indicates if the {@code billing_cycle_anchor} should be reset when a threshold is reached. If + * true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was last + * reached; otherwise, the value will remain unchanged. This value may not be {@code true} if + * the subscription contains items with plans that have {@code aggregate_usage=last_ever}. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + } + /** * For more details about CancellationDetails, please refer to the API Reference. @@ -1997,6 +2030,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(application, responseGetter); trySetResponseGetter(automaticTax, responseGetter); trySetResponseGetter(billingCycleAnchorConfig, responseGetter); + trySetResponseGetter(billingThresholds, responseGetter); trySetResponseGetter(cancellationDetails, responseGetter); trySetResponseGetter(customer, responseGetter); trySetResponseGetter(defaultPaymentMethod, responseGetter); diff --git a/src/main/java/com/stripe/model/SubscriptionItem.java b/src/main/java/com/stripe/model/SubscriptionItem.java index dcb60abdee9..0314d07543a 100644 --- a/src/main/java/com/stripe/model/SubscriptionItem.java +++ b/src/main/java/com/stripe/model/SubscriptionItem.java @@ -30,6 +30,13 @@ @EqualsAndHashCode(callSuper = false) public class SubscriptionItem extends ApiResource implements HasId, MetadataStore { + /** + * Define thresholds at which an invoice will be sent, and the related subscription advanced to a + * new billing period. + */ + @SerializedName("billing_thresholds") + BillingThresholds billingThresholds; + /** Time at which the object was created. Measured in seconds since the Unix epoch. */ @SerializedName("created") Long created; @@ -380,9 +387,23 @@ public SubscriptionItem update(SubscriptionItemUpdateParams params, RequestOptio return getResponseGetter().request(request, SubscriptionItem.class); } + /** + * For more details about BillingThresholds, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds extends StripeObject { + /** Usage threshold that triggers the subscription to create an invoice. */ + @SerializedName("usage_gte") + Long usageGte; + } + @Override public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); + trySetResponseGetter(billingThresholds, responseGetter); trySetResponseGetter(plan, responseGetter); trySetResponseGetter(price, responseGetter); } diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index 12fd129cdba..b2536e3a58e 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -603,6 +603,13 @@ public static class DefaultSettings extends StripeObject { @SerializedName("billing_cycle_anchor") String billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. + */ + @SerializedName("billing_thresholds") + BillingThresholds billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -758,6 +765,29 @@ public void setAccountObject(Account expandableObject) { } } + /** + * For more details about BillingThresholds, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds extends StripeObject { + /** Monetary threshold that triggers the subscription to create an invoice. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Indicates if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. This value may not be {@code + * true} if the subscription contains items with plans that have {@code + * aggregate_usage=last_ever}. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + } + /** * For more details about InvoiceSettings, please refer to the API Reference. @@ -950,6 +980,13 @@ public static class Phase extends StripeObject { @SerializedName("billing_cycle_anchor") String billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. + */ + @SerializedName("billing_thresholds") + BillingThresholds billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -1035,8 +1072,8 @@ public static class Phase extends StripeObject { ExpandableField onBehalfOf; /** - * If the subscription schedule will prorate when transitioning to this phase. Possible values - * are {@code create_prorations} and {@code none}. + * When transitioning phases, controls how prorations are handled (if any). Possible values are + * {@code create_prorations}, {@code none}, and {@code always_invoice}. * *

One of {@code always_invoice}, {@code create_prorations}, or {@code none}. */ @@ -1298,6 +1335,29 @@ public void setAccountObject(Account expandableObject) { } } + /** + * For more details about BillingThresholds, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds extends StripeObject { + /** Monetary threshold that triggers the subscription to create an invoice. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Indicates if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. This value may not be {@code + * true} if the subscription contains items with plans that have {@code + * aggregate_usage=last_ever}. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + } + /** * For more details about Discount, please refer to the API Reference. @@ -1503,6 +1563,13 @@ public void setAccountObject(Account expandableObject) { @Setter @EqualsAndHashCode(callSuper = false) public static class Item extends StripeObject { + /** + * Define thresholds at which an invoice will be sent, and the related subscription advanced + * to a new billing period. + */ + @SerializedName("billing_thresholds") + BillingThresholds billingThresholds; + /** * The discounts applied to the subscription item. Subscription item discounts are applied * before subscription discounts. Use {@code expand[]=discounts} to expand each discount. @@ -1577,6 +1644,19 @@ public void setPriceObject(Price expandableObject) { this.price = new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * For more details about BillingThresholds, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds extends StripeObject { + /** Usage threshold that triggers the subscription to create an invoice. */ + @SerializedName("usage_gte") + Long usageGte; + } + /** * For more details about Discount, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 81d54bb35bb..1b6017d5452 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -413,7 +413,10 @@ public class Session extends ApiResource implements HasId, MetadataStoreSubscription for Checkout + * Sessions in {@code subscription} mode. + */ @SerializedName("subscription") @Getter(lombok.AccessLevel.NONE) @Setter(lombok.AccessLevel.NONE) @@ -803,13 +806,23 @@ public static Session retrieve( return getGlobalResponseGetter().request(request, Session.class); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ @Override public Session update(Map params) throws StripeException { return update(params, (RequestOptions) null); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ @Override public Session update(Map params, RequestOptions options) throws StripeException { String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(this.getId())); @@ -818,12 +831,22 @@ public Session update(Map params, RequestOptions options) throws return getResponseGetter().request(request, Session.class); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(SessionUpdateParams params) throws StripeException { return update(params, (RequestOptions) null); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(SessionUpdateParams params, RequestOptions options) throws StripeException { String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(this.getId())); ApiResource.checkNullTypedParams(path, params); @@ -2967,6 +2990,30 @@ public static class NaverPay extends StripeObject { */ @SerializedName("capture_method") String captureMethod; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

One of {@code none}, or {@code off_session}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; } /** diff --git a/src/main/java/com/stripe/model/identity/VerificationReport.java b/src/main/java/com/stripe/model/identity/VerificationReport.java index ee0fef5d21a..e67fdcb1618 100644 --- a/src/main/java/com/stripe/model/identity/VerificationReport.java +++ b/src/main/java/com/stripe/model/identity/VerificationReport.java @@ -232,6 +232,14 @@ public static class Document extends StripeObject { @SerializedName("number") String number; + /** + * Sex of the person in the document. + * + *

One of {@code [redacted]}, {@code female}, {@code male}, or {@code unknown}. + */ + @SerializedName("sex") + String sex; + /** * Status of this {@code document} check. * @@ -248,6 +256,14 @@ public static class Document extends StripeObject { @SerializedName("type") String type; + /** Place of birth as it appears in the document. */ + @SerializedName("unparsed_place_of_birth") + String unparsedPlaceOfBirth; + + /** Sex as it appears in the document. */ + @SerializedName("unparsed_sex") + String unparsedSex; + /** Point in Time. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/identity/VerificationSession.java b/src/main/java/com/stripe/model/identity/VerificationSession.java index c38ef759f91..e065eed169b 100644 --- a/src/main/java/com/stripe/model/identity/VerificationSession.java +++ b/src/main/java/com/stripe/model/identity/VerificationSession.java @@ -875,6 +875,22 @@ public static class VerifiedOutputs extends StripeObject { @SerializedName("phone") String phone; + /** + * The user's verified sex. + * + *

One of {@code [redacted]}, {@code female}, {@code male}, or {@code unknown}. + */ + @SerializedName("sex") + String sex; + + /** The user's verified place of birth as it appears in the document. */ + @SerializedName("unparsed_place_of_birth") + String unparsedPlaceOfBirth; + + /** The user's verified sex as it appears in the document. */ + @SerializedName("unparsed_sex") + String unparsedSex; + /** Point in Time. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/tax/CalculationLineItem.java b/src/main/java/com/stripe/model/tax/CalculationLineItem.java index cd2fe05f733..157223e51d5 100644 --- a/src/main/java/com/stripe/model/tax/CalculationLineItem.java +++ b/src/main/java/com/stripe/model/tax/CalculationLineItem.java @@ -5,6 +5,7 @@ import com.stripe.model.HasId; import com.stripe.model.StripeObject; import java.util.List; +import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; import lombok.Setter; @@ -40,6 +41,14 @@ public class CalculationLineItem extends StripeObject implements HasId { @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. * diff --git a/src/main/java/com/stripe/model/terminal/Reader.java b/src/main/java/com/stripe/model/terminal/Reader.java index 49283fa0e3d..d8b5d3c0fa1 100644 --- a/src/main/java/com/stripe/model/terminal/Reader.java +++ b/src/main/java/com/stripe/model/terminal/Reader.java @@ -18,6 +18,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.terminal.ReaderCancelActionParams; +import com.stripe.param.terminal.ReaderCollectInputsParams; import com.stripe.param.terminal.ReaderCreateParams; import com.stripe.param.terminal.ReaderListParams; import com.stripe.param.terminal.ReaderPresentPaymentMethodParams; @@ -26,6 +27,8 @@ import com.stripe.param.terminal.ReaderRefundPaymentParams; import com.stripe.param.terminal.ReaderRetrieveParams; import com.stripe.param.terminal.ReaderSetReaderDisplayParams; +import com.stripe.param.terminal.ReaderSucceedInputCollectionParams; +import com.stripe.param.terminal.ReaderTimeoutInputCollectionParams; import com.stripe.param.terminal.ReaderUpdateParams; import java.util.List; import java.util.Map; @@ -56,9 +59,11 @@ public class Reader extends ApiResource implements HasId, MetadataStore String deviceSwVersion; /** - * Type of reader, one of {@code bbpos_wisepad3}, {@code stripe_m2}, {@code stripe_s700}, {@code - * bbpos_chipper2x}, {@code bbpos_wisepos_e}, {@code verifone_P400}, {@code simulated_wisepos_e}, - * or {@code mobile_phone_reader}. + * Device type of the reader. + * + *

One of {@code bbpos_chipper2x}, {@code bbpos_wisepad3}, {@code bbpos_wisepos_e}, {@code + * mobile_phone_reader}, {@code simulated_stripe_s700}, {@code simulated_wisepos_e}, {@code + * stripe_m2}, {@code stripe_s700}, or {@code verifone_P400}. */ @SerializedName("device_type") String deviceType; @@ -185,6 +190,44 @@ public Reader cancelAction(ReaderCancelActionParams params, RequestOptions optio return getResponseGetter().request(request, Reader.class); } + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs(Map params) throws StripeException { + return collectInputs(params, (RequestOptions) null); + } + + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/collect_inputs", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Reader.class); + } + + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs(ReaderCollectInputsParams params) throws StripeException { + return collectInputs(params, (RequestOptions) null); + } + + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/collect_inputs", 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, Reader.class); + } + /** Creates a new {@code Reader} object. */ public static Reader create(Map params) throws StripeException { return create(params, (RequestOptions) null); @@ -526,6 +569,10 @@ public Reader update(ReaderUpdateParams params, RequestOptions options) throws S @Setter @EqualsAndHashCode(callSuper = false) public static class Action extends StripeObject { + /** Represents a reader action to collect customer inputs. */ + @SerializedName("collect_inputs") + CollectInputs collectInputs; + /** Failure code, only set if status is {@code failed}. */ @SerializedName("failure_code") String failureCode; @@ -561,12 +608,229 @@ public static class Action extends StripeObject { /** * Type of action performed by the reader. * - *

One of {@code process_payment_intent}, {@code process_setup_intent}, {@code - * refund_payment}, or {@code set_reader_display}. + *

One of {@code collect_inputs}, {@code process_payment_intent}, {@code + * process_setup_intent}, {@code refund_payment}, or {@code set_reader_display}. */ @SerializedName("type") String type; + /** Represents a reader action to collect customer inputs. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CollectInputs extends StripeObject { + /** List of inputs to be collected. */ + @SerializedName("inputs") + List inputs; + + /** + * 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; + + /** Represents an input to be collected using the reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Input extends StripeObject { + /** Default text of input being collected. */ + @SerializedName("custom_text") + CustomText customText; + + /** Information about a email being collected using a reader. */ + @SerializedName("email") + Email email; + + /** Information about a number being collected using a reader. */ + @SerializedName("numeric") + Numeric numeric; + + /** Information about a phone number being collected using a reader. */ + @SerializedName("phone") + Phone phone; + + /** Indicate that this input is required, disabling the skip button. */ + @SerializedName("required") + Boolean required; + + /** Information about a selection being collected using a reader. */ + @SerializedName("selection") + Selection selection; + + /** Information about a signature being collected using a reader. */ + @SerializedName("signature") + Signature signature; + + /** Indicate that this input was skipped by the user. */ + @SerializedName("skipped") + Boolean skipped; + + /** Information about text being collected using a reader. */ + @SerializedName("text") + Text text; + + /** List of toggles being collected. Values are present if collection is complete. */ + @SerializedName("toggles") + List toggles; + + /** + * Type of input being collected. + * + *

One of {@code email}, {@code numeric}, {@code phone}, {@code selection}, {@code + * signature}, or {@code text}. + */ + @SerializedName("type") + String type; + + /** Represents custom text to be displayed when collecting the input using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CustomText extends StripeObject { + /** Customize the default description for this input. */ + @SerializedName("description") + String description; + + /** Customize the default label for this input's skip button. */ + @SerializedName("skip_button") + String skipButton; + + /** Customize the default label for this input's submit button. */ + @SerializedName("submit_button") + String submitButton; + + /** Customize the default title for this input. */ + @SerializedName("title") + String title; + } + + /** Information about a email being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Email extends StripeObject { + /** The collected email address. */ + @SerializedName("value") + String value; + } + + /** Information about a number being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Numeric extends StripeObject { + /** The collected number. */ + @SerializedName("value") + String value; + } + + /** Information about a phone number being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Phone extends StripeObject { + /** The collected phone number. */ + @SerializedName("value") + String value; + } + + /** Information about a selection being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Selection extends StripeObject implements HasId { + /** List of possible choices to be selected. */ + @SerializedName("choices") + List choices; + + /** The id of the selected choice. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** The text of the selected choice. */ + @SerializedName("text") + String text; + + /** Choice to be selected on a Reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Choice extends StripeObject implements HasId { + /** The id to be selected. */ + @Getter(onMethod_ = {@Override}) + @SerializedName("id") + String id; + + /** + * The button style for the choice + * + *

One of {@code primary}, or {@code secondary}. + */ + @SerializedName("style") + String style; + + /** The text to be selected. */ + @SerializedName("text") + String text; + } + } + + /** Information about a signature being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Signature extends StripeObject { + /** The File ID of a collected signature image. */ + @SerializedName("value") + String value; + } + + /** Information about text being collected using a reader. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Text extends StripeObject { + /** The collected text value. */ + @SerializedName("value") + String value; + } + + /** Information about an input's toggle. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Toggle extends StripeObject { + /** + * The toggle's default value + * + *

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

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("value") + String value; + } + } + } + /** Represents a reader action to process a payment intent. */ @Getter @Setter @@ -610,6 +874,13 @@ public static class ProcessConfig extends StripeObject { @SerializedName("enable_customer_cancellation") Boolean enableCustomerCancellation; + /** + * If the customer does not abandon authenticating the payment, they will be redirected to + * this specified URL after completion. + */ + @SerializedName("return_url") + String returnUrl; + /** Override showing a tipping selection screen on this transaction. */ @SerializedName("skip_tipping") Boolean skipTipping; @@ -970,6 +1241,120 @@ public Reader presentPaymentMethod( options); return resource.getResponseGetter().request(request, Reader.class); } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection() throws StripeException { + return succeedInputCollection((Map) null, (RequestOptions) null); + } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(RequestOptions options) throws StripeException { + return succeedInputCollection((Map) null, options); + } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(Map params) throws StripeException { + return succeedInputCollection(params, (RequestOptions) null); + } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/succeed_input_collection", + ApiResource.urlEncodeId(this.resource.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return resource.getResponseGetter().request(request, Reader.class); + } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(ReaderSucceedInputCollectionParams params) + throws StripeException { + return succeedInputCollection(params, (RequestOptions) null); + } + + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection( + ReaderSucceedInputCollectionParams params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/succeed_input_collection", + ApiResource.urlEncodeId(this.resource.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return resource.getResponseGetter().request(request, Reader.class); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection() throws StripeException { + return timeoutInputCollection((Map) null, (RequestOptions) null); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(RequestOptions options) throws StripeException { + return timeoutInputCollection((Map) null, options); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(Map params) throws StripeException { + return timeoutInputCollection(params, (RequestOptions) null); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/timeout_input_collection", + ApiResource.urlEncodeId(this.resource.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return resource.getResponseGetter().request(request, Reader.class); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(ReaderTimeoutInputCollectionParams params) + throws StripeException { + return timeoutInputCollection(params, (RequestOptions) null); + } + + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection( + ReaderTimeoutInputCollectionParams params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/timeout_input_collection", + ApiResource.urlEncodeId(this.resource.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return resource.getResponseGetter().request(request, Reader.class); + } } @Override diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 57fc58b52aa..e503d5709bf 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -1448,6 +1448,10 @@ public static class Capabilities { @SerializedName("paynow_payments") PaynowPayments paynowPayments; + /** The pix_payments capability. */ + @SerializedName("pix_payments") + PixPayments pixPayments; + /** The promptpay_payments capability. */ @SerializedName("promptpay_payments") PromptpayPayments promptpayPayments; @@ -1555,6 +1559,7 @@ private Capabilities( PayByBankPayments payByBankPayments, PaycoPayments paycoPayments, PaynowPayments paynowPayments, + PixPayments pixPayments, PromptpayPayments promptpayPayments, RevolutPayPayments revolutPayPayments, SamsungPayPayments samsungPayPayments, @@ -1613,6 +1618,7 @@ private Capabilities( this.payByBankPayments = payByBankPayments; this.paycoPayments = paycoPayments; this.paynowPayments = paynowPayments; + this.pixPayments = pixPayments; this.promptpayPayments = promptpayPayments; this.revolutPayPayments = revolutPayPayments; this.samsungPayPayments = samsungPayPayments; @@ -1720,6 +1726,8 @@ public static class Builder { private PaynowPayments paynowPayments; + private PixPayments pixPayments; + private PromptpayPayments promptpayPayments; private RevolutPayPayments revolutPayPayments; @@ -1797,6 +1805,7 @@ public AccountCreateParams.Capabilities build() { this.payByBankPayments, this.paycoPayments, this.paynowPayments, + this.pixPayments, this.promptpayPayments, this.revolutPayPayments, this.samsungPayPayments, @@ -2119,6 +2128,12 @@ public Builder setPaynowPayments( return this; } + /** The pix_payments capability. */ + public Builder setPixPayments(AccountCreateParams.Capabilities.PixPayments pixPayments) { + this.pixPayments = pixPayments; + return this; + } + /** The promptpay_payments capability. */ public Builder setPromptpayPayments( AccountCreateParams.Capabilities.PromptpayPayments promptpayPayments) { @@ -5506,6 +5521,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PixPayments { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private PixPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Capabilities.PixPayments build() { + return new AccountCreateParams.Capabilities.PixPayments(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.PixPayments#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Capabilities.PixPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PromptpayPayments { diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index 90ed1ac0cab..69a224784c6 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -149,6 +149,10 @@ public static class Components { @SerializedName("balances") Balances balances; + /** Configuration for the disputes list embedded component. */ + @SerializedName("disputes_list") + DisputesList disputesList; + /** Configuration for the documents embedded component. */ @SerializedName("documents") Documents documents; @@ -186,6 +190,10 @@ public static class Components { @SerializedName("payment_details") PaymentDetails paymentDetails; + /** Configuration for the payment disputes embedded component. */ + @SerializedName("payment_disputes") + PaymentDisputes paymentDisputes; + /** Configuration for the payments embedded component. */ @SerializedName("payments") Payments payments; @@ -210,6 +218,7 @@ private Components( AccountManagement accountManagement, AccountOnboarding accountOnboarding, Balances balances, + DisputesList disputesList, Documents documents, Map extraParams, FinancialAccount financialAccount, @@ -218,6 +227,7 @@ private Components( IssuingCardsList issuingCardsList, NotificationBanner notificationBanner, PaymentDetails paymentDetails, + PaymentDisputes paymentDisputes, Payments payments, Payouts payouts, PayoutsList payoutsList, @@ -226,6 +236,7 @@ private Components( this.accountManagement = accountManagement; this.accountOnboarding = accountOnboarding; this.balances = balances; + this.disputesList = disputesList; this.documents = documents; this.extraParams = extraParams; this.financialAccount = financialAccount; @@ -234,6 +245,7 @@ private Components( this.issuingCardsList = issuingCardsList; this.notificationBanner = notificationBanner; this.paymentDetails = paymentDetails; + this.paymentDisputes = paymentDisputes; this.payments = payments; this.payouts = payouts; this.payoutsList = payoutsList; @@ -252,6 +264,8 @@ public static class Builder { private Balances balances; + private DisputesList disputesList; + private Documents documents; private Map extraParams; @@ -268,6 +282,8 @@ public static class Builder { private PaymentDetails paymentDetails; + private PaymentDisputes paymentDisputes; + private Payments payments; private Payouts payouts; @@ -284,6 +300,7 @@ public AccountSessionCreateParams.Components build() { this.accountManagement, this.accountOnboarding, this.balances, + this.disputesList, this.documents, this.extraParams, this.financialAccount, @@ -292,6 +309,7 @@ public AccountSessionCreateParams.Components build() { this.issuingCardsList, this.notificationBanner, this.paymentDetails, + this.paymentDisputes, this.payments, this.payouts, this.payoutsList, @@ -319,6 +337,13 @@ public Builder setBalances(AccountSessionCreateParams.Components.Balances balanc return this; } + /** Configuration for the disputes list embedded component. */ + public Builder setDisputesList( + AccountSessionCreateParams.Components.DisputesList disputesList) { + this.disputesList = disputesList; + return this; + } + /** Configuration for the documents embedded component. */ public Builder setDocuments(AccountSessionCreateParams.Components.Documents documents) { this.documents = documents; @@ -393,6 +418,13 @@ public Builder setPaymentDetails( return this; } + /** Configuration for the payment disputes embedded component. */ + public Builder setPaymentDisputes( + AccountSessionCreateParams.Components.PaymentDisputes paymentDisputes) { + this.paymentDisputes = paymentDisputes; + return this; + } + /** Configuration for the payments embedded component. */ public Builder setPayments(AccountSessionCreateParams.Components.Payments payments) { this.payments = payments; @@ -1103,6 +1135,234 @@ public Builder setStandardPayouts(Boolean standardPayouts) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisputesList { + /** Required. Whether the embedded component 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; + + /** The list of features enabled in the embedded component. */ + @SerializedName("features") + Features features; + + private DisputesList(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 AccountSessionCreateParams.Components.DisputesList build() { + return new AccountSessionCreateParams.Components.DisputesList( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the embedded component 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 AccountSessionCreateParams.Components.DisputesList#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.DisputesList#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 list of features enabled in the embedded component. */ + public Builder setFeatures( + AccountSessionCreateParams.Components.DisputesList.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Whether to allow capturing and cancelling payment intents. This is {@code true} by + * default. + */ + @SerializedName("capture_payments") + Boolean capturePayments; + + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + @SerializedName("destination_on_behalf_of_charge_management") + Boolean destinationOnBehalfOfChargeManagement; + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + @SerializedName("dispute_management") + Boolean disputeManagement; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 to allow sending refunds. This is {@code true} by default. */ + @SerializedName("refund_management") + Boolean refundManagement; + + private Features( + Boolean capturePayments, + Boolean destinationOnBehalfOfChargeManagement, + Boolean disputeManagement, + Map extraParams, + Boolean refundManagement) { + this.capturePayments = capturePayments; + this.destinationOnBehalfOfChargeManagement = destinationOnBehalfOfChargeManagement; + this.disputeManagement = disputeManagement; + this.extraParams = extraParams; + this.refundManagement = refundManagement; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean capturePayments; + + private Boolean destinationOnBehalfOfChargeManagement; + + private Boolean disputeManagement; + + private Map extraParams; + + private Boolean refundManagement; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountSessionCreateParams.Components.DisputesList.Features build() { + return new AccountSessionCreateParams.Components.DisputesList.Features( + this.capturePayments, + this.destinationOnBehalfOfChargeManagement, + this.disputeManagement, + this.extraParams, + this.refundManagement); + } + + /** + * Whether to allow capturing and cancelling payment intents. This is {@code true} by + * default. + */ + public Builder setCapturePayments(Boolean capturePayments) { + this.capturePayments = capturePayments; + return this; + } + + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + public Builder setDestinationOnBehalfOfChargeManagement( + Boolean destinationOnBehalfOfChargeManagement) { + this.destinationOnBehalfOfChargeManagement = destinationOnBehalfOfChargeManagement; + return this; + } + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + public Builder setDisputeManagement(Boolean disputeManagement) { + this.disputeManagement = disputeManagement; + 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 + * AccountSessionCreateParams.Components.DisputesList.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 + * AccountSessionCreateParams.Components.DisputesList.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; + } + + /** Whether to allow sending refunds. This is {@code true} by default. */ + public Builder setRefundManagement(Boolean refundManagement) { + this.refundManagement = refundManagement; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Documents { @@ -2512,6 +2772,213 @@ public Builder setRefundManagement(Boolean refundManagement) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentDisputes { + /** Required. Whether the embedded component 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; + + /** The list of features enabled in the embedded component. */ + @SerializedName("features") + Features features; + + private PaymentDisputes(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 AccountSessionCreateParams.Components.PaymentDisputes build() { + return new AccountSessionCreateParams.Components.PaymentDisputes( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the embedded component 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 AccountSessionCreateParams.Components.PaymentDisputes#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.PaymentDisputes#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 list of features enabled in the embedded component. */ + public Builder setFeatures( + AccountSessionCreateParams.Components.PaymentDisputes.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + @SerializedName("destination_on_behalf_of_charge_management") + Boolean destinationOnBehalfOfChargeManagement; + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + @SerializedName("dispute_management") + Boolean disputeManagement; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 to allow sending refunds. This is {@code true} by default. */ + @SerializedName("refund_management") + Boolean refundManagement; + + private Features( + Boolean destinationOnBehalfOfChargeManagement, + Boolean disputeManagement, + Map extraParams, + Boolean refundManagement) { + this.destinationOnBehalfOfChargeManagement = destinationOnBehalfOfChargeManagement; + this.disputeManagement = disputeManagement; + this.extraParams = extraParams; + this.refundManagement = refundManagement; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean destinationOnBehalfOfChargeManagement; + + private Boolean disputeManagement; + + private Map extraParams; + + private Boolean refundManagement; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountSessionCreateParams.Components.PaymentDisputes.Features build() { + return new AccountSessionCreateParams.Components.PaymentDisputes.Features( + this.destinationOnBehalfOfChargeManagement, + this.disputeManagement, + this.extraParams, + this.refundManagement); + } + + /** + * Whether to allow connected accounts to manage destination charges that are created on + * behalf of them. This is {@code false} by default. + */ + public Builder setDestinationOnBehalfOfChargeManagement( + Boolean destinationOnBehalfOfChargeManagement) { + this.destinationOnBehalfOfChargeManagement = destinationOnBehalfOfChargeManagement; + return this; + } + + /** + * Whether to allow responding to disputes, including submitting evidence and accepting + * disputes. This is {@code true} by default. + */ + public Builder setDisputeManagement(Boolean disputeManagement) { + this.disputeManagement = disputeManagement; + 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 + * AccountSessionCreateParams.Components.PaymentDisputes.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 + * AccountSessionCreateParams.Components.PaymentDisputes.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; + } + + /** Whether to allow sending refunds. This is {@code true} by default. */ + public Builder setRefundManagement(Boolean refundManagement) { + this.refundManagement = refundManagement; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Payments { diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 0bfab1e65e2..8cd3d920707 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -1546,6 +1546,10 @@ public static class Capabilities { @SerializedName("paynow_payments") PaynowPayments paynowPayments; + /** The pix_payments capability. */ + @SerializedName("pix_payments") + PixPayments pixPayments; + /** The promptpay_payments capability. */ @SerializedName("promptpay_payments") PromptpayPayments promptpayPayments; @@ -1653,6 +1657,7 @@ private Capabilities( PayByBankPayments payByBankPayments, PaycoPayments paycoPayments, PaynowPayments paynowPayments, + PixPayments pixPayments, PromptpayPayments promptpayPayments, RevolutPayPayments revolutPayPayments, SamsungPayPayments samsungPayPayments, @@ -1711,6 +1716,7 @@ private Capabilities( this.payByBankPayments = payByBankPayments; this.paycoPayments = paycoPayments; this.paynowPayments = paynowPayments; + this.pixPayments = pixPayments; this.promptpayPayments = promptpayPayments; this.revolutPayPayments = revolutPayPayments; this.samsungPayPayments = samsungPayPayments; @@ -1818,6 +1824,8 @@ public static class Builder { private PaynowPayments paynowPayments; + private PixPayments pixPayments; + private PromptpayPayments promptpayPayments; private RevolutPayPayments revolutPayPayments; @@ -1895,6 +1903,7 @@ public AccountUpdateParams.Capabilities build() { this.payByBankPayments, this.paycoPayments, this.paynowPayments, + this.pixPayments, this.promptpayPayments, this.revolutPayPayments, this.samsungPayPayments, @@ -2217,6 +2226,12 @@ public Builder setPaynowPayments( return this; } + /** The pix_payments capability. */ + public Builder setPixPayments(AccountUpdateParams.Capabilities.PixPayments pixPayments) { + this.pixPayments = pixPayments; + return this; + } + /** The promptpay_payments capability. */ public Builder setPromptpayPayments( AccountUpdateParams.Capabilities.PromptpayPayments promptpayPayments) { @@ -5604,6 +5619,85 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PixPayments { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + @SerializedName("requested") + Boolean requested; + + private PixPayments(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Capabilities.PixPayments build() { + return new AccountUpdateParams.Capabilities.PixPayments(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.PixPayments#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Capabilities.PixPayments#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Passing true requests the capability for the account, if it is not already requested. A + * requested capability may not immediately become active. Any requirements to activate the + * capability are returned in the {@code requirements} arrays. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PromptpayPayments { diff --git a/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java new file mode 100644 index 00000000000..3cfd7b21ed9 --- /dev/null +++ b/src/main/java/com/stripe/param/InvoiceAttachPaymentParams.java @@ -0,0 +1,114 @@ +// 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 InvoiceAttachPaymentParams 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; + + /** The ID of the PaymentIntent to attach to the invoice. */ + @SerializedName("payment_intent") + String paymentIntent; + + private InvoiceAttachPaymentParams( + List expand, Map extraParams, String paymentIntent) { + this.expand = expand; + this.extraParams = extraParams; + this.paymentIntent = paymentIntent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private String paymentIntent; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceAttachPaymentParams build() { + return new InvoiceAttachPaymentParams(this.expand, this.extraParams, this.paymentIntent); + } + + /** + * 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 + * InvoiceAttachPaymentParams#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 + * InvoiceAttachPaymentParams#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 + * InvoiceAttachPaymentParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link InvoiceAttachPaymentParams#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 ID of the PaymentIntent to attach to the invoice. */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 7b2277cafe6..70bdf7781aa 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -3104,6 +3104,13 @@ public static class Phase { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle @@ -3213,14 +3220,13 @@ public static class Phase { String onBehalfOf; /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field - * on the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing - * configuration of the current phase. + * configuration (item price, quantity, etc.) of the current phase. */ @SerializedName("proration_behavior") ProrationBehavior prorationBehavior; @@ -3258,6 +3264,7 @@ private Phase( BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, CollectionMethod collectionMethod, String currency, String defaultPaymentMethod, @@ -3280,6 +3287,7 @@ private Phase( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; @@ -3314,6 +3322,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private CollectionMethod collectionMethod; private String currency; @@ -3357,6 +3367,7 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.collectionMethod, this.currency, this.defaultPaymentMethod, @@ -3440,6 +3451,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging * automatically, Stripe will attempt to pay the underlying subscription at the end of each @@ -3733,14 +3763,13 @@ public Builder setOnBehalfOf(String onBehalfOf) { } /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field - * on the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing - * configuration of the current phase. + * configuration (item price, quantity, etc.) of the current phase. */ public Builder setProrationBehavior( InvoiceCreatePreviewParams.ScheduleDetails.Phase.ProrationBehavior prorationBehavior) { @@ -4545,6 +4574,105 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** + * Monetary threshold that triggers the subscription to advance to a new billing period. + */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -4919,6 +5047,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -4982,6 +5117,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Object discounts, Map extraParams, Map metadata, @@ -4990,6 +5126,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -5005,6 +5142,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private Map extraParams; @@ -5024,6 +5163,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item( + this.billingThresholds, this.discounts, this.extraParams, this.metadata, @@ -5034,6 +5174,26 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.BillingThresholds + billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -5228,6 +5388,92 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.BillingThresholds build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.BillingThresholds#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.Item.BillingThresholds#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. Number of units that meets the billing threshold to + * advance the subscription to a new billing period (e.g., it takes 10 $5 units to meet + * a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -5929,7 +6175,8 @@ public static class SubscriptionDetails { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -6122,7 +6369,8 @@ public Builder setCancelAt(EmptyParam cancelAt) { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -6305,6 +6553,13 @@ public Builder setTrialEnd(Long trialEnd) { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Delete all usage for a given subscription item. You must pass this when deleting a usage * records subscription item. {@code clear_usage} has no effect if the plan has a billing @@ -6377,6 +6632,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Boolean clearUsage, Boolean deleted, Object discounts, @@ -6388,6 +6644,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; this.deleted = deleted; this.discounts = discounts; @@ -6406,6 +6663,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Boolean clearUsage; private Boolean deleted; @@ -6431,6 +6690,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.SubscriptionDetails.Item build() { return new InvoiceCreatePreviewParams.SubscriptionDetails.Item( + this.billingThresholds, this.clearUsage, this.deleted, this.discounts, @@ -6444,6 +6704,26 @@ public InvoiceCreatePreviewParams.SubscriptionDetails.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + InvoiceCreatePreviewParams.SubscriptionDetails.Item.BillingThresholds + billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Delete all usage for a given subscription item. You must pass this when deleting a usage * records subscription item. {@code clear_usage} has no effect if the plan has a billing @@ -6682,6 +6962,91 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.Item.BillingThresholds build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.BillingThresholds#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * InvoiceCreatePreviewParams.SubscriptionDetails.Item.BillingThresholds#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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 75b9c75c7d7..d92a2467291 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -69,7 +69,10 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { /** * ID of the payment method (a PaymentMethod, Card, or compatible - * Source object) to attach to this PaymentIntent. + * Source object) to attach to this PaymentIntent. If the payment method is attached to a + * Customer, it must match the customer that is set on + * this PaymentIntent. */ @SerializedName("payment_method") String paymentMethod; @@ -381,7 +384,10 @@ public Builder setOffSession(PaymentIntentConfirmParams.OffSession offSession) { /** * ID of the payment method (a PaymentMethod, Card, or compatible - * Source object) to attach to this PaymentIntent. + * Source object) to attach to this PaymentIntent. If the payment method is attached to a + * Customer, it must match the customer that is set on + * this PaymentIntent. */ public Builder setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -6646,6 +6652,13 @@ public static class PaymentMethodOptions { @SerializedName("samsung_pay") Object samsungPay; + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + @SerializedName("satispay") + Object satispay; + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the SEPA * Debit payment method options. @@ -6738,6 +6751,7 @@ private PaymentMethodOptions( Object promptpay, Object revolutPay, Object samsungPay, + Object satispay, Object sepaDebit, Object sofort, Object swish, @@ -6787,6 +6801,7 @@ private PaymentMethodOptions( this.promptpay = promptpay; this.revolutPay = revolutPay; this.samsungPay = samsungPay; + this.satispay = satispay; this.sepaDebit = sepaDebit; this.sofort = sofort; this.swish = swish; @@ -6885,6 +6900,8 @@ public static class Builder { private Object samsungPay; + private Object satispay; + private Object sepaDebit; private Object sofort; @@ -6944,6 +6961,7 @@ public PaymentIntentConfirmParams.PaymentMethodOptions build() { this.promptpay, this.revolutPay, this.samsungPay, + this.satispay, this.sepaDebit, this.sofort, this.swish, @@ -7730,6 +7748,25 @@ public Builder setSamsungPay(EmptyParam samsungPay) { return this; } + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay( + PaymentIntentConfirmParams.PaymentMethodOptions.Satispay satispay) { + this.satispay = satispay; + return this; + } + + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay(EmptyParam satispay) { + this.satispay = satispay; + return this; + } + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. @@ -17556,6 +17593,124 @@ public enum CaptureMethod implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Satispay { + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty value + * for this parameter unsets the stored value for this payment method type. + */ + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 Satispay(ApiRequestParams.EnumParam captureMethod, Map extraParams) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Satispay build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Satispay( + this.captureMethod, this.extraParams); + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod( + PaymentIntentConfirmParams.PaymentMethodOptions.Satispay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Satispay#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Satispay#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 CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class SepaDebit { diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index 43ef3723583..a65e2217502 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -179,7 +179,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { *

If you don't provide the {@code payment_method} parameter or the {@code source} parameter * with {@code confirm=true}, {@code source} automatically populates with {@code * customer.default_source} to improve migration for users of the Charges API. We recommend that - * you explicitly provide the {@code payment_method} moving forward. + * you explicitly provide the {@code payment_method} moving forward. If the payment method is + * attached to a Customer, you must also provide the ID of that Customer as the customer parameter of + * this PaymentIntent. end */ @SerializedName("payment_method") String paymentMethod; @@ -766,7 +769,10 @@ public Builder setOnBehalfOf(String onBehalfOf) { *

If you don't provide the {@code payment_method} parameter or the {@code source} parameter * with {@code confirm=true}, {@code source} automatically populates with {@code * customer.default_source} to improve migration for users of the Charges API. We recommend that - * you explicitly provide the {@code payment_method} moving forward. + * you explicitly provide the {@code payment_method} moving forward. If the payment method is + * attached to a Customer, you must also provide the ID of that Customer as the customer parameter of + * this PaymentIntent. end */ public Builder setPaymentMethod(String paymentMethod) { this.paymentMethod = paymentMethod; @@ -7160,6 +7166,13 @@ public static class PaymentMethodOptions { @SerializedName("samsung_pay") Object samsungPay; + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + @SerializedName("satispay") + Object satispay; + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the SEPA * Debit payment method options. @@ -7252,6 +7265,7 @@ private PaymentMethodOptions( Object promptpay, Object revolutPay, Object samsungPay, + Object satispay, Object sepaDebit, Object sofort, Object swish, @@ -7301,6 +7315,7 @@ private PaymentMethodOptions( this.promptpay = promptpay; this.revolutPay = revolutPay; this.samsungPay = samsungPay; + this.satispay = satispay; this.sepaDebit = sepaDebit; this.sofort = sofort; this.swish = swish; @@ -7399,6 +7414,8 @@ public static class Builder { private Object samsungPay; + private Object satispay; + private Object sepaDebit; private Object sofort; @@ -7458,6 +7475,7 @@ public PaymentIntentCreateParams.PaymentMethodOptions build() { this.promptpay, this.revolutPay, this.samsungPay, + this.satispay, this.sepaDebit, this.sofort, this.swish, @@ -8242,6 +8260,24 @@ public Builder setSamsungPay(EmptyParam samsungPay) { return this; } + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay(PaymentIntentCreateParams.PaymentMethodOptions.Satispay satispay) { + this.satispay = satispay; + return this; + } + + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay(EmptyParam satispay) { + this.satispay = satispay; + return this; + } + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. @@ -18056,6 +18092,124 @@ public enum CaptureMethod implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Satispay { + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty value + * for this parameter unsets the stored value for this payment method type. + */ + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 Satispay(ApiRequestParams.EnumParam captureMethod, Map extraParams) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Satispay build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Satispay( + this.captureMethod, this.extraParams); + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod( + PaymentIntentCreateParams.PaymentMethodOptions.Satispay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Satispay#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Satispay#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 CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class SepaDebit { diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index fba7729a9b8..90f73413b52 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -6677,6 +6677,13 @@ public static class PaymentMethodOptions { @SerializedName("samsung_pay") Object samsungPay; + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + @SerializedName("satispay") + Object satispay; + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the SEPA * Debit payment method options. @@ -6769,6 +6776,7 @@ private PaymentMethodOptions( Object promptpay, Object revolutPay, Object samsungPay, + Object satispay, Object sepaDebit, Object sofort, Object swish, @@ -6818,6 +6826,7 @@ private PaymentMethodOptions( this.promptpay = promptpay; this.revolutPay = revolutPay; this.samsungPay = samsungPay; + this.satispay = satispay; this.sepaDebit = sepaDebit; this.sofort = sofort; this.swish = swish; @@ -6916,6 +6925,8 @@ public static class Builder { private Object samsungPay; + private Object satispay; + private Object sepaDebit; private Object sofort; @@ -6975,6 +6986,7 @@ public PaymentIntentUpdateParams.PaymentMethodOptions build() { this.promptpay, this.revolutPay, this.samsungPay, + this.satispay, this.sepaDebit, this.sofort, this.swish, @@ -7759,6 +7771,24 @@ public Builder setSamsungPay(EmptyParam samsungPay) { return this; } + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay(PaymentIntentUpdateParams.PaymentMethodOptions.Satispay satispay) { + this.satispay = satispay; + return this; + } + + /** + * If this is a {@code satispay} PaymentMethod, this sub-hash contains details about the + * Satispay payment method options. + */ + public Builder setSatispay(EmptyParam satispay) { + this.satispay = satispay; + return this; + } + /** * If this is a {@code sepa_debit} PaymentIntent, this sub-hash contains details about the * SEPA Debit payment method options. @@ -17748,6 +17778,124 @@ public enum CaptureMethod implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Satispay { + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty value + * for this parameter unsets the stored value for this payment method type. + */ + @SerializedName("capture_method") + ApiRequestParams.EnumParam captureMethod; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 Satispay(ApiRequestParams.EnumParam captureMethod, Map extraParams) { + this.captureMethod = captureMethod; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ApiRequestParams.EnumParam captureMethod; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Satispay build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Satispay( + this.captureMethod, this.extraParams); + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod( + PaymentIntentUpdateParams.PaymentMethodOptions.Satispay.CaptureMethod captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Controls when the funds are captured from the customer's account. + * + *

If provided, this parameter overrides the behavior of the top-level capture_method + * for this payment method type when finalizing the payment with this payment method type. + * + *

If {@code capture_method} is already set on the PaymentIntent, providing an empty + * value for this parameter unsets the stored value for this payment method type. + */ + public Builder setCaptureMethod(EmptyParam captureMethod) { + this.captureMethod = captureMethod; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Satispay#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Satispay#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 CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class SepaDebit { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index 843996a4326..9e1bbde5a7f 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -251,6 +251,10 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("jcb") Jcb jcb; + /** Kakao Pay is a popular local wallet available in South Korea. */ + @SerializedName("kakao_pay") + KakaoPay kakaoPay; + /** * Klarna gives customers a range of payment options during @@ -270,6 +274,10 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("konbini") Konbini konbini; + /** Korean cards let users pay using locally issued cards from South Korea. */ + @SerializedName("kr_card") + KrCard krCard; + /** * Link is a payment method network. With * Link, users save their payment details once, then reuse that information to pay with one click @@ -300,6 +308,10 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("name") String name; + /** Naver Pay is a popular local wallet available in South Korea. */ + @SerializedName("naver_pay") + NaverPay naverPay; + /** * Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit * payments from customers with a New Zeland bank account. Check this single-use * payment method where customers are required to payment options during @@ -1076,6 +1133,12 @@ public Builder setKonbini(PaymentMethodConfigurationCreateParams.Konbini konbini return this; } + /** Korean cards let users pay using locally issued cards from South Korea. */ + public Builder setKrCard(PaymentMethodConfigurationCreateParams.KrCard krCard) { + this.krCard = krCard; + return this; + } + /** * Link is a payment method network. With * Link, users save their payment details once, then reuse that information to pay with one @@ -1115,6 +1178,12 @@ public Builder setName(String name) { return this; } + /** Naver Pay is a popular local wallet available in South Korea. */ + public Builder setNaverPay(PaymentMethodConfigurationCreateParams.NaverPay naverPay) { + this.naverPay = naverPay; + return this; + } + /** * Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit * payments from customers with a New Zeland bank account. Check this single-use * payment method where customers are required to extraParams; - private Klarna(DisplayPreference displayPreference, Map extraParams) { + private KakaoPay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5484,14 +5571,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Klarna build() { - return new PaymentMethodConfigurationCreateParams.Klarna( + public PaymentMethodConfigurationCreateParams.KakaoPay build() { + return new PaymentMethodConfigurationCreateParams.KakaoPay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5499,7 +5586,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Klarna#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.KakaoPay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5512,7 +5599,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 PaymentMethodConfigurationCreateParams.Klarna#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.KakaoPay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5555,8 +5642,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference( + public PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference( this.extraParams, this.preference); } @@ -5564,7 +5651,7 @@ public PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Klarna.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -5579,7 +5666,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 - * PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -5592,7 +5679,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference.Preference preference) { + PaymentMethodConfigurationCreateParams.KakaoPay.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -5620,7 +5708,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Konbini { + public static class Klarna { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5634,7 +5722,7 @@ public static class Konbini { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Konbini(DisplayPreference displayPreference, Map extraParams) { + private Klarna(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5649,14 +5737,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Konbini build() { - return new PaymentMethodConfigurationCreateParams.Konbini( + public PaymentMethodConfigurationCreateParams.Klarna build() { + return new PaymentMethodConfigurationCreateParams.Klarna( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5664,7 +5752,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Konbini#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.Klarna#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5677,7 +5765,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 PaymentMethodConfigurationCreateParams.Konbini#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.Klarna#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5720,8 +5808,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference( + public PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference( this.extraParams, this.preference); } @@ -5729,7 +5817,7 @@ public PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference build() * Add a key/value pair to `extraParams` map. 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.Konbini.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -5744,7 +5832,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 - * PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -5757,8 +5845,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationCreateParams.Klarna.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -5786,7 +5873,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Link { + public static class Konbini { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5800,7 +5887,7 @@ public static class Link { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Link(DisplayPreference displayPreference, Map extraParams) { + private Konbini(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5815,14 +5902,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Link build() { - return new PaymentMethodConfigurationCreateParams.Link( + public PaymentMethodConfigurationCreateParams.Konbini build() { + return new PaymentMethodConfigurationCreateParams.Konbini( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Link.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5830,7 +5917,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Link#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.Konbini#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5843,7 +5930,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 PaymentMethodConfigurationCreateParams.Link#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.Konbini#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5886,8 +5973,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Link.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Link.DisplayPreference( + public PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference( this.extraParams, this.preference); } @@ -5895,8 +5982,8 @@ public PaymentMethodConfigurationCreateParams.Link.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Link.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5910,8 +5997,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 - * PaymentMethodConfigurationCreateParams.Link.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -5923,7 +6010,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Link.DisplayPreference.Preference preference) { + PaymentMethodConfigurationCreateParams.Konbini.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -5951,7 +6039,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Mobilepay { + public static class KrCard { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5965,7 +6053,7 @@ public static class Mobilepay { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Mobilepay(DisplayPreference displayPreference, Map extraParams) { + private KrCard(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5980,14 +6068,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Mobilepay build() { - return new PaymentMethodConfigurationCreateParams.Mobilepay( + public PaymentMethodConfigurationCreateParams.KrCard build() { + return new PaymentMethodConfigurationCreateParams.KrCard( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5995,7 +6083,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Mobilepay#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.KrCard#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6008,7 +6096,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 PaymentMethodConfigurationCreateParams.Mobilepay#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.KrCard#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6051,8 +6139,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference( + public PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference( this.extraParams, this.preference); } @@ -6060,7 +6148,7 @@ public PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference build( * Add a key/value pair to `extraParams` map. 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.Mobilepay.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -6075,7 +6163,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 - * PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -6088,8 +6176,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationCreateParams.KrCard.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -6117,7 +6204,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Multibanco { + public static class Link { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6131,7 +6218,7 @@ public static class Multibanco { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Multibanco(DisplayPreference displayPreference, Map extraParams) { + private Link(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6146,14 +6233,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Multibanco build() { - return new PaymentMethodConfigurationCreateParams.Multibanco( + public PaymentMethodConfigurationCreateParams.Link build() { + return new PaymentMethodConfigurationCreateParams.Link( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.Link.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6161,7 +6248,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Multibanco#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.Link#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6174,7 +6261,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 PaymentMethodConfigurationCreateParams.Multibanco#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.Link#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6217,8 +6304,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference( + public PaymentMethodConfigurationCreateParams.Link.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Link.DisplayPreference( this.extraParams, this.preference); } @@ -6226,8 +6313,8 @@ public PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference build * Add a key/value pair to `extraParams` map. 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.Multibanco.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationCreateParams.Link.DisplayPreference#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6241,8 +6328,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 - * PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationCreateParams.Link.DisplayPreference#extraParams} for the field + * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6254,8 +6341,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationCreateParams.Link.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -6283,7 +6369,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class NzBankAccount { + public static class Mobilepay { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6297,7 +6383,7 @@ public static class NzBankAccount { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private NzBankAccount(DisplayPreference displayPreference, Map extraParams) { + private Mobilepay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6312,15 +6398,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.NzBankAccount build() { - return new PaymentMethodConfigurationCreateParams.NzBankAccount( + public PaymentMethodConfigurationCreateParams.Mobilepay build() { + return new PaymentMethodConfigurationCreateParams.Mobilepay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference - displayPreference) { + PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6328,8 +6413,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.NzBankAccount#extraParams} for the field - * documentation. + * PaymentMethodConfigurationCreateParams.Mobilepay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6342,7 +6426,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 PaymentMethodConfigurationCreateParams.NzBankAccount#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.Mobilepay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6385,8 +6469,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference( + public PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference( this.extraParams, this.preference); } @@ -6394,8 +6478,8 @@ public PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference bu * Add a key/value pair to `extraParams` map. 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.NzBankAccount.DisplayPreference#extraParams} for - * the field documentation. + * PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6409,8 +6493,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 - * PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference#extraParams} for - * the field documentation. + * PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6422,7 +6506,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference.Preference + PaymentMethodConfigurationCreateParams.Mobilepay.DisplayPreference.Preference preference) { this.preference = preference; return this; @@ -6451,7 +6535,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Oxxo { + public static class Multibanco { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6465,7 +6549,7 @@ public static class Oxxo { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Oxxo(DisplayPreference displayPreference, Map extraParams) { + private Multibanco(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6480,14 +6564,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Oxxo build() { - return new PaymentMethodConfigurationCreateParams.Oxxo( + public PaymentMethodConfigurationCreateParams.Multibanco build() { + return new PaymentMethodConfigurationCreateParams.Multibanco( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6495,7 +6579,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Oxxo#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.Multibanco#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6508,7 +6592,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 PaymentMethodConfigurationCreateParams.Oxxo#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.Multibanco#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6551,8 +6635,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference( + public PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference( this.extraParams, this.preference); } @@ -6560,8 +6644,8 @@ public PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Oxxo.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6575,8 +6659,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 - * PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6588,7 +6672,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.Oxxo.DisplayPreference.Preference preference) { + PaymentMethodConfigurationCreateParams.Multibanco.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -6616,7 +6701,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class P24 { + public static class NaverPay { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6630,7 +6715,7 @@ public static class P24 { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private P24(DisplayPreference displayPreference, Map extraParams) { + private NaverPay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6645,14 +6730,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.P24 build() { - return new PaymentMethodConfigurationCreateParams.P24( + public PaymentMethodConfigurationCreateParams.NaverPay build() { + return new PaymentMethodConfigurationCreateParams.NaverPay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.P24.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.NaverPay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6660,7 +6745,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.P24#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.NaverPay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6673,7 +6758,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 PaymentMethodConfigurationCreateParams.P24#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.NaverPay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6716,16 +6801,17 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.P24.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.P24.DisplayPreference( + public PaymentMethodConfigurationCreateParams.NaverPay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.NaverPay.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.P24.DisplayPreference#extraParams} - * for the field documentation. + * map. See {@link + * PaymentMethodConfigurationCreateParams.NaverPay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6738,8 +6824,9 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentMethodConfigurationCreateParams.P24.DisplayPreference#extraParams} - * for the field documentation. + * map. See {@link + * PaymentMethodConfigurationCreateParams.NaverPay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6751,7 +6838,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.P24.DisplayPreference.Preference preference) { + PaymentMethodConfigurationCreateParams.NaverPay.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -6779,7 +6867,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class PayByBank { + public static class NzBankAccount { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6793,7 +6881,7 @@ public static class PayByBank { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PayByBank(DisplayPreference displayPreference, Map extraParams) { + private NzBankAccount(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6808,14 +6896,15 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.PayByBank build() { - return new PaymentMethodConfigurationCreateParams.PayByBank( + public PaymentMethodConfigurationCreateParams.NzBankAccount build() { + return new PaymentMethodConfigurationCreateParams.NzBankAccount( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference displayPreference) { + PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference + displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6823,7 +6912,8 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.PayByBank#extraParams} for the field documentation. + * PaymentMethodConfigurationCreateParams.NzBankAccount#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6836,7 +6926,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 PaymentMethodConfigurationCreateParams.PayByBank#extraParams} for the field + * See {@link PaymentMethodConfigurationCreateParams.NzBankAccount#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6879,8 +6969,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference build() { - return new PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference( + public PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference( this.extraParams, this.preference); } @@ -6888,8 +6978,8 @@ public PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference build( * Add a key/value pair to `extraParams` map. 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.PayByBank.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference#extraParams} for + * the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6903,8 +6993,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 - * PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference#extraParams} for + * the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6916,7 +7006,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationCreateParams.PayByBank.DisplayPreference.Preference + PaymentMethodConfigurationCreateParams.NzBankAccount.DisplayPreference.Preference preference) { this.preference = preference; return this; @@ -6945,7 +7035,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Paynow { + public static class Oxxo { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6959,7 +7049,7 @@ public static class Paynow { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Paynow(DisplayPreference displayPreference, Map extraParams) { + private Oxxo(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6974,8 +7064,667 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationCreateParams.Paynow build() { - return new PaymentMethodConfigurationCreateParams.Paynow( + public PaymentMethodConfigurationCreateParams.Oxxo build() { + return new PaymentMethodConfigurationCreateParams.Oxxo( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Oxxo.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.Oxxo#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.Oxxo#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.Oxxo.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Oxxo.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.Oxxo.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.Oxxo.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.Oxxo.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 P24 { + /** 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 P24(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.P24 build() { + return new PaymentMethodConfigurationCreateParams.P24( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.P24.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.P24#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.P24#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.P24.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.P24.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.P24.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.P24.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.P24.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 PayByBank { + /** 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 PayByBank(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.PayByBank build() { + return new PaymentMethodConfigurationCreateParams.PayByBank( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.PayByBank.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.PayByBank#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.PayByBank#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.PayByBank.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.PayByBank.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.PayByBank.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.PayByBank.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.PayByBank.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 Payco { + /** 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 Payco(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.Payco build() { + return new PaymentMethodConfigurationCreateParams.Payco( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Payco.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.Payco#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.Payco#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.Payco.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Payco.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.Payco.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.Payco.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.Payco.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 Paynow { + /** 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 Paynow(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.Paynow build() { + return new PaymentMethodConfigurationCreateParams.Paynow( this.displayPreference, this.extraParams); } @@ -7768,6 +8517,172 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SamsungPay { + /** 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 SamsungPay(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.SamsungPay build() { + return new PaymentMethodConfigurationCreateParams.SamsungPay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.SamsungPay.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.SamsungPay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.SamsungPay#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.SamsungPay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.SamsungPay.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.SamsungPay.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.SamsungPay.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.SamsungPay.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 Satispay { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index a81b56a693b..e64f525d836 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -256,6 +256,10 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("jcb") Jcb jcb; + /** Kakao Pay is a popular local wallet available in South Korea. */ + @SerializedName("kakao_pay") + KakaoPay kakaoPay; + /** * Klarna gives customers a range of payment options during @@ -275,6 +279,10 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("konbini") Konbini konbini; + /** Korean cards let users pay using locally issued cards from South Korea. */ + @SerializedName("kr_card") + KrCard krCard; + /** * Link is a payment method network. With * Link, users save their payment details once, then reuse that information to pay with one click @@ -305,6 +313,10 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("name") Object name; + /** Naver Pay is a popular local wallet available in South Korea. */ + @SerializedName("naver_pay") + NaverPay naverPay; + /** * Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit * payments from customers with a New Zeland bank account. Check this single-use * payment method where customers are required to payment options during @@ -1083,6 +1140,12 @@ public Builder setKonbini(PaymentMethodConfigurationUpdateParams.Konbini konbini return this; } + /** Korean cards let users pay using locally issued cards from South Korea. */ + public Builder setKrCard(PaymentMethodConfigurationUpdateParams.KrCard krCard) { + this.krCard = krCard; + return this; + } + /** * Link is a payment method network. With * Link, users save their payment details once, then reuse that information to pay with one @@ -1128,6 +1191,12 @@ public Builder setName(EmptyParam name) { return this; } + /** Naver Pay is a popular local wallet available in South Korea. */ + public Builder setNaverPay(PaymentMethodConfigurationUpdateParams.NaverPay naverPay) { + this.naverPay = naverPay; + return this; + } + /** * Stripe users in New Zealand can accept Bulk Electronic Clearing System (BECS) direct debit * payments from customers with a New Zeland bank account. Check this single-use * payment method where customers are required to extraParams; - private Klarna(DisplayPreference displayPreference, Map extraParams) { + private KakaoPay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5491,14 +5578,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Klarna build() { - return new PaymentMethodConfigurationUpdateParams.Klarna( + public PaymentMethodConfigurationUpdateParams.KakaoPay build() { + return new PaymentMethodConfigurationUpdateParams.KakaoPay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5506,7 +5593,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Klarna#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.KakaoPay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5519,7 +5606,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 PaymentMethodConfigurationUpdateParams.Klarna#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.KakaoPay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5562,8 +5649,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference( this.extraParams, this.preference); } @@ -5571,7 +5658,7 @@ public PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Klarna.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -5586,7 +5673,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 - * PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -5599,7 +5686,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference.Preference preference) { + PaymentMethodConfigurationUpdateParams.KakaoPay.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -5627,7 +5715,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Konbini { + public static class Klarna { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5641,7 +5729,7 @@ public static class Konbini { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Konbini(DisplayPreference displayPreference, Map extraParams) { + private Klarna(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5656,14 +5744,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Konbini build() { - return new PaymentMethodConfigurationUpdateParams.Konbini( + public PaymentMethodConfigurationUpdateParams.Klarna build() { + return new PaymentMethodConfigurationUpdateParams.Klarna( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5671,7 +5759,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Konbini#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.Klarna#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5684,7 +5772,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 PaymentMethodConfigurationUpdateParams.Konbini#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.Klarna#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5727,8 +5815,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference( this.extraParams, this.preference); } @@ -5736,7 +5824,7 @@ public PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference build() * Add a key/value pair to `extraParams` map. 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.Konbini.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -5751,7 +5839,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 - * PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -5764,8 +5852,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationUpdateParams.Klarna.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -5793,7 +5880,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Link { + public static class Konbini { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5807,7 +5894,7 @@ public static class Link { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Link(DisplayPreference displayPreference, Map extraParams) { + private Konbini(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5822,14 +5909,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Link build() { - return new PaymentMethodConfigurationUpdateParams.Link( + public PaymentMethodConfigurationUpdateParams.Konbini build() { + return new PaymentMethodConfigurationUpdateParams.Konbini( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Link.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -5837,7 +5924,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Link#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.Konbini#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5850,7 +5937,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 PaymentMethodConfigurationUpdateParams.Link#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.Konbini#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -5893,8 +5980,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Link.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Link.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference( this.extraParams, this.preference); } @@ -5902,8 +5989,8 @@ public PaymentMethodConfigurationUpdateParams.Link.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Link.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -5917,8 +6004,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 - * PaymentMethodConfigurationUpdateParams.Link.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -5930,7 +6017,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Link.DisplayPreference.Preference preference) { + PaymentMethodConfigurationUpdateParams.Konbini.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -5958,7 +6046,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Mobilepay { + public static class KrCard { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -5972,7 +6060,7 @@ public static class Mobilepay { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Mobilepay(DisplayPreference displayPreference, Map extraParams) { + private KrCard(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -5987,14 +6075,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Mobilepay build() { - return new PaymentMethodConfigurationUpdateParams.Mobilepay( + public PaymentMethodConfigurationUpdateParams.KrCard build() { + return new PaymentMethodConfigurationUpdateParams.KrCard( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6002,7 +6090,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Mobilepay#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.KrCard#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6015,7 +6103,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 PaymentMethodConfigurationUpdateParams.Mobilepay#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.KrCard#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6058,8 +6146,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference( this.extraParams, this.preference); } @@ -6067,7 +6155,7 @@ public PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference build( * Add a key/value pair to `extraParams` map. 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.Mobilepay.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference#extraParams} for the * field documentation. */ public Builder putExtraParam(String key, Object value) { @@ -6082,7 +6170,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 - * PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference#extraParams} for the + * PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference#extraParams} for the * field documentation. */ public Builder putAllExtraParam(Map map) { @@ -6095,8 +6183,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationUpdateParams.KrCard.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -6124,7 +6211,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Multibanco { + public static class Link { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6138,7 +6225,7 @@ public static class Multibanco { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Multibanco(DisplayPreference displayPreference, Map extraParams) { + private Link(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6153,14 +6240,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Multibanco build() { - return new PaymentMethodConfigurationUpdateParams.Multibanco( + public PaymentMethodConfigurationUpdateParams.Link build() { + return new PaymentMethodConfigurationUpdateParams.Link( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.Link.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6168,7 +6255,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Multibanco#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.Link#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6181,7 +6268,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 PaymentMethodConfigurationUpdateParams.Multibanco#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.Link#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6224,8 +6311,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.Link.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Link.DisplayPreference( this.extraParams, this.preference); } @@ -6233,8 +6320,8 @@ public PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference build * Add a key/value pair to `extraParams` map. 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.Multibanco.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationUpdateParams.Link.DisplayPreference#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6248,8 +6335,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 - * PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationUpdateParams.Link.DisplayPreference#extraParams} for the field + * documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6261,8 +6348,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference.Preference - preference) { + PaymentMethodConfigurationUpdateParams.Link.DisplayPreference.Preference preference) { this.preference = preference; return this; } @@ -6290,7 +6376,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class NzBankAccount { + public static class Mobilepay { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6304,7 +6390,7 @@ public static class NzBankAccount { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private NzBankAccount(DisplayPreference displayPreference, Map extraParams) { + private Mobilepay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6319,15 +6405,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.NzBankAccount build() { - return new PaymentMethodConfigurationUpdateParams.NzBankAccount( + public PaymentMethodConfigurationUpdateParams.Mobilepay build() { + return new PaymentMethodConfigurationUpdateParams.Mobilepay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference - displayPreference) { + PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6335,8 +6420,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.NzBankAccount#extraParams} for the field - * documentation. + * PaymentMethodConfigurationUpdateParams.Mobilepay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6349,7 +6433,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 PaymentMethodConfigurationUpdateParams.NzBankAccount#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.Mobilepay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6392,8 +6476,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference( this.extraParams, this.preference); } @@ -6401,8 +6485,8 @@ public PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference bu * Add a key/value pair to `extraParams` map. 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.NzBankAccount.DisplayPreference#extraParams} for - * the field documentation. + * PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6416,8 +6500,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 - * PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference#extraParams} for - * the field documentation. + * PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6429,7 +6513,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference.Preference + PaymentMethodConfigurationUpdateParams.Mobilepay.DisplayPreference.Preference preference) { this.preference = preference; return this; @@ -6458,7 +6542,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Oxxo { + public static class Multibanco { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6472,7 +6556,7 @@ public static class Oxxo { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Oxxo(DisplayPreference displayPreference, Map extraParams) { + private Multibanco(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6487,14 +6571,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Oxxo build() { - return new PaymentMethodConfigurationUpdateParams.Oxxo( + public PaymentMethodConfigurationUpdateParams.Multibanco build() { + return new PaymentMethodConfigurationUpdateParams.Multibanco( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6502,7 +6586,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.Oxxo#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.Multibanco#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6515,7 +6599,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 PaymentMethodConfigurationUpdateParams.Oxxo#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.Multibanco#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6558,8 +6642,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference( this.extraParams, this.preference); } @@ -6567,8 +6651,8 @@ public PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference build() { * Add a key/value pair to `extraParams` map. 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.Oxxo.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6582,8 +6666,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 - * PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference#extraParams} for the field - * documentation. + * PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6595,7 +6679,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.Oxxo.DisplayPreference.Preference preference) { + PaymentMethodConfigurationUpdateParams.Multibanco.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -6623,7 +6708,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class P24 { + public static class NaverPay { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6637,7 +6722,7 @@ public static class P24 { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private P24(DisplayPreference displayPreference, Map extraParams) { + private NaverPay(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6652,14 +6737,14 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.P24 build() { - return new PaymentMethodConfigurationUpdateParams.P24( + public PaymentMethodConfigurationUpdateParams.NaverPay build() { + return new PaymentMethodConfigurationUpdateParams.NaverPay( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.P24.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.NaverPay.DisplayPreference displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6667,7 +6752,7 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.P24#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.NaverPay#extraParams} for the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6680,7 +6765,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 PaymentMethodConfigurationUpdateParams.P24#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.NaverPay#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6723,16 +6808,17 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.P24.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.P24.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.NaverPay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.NaverPay.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.P24.DisplayPreference#extraParams} - * for the field documentation. + * map. See {@link + * PaymentMethodConfigurationUpdateParams.NaverPay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6745,8 +6831,9 @@ public Builder putExtraParam(String key, Object value) { /** * Add all map key/value pairs to `extraParams` map. A map is initialized for the first * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link PaymentMethodConfigurationUpdateParams.P24.DisplayPreference#extraParams} - * for the field documentation. + * map. See {@link + * PaymentMethodConfigurationUpdateParams.NaverPay.DisplayPreference#extraParams} for the + * field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6758,7 +6845,8 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.P24.DisplayPreference.Preference preference) { + PaymentMethodConfigurationUpdateParams.NaverPay.DisplayPreference.Preference + preference) { this.preference = preference; return this; } @@ -6786,7 +6874,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class PayByBank { + public static class NzBankAccount { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6800,7 +6888,7 @@ public static class PayByBank { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PayByBank(DisplayPreference displayPreference, Map extraParams) { + private NzBankAccount(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6815,14 +6903,15 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.PayByBank build() { - return new PaymentMethodConfigurationUpdateParams.PayByBank( + public PaymentMethodConfigurationUpdateParams.NzBankAccount build() { + return new PaymentMethodConfigurationUpdateParams.NzBankAccount( this.displayPreference, this.extraParams); } /** Whether or not the payment method should be displayed. */ public Builder setDisplayPreference( - PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference displayPreference) { + PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference + displayPreference) { this.displayPreference = displayPreference; return this; } @@ -6830,7 +6919,8 @@ public Builder setDisplayPreference( /** * Add a key/value pair to `extraParams` map. 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.PayByBank#extraParams} for the field documentation. + * PaymentMethodConfigurationUpdateParams.NzBankAccount#extraParams} for the field + * documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6843,7 +6933,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 PaymentMethodConfigurationUpdateParams.PayByBank#extraParams} for the field + * See {@link PaymentMethodConfigurationUpdateParams.NzBankAccount#extraParams} for the field * documentation. */ public Builder putAllExtraParam(Map map) { @@ -6886,8 +6976,8 @@ public static class Builder { private Preference preference; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference build() { - return new PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference( + public PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference( this.extraParams, this.preference); } @@ -6895,8 +6985,8 @@ public PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference build( * Add a key/value pair to `extraParams` map. 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.PayByBank.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference#extraParams} for + * the field documentation. */ public Builder putExtraParam(String key, Object value) { if (this.extraParams == null) { @@ -6910,8 +7000,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 - * PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference#extraParams} for the - * field documentation. + * PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference#extraParams} for + * the field documentation. */ public Builder putAllExtraParam(Map map) { if (this.extraParams == null) { @@ -6923,7 +7013,7 @@ public Builder putAllExtraParam(Map map) { /** The account's preference for whether or not to display this payment method. */ public Builder setPreference( - PaymentMethodConfigurationUpdateParams.PayByBank.DisplayPreference.Preference + PaymentMethodConfigurationUpdateParams.NzBankAccount.DisplayPreference.Preference preference) { this.preference = preference; return this; @@ -6952,7 +7042,7 @@ public enum Preference implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) - public static class Paynow { + public static class Oxxo { /** Whether or not the payment method should be displayed. */ @SerializedName("display_preference") DisplayPreference displayPreference; @@ -6966,7 +7056,7 @@ public static class Paynow { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private Paynow(DisplayPreference displayPreference, Map extraParams) { + private Oxxo(DisplayPreference displayPreference, Map extraParams) { this.displayPreference = displayPreference; this.extraParams = extraParams; } @@ -6981,8 +7071,667 @@ public static class Builder { private Map extraParams; /** Finalize and obtain parameter instance from this builder. */ - public PaymentMethodConfigurationUpdateParams.Paynow build() { - return new PaymentMethodConfigurationUpdateParams.Paynow( + public PaymentMethodConfigurationUpdateParams.Oxxo build() { + return new PaymentMethodConfigurationUpdateParams.Oxxo( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Oxxo.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.Oxxo#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.Oxxo#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.Oxxo.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Oxxo.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.Oxxo.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.Oxxo.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.Oxxo.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 P24 { + /** 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 P24(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.P24 build() { + return new PaymentMethodConfigurationUpdateParams.P24( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.P24.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.P24#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.P24#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.P24.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.P24.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.P24.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.P24.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.P24.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 PayByBank { + /** 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 PayByBank(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.PayByBank build() { + return new PaymentMethodConfigurationUpdateParams.PayByBank( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.PayByBank.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.PayByBank#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.PayByBank#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.PayByBank.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.PayByBank.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.PayByBank.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.PayByBank.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.PayByBank.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 Payco { + /** 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 Payco(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.Payco build() { + return new PaymentMethodConfigurationUpdateParams.Payco( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Payco.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.Payco#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.Payco#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.Payco.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Payco.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.Payco.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.Payco.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.Payco.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 Paynow { + /** 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 Paynow(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.Paynow build() { + return new PaymentMethodConfigurationUpdateParams.Paynow( this.displayPreference, this.extraParams); } @@ -7775,6 +8524,172 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class SamsungPay { + /** 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 SamsungPay(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.SamsungPay build() { + return new PaymentMethodConfigurationUpdateParams.SamsungPay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.SamsungPay.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.SamsungPay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.SamsungPay#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.SamsungPay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.SamsungPay.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.SamsungPay.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.SamsungPay.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.SamsungPay.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 Satispay { diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 7a462448a55..f5858d0830f 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -66,6 +66,13 @@ public class SubscriptionCreateParams extends ApiRequestParams { @SerializedName("billing_cycle_anchor_config") BillingCycleAnchorConfig billingCycleAnchorConfig; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * A timestamp at which the subscription should cancel. If set to a date before the current period * ends, this will cause a proration if prorations have been enabled using {@code @@ -77,7 +84,8 @@ public class SubscriptionCreateParams extends ApiRequestParams { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -302,6 +310,7 @@ private SubscriptionCreateParams( Long backdateStartDate, Long billingCycleAnchor, BillingCycleAnchorConfig billingCycleAnchorConfig, + Object billingThresholds, Long cancelAt, Boolean cancelAtPeriodEnd, CollectionMethod collectionMethod, @@ -335,6 +344,7 @@ private SubscriptionCreateParams( this.backdateStartDate = backdateStartDate; this.billingCycleAnchor = billingCycleAnchor; this.billingCycleAnchorConfig = billingCycleAnchorConfig; + this.billingThresholds = billingThresholds; this.cancelAt = cancelAt; this.cancelAtPeriodEnd = cancelAtPeriodEnd; this.collectionMethod = collectionMethod; @@ -381,6 +391,8 @@ public static class Builder { private BillingCycleAnchorConfig billingCycleAnchorConfig; + private Object billingThresholds; + private Long cancelAt; private Boolean cancelAtPeriodEnd; @@ -444,6 +456,7 @@ public SubscriptionCreateParams build() { this.backdateStartDate, this.billingCycleAnchor, this.billingCycleAnchorConfig, + this.billingThresholds, this.cancelAt, this.cancelAtPeriodEnd, this.collectionMethod, @@ -567,6 +580,25 @@ public Builder setBillingCycleAnchorConfig( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionCreateParams.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * A timestamp at which the subscription should cancel. If set to a date before the current * period ends, this will cause a proration if prorations have been enabled using {@code @@ -580,7 +612,8 @@ public Builder setCancelAt(Long cancelAt) { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -1888,6 +1921,99 @@ public Builder setSecond(Long second) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. If + * true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was last + * reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.BillingThresholds build() { + return new SubscriptionCreateParams.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * SubscriptionCreateParams.BillingThresholds#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionCreateParams.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -2221,6 +2347,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -2273,6 +2406,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Object discounts, Map extraParams, Map metadata, @@ -2281,6 +2415,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -2296,6 +2431,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private Map extraParams; @@ -2315,6 +2452,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionCreateParams.Item build() { return new SubscriptionCreateParams.Item( + this.billingThresholds, this.discounts, this.extraParams, this.metadata, @@ -2325,6 +2463,25 @@ public SubscriptionCreateParams.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionCreateParams.Item.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -2497,6 +2654,88 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.Item.BillingThresholds build() { + return new SubscriptionCreateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionCreateParams.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionCreateParams.Item.BillingThresholds#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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java index 1a4d69ba1a2..60c9900cfc6 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemCreateParams.java @@ -15,6 +15,13 @@ @Getter @EqualsAndHashCode(callSuper = false) public class SubscriptionItemCreateParams extends ApiRequestParams { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -124,6 +131,7 @@ public class SubscriptionItemCreateParams extends ApiRequestParams { Object taxRates; private SubscriptionItemCreateParams( + Object billingThresholds, Object discounts, List expand, Map extraParams, @@ -137,6 +145,7 @@ private SubscriptionItemCreateParams( Long quantity, String subscription, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.expand = expand; this.extraParams = extraParams; @@ -157,6 +166,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private List expand; @@ -186,6 +197,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemCreateParams build() { return new SubscriptionItemCreateParams( + this.billingThresholds, this.discounts, this.expand, this.extraParams, @@ -201,6 +213,25 @@ public SubscriptionItemCreateParams build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionItemCreateParams.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -462,6 +493,86 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemCreateParams.BillingThresholds build() { + return new SubscriptionItemCreateParams.BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionItemCreateParams.BillingThresholds#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionItemCreateParams.BillingThresholds#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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java index 5a4bf2ae290..8e9340c5b94 100644 --- a/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionItemUpdateParams.java @@ -15,6 +15,13 @@ @Getter @EqualsAndHashCode(callSuper = false) public class SubscriptionItemUpdateParams extends ApiRequestParams { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -131,6 +138,7 @@ public class SubscriptionItemUpdateParams extends ApiRequestParams { Object taxRates; private SubscriptionItemUpdateParams( + Object billingThresholds, Object discounts, List expand, Map extraParams, @@ -144,6 +152,7 @@ private SubscriptionItemUpdateParams( Long prorationDate, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.expand = expand; this.extraParams = extraParams; @@ -164,6 +173,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private List expand; @@ -193,6 +204,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionItemUpdateParams build() { return new SubscriptionItemUpdateParams( + this.billingThresholds, this.discounts, this.expand, this.extraParams, @@ -208,6 +220,25 @@ public SubscriptionItemUpdateParams build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionItemUpdateParams.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` call, * and subsequent calls adds additional elements to the original list. See {@link @@ -516,6 +547,86 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionItemUpdateParams.BillingThresholds build() { + return new SubscriptionItemUpdateParams.BillingThresholds(this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionItemUpdateParams.BillingThresholds#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionItemUpdateParams.BillingThresholds#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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionResumeParams.java b/src/main/java/com/stripe/param/SubscriptionResumeParams.java index cf893d35595..0630cf0e49a 100644 --- a/src/main/java/com/stripe/param/SubscriptionResumeParams.java +++ b/src/main/java/com/stripe/param/SubscriptionResumeParams.java @@ -36,18 +36,18 @@ public class SubscriptionResumeParams extends ApiRequestParams { /** * Determines how to handle prorations when the billing - * cycle changes (e.g., when switching plans, resetting {@code billing_cycle_anchor=now}, or - * starting a trial), or if an item's {@code quantity} changes. The default value is {@code - * create_prorations}. + * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations resulting from + * the {@code billing_cycle_anchor} being {@code unchanged}. When the {@code billing_cycle_anchor} + * is set to {@code now} (default value), no prorations are generated. If no value is passed, the + * default is {@code create_prorations}. */ @SerializedName("proration_behavior") ProrationBehavior prorationBehavior; /** - * If set, the proration will be calculated as though the subscription was resumed at the given - * time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. + * If set, prorations will be calculated as though the subscription was resumed at the given time. + * This can be used to apply exactly the same prorations that were previewed with the create preview endpoint. */ @SerializedName("proration_date") Long prorationDate; @@ -155,10 +155,10 @@ public Builder putAllExtraParam(Map map) { /** * Determines how to handle prorations when the - * billing cycle changes (e.g., when switching plans, resetting {@code - * billing_cycle_anchor=now}, or starting a trial), or if an item's {@code quantity} changes. - * The default value is {@code create_prorations}. + * href="https://stripe.com/docs/billing/subscriptions/prorations">prorations resulting from + * the {@code billing_cycle_anchor} being {@code unchanged}. When the {@code + * billing_cycle_anchor} is set to {@code now} (default value), no prorations are generated. If + * no value is passed, the default is {@code create_prorations}. */ public Builder setProrationBehavior( SubscriptionResumeParams.ProrationBehavior prorationBehavior) { @@ -167,9 +167,9 @@ public Builder setProrationBehavior( } /** - * If set, the proration will be calculated as though the subscription was resumed at the given - * time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. + * If set, prorations will be calculated as though the subscription was resumed at the given + * time. This can be used to apply exactly the same prorations that were previewed with the create preview endpoint. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index a5c65468644..514cfa9ab56 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -350,6 +350,13 @@ public static class DefaultSettings { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -406,6 +413,7 @@ private DefaultSettings( BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, CollectionMethod collectionMethod, String defaultPaymentMethod, Object description, @@ -416,6 +424,7 @@ private DefaultSettings( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; this.description = description; @@ -436,6 +445,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private CollectionMethod collectionMethod; private String defaultPaymentMethod; @@ -456,6 +467,7 @@ public SubscriptionScheduleCreateParams.DefaultSettings build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, this.description, @@ -497,6 +509,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle @@ -818,6 +849,102 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleCreateParams.DefaultSettings.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class InvoiceSettings { @@ -1245,6 +1372,13 @@ public static class Phase { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -1353,14 +1487,13 @@ public static class Phase { String onBehalfOf; /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field on - * the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing configuration - * of the current phase. + * (item price, quantity, etc.) of the current phase. */ @SerializedName("proration_behavior") ProrationBehavior prorationBehavior; @@ -1391,6 +1524,7 @@ private Phase( BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, CollectionMethod collectionMethod, String currency, String defaultPaymentMethod, @@ -1412,6 +1546,7 @@ private Phase( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; @@ -1444,6 +1579,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private CollectionMethod collectionMethod; private String currency; @@ -1485,6 +1622,7 @@ public SubscriptionScheduleCreateParams.Phase build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.collectionMethod, this.currency, this.defaultPaymentMethod, @@ -1564,6 +1702,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle @@ -1835,14 +1992,13 @@ public Builder setOnBehalfOf(String onBehalfOf) { } /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field - * on the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing - * configuration of the current phase. + * configuration (item price, quantity, etc.) of the current phase. */ public Builder setProrationBehavior( SubscriptionScheduleCreateParams.Phase.ProrationBehavior prorationBehavior) { @@ -2601,6 +2757,100 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 SubscriptionScheduleCreateParams.Phase.BillingThresholds#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionScheduleCreateParams.Phase.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -2966,6 +3216,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -3026,6 +3283,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Object discounts, Map extraParams, Map metadata, @@ -3034,6 +3292,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -3049,6 +3308,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private Map extraParams; @@ -3068,6 +3329,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCreateParams.Phase.Item build() { return new SubscriptionScheduleCreateParams.Phase.Item( + this.billingThresholds, this.discounts, this.extraParams, this.metadata, @@ -3078,6 +3340,25 @@ public SubscriptionScheduleCreateParams.Phase.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -3264,6 +3545,91 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleCreateParams.Phase.Item.BillingThresholds#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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index c676f9ef50a..bcdb6000191 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -60,8 +60,9 @@ public class SubscriptionScheduleUpdateParams extends ApiRequestParams { List phases; /** - * If the update changes the current phase, indicates whether the changes should be prorated. The - * default value is {@code create_prorations}. + * If the update changes the billing configuration (item price, quantity, etc.) of the current + * phase, indicates how prorations from this change should be handled. The default value is {@code + * create_prorations}. */ @SerializedName("proration_behavior") ProrationBehavior prorationBehavior; @@ -261,8 +262,9 @@ public Builder addAllPhase(List elements } /** - * If the update changes the current phase, indicates whether the changes should be prorated. - * The default value is {@code create_prorations}. + * If the update changes the billing configuration (item price, quantity, etc.) of the current + * phase, indicates how prorations from this change should be handled. The default value is + * {@code create_prorations}. */ public Builder setProrationBehavior( SubscriptionScheduleUpdateParams.ProrationBehavior prorationBehavior) { @@ -298,6 +300,13 @@ public static class DefaultSettings { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -354,6 +363,7 @@ private DefaultSettings( BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, CollectionMethod collectionMethod, Object defaultPaymentMethod, Object description, @@ -364,6 +374,7 @@ private DefaultSettings( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.defaultPaymentMethod = defaultPaymentMethod; this.description = description; @@ -384,6 +395,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private CollectionMethod collectionMethod; private Object defaultPaymentMethod; @@ -404,6 +417,7 @@ public SubscriptionScheduleUpdateParams.DefaultSettings build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.collectionMethod, this.defaultPaymentMethod, this.description, @@ -445,6 +459,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle @@ -782,6 +815,102 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleUpdateParams.DefaultSettings.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class InvoiceSettings { @@ -1221,6 +1350,13 @@ public static class Phase { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle using @@ -1329,14 +1465,13 @@ public static class Phase { Object onBehalfOf; /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field on - * the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing configuration - * of the current phase. + * (item price, quantity, etc.) of the current phase. */ @SerializedName("proration_behavior") ProrationBehavior prorationBehavior; @@ -1374,6 +1509,7 @@ private Phase( BigDecimal applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, CollectionMethod collectionMethod, Object currency, Object defaultPaymentMethod, @@ -1396,6 +1532,7 @@ private Phase( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.collectionMethod = collectionMethod; this.currency = currency; this.defaultPaymentMethod = defaultPaymentMethod; @@ -1429,6 +1566,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private CollectionMethod collectionMethod; private Object currency; @@ -1472,6 +1611,7 @@ public SubscriptionScheduleUpdateParams.Phase build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.collectionMethod, this.currency, this.defaultPaymentMethod, @@ -1552,6 +1692,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Either {@code charge_automatically}, or {@code send_invoice}. When charging automatically, * Stripe will attempt to pay the underlying subscription at the end of each billing cycle @@ -1861,14 +2020,13 @@ public Builder setOnBehalfOf(EmptyParam onBehalfOf) { } /** - * Whether the subscription schedule will create prorations when - * transitioning to this phase. The default value is {@code create_prorations}. This setting - * controls prorations when a phase is started asynchronously and it is persisted as a field - * on the phase. It's different from the request-level proration_behavior * parameter which controls what happens if the update request affects the billing - * configuration of the current phase. + * configuration (item price, quantity, etc.) of the current phase. */ public Builder setProrationBehavior( SubscriptionScheduleUpdateParams.Phase.ProrationBehavior prorationBehavior) { @@ -2715,6 +2873,100 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 SubscriptionScheduleUpdateParams.Phase.BillingThresholds#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionScheduleUpdateParams.Phase.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is + * reached. If true, {@code billing_cycle_anchor} will be updated to the date/time the + * threshold was last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { @@ -3104,6 +3356,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** The coupons to redeem into discounts for the subscription item. */ @SerializedName("discounts") Object discounts; @@ -3164,6 +3423,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Object discounts, Map extraParams, Map metadata, @@ -3172,6 +3432,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.discounts = discounts; this.extraParams = extraParams; this.metadata = metadata; @@ -3187,6 +3448,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Object discounts; private Map extraParams; @@ -3206,6 +3469,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleUpdateParams.Phase.Item build() { return new SubscriptionScheduleUpdateParams.Phase.Item( + this.billingThresholds, this.discounts, this.extraParams, this.metadata, @@ -3216,6 +3480,25 @@ public SubscriptionScheduleUpdateParams.Phase.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a + * new billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Add an element to `discounts` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -3417,6 +3700,91 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds build() { + return new SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleUpdateParams.Phase.Item.BillingThresholds#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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 5b78cd9d0e5..f8eaeee314d 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -49,6 +49,13 @@ public class SubscriptionUpdateParams extends ApiRequestParams { @SerializedName("billing_cycle_anchor") BillingCycleAnchor billingCycleAnchor; + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * A timestamp at which the subscription should cancel. If set to a date before the current period * ends, this will cause a proration if prorations have been enabled using {@code @@ -60,7 +67,8 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -236,11 +244,11 @@ public class SubscriptionUpdateParams extends ApiRequestParams { ProrationBehavior prorationBehavior; /** - * If set, the proration will be calculated as though the subscription was updated at the given - * time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can also - * be used to implement custom proration logic, such as prorating by day instead of by second, by - * providing the time that you wish to use for proration calculations. + * If set, prorations will be calculated as though the subscription was updated at the given time. + * This can be used to apply exactly the same prorations that were previewed with the create preview endpoint. {@code + * proration_date} can also be used to implement custom proration logic, such as prorating by day + * instead of by second, by providing the time that you wish to use for proration calculations. */ @SerializedName("proration_date") Long prorationDate; @@ -256,9 +264,10 @@ public class SubscriptionUpdateParams extends ApiRequestParams { /** * Unix timestamp representing the end of the trial period the customer will get before being * charged for the first time. This will always overwrite any trials that might apply via a - * subscribed plan. If set, trial_end will override the default trial period of the plan the - * customer is being subscribed to. The special value {@code now} can be provided to end the - * customer's trial immediately. Can be at most two years from {@code billing_cycle_anchor}. + * subscribed plan. If set, {@code trial_end} will override the default trial period of the plan + * the customer is being subscribed to. The {@code billing_cycle_anchor} will be updated to the + * {@code trial_end} value. The special value {@code now} can be provided to end the customer's + * trial immediately. Can be at most two years from {@code billing_cycle_anchor}. */ @SerializedName("trial_end") Object trialEnd; @@ -282,6 +291,7 @@ private SubscriptionUpdateParams( Object applicationFeePercent, AutomaticTax automaticTax, BillingCycleAnchor billingCycleAnchor, + Object billingThresholds, Object cancelAt, Boolean cancelAtPeriodEnd, CancellationDetails cancellationDetails, @@ -313,6 +323,7 @@ private SubscriptionUpdateParams( this.applicationFeePercent = applicationFeePercent; this.automaticTax = automaticTax; this.billingCycleAnchor = billingCycleAnchor; + this.billingThresholds = billingThresholds; this.cancelAt = cancelAt; this.cancelAtPeriodEnd = cancelAtPeriodEnd; this.cancellationDetails = cancellationDetails; @@ -355,6 +366,8 @@ public static class Builder { private BillingCycleAnchor billingCycleAnchor; + private Object billingThresholds; + private Object cancelAt; private Boolean cancelAtPeriodEnd; @@ -416,6 +429,7 @@ public SubscriptionUpdateParams build() { this.applicationFeePercent, this.automaticTax, this.billingCycleAnchor, + this.billingThresholds, this.cancelAt, this.cancelAtPeriodEnd, this.cancellationDetails, @@ -518,6 +532,25 @@ public Builder setBillingCycleAnchor( return this; } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionUpdateParams.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. When updating, pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * A timestamp at which the subscription should cancel. If set to a date before the current * period ends, this will cause a proration if prorations have been enabled using {@code @@ -542,7 +575,8 @@ public Builder setCancelAt(EmptyParam cancelAt) { /** * Indicate whether this subscription should cancel at the end of the current period ({@code - * current_period_end}). Defaults to {@code false}. + * current_period_end}). Defaults to {@code false}. This param will be removed in a future API + * version. Please use {@code cancel_at} instead. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -996,11 +1030,12 @@ public Builder setProrationBehavior( } /** - * If set, the proration will be calculated as though the subscription was updated at the given - * time. This can be used to apply exactly the same proration that was previewed with upcoming invoice endpoint. It can - * also be used to implement custom proration logic, such as prorating by day instead of by - * second, by providing the time that you wish to use for proration calculations. + * If set, prorations will be calculated as though the subscription was updated at the given + * time. This can be used to apply exactly the same prorations that were previewed with the create preview endpoint. + * {@code proration_date} can also be used to implement custom proration logic, such as + * prorating by day instead of by second, by providing the time that you wish to use for + * proration calculations. */ public Builder setProrationDate(Long prorationDate) { this.prorationDate = prorationDate; @@ -1030,9 +1065,10 @@ public Builder setTransferData(EmptyParam transferData) { /** * Unix timestamp representing the end of the trial period the customer will get before being * charged for the first time. This will always overwrite any trials that might apply via a - * subscribed plan. If set, trial_end will override the default trial period of the plan the - * customer is being subscribed to. The special value {@code now} can be provided to end the - * customer's trial immediately. Can be at most two years from {@code billing_cycle_anchor}. + * subscribed plan. If set, {@code trial_end} will override the default trial period of the plan + * the customer is being subscribed to. The {@code billing_cycle_anchor} will be updated to the + * {@code trial_end} value. The special value {@code now} can be provided to end the customer's + * trial immediately. Can be at most two years from {@code billing_cycle_anchor}. */ public Builder setTrialEnd(SubscriptionUpdateParams.TrialEnd trialEnd) { this.trialEnd = trialEnd; @@ -1042,9 +1078,10 @@ public Builder setTrialEnd(SubscriptionUpdateParams.TrialEnd trialEnd) { /** * Unix timestamp representing the end of the trial period the customer will get before being * charged for the first time. This will always overwrite any trials that might apply via a - * subscribed plan. If set, trial_end will override the default trial period of the plan the - * customer is being subscribed to. The special value {@code now} can be provided to end the - * customer's trial immediately. Can be at most two years from {@code billing_cycle_anchor}. + * subscribed plan. If set, {@code trial_end} will override the default trial period of the plan + * the customer is being subscribed to. The {@code billing_cycle_anchor} will be updated to the + * {@code trial_end} value. The special value {@code now} can be provided to end the customer's + * trial immediately. Can be at most two years from {@code billing_cycle_anchor}. */ public Builder setTrialEnd(Long trialEnd) { this.trialEnd = trialEnd; @@ -1829,6 +1866,99 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + @SerializedName("amount_gte") + Long amountGte; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. If + * true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was last + * reached; otherwise, the value will remain unchanged. + */ + @SerializedName("reset_billing_cycle_anchor") + Boolean resetBillingCycleAnchor; + + private BillingThresholds( + Long amountGte, Map extraParams, Boolean resetBillingCycleAnchor) { + this.amountGte = amountGte; + this.extraParams = extraParams; + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountGte; + + private Map extraParams; + + private Boolean resetBillingCycleAnchor; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.BillingThresholds build() { + return new SubscriptionUpdateParams.BillingThresholds( + this.amountGte, this.extraParams, this.resetBillingCycleAnchor); + } + + /** Monetary threshold that triggers the subscription to advance to a new billing period. */ + public Builder setAmountGte(Long amountGte) { + this.amountGte = amountGte; + 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 + * SubscriptionUpdateParams.BillingThresholds#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionUpdateParams.BillingThresholds#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 if the {@code billing_cycle_anchor} should be reset when a threshold is reached. + * If true, {@code billing_cycle_anchor} will be updated to the date/time the threshold was + * last reached; otherwise, the value will remain unchanged. + */ + public Builder setResetBillingCycleAnchor(Boolean resetBillingCycleAnchor) { + this.resetBillingCycleAnchor = resetBillingCycleAnchor; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CancellationDetails { @@ -2334,6 +2464,13 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Item { + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + @SerializedName("billing_thresholds") + Object billingThresholds; + /** * Delete all usage for a given subscription item. You must pass this when deleting a usage * records subscription item. {@code clear_usage} has no effect if the plan has a billing meter @@ -2406,6 +2543,7 @@ public static class Item { Object taxRates; private Item( + Object billingThresholds, Boolean clearUsage, Boolean deleted, Object discounts, @@ -2417,6 +2555,7 @@ private Item( PriceData priceData, Long quantity, Object taxRates) { + this.billingThresholds = billingThresholds; this.clearUsage = clearUsage; this.deleted = deleted; this.discounts = discounts; @@ -2435,6 +2574,8 @@ public static Builder builder() { } public static class Builder { + private Object billingThresholds; + private Boolean clearUsage; private Boolean deleted; @@ -2460,6 +2601,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionUpdateParams.Item build() { return new SubscriptionUpdateParams.Item( + this.billingThresholds, this.clearUsage, this.deleted, this.discounts, @@ -2473,6 +2615,25 @@ public SubscriptionUpdateParams.Item build() { this.taxRates); } + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds( + SubscriptionUpdateParams.Item.BillingThresholds billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + + /** + * Define thresholds at which an invoice will be sent, and the subscription advanced to a new + * billing period. Pass an empty string to remove previously-defined thresholds. + */ + public Builder setBillingThresholds(EmptyParam billingThresholds) { + this.billingThresholds = billingThresholds; + return this; + } + /** * Delete all usage for a given subscription item. You must pass this when deleting a usage * records subscription item. {@code clear_usage} has no effect if the plan has a billing @@ -2717,6 +2878,88 @@ public Builder setTaxRates(List taxRates) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingThresholds { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Number of units that meets the billing threshold to advance the + * subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + @SerializedName("usage_gte") + Long usageGte; + + private BillingThresholds(Map extraParams, Long usageGte) { + this.extraParams = extraParams; + this.usageGte = usageGte; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long usageGte; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.Item.BillingThresholds build() { + return new SubscriptionUpdateParams.Item.BillingThresholds( + this.extraParams, this.usageGte); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.Item.BillingThresholds#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.Item.BillingThresholds#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. Number of units that meets the billing threshold to advance + * the subscription to a new billing period (e.g., it takes 10 $5 units to meet a $50 monetary + * threshold) + */ + public Builder setUsageGte(Long usageGte) { + this.usageGte = usageGte; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Discount { diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 2ac8c29e544..185af077bad 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -615,7 +615,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2025_03_31_BASIL("2025-03-31.basil"), @SerializedName("2025-04-30.basil") - VERSION_2025_04_30_BASIL("2025-04-30.basil"); + VERSION_2025_04_30_BASIL("2025-04-30.basil"), + + @SerializedName("2025-05-28.basil") + VERSION_2025_05_28_BASIL("2025-05-28.basil"); @Getter(onMethod_ = {@Override}) private final String value; @@ -930,6 +933,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.will_be_due") INVOICE__WILL_BE_DUE("invoice.will_be_due"), + @SerializedName("invoice_payment.paid") + INVOICE_PAYMENT__PAID("invoice_payment.paid"), + @SerializedName("invoiceitem.created") INVOICEITEM__CREATED("invoiceitem.created"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index ae8c7e047bd..d1f9802e35d 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -567,6 +567,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.will_be_due") INVOICE__WILL_BE_DUE("invoice.will_be_due"), + @SerializedName("invoice_payment.paid") + INVOICE_PAYMENT__PAID("invoice_payment.paid"), + @SerializedName("invoiceitem.created") INVOICEITEM__CREATED("invoiceitem.created"), diff --git a/src/main/java/com/stripe/param/billing/AlertCreateParams.java b/src/main/java/com/stripe/param/billing/AlertCreateParams.java index bfc37f6c2d8..f6e4a483961 100644 --- a/src/main/java/com/stripe/param/billing/AlertCreateParams.java +++ b/src/main/java/com/stripe/param/billing/AlertCreateParams.java @@ -167,8 +167,8 @@ public static class UsageThreshold { Long gte; /** - * The Billing Meter ID whose usage is - * monitored. + * Required. The Billing + * Meter ID whose usage is monitored. */ @SerializedName("meter") String meter; @@ -273,8 +273,8 @@ public Builder setGte(Long gte) { } /** - * The Billing Meter ID whose usage is - * monitored. + * Required. The Billing + * Meter ID whose usage is monitored. */ public Builder setMeter(String meter) { this.meter = meter; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index babc96a619b..fd0f8858a7f 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -13733,6 +13733,13 @@ public static class SavedPaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Enable customers to choose if they wish to remove their saved payment methods. Disabled by + * default. + */ + @SerializedName("payment_method_remove") + PaymentMethodRemove paymentMethodRemove; + /** * Enable customers to choose if they wish to save their payment method for future use. Disabled * by default. @@ -13744,9 +13751,11 @@ private SavedPaymentMethodOptions( List allowRedisplayFilters, Map extraParams, + PaymentMethodRemove paymentMethodRemove, PaymentMethodSave paymentMethodSave) { this.allowRedisplayFilters = allowRedisplayFilters; this.extraParams = extraParams; + this.paymentMethodRemove = paymentMethodRemove; this.paymentMethodSave = paymentMethodSave; } @@ -13760,12 +13769,17 @@ public static class Builder { private Map extraParams; + private PaymentMethodRemove paymentMethodRemove; + private PaymentMethodSave paymentMethodSave; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.SavedPaymentMethodOptions build() { return new SessionCreateParams.SavedPaymentMethodOptions( - this.allowRedisplayFilters, this.extraParams, this.paymentMethodSave); + this.allowRedisplayFilters, + this.extraParams, + this.paymentMethodRemove, + this.paymentMethodSave); } /** @@ -13825,6 +13839,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Enable customers to choose if they wish to remove their saved payment methods. Disabled by + * default. + */ + public Builder setPaymentMethodRemove( + SessionCreateParams.SavedPaymentMethodOptions.PaymentMethodRemove paymentMethodRemove) { + this.paymentMethodRemove = paymentMethodRemove; + return this; + } + /** * Enable customers to choose if they wish to save their payment method for future use. * Disabled by default. @@ -13854,6 +13878,21 @@ public enum AllowRedisplayFilter implements ApiRequestParams.EnumParam { } } + 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"), diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index 84b148b5622..c7f5247f253 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -38,6 +38,10 @@ public class CardCreateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The new financial account ID the card will be associated with. This field allows a card to be + * reassigned to a different financial account. + */ @SerializedName("financial_account") String financialAccount; @@ -253,6 +257,10 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The new financial account ID the card will be associated with. This field allows a card to be + * reassigned to a different financial account. + */ public Builder setFinancialAccount(String financialAccount) { this.financialAccount = financialAccount; return this; diff --git a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java index b0f28ee59af..a539435d89c 100644 --- a/src/main/java/com/stripe/param/tax/CalculationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/CalculationCreateParams.java @@ -1141,6 +1141,14 @@ public static class LineItem { @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. + */ + @SerializedName("metadata") + Map metadata; + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code tax_code}. */ @@ -1179,6 +1187,7 @@ public static class LineItem { private LineItem( Long amount, Map extraParams, + Map metadata, String product, Long quantity, String reference, @@ -1186,6 +1195,7 @@ private LineItem( String taxCode) { this.amount = amount; this.extraParams = extraParams; + this.metadata = metadata; this.product = product; this.quantity = quantity; this.reference = reference; @@ -1202,6 +1212,8 @@ public static class Builder { private Map extraParams; + private Map metadata; + private String product; private Long quantity; @@ -1217,6 +1229,7 @@ public CalculationCreateParams.LineItem build() { return new CalculationCreateParams.LineItem( this.amount, this.extraParams, + this.metadata, this.product, this.quantity, this.reference, @@ -1261,6 +1274,32 @@ public Builder putAllExtraParam(Map 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 + * CalculationCreateParams.LineItem#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link CalculationCreateParams.LineItem#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** * If provided, the product's {@code tax_code} will be used as the line item's {@code * tax_code}. diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index cef90a12e4b..b699668442c 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -12701,7 +12701,8 @@ public static class LocalAmusementTax { * href="https://www.census.gov/library/reference/code-lists/ansi.html">FIPS code * representing the local jurisdiction. Supported FIPS codes are: {@code 14000} (Chicago), * {@code 06613} (Bloomington), {@code 21696} (East Dundee), {@code 24582} (Evanston), - * {@code 45421} (Lynwood), {@code 64343} (River Grove), and {@code 68081} (Schiller Park). + * {@code 45421} (Lynwood), {@code 48892} (Midlothian), {@code 64343} (River Grove), and + * {@code 68081} (Schiller Park). */ @SerializedName("jurisdiction") String jurisdiction; @@ -12761,8 +12762,8 @@ public Builder putAllExtraParam(Map map) { * href="https://www.census.gov/library/reference/code-lists/ansi.html">FIPS code * representing the local jurisdiction. Supported FIPS codes are: {@code 14000} (Chicago), * {@code 06613} (Bloomington), {@code 21696} (East Dundee), {@code 24582} (Evanston), - * {@code 45421} (Lynwood), {@code 64343} (River Grove), and {@code 68081} (Schiller - * Park). + * {@code 45421} (Lynwood), {@code 48892} (Midlothian), {@code 64343} (River Grove), and + * {@code 68081} (Schiller Park). */ public Builder setJurisdiction(String jurisdiction) { this.jurisdiction = jurisdiction; diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java new file mode 100644 index 00000000000..efe83e3e0e8 --- /dev/null +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java @@ -0,0 +1,808 @@ +// File generated from our OpenAPI spec +package com.stripe.param.terminal; + +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 ReaderCollectInputsParams 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. List of inputs to be collected using the Reader */ + @SerializedName("inputs") + List inputs; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + private ReaderCollectInputsParams( + List expand, + Map extraParams, + List inputs, + Map metadata) { + this.expand = expand; + this.extraParams = extraParams; + this.inputs = inputs; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private List inputs; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams build() { + return new ReaderCollectInputsParams( + this.expand, this.extraParams, this.inputs, 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 + * ReaderCollectInputsParams#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 + * ReaderCollectInputsParams#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 + * ReaderCollectInputsParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderCollectInputsParams#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 `inputs` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams#inputs} for the field documentation. + */ + public Builder addInput(ReaderCollectInputsParams.Input element) { + if (this.inputs == null) { + this.inputs = new ArrayList<>(); + } + this.inputs.add(element); + return this; + } + + /** + * Add all elements to `inputs` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams#inputs} for the field documentation. + */ + public Builder addAllInput(List elements) { + if (this.inputs == null) { + this.inputs = new ArrayList<>(); + } + this.inputs.addAll(elements); + 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 + * ReaderCollectInputsParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderCollectInputsParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Input { + /** + * Required. Customize the text which will be displayed while collecting this + * input + */ + @SerializedName("custom_text") + CustomText customText; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Indicate that this input is required, disabling the skip button. */ + @SerializedName("required") + Boolean required; + + /** Options for the {@code selection} input. */ + @SerializedName("selection") + Selection selection; + + /** List of toggles to be displayed and customization for the toggles. */ + @SerializedName("toggles") + List toggles; + + /** Required. The type of input to collect */ + @SerializedName("type") + Type type; + + private Input( + CustomText customText, + Map extraParams, + Boolean required, + Selection selection, + List toggles, + Type type) { + this.customText = customText; + this.extraParams = extraParams; + this.required = required; + this.selection = selection; + this.toggles = toggles; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CustomText customText; + + private Map extraParams; + + private Boolean required; + + private Selection selection; + + private List toggles; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams.Input build() { + return new ReaderCollectInputsParams.Input( + this.customText, + this.extraParams, + this.required, + this.selection, + this.toggles, + this.type); + } + + /** + * Required. Customize the text which will be displayed while collecting this + * input + */ + public Builder setCustomText(ReaderCollectInputsParams.Input.CustomText customText) { + this.customText = customText; + 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 + * ReaderCollectInputsParams.Input#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderCollectInputsParams.Input#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Indicate that this input is required, disabling the skip button. */ + public Builder setRequired(Boolean required) { + this.required = required; + return this; + } + + /** Options for the {@code selection} input. */ + public Builder setSelection(ReaderCollectInputsParams.Input.Selection selection) { + this.selection = selection; + return this; + } + + /** + * Add an element to `toggles` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams.Input#toggles} for the field documentation. + */ + public Builder addToggle(ReaderCollectInputsParams.Input.Toggle element) { + if (this.toggles == null) { + this.toggles = new ArrayList<>(); + } + this.toggles.add(element); + return this; + } + + /** + * Add all elements to `toggles` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams.Input#toggles} for the field documentation. + */ + public Builder addAllToggle(List elements) { + if (this.toggles == null) { + this.toggles = new ArrayList<>(); + } + this.toggles.addAll(elements); + return this; + } + + /** Required. The type of input to collect */ + public Builder setType(ReaderCollectInputsParams.Input.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CustomText { + /** The description which will be displayed when collecting this input. */ + @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 skip button text. */ + @SerializedName("skip_button") + String skipButton; + + /** The submit button text. */ + @SerializedName("submit_button") + String submitButton; + + /** Required. The title which will be displayed when collecting this input */ + @SerializedName("title") + String title; + + private CustomText( + String description, + Map extraParams, + String skipButton, + String submitButton, + String title) { + this.description = description; + this.extraParams = extraParams; + this.skipButton = skipButton; + this.submitButton = submitButton; + this.title = title; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String description; + + private Map extraParams; + + private String skipButton; + + private String submitButton; + + private String title; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams.Input.CustomText build() { + return new ReaderCollectInputsParams.Input.CustomText( + this.description, this.extraParams, this.skipButton, this.submitButton, this.title); + } + + /** The description which will be displayed when collecting this input. */ + 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 ReaderCollectInputsParams.Input.CustomText#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ReaderCollectInputsParams.Input.CustomText#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 skip button text. */ + public Builder setSkipButton(String skipButton) { + this.skipButton = skipButton; + return this; + } + + /** The submit button text. */ + public Builder setSubmitButton(String submitButton) { + this.submitButton = submitButton; + return this; + } + + /** + * Required. The title which will be displayed when collecting this input + */ + public Builder setTitle(String title) { + this.title = title; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Selection { + /** Required. List of choices for the {@code selection} input */ + @SerializedName("choices") + List choices; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 Selection( + List choices, + Map extraParams) { + this.choices = choices; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List choices; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams.Input.Selection build() { + return new ReaderCollectInputsParams.Input.Selection(this.choices, this.extraParams); + } + + /** + * Add an element to `choices` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams.Input.Selection#choices} for the field documentation. + */ + public Builder addChoice(ReaderCollectInputsParams.Input.Selection.Choice element) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.add(element); + return this; + } + + /** + * Add all elements to `choices` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectInputsParams.Input.Selection#choices} for the field documentation. + */ + public Builder addAllChoice( + List elements) { + if (this.choices == null) { + this.choices = new ArrayList<>(); + } + this.choices.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 ReaderCollectInputsParams.Input.Selection#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ReaderCollectInputsParams.Input.Selection#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 Choice { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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 unique identifier for this choice */ + @SerializedName("id") + String id; + + /** The style of the button which will be shown for this choice. */ + @SerializedName("style") + Style style; + + /** Required. The text which will be shown on the button for this choice */ + @SerializedName("text") + String text; + + private Choice(Map extraParams, String id, Style style, String text) { + this.extraParams = extraParams; + this.id = id; + this.style = style; + this.text = text; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String id; + + private Style style; + + private String text; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams.Input.Selection.Choice build() { + return new ReaderCollectInputsParams.Input.Selection.Choice( + this.extraParams, this.id, this.style, this.text); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ReaderCollectInputsParams.Input.Selection.Choice#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ReaderCollectInputsParams.Input.Selection.Choice#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 unique identifier for this choice */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** The style of the button which will be shown for this choice. */ + public Builder setStyle(ReaderCollectInputsParams.Input.Selection.Choice.Style style) { + this.style = style; + return this; + } + + /** + * Required. The text which will be shown on the button for this choice + */ + public Builder setText(String text) { + this.text = text; + return this; + } + } + + public enum Style implements ApiRequestParams.EnumParam { + @SerializedName("primary") + PRIMARY("primary"), + + @SerializedName("secondary") + SECONDARY("secondary"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Style(String value) { + this.value = value; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Toggle { + /** The default value of the toggle. */ + @SerializedName("default_value") + DefaultValue defaultValue; + + /** The description which will be displayed for the toggle. */ + @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 title which will be displayed for the toggle. */ + @SerializedName("title") + String title; + + private Toggle( + DefaultValue defaultValue, + String description, + Map extraParams, + String title) { + this.defaultValue = defaultValue; + this.description = description; + this.extraParams = extraParams; + this.title = title; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DefaultValue defaultValue; + + private String description; + + private Map extraParams; + + private String title; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectInputsParams.Input.Toggle build() { + return new ReaderCollectInputsParams.Input.Toggle( + this.defaultValue, this.description, this.extraParams, this.title); + } + + /** The default value of the toggle. */ + public Builder setDefaultValue( + ReaderCollectInputsParams.Input.Toggle.DefaultValue defaultValue) { + this.defaultValue = defaultValue; + return this; + } + + /** The description which will be displayed for the toggle. */ + 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 ReaderCollectInputsParams.Input.Toggle#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ReaderCollectInputsParams.Input.Toggle#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 title which will be displayed for the toggle. */ + public Builder setTitle(String title) { + this.title = title; + return this; + } + } + + public enum DefaultValue implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + DefaultValue(String value) { + this.value = value; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("email") + EMAIL("email"), + + @SerializedName("numeric") + NUMERIC("numeric"), + + @SerializedName("phone") + PHONE("phone"), + + @SerializedName("selection") + SELECTION("selection"), + + @SerializedName("signature") + SIGNATURE("signature"), + + @SerializedName("text") + TEXT("text"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } +} diff --git a/src/main/java/com/stripe/param/terminal/ReaderListParams.java b/src/main/java/com/stripe/param/terminal/ReaderListParams.java index 460801418a3..47caf319733 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderListParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderListParams.java @@ -246,6 +246,9 @@ public enum DeviceType implements ApiRequestParams.EnumParam { @SerializedName("mobile_phone_reader") MOBILE_PHONE_READER("mobile_phone_reader"), + @SerializedName("simulated_stripe_s700") + SIMULATED_STRIPE_S700("simulated_stripe_s700"), + @SerializedName("simulated_wisepos_e") SIMULATED_WISEPOS_E("simulated_wisepos_e"), diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java index d27746bf8d2..826c2e8bcc9 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java @@ -153,6 +153,14 @@ public static class ProcessConfig { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment on + * the payment method's app or site. If you'd prefer to redirect to a mobile application, you + * can alternatively supply an application URI scheme. + */ + @SerializedName("return_url") + String returnUrl; + /** Override showing a tipping selection screen on this transaction. */ @SerializedName("skip_tipping") Boolean skipTipping; @@ -165,11 +173,13 @@ private ProcessConfig( AllowRedisplay allowRedisplay, Boolean enableCustomerCancellation, Map extraParams, + String returnUrl, Boolean skipTipping, Tipping tipping) { this.allowRedisplay = allowRedisplay; this.enableCustomerCancellation = enableCustomerCancellation; this.extraParams = extraParams; + this.returnUrl = returnUrl; this.skipTipping = skipTipping; this.tipping = tipping; } @@ -185,6 +195,8 @@ public static class Builder { private Map extraParams; + private String returnUrl; + private Boolean skipTipping; private Tipping tipping; @@ -195,6 +207,7 @@ public ReaderProcessPaymentIntentParams.ProcessConfig build() { this.allowRedisplay, this.enableCustomerCancellation, this.extraParams, + this.returnUrl, this.skipTipping, this.tipping); } @@ -243,6 +256,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The URL to redirect your customer back to after they authenticate or cancel their payment + * on the payment method's app or site. If you'd prefer to redirect to a mobile application, + * you can alternatively supply an application URI scheme. + */ + public Builder setReturnUrl(String returnUrl) { + this.returnUrl = returnUrl; + return this; + } + /** Override showing a tipping selection screen on this transaction. */ public Builder setSkipTipping(Boolean skipTipping) { this.skipTipping = skipTipping; diff --git a/src/main/java/com/stripe/param/terminal/ReaderSucceedInputCollectionParams.java b/src/main/java/com/stripe/param/terminal/ReaderSucceedInputCollectionParams.java new file mode 100644 index 00000000000..cfcfaeec7f6 --- /dev/null +++ b/src/main/java/com/stripe/param/terminal/ReaderSucceedInputCollectionParams.java @@ -0,0 +1,133 @@ +// File generated from our OpenAPI spec +package com.stripe.param.terminal; + +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 ReaderSucceedInputCollectionParams 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; + + /** This parameter defines the skip behavior for input collection. */ + @SerializedName("skip_non_required_inputs") + SkipNonRequiredInputs skipNonRequiredInputs; + + private ReaderSucceedInputCollectionParams( + List expand, + Map extraParams, + SkipNonRequiredInputs skipNonRequiredInputs) { + this.expand = expand; + this.extraParams = extraParams; + this.skipNonRequiredInputs = skipNonRequiredInputs; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List expand; + + private Map extraParams; + + private SkipNonRequiredInputs skipNonRequiredInputs; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderSucceedInputCollectionParams build() { + return new ReaderSucceedInputCollectionParams( + this.expand, this.extraParams, this.skipNonRequiredInputs); + } + + /** + * 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 + * ReaderSucceedInputCollectionParams#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 + * ReaderSucceedInputCollectionParams#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 + * ReaderSucceedInputCollectionParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderSucceedInputCollectionParams#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 parameter defines the skip behavior for input collection. */ + public Builder setSkipNonRequiredInputs( + ReaderSucceedInputCollectionParams.SkipNonRequiredInputs skipNonRequiredInputs) { + this.skipNonRequiredInputs = skipNonRequiredInputs; + return this; + } + } + + public enum SkipNonRequiredInputs implements ApiRequestParams.EnumParam { + @SerializedName("all") + ALL("all"), + + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SkipNonRequiredInputs(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/terminal/ReaderTimeoutInputCollectionParams.java b/src/main/java/com/stripe/param/terminal/ReaderTimeoutInputCollectionParams.java new file mode 100644 index 00000000000..f3f19bd9099 --- /dev/null +++ b/src/main/java/com/stripe/param/terminal/ReaderTimeoutInputCollectionParams.java @@ -0,0 +1,100 @@ +// File generated from our OpenAPI spec +package com.stripe.param.terminal; + +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 ReaderTimeoutInputCollectionParams 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 ReaderTimeoutInputCollectionParams(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 ReaderTimeoutInputCollectionParams build() { + return new ReaderTimeoutInputCollectionParams(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 + * ReaderTimeoutInputCollectionParams#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 + * ReaderTimeoutInputCollectionParams#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 + * ReaderTimeoutInputCollectionParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderTimeoutInputCollectionParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/service/CreditNoteService.java b/src/main/java/com/stripe/service/CreditNoteService.java index 33554a16a2a..f5dab955ab3 100644 --- a/src/main/java/com/stripe/service/CreditNoteService.java +++ b/src/main/java/com/stripe/service/CreditNoteService.java @@ -50,55 +50,57 @@ public StripeCollection list(CreditNoteListParams params, RequestOpt return this.request(request, new TypeToken>() {}.getType()); } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public CreditNote create(CreditNoteCreateParams params) throws StripeException { return create(params, (RequestOptions) null); } /** - * Issue a credit note to adjust the amount of a finalized invoice. For a {@code status=open} - * invoice, a credit note reduces its {@code amount_due}. For a {@code status=paid} invoice, a - * credit note does not affect its {@code amount_due}. Instead, it can result in any combination - * of the following: + * Issue a credit note to adjust the amount of a finalized invoice. A credit note will first + * reduce the invoice’s {@code amount_remaining} (and {@code amount_due}), but not below zero. + * This amount is indicated by the credit note’s {@code pre_payment_amount}. The excess amount is + * indicated by {@code post_payment_amount}, and it can result in any combination of the + * following: * *

* *

* - *

For post-payment credit notes the sum of the refund, credit and outside of Stripe amounts - * must equal the credit note total. + *

The sum of refunds, customer balance credits, and outside of Stripe credits must equal the + * {@code post_payment_amount}. * - *

You may issue multiple credit notes for an invoice. Each credit note will increment the - * invoice’s {@code pre_payment_credit_notes_amount} or {@code post_payment_credit_notes_amount} - * depending on its {@code status} at the time of credit note creation. + *

You may issue multiple credit notes for an invoice. Each credit note may increment the + * invoice’s {@code pre_payment_credit_notes_amount}, {@code post_payment_credit_notes_amount}, or + * both, depending on the invoice’s {@code amount_remaining} at the time of credit note creation. */ public CreditNote create(CreditNoteCreateParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/InvoiceService.java b/src/main/java/com/stripe/service/InvoiceService.java index 5d9a112bdb7..30efc494903 100644 --- a/src/main/java/com/stripe/service/InvoiceService.java +++ b/src/main/java/com/stripe/service/InvoiceService.java @@ -14,6 +14,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.InvoiceAddLinesParams; +import com.stripe.param.InvoiceAttachPaymentParams; import com.stripe.param.InvoiceCreateParams; import com.stripe.param.InvoiceCreatePreviewParams; import com.stripe.param.InvoiceFinalizeInvoiceParams; @@ -273,6 +274,85 @@ public Invoice addLines(String invoice, InvoiceAddLinesParams params, RequestOpt options); return this.request(request, Invoice.class); } + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(String invoice, InvoiceAttachPaymentParams params) + throws StripeException { + return attachPayment(invoice, params, (RequestOptions) null); + } + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(String invoice, RequestOptions options) throws StripeException { + return attachPayment(invoice, (InvoiceAttachPaymentParams) null, options); + } + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment(String invoice) throws StripeException { + return attachPayment(invoice, (InvoiceAttachPaymentParams) null, (RequestOptions) null); + } + /** + * Attaches a PaymentIntent or an Out of Band Payment to the invoice, adding it to the list of + * {@code payments}. + * + *

For the PaymentIntent, when the PaymentIntent’s status changes to {@code succeeded}, the + * payment is credited to the invoice, increasing its {@code amount_paid}. When the invoice is + * fully paid, the invoice’s status becomes {@code paid}. + * + *

If the PaymentIntent’s status is already {@code succeeded} when it’s attached, it’s credited + * to the invoice immediately. + * + *

See: Partial payments to + * learn more. + */ + public Invoice attachPayment( + String invoice, InvoiceAttachPaymentParams params, RequestOptions options) + throws StripeException { + String path = String.format("/v1/invoices/%s/attach_payment", ApiResource.urlEncodeId(invoice)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Invoice.class); + } /** * Stripe automatically finalizes drafts before sending and attempting payment on invoices. * However, if you’d like to finalize a draft invoice manually, you can do so using this method. @@ -587,19 +667,20 @@ public Invoice voidInvoice( * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -613,19 +694,20 @@ public Invoice createPreview(InvoiceCreatePreviewParams params) throws StripeExc * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -639,19 +721,20 @@ public Invoice createPreview(RequestOptions options) throws StripeException { * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more @@ -665,19 +748,20 @@ public Invoice createPreview() throws StripeException { * invoice item charges, etc. It will also show you any discounts that are applicable to the * invoice. * + *

You can also preview the effects of creating or updating a subscription or subscription + * schedule, including a preview of any prorations that will take place. To ensure that the actual + * proration is calculated exactly the same as the previewed proration, you should pass the {@code + * subscription_details.proration_date} parameter when doing the actual subscription update. + * + *

The recommended way to get only the prorations being previewed on the invoice is to consider + * line items where {@code parent.subscription_item_details.proration} is {@code true}. + * *

Note that when you are viewing an upcoming invoice, you are simply viewing a preview – the * invoice has not yet been created. As such, the upcoming invoice will not show up in invoice * listing calls, and you cannot use the API to pay or edit the invoice. If you want to change the * amount that your customer will be billed, you can add, remove, or update pending invoice items, * or update the customer’s discount. * - *

You can preview the effects of updating a subscription, including a preview of what - * proration will take place. To ensure that the actual proration is calculated exactly the same - * as the previewed proration, you should pass the {@code subscription_details.proration_date} - * parameter when doing the actual subscription update. The recommended way to get only the - * prorations being previewed is to consider only proration line items where {@code period[start]} - * is equal to the {@code subscription_details.proration_date} value passed in the request. - * *

Note: Currency conversion calculations use the latest exchange rates. Exchange rates may * vary between the time of the preview and the time of the actual invoice creation. Learn more diff --git a/src/main/java/com/stripe/service/checkout/SessionService.java b/src/main/java/com/stripe/service/checkout/SessionService.java index 7f2c6bdba03..1fd61f54801 100644 --- a/src/main/java/com/stripe/service/checkout/SessionService.java +++ b/src/main/java/com/stripe/service/checkout/SessionService.java @@ -97,19 +97,39 @@ public Session retrieve(String session, SessionRetrieveParams params, RequestOpt options); return this.request(request, Session.class); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(String session, SessionUpdateParams params) throws StripeException { return update(session, params, (RequestOptions) null); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(String session, RequestOptions options) throws StripeException { return update(session, (SessionUpdateParams) null, options); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(String session) throws StripeException { return update(session, (SessionUpdateParams) null, (RequestOptions) null); } - /** Updates a Checkout Session object. */ + /** + * Updates a Checkout Session object. + * + *

Related guide: Dynamically + * update Checkout. + */ public Session update(String session, SessionUpdateParams params, RequestOptions options) throws StripeException { String path = String.format("/v1/checkout/sessions/%s", ApiResource.urlEncodeId(session)); diff --git a/src/main/java/com/stripe/service/terminal/ReaderService.java b/src/main/java/com/stripe/service/terminal/ReaderService.java index 386a3c5ff6c..d76702f578c 100644 --- a/src/main/java/com/stripe/service/terminal/ReaderService.java +++ b/src/main/java/com/stripe/service/terminal/ReaderService.java @@ -13,6 +13,7 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.terminal.ReaderCancelActionParams; +import com.stripe.param.terminal.ReaderCollectInputsParams; import com.stripe.param.terminal.ReaderCreateParams; import com.stripe.param.terminal.ReaderListParams; import com.stripe.param.terminal.ReaderProcessPaymentIntentParams; @@ -168,6 +169,26 @@ public Reader cancelAction(String reader, ReaderCancelActionParams params, Reque options); return this.request(request, Reader.class); } + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs(String reader, ReaderCollectInputsParams params) + throws StripeException { + return collectInputs(reader, params, (RequestOptions) null); + } + /** Initiates an input collection flow on a Reader. */ + public Reader collectInputs( + String reader, ReaderCollectInputsParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/terminal/readers/%s/collect_inputs", ApiResource.urlEncodeId(reader)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Reader.class); + } /** Initiates a payment flow on a Reader. */ public Reader processPaymentIntent(String reader, ReaderProcessPaymentIntentParams params) throws StripeException { diff --git a/src/main/java/com/stripe/service/testhelpers/terminal/ReaderService.java b/src/main/java/com/stripe/service/testhelpers/terminal/ReaderService.java index 840cd85b4af..b1d03f3bf25 100644 --- a/src/main/java/com/stripe/service/testhelpers/terminal/ReaderService.java +++ b/src/main/java/com/stripe/service/testhelpers/terminal/ReaderService.java @@ -11,6 +11,8 @@ import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; import com.stripe.param.terminal.ReaderPresentPaymentMethodParams; +import com.stripe.param.terminal.ReaderSucceedInputCollectionParams; +import com.stripe.param.terminal.ReaderTimeoutInputCollectionParams; public final class ReaderService extends ApiService { public ReaderService(StripeResponseGetter responseGetter) { @@ -60,4 +62,76 @@ public Reader presentPaymentMethod( options); return this.request(request, Reader.class); } + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(String reader, ReaderSucceedInputCollectionParams params) + throws StripeException { + return succeedInputCollection(reader, params, (RequestOptions) null); + } + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(String reader, RequestOptions options) + throws StripeException { + return succeedInputCollection(reader, (ReaderSucceedInputCollectionParams) null, options); + } + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection(String reader) throws StripeException { + return succeedInputCollection( + reader, (ReaderSucceedInputCollectionParams) null, (RequestOptions) null); + } + /** Use this endpoint to trigger a successful input collection on a simulated reader. */ + public Reader succeedInputCollection( + String reader, ReaderSucceedInputCollectionParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/succeed_input_collection", + ApiResource.urlEncodeId(reader)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Reader.class); + } + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(String reader, ReaderTimeoutInputCollectionParams params) + throws StripeException { + return timeoutInputCollection(reader, params, (RequestOptions) null); + } + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(String reader, RequestOptions options) + throws StripeException { + return timeoutInputCollection(reader, (ReaderTimeoutInputCollectionParams) null, options); + } + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection(String reader) throws StripeException { + return timeoutInputCollection( + reader, (ReaderTimeoutInputCollectionParams) null, (RequestOptions) null); + } + /** + * Use this endpoint to complete an input collection with a timeout error on a simulated reader. + */ + public Reader timeoutInputCollection( + String reader, ReaderTimeoutInputCollectionParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/test_helpers/terminal/readers/%s/timeout_input_collection", + ApiResource.urlEncodeId(reader)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Reader.class); + } }