diff --git a/API_VERSION b/API_VERSION new file mode 100644 index 00000000000..1116f63c2f8 --- /dev/null +++ b/API_VERSION @@ -0,0 +1 @@ +2025-06-30.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index f1757af659a..d8931ef8a65 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1773 +v1819 \ 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 02176b8db3c..279a56e0088 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,5 +2,6 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-05-28.basil"; + public static final String CURRENT = "2025-06-30.basil"; + public static final String CURRENT_MAJOR = "basil"; } diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 043a04fa4da..a6309ba8dc7 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1001,6 +1001,15 @@ public static class Capabilities extends StripeObject { @SerializedName("cashapp_payments") String cashappPayments; + /** + * The status of the Crypto capability of the account, or whether the account can directly + * process Crypto payments. + * + *

One of {@code active}, {@code inactive}, or {@code pending}. + */ + @SerializedName("crypto_payments") + String cryptoPayments; + /** * The status of the EPS payments capability of the account, or whether the account can directly * process EPS charges. @@ -2709,12 +2718,27 @@ public static class Schedule extends StripeObject { @SerializedName("monthly_anchor") Long monthlyAnchor; + /** + * The days of the month funds will be paid out. Only shown if {@code interval} is monthly. + * Payouts scheduled between the 29th and 31st of the month are sent on the last day of + * shorter months. + */ + @SerializedName("monthly_payout_days") + List monthlyPayoutDays; + /** * The day of the week funds will be paid out, of the style 'monday', 'tuesday', etc. Only * shown if {@code interval} is weekly. */ @SerializedName("weekly_anchor") String weeklyAnchor; + + /** + * The days of the week when available funds are paid out, specified as an array, for + * example, [{@code monday}, {@code tuesday}]. Only shown if {@code interval} is weekly. + */ + @SerializedName("weekly_payout_days") + List weeklyPayoutDays; } } diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index e40ef491a1b..208b5ed9ef2 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -201,21 +201,20 @@ public static class AccountManagement extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -246,21 +245,20 @@ public static class AccountOnboarding extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -291,42 +289,44 @@ public static class Balances extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("edit_payout_schedule") Boolean editPayoutSchedule; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("instant_payouts") Boolean instantPayouts; /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("standard_payouts") Boolean standardPayouts; @@ -364,20 +364,20 @@ public static class Features extends StripeObject { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, 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. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; } @@ -432,16 +432,21 @@ public static class FinancialAccount extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; - /** Whether to allow external accounts to be linked for money transfer. */ + /** + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. + */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -561,9 +566,11 @@ public static class Features extends StripeObject { Boolean cardholderManagement; /** - * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -598,21 +605,20 @@ public static class NotificationBanner extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -650,20 +656,20 @@ public static class Features extends StripeObject { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, 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. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; } @@ -693,20 +699,20 @@ public static class PaymentDisputes extends StripeObject { @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. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, 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. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; } @@ -743,20 +749,20 @@ public static class Features extends StripeObject { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, 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. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; } @@ -786,42 +792,44 @@ public static class Payouts extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class Features extends StripeObject { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("edit_payout_schedule") Boolean editPayoutSchedule; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("instant_payouts") Boolean instantPayouts; /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("standard_payouts") Boolean standardPayouts; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index bb47e3291e7..b5cb29c7fa0 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1200,6 +1200,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("cashapp") Cashapp cashapp; + @SerializedName("crypto") + Crypto crypto; + @SerializedName("customer_balance") CustomerBalance customerBalance; @@ -1856,7 +1859,7 @@ public static class Card extends StripeObject { IncrementalAuthorization incrementalAuthorization; /** - * Installment details for this payment (Mexico only). + * Installment details for this payment. * *

For more information, see the installments integration guide. @@ -2029,7 +2032,10 @@ public static class Plan extends StripeObject { @SerializedName("interval") String interval; - /** Type of installment plan, one of {@code fixed_count}. */ + /** + * Type of installment plan, one of {@code fixed_count}, {@code bonus}, or {@code + * revolving}. + */ @SerializedName("type") String type; } @@ -2482,7 +2488,10 @@ public static class CardPresent extends StripeObject { @SerializedName("overcapture_supported") Boolean overcaptureSupported; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -2542,11 +2551,18 @@ public static class Receipt extends StripeObject { @SerializedName("account_type") String accountType; - /** EMV tag 9F26, cryptogram generated by the integrated circuit chip. */ + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ @SerializedName("application_cryptogram") String applicationCryptogram; - /** Mnenomic of the Application Identifier. */ + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ @SerializedName("application_preferred_name") String applicationPreferredName; @@ -2567,16 +2583,24 @@ public static class Receipt extends StripeObject { String cardholderVerificationMethod; /** - * EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. */ @SerializedName("dedicated_file_name") String dedicatedFileName; - /** The outcome of a series of EMV functions performed by the card reader. */ + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ @SerializedName("terminal_verification_results") String terminalVerificationResults; - /** An indication of various EMV functions performed during the transaction. */ + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ @SerializedName("transaction_status_information") String transactionStatusInformation; } @@ -2615,6 +2639,39 @@ public static class Cashapp extends StripeObject { String cashtag; } + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** The wallet address of the customer. */ + @SerializedName("buyer_address") + String buyerAddress; + + /** + * The blockchain network that the transaction was sent on. + * + *

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

One of {@code usdc}, {@code usdg}, or {@code usdp}. + */ + @SerializedName("token_currency") + String tokenCurrency; + + /** The blockchain transaction hash of the crypto payment. */ + @SerializedName("transaction_hash") + String transactionHash; + } + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -2738,9 +2795,9 @@ public static class Grabpay extends StripeObject { public static class Ideal extends StripeObject { /** * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, {@code nn}, {@code - * rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, - * {@code van_lanschot}, or {@code yoursafe}. + * buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, + * {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code + * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -2749,9 +2806,9 @@ public static class Ideal extends StripeObject { * The Bank Identifier Code of the customer's bank. * *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code MOYONL21}, {@code - * NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code - * REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; @@ -2935,7 +2992,10 @@ public static class InteracPresent extends StripeObject { @SerializedName("network_transaction_id") String networkTransactionId; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -2971,11 +3031,18 @@ public static class Receipt extends StripeObject { @SerializedName("account_type") String accountType; - /** EMV tag 9F26, cryptogram generated by the integrated circuit chip. */ + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ @SerializedName("application_cryptogram") String applicationCryptogram; - /** Mnenomic of the Application Identifier. */ + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on the + * card's chip. + */ @SerializedName("application_preferred_name") String applicationPreferredName; @@ -2996,16 +3063,24 @@ public static class Receipt extends StripeObject { String cardholderVerificationMethod; /** - * EMV tag 84. Similar to the application identifier stored on the integrated circuit chip. + * Similar to the application_preferred_name, identifying the applications (AIDs) available + * on the card. Referenced from EMV tag 84. */ @SerializedName("dedicated_file_name") String dedicatedFileName; - /** The outcome of a series of EMV functions performed by the card reader. */ + /** + * A 5-byte string that records the checks and validations that occur between the card and + * the terminal. These checks determine how the terminal processes the transaction and what + * risk tolerance is acceptable. Referenced from EMV Tag 95. + */ @SerializedName("terminal_verification_results") String terminalVerificationResults; - /** An indication of various EMV functions performed during the transaction. */ + /** + * An indication of which steps were completed during the card read process. Referenced from + * EMV Tag 9B. + */ @SerializedName("transaction_status_information") String transactionStatusInformation; } diff --git a/src/main/java/com/stripe/model/ConfirmationToken.java b/src/main/java/com/stripe/model/ConfirmationToken.java index cb8255def79..2419385420b 100644 --- a/src/main/java/com/stripe/model/ConfirmationToken.java +++ b/src/main/java/com/stripe/model/ConfirmationToken.java @@ -251,7 +251,10 @@ public static class Plan extends StripeObject { @SerializedName("interval") String interval; - /** Type of installment plan, one of {@code fixed_count}. */ + /** + * Type of installment plan, one of {@code fixed_count}, {@code bonus}, or {@code + * revolving}. + */ @SerializedName("type") String type; } @@ -323,6 +326,9 @@ public static class PaymentMethodPreview extends StripeObject { @SerializedName("cashapp") Cashapp cashapp; + @SerializedName("crypto") + Crypto crypto; + /** * The ID of the Customer to which this PaymentMethod is saved. This will not be set when the * PaymentMethod has not been saved to a Customer. @@ -433,14 +439,14 @@ public static class PaymentMethodPreview extends StripeObject { *

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code * bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cashapp}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code - * giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code - * klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code mobilepay}, {@code - * multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code - * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code pix}, {@code promptpay}, - * {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code - * sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code - * zip}. + * card_present}, {@code cashapp}, {@code crypto}, {@code customer_balance}, {@code eps}, {@code + * fpx}, {@code giropay}, {@code grabpay}, {@code ideal}, {@code interac_present}, {@code + * kakao_pay}, {@code klarna}, {@code konbini}, {@code kr_card}, {@code link}, {@code + * mobilepay}, {@code multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, + * {@code p24}, {@code pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code pix}, + * {@code promptpay}, {@code revolut_pay}, {@code samsung_pay}, {@code satispay}, {@code + * sepa_debit}, {@code sofort}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code + * wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; @@ -1022,7 +1028,11 @@ public static class CardPresent extends StripeObject { @SerializedName("overcapture_supported") Boolean overcaptureSupported; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any + * customer-facing text, as read from the card. Referenced from EMV tag 5F2D, data + * encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -1083,11 +1093,18 @@ public static class Receipt extends StripeObject { @SerializedName("account_type") String accountType; - /** EMV tag 9F26, cryptogram generated by the integrated circuit chip. */ + /** + * The Application Cryptogram, a unique value generated by the card to authenticate + * the transaction with issuers. + */ @SerializedName("application_cryptogram") String applicationCryptogram; - /** Mnenomic of the Application Identifier. */ + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on + * the card's chip. + */ @SerializedName("application_preferred_name") String applicationPreferredName; @@ -1109,17 +1126,24 @@ public static class Receipt extends StripeObject { String cardholderVerificationMethod; /** - * EMV tag 84. Similar to the application identifier stored on the integrated circuit - * chip. + * Similar to the application_preferred_name, identifying the applications (AIDs) + * available on the card. Referenced from EMV tag 84. */ @SerializedName("dedicated_file_name") String dedicatedFileName; - /** The outcome of a series of EMV functions performed by the card reader. */ + /** + * A 5-byte string that records the checks and validations that occur between the card + * and the terminal. These checks determine how the terminal processes the transaction + * and what risk tolerance is acceptable. Referenced from EMV Tag 95. + */ @SerializedName("terminal_verification_results") String terminalVerificationResults; - /** An indication of various EMV functions performed during the transaction. */ + /** + * An indication of which steps were completed during the card read process. + * Referenced from EMV Tag 9B. + */ @SerializedName("transaction_status_information") String transactionStatusInformation; } @@ -1448,7 +1472,10 @@ public static class CardPresent extends StripeObject { @SerializedName("offline") Offline offline; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -1539,6 +1566,15 @@ public static class Cashapp extends StripeObject { String cashtag; } + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject {} + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -1626,9 +1662,9 @@ public static class Grabpay extends StripeObject {} public static class Ideal extends StripeObject { /** * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, - * {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code - * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. + * bunq}, {@code buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, + * {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code + * sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1637,9 +1673,9 @@ public static class Ideal extends StripeObject { * The Bank Identifier Code of the customer's bank, if the bank was provided. * *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code MOYONL21}, {@code - * NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code - * REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; @@ -1731,7 +1767,10 @@ public static class InteracPresent extends StripeObject { @SerializedName("networks") Networks networks; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; diff --git a/src/main/java/com/stripe/model/CustomerSession.java b/src/main/java/com/stripe/model/CustomerSession.java index 4b86348ff87..534a5a172e7 100644 --- a/src/main/java/com/stripe/model/CustomerSession.java +++ b/src/main/java/com/stripe/model/CustomerSession.java @@ -210,7 +210,7 @@ public static class Features extends StripeObject { /** * Determines the max number of saved payment methods for the Payment Element to display. - * This parameter defaults to {@code 3}. + * This parameter defaults to {@code 3}. The maximum redisplay limit is {@code 10}. */ @SerializedName("payment_method_redisplay_limit") Long paymentMethodRedisplayLimit; diff --git a/src/main/java/com/stripe/model/Dispute.java b/src/main/java/com/stripe/model/Dispute.java index e5bb2ce2a77..1445a1397ca 100644 --- a/src/main/java/com/stripe/model/Dispute.java +++ b/src/main/java/com/stripe/model/Dispute.java @@ -1166,7 +1166,7 @@ public static class Card extends StripeObject { * The type of dispute opened. Different case types may have varying fees and financial * impact. * - *

One of {@code chargeback}, or {@code inquiry}. + *

One of {@code chargeback}, {@code compliance}, or {@code inquiry}. */ @SerializedName("case_type") String caseType; diff --git a/src/main/java/com/stripe/model/Event.java b/src/main/java/com/stripe/model/Event.java index 8259eb58f5c..1391eed008e 100644 --- a/src/main/java/com/stripe/model/Event.java +++ b/src/main/java/com/stripe/model/Event.java @@ -56,8 +56,9 @@ public class Event extends ApiResource implements HasId { String account; /** - * The Stripe API version used to render {@code data}. This property is populated only for events - * on or after October 31, 2014. + * The Stripe API version used to render {@code data} when the event was created. The contents of + * {@code data} never change, so this value remains static regardless of the API version currently + * in use. This property is populated only for events created on or after October 31, 2014. */ @SerializedName("api_version") String apiVersion; @@ -191,13 +192,13 @@ public class Event extends ApiResource implements HasId { * subscription_schedule.expiring}, {@code subscription_schedule.released}, {@code * subscription_schedule.updated}, {@code tax.settings.updated}, {@code tax_rate.created}, {@code * tax_rate.updated}, {@code terminal.reader.action_failed}, {@code - * terminal.reader.action_succeeded}, {@code test_helpers.test_clock.advancing}, {@code - * test_helpers.test_clock.created}, {@code test_helpers.test_clock.deleted}, {@code - * test_helpers.test_clock.internal_failure}, {@code test_helpers.test_clock.ready}, {@code - * topup.canceled}, {@code topup.created}, {@code topup.failed}, {@code topup.reversed}, {@code - * topup.succeeded}, {@code transfer.created}, {@code transfer.reversed}, {@code - * transfer.updated}, {@code treasury.credit_reversal.created}, {@code - * treasury.credit_reversal.posted}, {@code treasury.debit_reversal.completed}, {@code + * terminal.reader.action_succeeded}, {@code terminal.reader.action_updated}, {@code + * test_helpers.test_clock.advancing}, {@code test_helpers.test_clock.created}, {@code + * test_helpers.test_clock.deleted}, {@code test_helpers.test_clock.internal_failure}, {@code + * test_helpers.test_clock.ready}, {@code topup.canceled}, {@code topup.created}, {@code + * topup.failed}, {@code topup.reversed}, {@code topup.succeeded}, {@code transfer.created}, + * {@code transfer.reversed}, {@code transfer.updated}, {@code treasury.credit_reversal.created}, + * {@code treasury.credit_reversal.posted}, {@code treasury.debit_reversal.completed}, {@code * treasury.debit_reversal.created}, {@code treasury.debit_reversal.initial_credit_granted}, * {@code treasury.financial_account.closed}, {@code treasury.financial_account.created}, {@code * treasury.financial_account.features_status_updated}, {@code diff --git a/src/main/java/com/stripe/model/InvoiceItem.java b/src/main/java/com/stripe/model/InvoiceItem.java index d18f3752852..3e7ae0a0338 100644 --- a/src/main/java/com/stripe/model/InvoiceItem.java +++ b/src/main/java/com/stripe/model/InvoiceItem.java @@ -24,15 +24,15 @@ /** * Invoice Items represent the component lines of an invoice. An invoice item is added to an invoice - * by creating or updating it with an {@code invoice} field, at which point it will be included as - * an invoice line item within invoice. When you create an invoice item with an + * {@code invoice} field, it is attached to the specified invoice and included as an invoice line item within invoice.lines. * *

Invoice Items can be created before you are ready to actually send the invoice. This can be * particularly useful when combined with a subscription. Sometimes you want to add a - * charge or credit to a customer, but actually charge or credit the customer’s card only at the end + * charge or credit to a customer, but actually charge or credit the customer's card only at the end * of a regular billing cycle. This is useful for combining several charges (to minimize * per-transaction fees), or for having Stripe tabulate your usage-based billing totals. * diff --git a/src/main/java/com/stripe/model/Mandate.java b/src/main/java/com/stripe/model/Mandate.java index aeedd1d46c2..b857d7608a2 100644 --- a/src/main/java/com/stripe/model/Mandate.java +++ b/src/main/java/com/stripe/model/Mandate.java @@ -227,6 +227,9 @@ public static class PaymentMethodDetails extends StripeObject { @SerializedName("kakao_pay") KakaoPay kakaoPay; + @SerializedName("klarna") + Klarna klarna; + @SerializedName("kr_card") KrCard krCard; @@ -381,6 +384,15 @@ public static class Cashapp extends StripeObject {} @EqualsAndHashCode(callSuper = false) public static class KakaoPay extends StripeObject {} + /** + * For more details about Klarna, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Klarna extends StripeObject {} + /** * For more details about KrCard, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index eb203e8210f..fc228314023 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -2522,6 +2522,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("cashapp") Cashapp cashapp; + @SerializedName("crypto") + Crypto crypto; + @SerializedName("customer_balance") CustomerBalance customerBalance; @@ -3148,7 +3151,7 @@ public static class Card extends StripeObject { String captureMethod; /** - * Installment details for this payment (Mexico only). + * Installment details for this payment. * *

For more information, see the installments integration guide. @@ -3314,7 +3317,10 @@ public static class AvailablePlan extends StripeObject { @SerializedName("interval") String interval; - /** Type of installment plan, one of {@code fixed_count}. */ + /** + * Type of installment plan, one of {@code fixed_count}, {@code bonus}, or {@code + * revolving}. + */ @SerializedName("type") String type; } @@ -3341,7 +3347,10 @@ public static class Plan extends StripeObject { @SerializedName("interval") String interval; - /** Type of installment plan, one of {@code fixed_count}. */ + /** + * Type of installment plan, one of {@code fixed_count}, {@code bonus}, or {@code + * revolving}. + */ @SerializedName("type") String type; } @@ -3503,6 +3512,39 @@ public static class Cashapp extends StripeObject { String setupFutureUsage; } + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

Equal to {@code none}. + */ + @SerializedName("setup_future_usage") + String setupFutureUsage; + } + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -3853,7 +3895,7 @@ public static class Klarna extends StripeObject { * with regional legislation and network rules, such as SCA. * - *

Equal to {@code none}. + *

One of {@code none}, {@code off_session}, or {@code on_session}. */ @SerializedName("setup_future_usage") String setupFutureUsage; diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 7264fcca35f..6cdec492a46 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -96,6 +96,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, {@code * alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code bancontact}, * {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code card_present}, {@code - * cashapp}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code giropay}, {@code grabpay}, - * {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, - * {@code kr_card}, {@code link}, {@code mobilepay}, {@code multibanco}, {@code naver_pay}, {@code - * nz_bank_account}, {@code oxxo}, {@code p24}, {@code pay_by_bank}, {@code payco}, {@code - * paynow}, {@code paypal}, {@code pix}, {@code promptpay}, {@code revolut_pay}, {@code - * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code sofort}, {@code swish}, {@code - * twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. + * cashapp}, {@code crypto}, {@code customer_balance}, {@code eps}, {@code fpx}, {@code giropay}, + * {@code grabpay}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, + * {@code konbini}, {@code kr_card}, {@code link}, {@code mobilepay}, {@code multibanco}, {@code + * naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code pay_by_bank}, {@code + * payco}, {@code paynow}, {@code paypal}, {@code pix}, {@code promptpay}, {@code revolut_pay}, + * {@code samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code sofort}, {@code swish}, + * {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. */ @SerializedName("type") String type; @@ -1212,7 +1215,11 @@ public static class CardPresent extends StripeObject { @SerializedName("overcapture_supported") Boolean overcaptureSupported; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing + * text, as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's + * chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -1273,11 +1280,18 @@ public static class Receipt extends StripeObject { @SerializedName("account_type") String accountType; - /** EMV tag 9F26, cryptogram generated by the integrated circuit chip. */ + /** + * The Application Cryptogram, a unique value generated by the card to authenticate the + * transaction with issuers. + */ @SerializedName("application_cryptogram") String applicationCryptogram; - /** Mnenomic of the Application Identifier. */ + /** + * The Application Identifier (AID) on the card used to determine which networks are + * eligible to process the transaction. Referenced from EMV tag 9F12, data encoded on + * the card's chip. + */ @SerializedName("application_preferred_name") String applicationPreferredName; @@ -1298,17 +1312,24 @@ public static class Receipt extends StripeObject { String cardholderVerificationMethod; /** - * EMV tag 84. Similar to the application identifier stored on the integrated circuit - * chip. + * Similar to the application_preferred_name, identifying the applications (AIDs) + * available on the card. Referenced from EMV tag 84. */ @SerializedName("dedicated_file_name") String dedicatedFileName; - /** The outcome of a series of EMV functions performed by the card reader. */ + /** + * A 5-byte string that records the checks and validations that occur between the card + * and the terminal. These checks determine how the terminal processes the transaction + * and what risk tolerance is acceptable. Referenced from EMV Tag 95. + */ @SerializedName("terminal_verification_results") String terminalVerificationResults; - /** An indication of various EMV functions performed during the transaction. */ + /** + * An indication of which steps were completed during the card read process. Referenced + * from EMV Tag 9B. + */ @SerializedName("transaction_status_information") String transactionStatusInformation; } @@ -1631,7 +1652,10 @@ public static class CardPresent extends StripeObject { @SerializedName("offline") Offline offline; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing text, + * as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -1722,6 +1746,15 @@ public static class Cashapp extends StripeObject { String cashtag; } + /** + * For more details about Crypto, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject {} + /** * For more details about CustomerBalance, please refer to the API Reference. @@ -1809,9 +1842,9 @@ public static class Grabpay extends StripeObject {} public static class Ideal extends StripeObject { /** * The customer's bank, if provided. Can be one of {@code abn_amro}, {@code asn_bank}, {@code - * bunq}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, {@code - * nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code - * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. + * bunq}, {@code buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, + * {@code n26}, {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code + * sns_bank}, {@code triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -1820,9 +1853,9 @@ public static class Ideal extends StripeObject { * The Bank Identifier Code of the customer's bank, if the bank was provided. * *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code MOYONL21}, {@code - * NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code - * REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; @@ -1913,7 +1946,10 @@ public static class InteracPresent extends StripeObject { @SerializedName("networks") Networks networks; - /** EMV tag 5F2D. Preferred languages specified by the integrated circuit chip. */ + /** + * The languages that the issuing bank recommends using for localizing any customer-facing text, + * as read from the card. Referenced from EMV tag 5F2D, data encoded on the card's chip. + */ @SerializedName("preferred_locales") List preferredLocales; @@ -2543,6 +2579,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(card, responseGetter); trySetResponseGetter(cardPresent, responseGetter); trySetResponseGetter(cashapp, responseGetter); + trySetResponseGetter(crypto, responseGetter); trySetResponseGetter(customer, responseGetter); trySetResponseGetter(customerBalance, responseGetter); trySetResponseGetter(eps, responseGetter); diff --git a/src/main/java/com/stripe/model/Quote.java b/src/main/java/com/stripe/model/Quote.java index ea18f793f54..98666a51950 100644 --- a/src/main/java/com/stripe/model/Quote.java +++ b/src/main/java/com/stripe/model/Quote.java @@ -1422,6 +1422,10 @@ public static class StatusTransitions extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SubscriptionData extends StripeObject { + /** The billing mode of the quote. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -1456,6 +1460,20 @@ public static class SubscriptionData extends StripeObject { */ @SerializedName("trial_period_days") Long trialPeriodDays; + + /** The billing mode of the quote. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode extends StripeObject { + /** + * Controls how prorations and invoices for subscriptions are calculated and orchestrated. + * + *

One of {@code classic}, or {@code flexible}. + */ + @SerializedName("type") + String type; + } } /** diff --git a/src/main/java/com/stripe/model/SetupAttempt.java b/src/main/java/com/stripe/model/SetupAttempt.java index 863f5363661..3bdd7a11ef4 100644 --- a/src/main/java/com/stripe/model/SetupAttempt.java +++ b/src/main/java/com/stripe/model/SetupAttempt.java @@ -788,9 +788,9 @@ public static class Cashapp extends StripeObject {} public static class Ideal extends StripeObject { /** * The customer's bank. Can be one of {@code abn_amro}, {@code asn_bank}, {@code bunq}, {@code - * handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, {@code nn}, {@code - * rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code triodos_bank}, - * {@code van_lanschot}, or {@code yoursafe}. + * buut}, {@code handelsbanken}, {@code ing}, {@code knab}, {@code moneyou}, {@code n26}, + * {@code nn}, {@code rabobank}, {@code regiobank}, {@code revolut}, {@code sns_bank}, {@code + * triodos_bank}, {@code van_lanschot}, or {@code yoursafe}. */ @SerializedName("bank") String bank; @@ -799,9 +799,9 @@ public static class Ideal extends StripeObject { * The Bank Identifier Code of the customer's bank. * *

One of {@code ABNANL2A}, {@code ASNBNL21}, {@code BITSNL2A}, {@code BUNQNL2A}, {@code - * FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code MOYONL21}, {@code - * NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code REVOIE23}, {@code - * REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. + * BUUTNL2A}, {@code FVLBNL22}, {@code HANDNL2A}, {@code INGBNL2A}, {@code KNABNL2H}, {@code + * MOYONL21}, {@code NNBANL2G}, {@code NTSBDEB1}, {@code RABONL2U}, {@code RBRBNL21}, {@code + * REVOIE23}, {@code REVOLT21}, {@code SNSBNL2A}, or {@code TRIONL2U}. */ @SerializedName("bic") String bic; diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index 937eccac83c..7593c837533 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -205,7 +205,11 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStorehere. + */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -1018,6 +1022,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("card_present") CardPresent cardPresent; + @SerializedName("klarna") + Klarna klarna; + @SerializedName("link") Link link; @@ -1255,6 +1262,23 @@ public static class MandateOptions extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class CardPresent extends StripeObject {} + /** + * For more details about Klarna, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Klarna extends StripeObject { + /** The currency of the setup intent. Three letter ISO currency code. */ + @SerializedName("currency") + String currency; + + /** Preferred locale of the Klarna checkout page that the customer is redirected to. */ + @SerializedName("preferred_locale") + String preferredLocale; + } + /** * For more details about Link, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/Subscription.java b/src/main/java/com/stripe/model/Subscription.java index ee52d6fb3c1..4649031b54d 100644 --- a/src/main/java/com/stripe/model/Subscription.java +++ b/src/main/java/com/stripe/model/Subscription.java @@ -13,6 +13,7 @@ import com.stripe.param.SubscriptionCancelParams; import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; +import com.stripe.param.SubscriptionMigrateParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -65,6 +66,10 @@ public class Subscription extends ApiResource implements HasId, MetadataStore params) throws StripeException { + return migrate(params, (RequestOptions) null); + } + + /** Upgrade the billing_mode of an existing subscription. */ + public Subscription migrate(Map params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/migrate", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Subscription.class); + } + + /** Upgrade the billing_mode of an existing subscription. */ + public Subscription migrate(SubscriptionMigrateParams params) throws StripeException { + return migrate(params, (RequestOptions) null); + } + + /** Upgrade the billing_mode of an existing subscription. */ + public Subscription migrate(SubscriptionMigrateParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/migrate", 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, Subscription.class); + } + /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked @@ -1359,6 +1396,24 @@ public static class BillingCycleAnchorConfig extends StripeObject { Long second; } + /** The billing mode of the subscription. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode extends StripeObject { + /** + * Controls how prorations and invoices for subscriptions are calculated and orchestrated. + * + *

One of {@code classic}, or {@code flexible}. + */ + @SerializedName("type") + String type; + + /** Details on when the current billing_mode was adopted. */ + @SerializedName("updated_at") + Long updatedAt; + } + /** * For more details about BillingThresholds, please refer to the API Reference. @@ -2030,6 +2085,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(application, responseGetter); trySetResponseGetter(automaticTax, responseGetter); trySetResponseGetter(billingCycleAnchorConfig, responseGetter); + trySetResponseGetter(billingMode, responseGetter); trySetResponseGetter(billingThresholds, responseGetter); trySetResponseGetter(cancellationDetails, responseGetter); trySetResponseGetter(customer, responseGetter); diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index b2536e3a58e..a2efba6bc13 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -43,6 +43,10 @@ public class SubscriptionSchedule extends ApiResource @Setter(lombok.AccessLevel.NONE) ExpandableField application; + /** The billing mode of the subscription. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * Time at which the subscription schedule was canceled. Measured in seconds since the Unix epoch. */ @@ -555,6 +559,24 @@ public SubscriptionSchedule update( return getResponseGetter().request(request, SubscriptionSchedule.class); } + /** The billing mode of the subscription. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode extends StripeObject { + /** + * Controls how prorations and invoices for subscriptions are calculated and orchestrated. + * + *

One of {@code classic}, or {@code flexible}. + */ + @SerializedName("type") + String type; + + /** Details on when the current billing_mode was adopted. */ + @SerializedName("updated_at") + Long updatedAt; + } + /** * For more details about CurrentPhase, please refer to the API Reference. @@ -1788,6 +1810,7 @@ public void setDestinationObject(Account expandableObject) { public void setResponseGetter(StripeResponseGetter responseGetter) { super.setResponseGetter(responseGetter); trySetResponseGetter(application, responseGetter); + trySetResponseGetter(billingMode, responseGetter); trySetResponseGetter(currentPhase, responseGetter); trySetResponseGetter(customer, responseGetter); trySetResponseGetter(defaultSettings, responseGetter); diff --git a/src/main/java/com/stripe/model/billingportal/Session.java b/src/main/java/com/stripe/model/billingportal/Session.java index 767179a0877..6b31d8e042e 100644 --- a/src/main/java/com/stripe/model/billingportal/Session.java +++ b/src/main/java/com/stripe/model/billingportal/Session.java @@ -326,10 +326,7 @@ public static class SubscriptionUpdate extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class SubscriptionUpdateConfirm extends StripeObject { - /** - * The coupon or promotion code to apply to this subscription update. Currently, only up to - * one may be specified. - */ + /** The coupon or promotion code to apply to this subscription update. */ @SerializedName("discounts") List discounts; diff --git a/src/main/java/com/stripe/model/identity/VerificationSession.java b/src/main/java/com/stripe/model/identity/VerificationSession.java index e065eed169b..fee00409fb5 100644 --- a/src/main/java/com/stripe/model/identity/VerificationSession.java +++ b/src/main/java/com/stripe/model/identity/VerificationSession.java @@ -133,6 +133,9 @@ public class VerificationSession extends ApiResource @SerializedName("related_customer") String relatedCustomer; + @SerializedName("related_person") + RelatedPerson relatedPerson; + /** * Status of this VerificationSession. Learn more about the lifecycle of @@ -717,6 +720,9 @@ public static class Options extends StripeObject { @SerializedName("id_number") IdNumber idNumber; + @SerializedName("matching") + Matching matching; + @SerializedName("phone") Phone phone; @@ -783,6 +789,31 @@ public static class Email extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class IdNumber extends StripeObject {} + /** + * For more details about Matching, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Matching extends StripeObject { + /** + * Strictness of the DOB matching policy to apply. + * + *

One of {@code none}, or {@code similar}. + */ + @SerializedName("dob") + String dob; + + /** + * Strictness of the name matching policy to apply. + * + *

One of {@code none}, or {@code similar}. + */ + @SerializedName("name") + String name; + } + /** * For more details about Phone, please refer to the API * Reference. @@ -831,6 +862,23 @@ public static class Redaction extends StripeObject { String status; } + /** + * For more details about RelatedPerson, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RelatedPerson extends StripeObject { + /** Token referencing the associated Account of the related Person resource. */ + @SerializedName("account") + String account; + + /** Token referencing the related Person resource. */ + @SerializedName("person") + String person; + } + /** * For more details about VerifiedOutputs, please refer to the API Reference. @@ -918,6 +966,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(options, responseGetter); trySetResponseGetter(providedDetails, responseGetter); trySetResponseGetter(redaction, responseGetter); + trySetResponseGetter(relatedPerson, responseGetter); trySetResponseGetter(verifiedOutputs, responseGetter); } } diff --git a/src/main/java/com/stripe/model/tax/Registration.java b/src/main/java/com/stripe/model/tax/Registration.java index a926de6ef47..ee06edade1d 100644 --- a/src/main/java/com/stripe/model/tax/Registration.java +++ b/src/main/java/com/stripe/model/tax/Registration.java @@ -525,6 +525,9 @@ public static class CountryOptions extends StripeObject { @SerializedName("tz") Tz tz; + @SerializedName("ua") + Ua ua; + @SerializedName("ug") Ug ug; @@ -2638,6 +2641,23 @@ public static class Tz extends StripeObject { String type; } + /** + * For more details about Ua, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Ua extends StripeObject { + /** + * Type of registration in {@code country}. + * + *

Equal to {@code simplified}. + */ + @SerializedName("type") + String type; + } + /** * For more details about Ug, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index fea34241544..3ee272db124 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -23,7 +23,12 @@ import lombok.Getter; import lombok.Setter; -/** A Configurations object represents how features should be configured for terminal readers. */ +/** + * A Configurations object represents how features should be configured for terminal readers. For + * information about how to use it, see the Terminal configurations + * documentation. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/terminal/Reader.java b/src/main/java/com/stripe/model/terminal/Reader.java index d8b5d3c0fa1..578dab1b198 100644 --- a/src/main/java/com/stripe/model/terminal/Reader.java +++ b/src/main/java/com/stripe/model/terminal/Reader.java @@ -8,6 +8,7 @@ import com.stripe.model.HasId; import com.stripe.model.MetadataStore; import com.stripe.model.PaymentIntent; +import com.stripe.model.PaymentMethod; import com.stripe.model.Refund; import com.stripe.model.SetupIntent; import com.stripe.model.StripeObject; @@ -19,6 +20,8 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.terminal.ReaderCancelActionParams; import com.stripe.param.terminal.ReaderCollectInputsParams; +import com.stripe.param.terminal.ReaderCollectPaymentMethodParams; +import com.stripe.param.terminal.ReaderConfirmPaymentIntentParams; import com.stripe.param.terminal.ReaderCreateParams; import com.stripe.param.terminal.ReaderListParams; import com.stripe.param.terminal.ReaderPresentPaymentMethodParams; @@ -228,6 +231,100 @@ public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions opt return getResponseGetter().request(request, Reader.class); } + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod(Map params) throws StripeException { + return collectPaymentMethod(params, (RequestOptions) null); + } + + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/collect_payment_method", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Reader.class); + } + + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params) + throws StripeException { + return collectPaymentMethod(params, (RequestOptions) null); + } + + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod( + ReaderCollectPaymentMethodParams params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/collect_payment_method", + 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); + } + + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent(Map params) throws StripeException { + return confirmPaymentIntent(params, (RequestOptions) null); + } + + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/confirm_payment_intent", + ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, Reader.class); + } + + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent(ReaderConfirmPaymentIntentParams params) + throws StripeException { + return confirmPaymentIntent(params, (RequestOptions) null); + } + + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent( + ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/confirm_payment_intent", + 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); @@ -573,6 +670,14 @@ public static class Action extends StripeObject { @SerializedName("collect_inputs") CollectInputs collectInputs; + /** Represents a reader action to collect a payment method. */ + @SerializedName("collect_payment_method") + CollectPaymentMethod collectPaymentMethod; + + /** Represents a reader action to confirm a payment. */ + @SerializedName("confirm_payment_intent") + ConfirmPaymentIntent confirmPaymentIntent; + /** Failure code, only set if status is {@code failed}. */ @SerializedName("failure_code") String failureCode; @@ -608,8 +713,9 @@ public static class Action extends StripeObject { /** * Type of action performed by the reader. * - *

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

One of {@code collect_inputs}, {@code collect_payment_method}, {@code + * confirm_payment_intent}, {@code process_payment_intent}, {@code process_setup_intent}, {@code + * refund_payment}, or {@code set_reader_display}. */ @SerializedName("type") String type; @@ -831,6 +937,133 @@ public static class Toggle extends StripeObject { } } + /** Represents a reader action to collect a payment method. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CollectPaymentMethod extends StripeObject { + /** Represents a per-transaction override of a reader configuration. */ + @SerializedName("collect_config") + CollectConfig collectConfig; + + /** Most recent PaymentIntent processed by the reader. */ + @SerializedName("payment_intent") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentIntent; + + /** + * PaymentMethod objects represent your customer's payment instruments. You can use them with + * PaymentIntents to collect + * payments or save them to Customer objects to store instrument details for future payments. + * + *

Related guides: Payment + * Methods and More + * Payment Scenarios. + */ + @SerializedName("payment_method") + PaymentMethod paymentMethod; + + /** Get ID of expandable {@code paymentIntent} object. */ + public String getPaymentIntent() { + return (this.paymentIntent != null) ? this.paymentIntent.getId() : null; + } + + public void setPaymentIntent(String id) { + this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent); + } + + /** Get expanded {@code paymentIntent}. */ + public PaymentIntent getPaymentIntentObject() { + return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null; + } + + public void setPaymentIntentObject(PaymentIntent expandableObject) { + this.paymentIntent = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Represents a per-transaction override of a reader configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class CollectConfig extends StripeObject { + /** Enable customer-initiated cancellation when processing this payment. */ + @SerializedName("enable_customer_cancellation") + Boolean enableCustomerCancellation; + + /** Override showing a tipping selection screen on this transaction. */ + @SerializedName("skip_tipping") + Boolean skipTipping; + + /** Represents a per-transaction tipping configuration. */ + @SerializedName("tipping") + Tipping tipping; + + /** Represents a per-transaction tipping configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Tipping extends StripeObject { + /** + * Amount used to calculate tip suggestions on tipping selection screen for this + * transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents + * to represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + */ + @SerializedName("amount_eligible") + Long amountEligible; + } + } + } + + /** Represents a reader action to confirm a payment. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ConfirmPaymentIntent extends StripeObject { + /** Represents a per-transaction override of a reader configuration. */ + @SerializedName("confirm_config") + ConfirmConfig confirmConfig; + + /** Most recent PaymentIntent processed by the reader. */ + @SerializedName("payment_intent") + @Getter(lombok.AccessLevel.NONE) + @Setter(lombok.AccessLevel.NONE) + ExpandableField paymentIntent; + + /** Get ID of expandable {@code paymentIntent} object. */ + public String getPaymentIntent() { + return (this.paymentIntent != null) ? this.paymentIntent.getId() : null; + } + + public void setPaymentIntent(String id) { + this.paymentIntent = ApiResource.setExpandableFieldId(id, this.paymentIntent); + } + + /** Get expanded {@code paymentIntent}. */ + public PaymentIntent getPaymentIntentObject() { + return (this.paymentIntent != null) ? this.paymentIntent.getExpanded() : null; + } + + public void setPaymentIntentObject(PaymentIntent expandableObject) { + this.paymentIntent = + new ExpandableField(expandableObject.getId(), expandableObject); + } + + /** Represents a per-transaction override of a reader configuration. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class ConfirmConfig extends StripeObject { + /** + * If the customer doesn't abandon authenticating the payment, they're redirected to this + * URL after completion. + */ + @SerializedName("return_url") + String returnUrl; + } + } + /** Represents a reader action to process a payment intent. */ @Getter @Setter @@ -870,13 +1103,13 @@ public void setPaymentIntentObject(PaymentIntent expandableObject) { @Setter @EqualsAndHashCode(callSuper = false) public static class ProcessConfig extends StripeObject { - /** Enable customer initiated cancellation when processing this payment. */ + /** Enable customer-initiated cancellation when processing this payment. */ @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. + * If the customer doesn't abandon authenticating the payment, they're redirected to this + * URL after completion. */ @SerializedName("return_url") String returnUrl; @@ -952,7 +1185,7 @@ public void setSetupIntentObject(SetupIntent expandableObject) { @Setter @EqualsAndHashCode(callSuper = false) public static class ProcessConfig extends StripeObject { - /** Enable customer initiated cancellation when processing this SetupIntent. */ + /** Enable customer-initiated cancellation when processing this SetupIntent. */ @SerializedName("enable_customer_cancellation") Boolean enableCustomerCancellation; } @@ -1084,7 +1317,7 @@ public void setRefundObject(Refund expandableObject) { @Setter @EqualsAndHashCode(callSuper = false) public static class RefundPaymentConfig extends StripeObject { - /** Enable customer initiated cancellation when refunding this payment. */ + /** Enable customer-initiated cancellation when refunding this payment. */ @SerializedName("enable_customer_cancellation") Boolean enableCustomerCancellation; } diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index e503d5709bf..d27643d0cba 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -1339,6 +1339,10 @@ public static class Capabilities { @SerializedName("cashapp_payments") CashappPayments cashappPayments; + /** The crypto_payments capability. */ + @SerializedName("crypto_payments") + CryptoPayments cryptoPayments; + /** The eps_payments capability. */ @SerializedName("eps_payments") EpsPayments epsPayments; @@ -1533,6 +1537,7 @@ private Capabilities( CardPayments cardPayments, CartesBancairesPayments cartesBancairesPayments, CashappPayments cashappPayments, + CryptoPayments cryptoPayments, EpsPayments epsPayments, Map extraParams, FpxPayments fpxPayments, @@ -1592,6 +1597,7 @@ private Capabilities( this.cardPayments = cardPayments; this.cartesBancairesPayments = cartesBancairesPayments; this.cashappPayments = cashappPayments; + this.cryptoPayments = cryptoPayments; this.epsPayments = epsPayments; this.extraParams = extraParams; this.fpxPayments = fpxPayments; @@ -1674,6 +1680,8 @@ public static class Builder { private CashappPayments cashappPayments; + private CryptoPayments cryptoPayments; + private EpsPayments epsPayments; private Map extraParams; @@ -1779,6 +1787,7 @@ public AccountCreateParams.Capabilities build() { this.cardPayments, this.cartesBancairesPayments, this.cashappPayments, + this.cryptoPayments, this.epsPayments, this.extraParams, this.fpxPayments, @@ -1932,6 +1941,13 @@ public Builder setCashappPayments( return this; } + /** The crypto_payments capability. */ + public Builder setCryptoPayments( + AccountCreateParams.Capabilities.CryptoPayments cryptoPayments) { + this.cryptoPayments = cryptoPayments; + return this; + } + /** The eps_payments capability. */ public Builder setEpsPayments(AccountCreateParams.Capabilities.EpsPayments epsPayments) { this.epsPayments = epsPayments; @@ -3523,6 +3539,86 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CryptoPayments { + /** + * 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 CryptoPayments(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.CryptoPayments build() { + return new AccountCreateParams.Capabilities.CryptoPayments( + 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.CryptoPayments#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.CryptoPayments#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 EpsPayments { @@ -6980,6 +7076,7 @@ public static class Company { @SerializedName("phone") String phone; + /** When the business was incorporated or registered. */ @SerializedName("registration_date") Object registrationDate; @@ -7312,12 +7409,14 @@ public Builder setPhone(String phone) { return this; } + /** When the business was incorporated or registered. */ public Builder setRegistrationDate( AccountCreateParams.Company.RegistrationDate registrationDate) { this.registrationDate = registrationDate; return this; } + /** When the business was incorporated or registered. */ public Builder setRegistrationDate(EmptyParam registrationDate) { this.registrationDate = registrationDate; return this; @@ -8939,6 +9038,10 @@ public static class Documents { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** One or more documents that demonstrate proof of address. */ + @SerializedName("proof_of_address") + ProofOfAddress proofOfAddress; + /** * One or more documents showing the company’s proof of registration with the national business * registry. @@ -8958,6 +9061,7 @@ private Documents( CompanyRegistrationVerification companyRegistrationVerification, CompanyTaxIdVerification companyTaxIdVerification, Map extraParams, + ProofOfAddress proofOfAddress, ProofOfRegistration proofOfRegistration, ProofOfUltimateBeneficialOwnership proofOfUltimateBeneficialOwnership) { this.bankAccountOwnershipVerification = bankAccountOwnershipVerification; @@ -8967,6 +9071,7 @@ private Documents( this.companyRegistrationVerification = companyRegistrationVerification; this.companyTaxIdVerification = companyTaxIdVerification; this.extraParams = extraParams; + this.proofOfAddress = proofOfAddress; this.proofOfRegistration = proofOfRegistration; this.proofOfUltimateBeneficialOwnership = proofOfUltimateBeneficialOwnership; } @@ -8990,6 +9095,8 @@ public static class Builder { private Map extraParams; + private ProofOfAddress proofOfAddress; + private ProofOfRegistration proofOfRegistration; private ProofOfUltimateBeneficialOwnership proofOfUltimateBeneficialOwnership; @@ -9004,6 +9111,7 @@ public AccountCreateParams.Documents build() { this.companyRegistrationVerification, this.companyTaxIdVerification, this.extraParams, + this.proofOfAddress, this.proofOfRegistration, this.proofOfUltimateBeneficialOwnership); } @@ -9091,6 +9199,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** One or more documents that demonstrate proof of address. */ + public Builder setProofOfAddress( + AccountCreateParams.Documents.ProofOfAddress proofOfAddress) { + this.proofOfAddress = proofOfAddress; + return this; + } + /** * One or more documents showing the company’s proof of registration with the national * business registry. @@ -9700,6 +9815,101 @@ public Builder addAllFile(List elements) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ProofOfAddress { + /** + * 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; + + /** + * One or more document ids returned by a file upload with a {@code purpose} value + * of {@code account_requirement}. + */ + @SerializedName("files") + List files; + + private ProofOfAddress(Map extraParams, List files) { + this.extraParams = extraParams; + this.files = files; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List files; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Documents.ProofOfAddress build() { + return new AccountCreateParams.Documents.ProofOfAddress(this.extraParams, this.files); + } + + /** + * Add a key/value pair to `extraParams` map. 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.Documents.ProofOfAddress#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.Documents.ProofOfAddress#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 `files` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountCreateParams.Documents.ProofOfAddress#files} for the field documentation. + */ + public Builder addFile(String element) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(element); + return this; + } + + /** + * Add all elements to `files` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountCreateParams.Documents.ProofOfAddress#files} for the field documentation. + */ + public Builder addAllFile(List elements) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.addAll(elements); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class ProofOfRegistration { @@ -13043,6 +13253,15 @@ public static class Schedule { @SerializedName("monthly_anchor") Long monthlyAnchor; + /** + * The days of the month when available funds are paid out, specified as an array of numbers + * between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are + * instead sent on the last day of a shorter month. Required and applicable only if {@code + * interval} is {@code monthly} and {@code monthly_anchor} is not set. + */ + @SerializedName("monthly_payout_days") + List monthlyPayoutDays; + /** * The day of the week when available funds are paid out, specified as {@code monday}, * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code @@ -13051,17 +13270,29 @@ public static class Schedule { @SerializedName("weekly_anchor") WeeklyAnchor weeklyAnchor; + /** + * The days of the week when available funds are paid out, specified as an array, e.g., + * [{@code monday}, {@code tuesday}]. (required and applicable only if {@code interval} is + * {@code weekly} and {@code weekly_anchor} is not set.) + */ + @SerializedName("weekly_payout_days") + List weeklyPayoutDays; + private Schedule( Object delayDays, Map extraParams, Interval interval, Long monthlyAnchor, - WeeklyAnchor weeklyAnchor) { + List monthlyPayoutDays, + WeeklyAnchor weeklyAnchor, + List weeklyPayoutDays) { this.delayDays = delayDays; this.extraParams = extraParams; this.interval = interval; this.monthlyAnchor = monthlyAnchor; + this.monthlyPayoutDays = monthlyPayoutDays; this.weeklyAnchor = weeklyAnchor; + this.weeklyPayoutDays = weeklyPayoutDays; } public static Builder builder() { @@ -13077,8 +13308,13 @@ public static class Builder { private Long monthlyAnchor; + private List monthlyPayoutDays; + private WeeklyAnchor weeklyAnchor; + private List + weeklyPayoutDays; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Settings.Payouts.Schedule build() { return new AccountCreateParams.Settings.Payouts.Schedule( @@ -13086,7 +13322,9 @@ public AccountCreateParams.Settings.Payouts.Schedule build() { this.extraParams, this.interval, this.monthlyAnchor, - this.weeklyAnchor); + this.monthlyPayoutDays, + this.weeklyAnchor, + this.weeklyPayoutDays); } /** @@ -13165,6 +13403,34 @@ public Builder setMonthlyAnchor(Long monthlyAnchor) { return this; } + /** + * Add an element to `monthlyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.Payouts.Schedule#monthlyPayoutDays} for the + * field documentation. + */ + public Builder addMonthlyPayoutDay(Long element) { + if (this.monthlyPayoutDays == null) { + this.monthlyPayoutDays = new ArrayList<>(); + } + this.monthlyPayoutDays.add(element); + return this; + } + + /** + * Add all elements to `monthlyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.Payouts.Schedule#monthlyPayoutDays} for the + * field documentation. + */ + public Builder addAllMonthlyPayoutDay(List elements) { + if (this.monthlyPayoutDays == null) { + this.monthlyPayoutDays = new ArrayList<>(); + } + this.monthlyPayoutDays.addAll(elements); + return this; + } + /** * The day of the week when available funds are paid out, specified as {@code monday}, * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code @@ -13175,6 +13441,36 @@ public Builder setWeeklyAnchor( this.weeklyAnchor = weeklyAnchor; return this; } + + /** + * Add an element to `weeklyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.Payouts.Schedule#weeklyPayoutDays} for the + * field documentation. + */ + public Builder addWeeklyPayoutDay( + AccountCreateParams.Settings.Payouts.Schedule.WeeklyPayoutDay element) { + if (this.weeklyPayoutDays == null) { + this.weeklyPayoutDays = new ArrayList<>(); + } + this.weeklyPayoutDays.add(element); + return this; + } + + /** + * Add all elements to `weeklyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountCreateParams.Settings.Payouts.Schedule#weeklyPayoutDays} for the + * field documentation. + */ + public Builder addAllWeeklyPayoutDay( + List elements) { + if (this.weeklyPayoutDays == null) { + this.weeklyPayoutDays = new ArrayList<>(); + } + this.weeklyPayoutDays.addAll(elements); + return this; + } } public enum DelayDays implements ApiRequestParams.EnumParam { @@ -13239,6 +13535,36 @@ public enum WeeklyAnchor implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum WeeklyPayoutDay implements ApiRequestParams.EnumParam { + @SerializedName("friday") + FRIDAY("friday"), + + @SerializedName("monday") + MONDAY("monday"), + + @SerializedName("saturday") + SATURDAY("saturday"), + + @SerializedName("sunday") + SUNDAY("sunday"), + + @SerializedName("thursday") + THURSDAY("thursday"), + + @SerializedName("tuesday") + TUESDAY("tuesday"), + + @SerializedName("wednesday") + WEDNESDAY("wednesday"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + WeeklyPayoutDay(String value) { + this.value = value; + } + } } } diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index 69a224784c6..febcc67a59c 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -137,23 +137,43 @@ public Builder putAllExtraParam(Map map) { @Getter @EqualsAndHashCode(callSuper = false) public static class Components { - /** Configuration for the account management embedded component. */ + /** + * Configuration for the account + * management embedded component. + */ @SerializedName("account_management") AccountManagement accountManagement; - /** Configuration for the account onboarding embedded component. */ + /** + * Configuration for the account + * onboarding embedded component. + */ @SerializedName("account_onboarding") AccountOnboarding accountOnboarding; - /** Configuration for the balances embedded component. */ + /** + * Configuration for the balances + * embedded component. + */ @SerializedName("balances") Balances balances; - /** Configuration for the disputes list embedded component. */ + /** + * Configuration for the disputes + * list embedded component. + */ @SerializedName("disputes_list") DisputesList disputesList; - /** Configuration for the documents embedded component. */ + /** + * Configuration for the documents + * embedded component. + */ @SerializedName("documents") Documents documents; @@ -166,51 +186,99 @@ public static class Components { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Configuration for the financial account embedded component. */ + /** + * Configuration for the financial + * account embedded component. + */ @SerializedName("financial_account") FinancialAccount financialAccount; - /** Configuration for the financial account transactions embedded component. */ + /** + * Configuration for the financial + * account transactions embedded component. + */ @SerializedName("financial_account_transactions") FinancialAccountTransactions financialAccountTransactions; - /** Configuration for the issuing card embedded component. */ + /** + * Configuration for the issuing + * card embedded component. + */ @SerializedName("issuing_card") IssuingCard issuingCard; - /** Configuration for the issuing cards list embedded component. */ + /** + * Configuration for the issuing + * cards list embedded component. + */ @SerializedName("issuing_cards_list") IssuingCardsList issuingCardsList; - /** Configuration for the notification banner embedded component. */ + /** + * Configuration for the notification + * banner embedded component. + */ @SerializedName("notification_banner") NotificationBanner notificationBanner; - /** Configuration for the payment details embedded component. */ + /** + * Configuration for the payment + * details embedded component. + */ @SerializedName("payment_details") PaymentDetails paymentDetails; - /** Configuration for the payment disputes embedded component. */ + /** + * Configuration for the payment + * disputes embedded component. + */ @SerializedName("payment_disputes") PaymentDisputes paymentDisputes; - /** Configuration for the payments embedded component. */ + /** + * Configuration for the payments + * embedded component. + */ @SerializedName("payments") Payments payments; - /** Configuration for the payouts embedded component. */ + /** + * Configuration for the payouts embedded + * component. + */ @SerializedName("payouts") Payouts payouts; - /** Configuration for the payouts list embedded component. */ + /** + * Configuration for the payouts + * list embedded component. + */ @SerializedName("payouts_list") PayoutsList payoutsList; - /** Configuration for the tax registrations embedded component. */ + /** + * Configuration for the tax + * registrations embedded component. + */ @SerializedName("tax_registrations") TaxRegistrations taxRegistrations; - /** Configuration for the tax settings embedded component. */ + /** + * Configuration for the tax + * settings embedded component. + */ @SerializedName("tax_settings") TaxSettings taxSettings; @@ -317,34 +385,54 @@ public AccountSessionCreateParams.Components build() { this.taxSettings); } - /** Configuration for the account management embedded component. */ + /** + * Configuration for the account + * management embedded component. + */ public Builder setAccountManagement( AccountSessionCreateParams.Components.AccountManagement accountManagement) { this.accountManagement = accountManagement; return this; } - /** Configuration for the account onboarding embedded component. */ + /** + * Configuration for the account + * onboarding embedded component. + */ public Builder setAccountOnboarding( AccountSessionCreateParams.Components.AccountOnboarding accountOnboarding) { this.accountOnboarding = accountOnboarding; return this; } - /** Configuration for the balances embedded component. */ + /** + * Configuration for the balances + * embedded component. + */ public Builder setBalances(AccountSessionCreateParams.Components.Balances balances) { this.balances = balances; return this; } - /** Configuration for the disputes list embedded component. */ + /** + * 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. */ + /** + * Configuration for the documents + * embedded component. + */ public Builder setDocuments(AccountSessionCreateParams.Components.Documents documents) { this.documents = documents; return this; @@ -376,14 +464,22 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Configuration for the financial account embedded component. */ + /** + * Configuration for the financial + * account embedded component. + */ public Builder setFinancialAccount( AccountSessionCreateParams.Components.FinancialAccount financialAccount) { this.financialAccount = financialAccount; return this; } - /** Configuration for the financial account transactions embedded component. */ + /** + * Configuration for the financial + * account transactions embedded component. + */ public Builder setFinancialAccountTransactions( AccountSessionCreateParams.Components.FinancialAccountTransactions financialAccountTransactions) { @@ -391,66 +487,106 @@ public Builder setFinancialAccountTransactions( return this; } - /** Configuration for the issuing card embedded component. */ + /** + * Configuration for the issuing + * card embedded component. + */ public Builder setIssuingCard(AccountSessionCreateParams.Components.IssuingCard issuingCard) { this.issuingCard = issuingCard; return this; } - /** Configuration for the issuing cards list embedded component. */ + /** + * Configuration for the issuing + * cards list embedded component. + */ public Builder setIssuingCardsList( AccountSessionCreateParams.Components.IssuingCardsList issuingCardsList) { this.issuingCardsList = issuingCardsList; return this; } - /** Configuration for the notification banner embedded component. */ + /** + * Configuration for the notification + * banner embedded component. + */ public Builder setNotificationBanner( AccountSessionCreateParams.Components.NotificationBanner notificationBanner) { this.notificationBanner = notificationBanner; return this; } - /** Configuration for the payment details embedded component. */ + /** + * Configuration for the payment + * details embedded component. + */ public Builder setPaymentDetails( AccountSessionCreateParams.Components.PaymentDetails paymentDetails) { this.paymentDetails = paymentDetails; return this; } - /** Configuration for the payment disputes embedded component. */ + /** + * 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. */ + /** + * Configuration for the payments + * embedded component. + */ public Builder setPayments(AccountSessionCreateParams.Components.Payments payments) { this.payments = payments; return this; } - /** Configuration for the payouts embedded component. */ + /** + * Configuration for the payouts + * embedded component. + */ public Builder setPayouts(AccountSessionCreateParams.Components.Payouts payouts) { this.payouts = payouts; return this; } - /** Configuration for the payouts list embedded component. */ + /** + * Configuration for the payouts + * list embedded component. + */ public Builder setPayoutsList(AccountSessionCreateParams.Components.PayoutsList payoutsList) { this.payoutsList = payoutsList; return this; } - /** Configuration for the tax registrations embedded component. */ + /** + * Configuration for the tax + * registrations embedded component. + */ public Builder setTaxRegistrations( AccountSessionCreateParams.Components.TaxRegistrations taxRegistrations) { this.taxRegistrations = taxRegistrations; return this; } - /** Configuration for the tax settings embedded component. */ + /** + * Configuration for the tax + * settings embedded component. + */ public Builder setTaxSettings(AccountSessionCreateParams.Components.TaxSettings taxSettings) { this.taxSettings = taxSettings; return this; @@ -547,21 +683,20 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -605,12 +740,12 @@ public AccountSessionCreateParams.Components.AccountManagement.Features build() } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -619,11 +754,10 @@ public Builder setDisableStripeUserAuthentication( } /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom - * accounts. Otherwise, bank account collection is determined by compliance requirements. - * The default value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; @@ -753,21 +887,20 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -811,12 +944,12 @@ public AccountSessionCreateParams.Components.AccountOnboarding.Features build() } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -825,11 +958,10 @@ public Builder setDisableStripeUserAuthentication( } /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom - * accounts. Otherwise, bank account collection is determined by compliance requirements. - * The default value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; @@ -958,28 +1090,28 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("edit_payout_schedule") Boolean editPayoutSchedule; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -995,15 +1127,17 @@ public static class Features { Map extraParams; /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("instant_payouts") Boolean instantPayouts; /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("standard_payouts") Boolean standardPayouts; @@ -1052,12 +1186,12 @@ public AccountSessionCreateParams.Components.Balances.Features build() { } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -1066,8 +1200,9 @@ public Builder setDisableStripeUserAuthentication( } /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setEditPayoutSchedule(Boolean editPayoutSchedule) { this.editPayoutSchedule = editPayoutSchedule; @@ -1075,11 +1210,10 @@ public Builder setEditPayoutSchedule(Boolean editPayoutSchedule) { } /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom - * accounts. Otherwise, bank account collection is determined by compliance requirements. - * The default value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; @@ -1115,8 +1249,9 @@ public Builder putAllExtraParam(Map map) { } /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; @@ -1124,8 +1259,9 @@ public Builder setInstantPayouts(Boolean instantPayouts) { } /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setStandardPayouts(Boolean standardPayouts) { this.standardPayouts = standardPayouts; @@ -1231,14 +1367,14 @@ public static class Features { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ @SerializedName("dispute_management") @@ -1254,7 +1390,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; @@ -1306,8 +1442,8 @@ public Builder setCapturePayments(Boolean capturePayments) { } /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can manage destination charges that are created on behalf of + * them. This is {@code false} by default. */ public Builder setDestinationOnBehalfOfChargeManagement( Boolean destinationOnBehalfOfChargeManagement) { @@ -1316,7 +1452,7 @@ public Builder setDestinationOnBehalfOfChargeManagement( } /** - * Whether to allow responding to disputes, including submitting evidence and accepting + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ public Builder setDisputeManagement(Boolean disputeManagement) { @@ -1354,7 +1490,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ public Builder setRefundManagement(Boolean refundManagement) { this.refundManagement = refundManagement; return this; @@ -1598,16 +1734,21 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; - /** Whether to allow external accounts to be linked for money transfer. */ + /** + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. + */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -1668,12 +1809,12 @@ public AccountSessionCreateParams.Components.FinancialAccount.Features build() { } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -1681,7 +1822,12 @@ public Builder setDisableStripeUserAuthentication( return this; } - /** Whether to allow external accounts to be linked for money transfer. */ + /** + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. + */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; return this; @@ -2206,9 +2352,11 @@ public static class Features { Boolean cardholderManagement; /** - * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -2289,9 +2437,12 @@ public Builder setCardholderManagement(Boolean cardholderManagement) { } /** - * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -2428,21 +2579,20 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -2486,12 +2636,12 @@ public AccountSessionCreateParams.Components.NotificationBanner.Features build() } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -2500,11 +2650,10 @@ public Builder setDisableStripeUserAuthentication( } /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom - * accounts. Otherwise, bank account collection is determined by compliance requirements. - * The default value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; @@ -2640,14 +2789,14 @@ public static class Features { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ @SerializedName("dispute_management") @@ -2663,7 +2812,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; @@ -2715,8 +2864,8 @@ public Builder setCapturePayments(Boolean capturePayments) { } /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can manage destination charges that are created on behalf of + * them. This is {@code false} by default. */ public Builder setDestinationOnBehalfOfChargeManagement( Boolean destinationOnBehalfOfChargeManagement) { @@ -2725,7 +2874,7 @@ public Builder setDestinationOnBehalfOfChargeManagement( } /** - * Whether to allow responding to disputes, including submitting evidence and accepting + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ public Builder setDisputeManagement(Boolean disputeManagement) { @@ -2763,7 +2912,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ public Builder setRefundManagement(Boolean refundManagement) { this.refundManagement = refundManagement; return this; @@ -2861,14 +3010,14 @@ public Builder setFeatures( @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. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ @SerializedName("dispute_management") @@ -2884,7 +3033,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; @@ -2922,8 +3071,8 @@ public AccountSessionCreateParams.Components.PaymentDisputes.Features build() { } /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can manage destination charges that are created on behalf of + * them. This is {@code false} by default. */ public Builder setDestinationOnBehalfOfChargeManagement( Boolean destinationOnBehalfOfChargeManagement) { @@ -2932,7 +3081,7 @@ public Builder setDestinationOnBehalfOfChargeManagement( } /** - * Whether to allow responding to disputes, including submitting evidence and accepting + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ public Builder setDisputeManagement(Boolean disputeManagement) { @@ -2970,7 +3119,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ public Builder setRefundManagement(Boolean refundManagement) { this.refundManagement = refundManagement; return this; @@ -3075,14 +3224,14 @@ public static class Features { Boolean capturePayments; /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can 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 + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ @SerializedName("dispute_management") @@ -3098,7 +3247,7 @@ public static class Features { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ @SerializedName("refund_management") Boolean refundManagement; @@ -3150,8 +3299,8 @@ public Builder setCapturePayments(Boolean capturePayments) { } /** - * Whether to allow connected accounts to manage destination charges that are created on - * behalf of them. This is {@code false} by default. + * Whether connected accounts can manage destination charges that are created on behalf of + * them. This is {@code false} by default. */ public Builder setDestinationOnBehalfOfChargeManagement( Boolean destinationOnBehalfOfChargeManagement) { @@ -3160,7 +3309,7 @@ public Builder setDestinationOnBehalfOfChargeManagement( } /** - * Whether to allow responding to disputes, including submitting evidence and accepting + * Whether responding to disputes is enabled, including submitting evidence and accepting * disputes. This is {@code true} by default. */ public Builder setDisputeManagement(Boolean disputeManagement) { @@ -3196,7 +3345,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Whether to allow sending refunds. This is {@code true} by default. */ + /** Whether sending refunds is enabled. This is {@code true} by default. */ public Builder setRefundManagement(Boolean refundManagement) { this.refundManagement = refundManagement; return this; @@ -3294,28 +3443,28 @@ public Builder setFeatures( @EqualsAndHashCode(callSuper = false) public static class Features { /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code application}. - * The default value is the opposite of the {@code external_account_collection} value. For - * example, if you don’t set {@code external_account_collection}, it defaults to true and - * {@code disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults to + * {@code true} and {@code disable_stripe_user_authentication} defaults to {@code false}. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("edit_payout_schedule") Boolean editPayoutSchedule; /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom accounts. - * Otherwise, bank account collection is determined by compliance requirements. The default - * value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this feature + * is {@code true}. */ @SerializedName("external_account_collection") Boolean externalAccountCollection; @@ -3331,15 +3480,17 @@ public static class Features { Map extraParams; /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("instant_payouts") Boolean instantPayouts; /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns Loss - * Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ @SerializedName("standard_payouts") Boolean standardPayouts; @@ -3388,12 +3539,12 @@ public AccountSessionCreateParams.Components.Payouts.Features build() { } /** - * Disables Stripe user authentication for this embedded component. This value can only be - * true for accounts where {@code controller.requirement_collection} is {@code - * application}. The default value is the opposite of the {@code - * external_account_collection} value. For example, if you don’t set {@code - * external_account_collection}, it defaults to true and {@code - * disable_stripe_user_authentication} defaults to false. + * Whether Stripe user authentication is disabled. This value can only be {@code true} for + * accounts where {@code controller.requirement_collection} is {@code application} for the + * account. The default value is the opposite of the {@code external_account_collection} + * value. For example, if you don't set {@code external_account_collection}, it defaults + * to {@code true} and {@code disable_stripe_user_authentication} defaults to {@code + * false}. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -3402,8 +3553,9 @@ public Builder setDisableStripeUserAuthentication( } /** - * Whether to allow payout schedule to be changed. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow payout schedule to be changed. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setEditPayoutSchedule(Boolean editPayoutSchedule) { this.editPayoutSchedule = editPayoutSchedule; @@ -3411,11 +3563,10 @@ public Builder setEditPayoutSchedule(Boolean editPayoutSchedule) { } /** - * Whether to allow platforms to control bank account collection for their connected - * accounts. This feature can only be false for accounts where you’re responsible for - * collecting updated information when requirements are due or change, like custom - * accounts. Otherwise, bank account collection is determined by compliance requirements. - * The default value for this feature is {@code true}. + * Whether external account collection is enabled. This feature can only be {@code false} + * for accounts where you’re responsible for collecting updated information when + * requirements are due or change, like Custom accounts. The default value for this + * feature is {@code true}. */ public Builder setExternalAccountCollection(Boolean externalAccountCollection) { this.externalAccountCollection = externalAccountCollection; @@ -3451,8 +3602,9 @@ public Builder putAllExtraParam(Map map) { } /** - * Whether to allow creation of instant payouts. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow creation of instant payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setInstantPayouts(Boolean instantPayouts) { this.instantPayouts = instantPayouts; @@ -3460,8 +3612,9 @@ public Builder setInstantPayouts(Boolean instantPayouts) { } /** - * Whether to allow creation of standard payouts. Default {@code true} when Stripe owns - * Loss Liability, default {@code false} otherwise. + * Whether to allow creation of standard payouts. Defaults to {@code true} when {@code + * controller.losses.payments} is set to {@code stripe} for the account, otherwise {@code + * false}. */ public Builder setStandardPayouts(Boolean standardPayouts) { this.standardPayouts = standardPayouts; diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index 8cd3d920707..d8f41461765 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -1437,6 +1437,10 @@ public static class Capabilities { @SerializedName("cashapp_payments") CashappPayments cashappPayments; + /** The crypto_payments capability. */ + @SerializedName("crypto_payments") + CryptoPayments cryptoPayments; + /** The eps_payments capability. */ @SerializedName("eps_payments") EpsPayments epsPayments; @@ -1631,6 +1635,7 @@ private Capabilities( CardPayments cardPayments, CartesBancairesPayments cartesBancairesPayments, CashappPayments cashappPayments, + CryptoPayments cryptoPayments, EpsPayments epsPayments, Map extraParams, FpxPayments fpxPayments, @@ -1690,6 +1695,7 @@ private Capabilities( this.cardPayments = cardPayments; this.cartesBancairesPayments = cartesBancairesPayments; this.cashappPayments = cashappPayments; + this.cryptoPayments = cryptoPayments; this.epsPayments = epsPayments; this.extraParams = extraParams; this.fpxPayments = fpxPayments; @@ -1772,6 +1778,8 @@ public static class Builder { private CashappPayments cashappPayments; + private CryptoPayments cryptoPayments; + private EpsPayments epsPayments; private Map extraParams; @@ -1877,6 +1885,7 @@ public AccountUpdateParams.Capabilities build() { this.cardPayments, this.cartesBancairesPayments, this.cashappPayments, + this.cryptoPayments, this.epsPayments, this.extraParams, this.fpxPayments, @@ -2030,6 +2039,13 @@ public Builder setCashappPayments( return this; } + /** The crypto_payments capability. */ + public Builder setCryptoPayments( + AccountUpdateParams.Capabilities.CryptoPayments cryptoPayments) { + this.cryptoPayments = cryptoPayments; + return this; + } + /** The eps_payments capability. */ public Builder setEpsPayments(AccountUpdateParams.Capabilities.EpsPayments epsPayments) { this.epsPayments = epsPayments; @@ -3621,6 +3637,86 @@ public Builder setRequested(Boolean requested) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CryptoPayments { + /** + * 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 CryptoPayments(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.CryptoPayments build() { + return new AccountUpdateParams.Capabilities.CryptoPayments( + 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.CryptoPayments#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.CryptoPayments#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 EpsPayments { @@ -8859,6 +8955,10 @@ public static class Documents { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** One or more documents that demonstrate proof of address. */ + @SerializedName("proof_of_address") + ProofOfAddress proofOfAddress; + /** * One or more documents showing the company’s proof of registration with the national business * registry. @@ -8878,6 +8978,7 @@ private Documents( CompanyRegistrationVerification companyRegistrationVerification, CompanyTaxIdVerification companyTaxIdVerification, Map extraParams, + ProofOfAddress proofOfAddress, ProofOfRegistration proofOfRegistration, ProofOfUltimateBeneficialOwnership proofOfUltimateBeneficialOwnership) { this.bankAccountOwnershipVerification = bankAccountOwnershipVerification; @@ -8887,6 +8988,7 @@ private Documents( this.companyRegistrationVerification = companyRegistrationVerification; this.companyTaxIdVerification = companyTaxIdVerification; this.extraParams = extraParams; + this.proofOfAddress = proofOfAddress; this.proofOfRegistration = proofOfRegistration; this.proofOfUltimateBeneficialOwnership = proofOfUltimateBeneficialOwnership; } @@ -8910,6 +9012,8 @@ public static class Builder { private Map extraParams; + private ProofOfAddress proofOfAddress; + private ProofOfRegistration proofOfRegistration; private ProofOfUltimateBeneficialOwnership proofOfUltimateBeneficialOwnership; @@ -8924,6 +9028,7 @@ public AccountUpdateParams.Documents build() { this.companyRegistrationVerification, this.companyTaxIdVerification, this.extraParams, + this.proofOfAddress, this.proofOfRegistration, this.proofOfUltimateBeneficialOwnership); } @@ -9011,6 +9116,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** One or more documents that demonstrate proof of address. */ + public Builder setProofOfAddress( + AccountUpdateParams.Documents.ProofOfAddress proofOfAddress) { + this.proofOfAddress = proofOfAddress; + return this; + } + /** * One or more documents showing the company’s proof of registration with the national * business registry. @@ -9620,6 +9732,101 @@ public Builder addAllFile(List elements) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ProofOfAddress { + /** + * 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; + + /** + * One or more document ids returned by a file upload with a {@code purpose} value + * of {@code account_requirement}. + */ + @SerializedName("files") + List files; + + private ProofOfAddress(Map extraParams, List files) { + this.extraParams = extraParams; + this.files = files; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List files; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Documents.ProofOfAddress build() { + return new AccountUpdateParams.Documents.ProofOfAddress(this.extraParams, this.files); + } + + /** + * Add a key/value pair to `extraParams` map. 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.Documents.ProofOfAddress#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.Documents.ProofOfAddress#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 `files` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountUpdateParams.Documents.ProofOfAddress#files} for the field documentation. + */ + public Builder addFile(String element) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.add(element); + return this; + } + + /** + * Add all elements to `files` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * AccountUpdateParams.Documents.ProofOfAddress#files} for the field documentation. + */ + public Builder addAllFile(List elements) { + if (this.files == null) { + this.files = new ArrayList<>(); + } + this.files.addAll(elements); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class ProofOfRegistration { @@ -13443,6 +13650,15 @@ public static class Schedule { @SerializedName("monthly_anchor") Long monthlyAnchor; + /** + * The days of the month when available funds are paid out, specified as an array of numbers + * between 1--31. Payouts nominally scheduled between the 29th and 31st of the month are + * instead sent on the last day of a shorter month. Required and applicable only if {@code + * interval} is {@code monthly} and {@code monthly_anchor} is not set. + */ + @SerializedName("monthly_payout_days") + List monthlyPayoutDays; + /** * The day of the week when available funds are paid out, specified as {@code monday}, * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code @@ -13451,17 +13667,29 @@ public static class Schedule { @SerializedName("weekly_anchor") WeeklyAnchor weeklyAnchor; + /** + * The days of the week when available funds are paid out, specified as an array, e.g., + * [{@code monday}, {@code tuesday}]. (required and applicable only if {@code interval} is + * {@code weekly} and {@code weekly_anchor} is not set.) + */ + @SerializedName("weekly_payout_days") + List weeklyPayoutDays; + private Schedule( Object delayDays, Map extraParams, Interval interval, Long monthlyAnchor, - WeeklyAnchor weeklyAnchor) { + List monthlyPayoutDays, + WeeklyAnchor weeklyAnchor, + List weeklyPayoutDays) { this.delayDays = delayDays; this.extraParams = extraParams; this.interval = interval; this.monthlyAnchor = monthlyAnchor; + this.monthlyPayoutDays = monthlyPayoutDays; this.weeklyAnchor = weeklyAnchor; + this.weeklyPayoutDays = weeklyPayoutDays; } public static Builder builder() { @@ -13477,8 +13705,13 @@ public static class Builder { private Long monthlyAnchor; + private List monthlyPayoutDays; + private WeeklyAnchor weeklyAnchor; + private List + weeklyPayoutDays; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Settings.Payouts.Schedule build() { return new AccountUpdateParams.Settings.Payouts.Schedule( @@ -13486,7 +13719,9 @@ public AccountUpdateParams.Settings.Payouts.Schedule build() { this.extraParams, this.interval, this.monthlyAnchor, - this.weeklyAnchor); + this.monthlyPayoutDays, + this.weeklyAnchor, + this.weeklyPayoutDays); } /** @@ -13565,6 +13800,34 @@ public Builder setMonthlyAnchor(Long monthlyAnchor) { return this; } + /** + * Add an element to `monthlyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.Payouts.Schedule#monthlyPayoutDays} for the + * field documentation. + */ + public Builder addMonthlyPayoutDay(Long element) { + if (this.monthlyPayoutDays == null) { + this.monthlyPayoutDays = new ArrayList<>(); + } + this.monthlyPayoutDays.add(element); + return this; + } + + /** + * Add all elements to `monthlyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.Payouts.Schedule#monthlyPayoutDays} for the + * field documentation. + */ + public Builder addAllMonthlyPayoutDay(List elements) { + if (this.monthlyPayoutDays == null) { + this.monthlyPayoutDays = new ArrayList<>(); + } + this.monthlyPayoutDays.addAll(elements); + return this; + } + /** * The day of the week when available funds are paid out, specified as {@code monday}, * {@code tuesday}, etc. (required and applicable only if {@code interval} is {@code @@ -13575,6 +13838,36 @@ public Builder setWeeklyAnchor( this.weeklyAnchor = weeklyAnchor; return this; } + + /** + * Add an element to `weeklyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.Payouts.Schedule#weeklyPayoutDays} for the + * field documentation. + */ + public Builder addWeeklyPayoutDay( + AccountUpdateParams.Settings.Payouts.Schedule.WeeklyPayoutDay element) { + if (this.weeklyPayoutDays == null) { + this.weeklyPayoutDays = new ArrayList<>(); + } + this.weeklyPayoutDays.add(element); + return this; + } + + /** + * Add all elements to `weeklyPayoutDays` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link AccountUpdateParams.Settings.Payouts.Schedule#weeklyPayoutDays} for the + * field documentation. + */ + public Builder addAllWeeklyPayoutDay( + List elements) { + if (this.weeklyPayoutDays == null) { + this.weeklyPayoutDays = new ArrayList<>(); + } + this.weeklyPayoutDays.addAll(elements); + return this; + } } public enum DelayDays implements ApiRequestParams.EnumParam { @@ -13639,6 +13932,36 @@ public enum WeeklyAnchor implements ApiRequestParams.EnumParam { this.value = value; } } + + public enum WeeklyPayoutDay implements ApiRequestParams.EnumParam { + @SerializedName("friday") + FRIDAY("friday"), + + @SerializedName("monday") + MONDAY("monday"), + + @SerializedName("saturday") + SATURDAY("saturday"), + + @SerializedName("sunday") + SUNDAY("sunday"), + + @SerializedName("thursday") + THURSDAY("thursday"), + + @SerializedName("tuesday") + TUESDAY("tuesday"), + + @SerializedName("wednesday") + WEDNESDAY("wednesday"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + WeeklyPayoutDay(String value) { + this.value = value; + } + } } } diff --git a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java index fe019133b9b..40045995471 100644 --- a/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java +++ b/src/main/java/com/stripe/param/ConfirmationTokenCreateParams.java @@ -320,6 +320,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -606,6 +613,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -659,6 +667,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -734,6 +743,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -828,6 +839,7 @@ public ConfirmationTokenCreateParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1012,6 +1024,15 @@ public Builder setCashapp(ConfirmationTokenCreateParams.PaymentMethodData.Cashap return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(ConfirmationTokenCreateParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -2605,6 +2626,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfirmationTokenCreateParams.PaymentMethodData.Crypto build() { + return new ConfirmationTokenCreateParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.Crypto#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfirmationTokenCreateParams.PaymentMethodData.Crypto#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3211,6 +3290,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -5546,6 +5628,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -5905,7 +5990,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, {@code + * bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -5987,7 +6075,10 @@ public Builder setInterval( return this; } - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ public Builder setType( ConfirmationTokenCreateParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { @@ -6009,8 +6100,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index ba8b2b660ef..ea0afac7f61 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -17,7 +17,7 @@ public class CreditNoteCreateParams extends ApiRequestParams { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ @SerializedName("amount") Long amount; @@ -61,7 +61,10 @@ public class CreditNoteCreateParams extends ApiRequestParams { @SerializedName("invoice") String invoice; - /** Line items that make up the credit note. */ + /** + * Line items that make up the credit note. One of {@code amount}, {@code lines}, or {@code + * shipping_cost} must be provided. + */ @SerializedName("lines") List lines; @@ -105,7 +108,8 @@ public class CreditNoteCreateParams extends ApiRequestParams { /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ @SerializedName("shipping_cost") ShippingCost shippingCost; @@ -200,7 +204,7 @@ public CreditNoteCreateParams build() { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ public Builder setAmount(Long amount) { this.amount = amount; @@ -406,7 +410,8 @@ public Builder addAllRefund(List elements) { /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ public Builder setShippingCost(CreditNoteCreateParams.ShippingCost shippingCost) { this.shippingCost = shippingCost; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index efd898e2778..681af744339 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -17,7 +17,7 @@ public class CreditNotePreviewLinesListParams extends ApiRequestParams { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ @SerializedName("amount") Long amount; @@ -77,7 +77,10 @@ public class CreditNotePreviewLinesListParams extends ApiRequestParams { @SerializedName("limit") Long limit; - /** Line items that make up the credit note. */ + /** + * Line items that make up the credit note. One of {@code amount}, {@code lines}, or {@code + * shipping_cost} must be provided. + */ @SerializedName("lines") List lines; @@ -121,7 +124,8 @@ public class CreditNotePreviewLinesListParams extends ApiRequestParams { /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ @SerializedName("shipping_cost") ShippingCost shippingCost; @@ -240,7 +244,7 @@ public CreditNotePreviewLinesListParams build() { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ public Builder setAmount(Long amount) { this.amount = amount; @@ -466,7 +470,8 @@ public Builder addAllRefund(List elemen /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ public Builder setShippingCost(CreditNotePreviewLinesListParams.ShippingCost shippingCost) { this.shippingCost = shippingCost; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index a4dff4543ea..3c1d564b083 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -17,7 +17,7 @@ public class CreditNotePreviewParams extends ApiRequestParams { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ @SerializedName("amount") Long amount; @@ -61,7 +61,10 @@ public class CreditNotePreviewParams extends ApiRequestParams { @SerializedName("invoice") String invoice; - /** Line items that make up the credit note. */ + /** + * Line items that make up the credit note. One of {@code amount}, {@code lines}, or {@code + * shipping_cost} must be provided. + */ @SerializedName("lines") List lines; @@ -105,7 +108,8 @@ public class CreditNotePreviewParams extends ApiRequestParams { /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ @SerializedName("shipping_cost") ShippingCost shippingCost; @@ -200,7 +204,7 @@ public CreditNotePreviewParams build() { /** * The integer amount in cents (or local equivalent) representing the total amount of the credit - * note. + * note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be provided. */ public Builder setAmount(Long amount) { this.amount = amount; @@ -406,7 +410,8 @@ public Builder addAllRefund(List elements) { /** * When shipping_cost contains the shipping_rate from the invoice, the shipping_cost is included - * in the credit note. + * in the credit note. One of {@code amount}, {@code lines}, or {@code shipping_cost} must be + * provided. */ public Builder setShippingCost(CreditNotePreviewParams.ShippingCost shippingCost) { this.shippingCost = shippingCost; diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index ae668b00fec..588caebbb85 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -282,6 +282,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index df58f675199..fb75adf70d3 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -282,6 +282,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java index 5ff8684de01..d69fb2456b9 100644 --- a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java @@ -438,7 +438,7 @@ public static class Features { /** * Determines the max number of saved payment methods for the Payment Element to display. - * This parameter defaults to {@code 3}. + * This parameter defaults to {@code 3}. The maximum redisplay limit is {@code 10}. */ @SerializedName("payment_method_redisplay_limit") Long paymentMethodRedisplayLimit; @@ -618,7 +618,7 @@ public Builder setPaymentMethodRedisplay( /** * Determines the max number of saved payment methods for the Payment Element to display. - * This parameter defaults to {@code 3}. + * This parameter defaults to {@code 3}. The maximum redisplay limit is {@code 10}. */ public Builder setPaymentMethodRedisplayLimit(Long paymentMethodRedisplayLimit) { this.paymentMethodRedisplayLimit = paymentMethodRedisplayLimit; diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index 48afcc1a695..d1365f399aa 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -2529,7 +2529,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -2614,7 +2617,8 @@ public Builder setInterval( } /** - * Required. Type of installment plan, one of {@code fixed_count}. + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. */ public Builder setType( InvoiceCreateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan @@ -2638,8 +2642,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3609,6 +3619,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index 70bdf7781aa..dcaa0a2cd24 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -2931,6 +2931,10 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class ScheduleDetails { + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * Behavior of the subscription schedule and underlying subscription when it ends. Possible * values are {@code release} or {@code cancel} with the default being {@code release}. {@code @@ -2965,10 +2969,12 @@ public static class ScheduleDetails { ProrationBehavior prorationBehavior; private ScheduleDetails( + BillingMode billingMode, EndBehavior endBehavior, Map extraParams, List phases, ProrationBehavior prorationBehavior) { + this.billingMode = billingMode; this.endBehavior = endBehavior; this.extraParams = extraParams; this.phases = phases; @@ -2980,6 +2986,8 @@ public static Builder builder() { } public static class Builder { + private BillingMode billingMode; + private EndBehavior endBehavior; private Map extraParams; @@ -2991,7 +2999,18 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public InvoiceCreatePreviewParams.ScheduleDetails build() { return new InvoiceCreatePreviewParams.ScheduleDetails( - this.endBehavior, this.extraParams, this.phases, this.prorationBehavior); + this.billingMode, + this.endBehavior, + this.extraParams, + this.phases, + this.prorationBehavior); + } + + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode( + InvoiceCreatePreviewParams.ScheduleDetails.BillingMode billingMode) { + this.billingMode = billingMode; + return this; } /** @@ -3070,6 +3089,93 @@ public Builder setProrationBehavior( } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.BillingMode build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.BillingMode( + this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link InvoiceCreatePreviewParams.ScheduleDetails.BillingMode#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.BillingMode#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. */ + public Builder setType(InvoiceCreatePreviewParams.ScheduleDetails.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Phase { @@ -6164,6 +6270,10 @@ public static class SubscriptionDetails { @SerializedName("billing_cycle_anchor") Object billingCycleAnchor; + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * 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 @@ -6175,8 +6285,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -6249,6 +6358,7 @@ public static class SubscriptionDetails { private SubscriptionDetails( Object billingCycleAnchor, + BillingMode billingMode, Object cancelAt, Boolean cancelAtPeriodEnd, Boolean cancelNow, @@ -6261,6 +6371,7 @@ private SubscriptionDetails( Long startDate, Object trialEnd) { this.billingCycleAnchor = billingCycleAnchor; + this.billingMode = billingMode; this.cancelAt = cancelAt; this.cancelAtPeriodEnd = cancelAtPeriodEnd; this.cancelNow = cancelNow; @@ -6281,6 +6392,8 @@ public static Builder builder() { public static class Builder { private Object billingCycleAnchor; + private BillingMode billingMode; + private Object cancelAt; private Boolean cancelAtPeriodEnd; @@ -6307,6 +6420,7 @@ public static class Builder { public InvoiceCreatePreviewParams.SubscriptionDetails build() { return new InvoiceCreatePreviewParams.SubscriptionDetails( this.billingCycleAnchor, + this.billingMode, this.cancelAt, this.cancelAtPeriodEnd, this.cancelNow, @@ -6345,6 +6459,13 @@ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { return this; } + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode( + InvoiceCreatePreviewParams.SubscriptionDetails.BillingMode billingMode) { + this.billingMode = billingMode; + 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 @@ -6369,8 +6490,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -6550,6 +6670,94 @@ public Builder setTrialEnd(Long trialEnd) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.SubscriptionDetails.BillingMode build() { + return new InvoiceCreatePreviewParams.SubscriptionDetails.BillingMode( + this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link InvoiceCreatePreviewParams.SubscriptionDetails.BillingMode#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.BillingMode#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. */ + public Builder setType( + InvoiceCreatePreviewParams.SubscriptionDetails.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Item { diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 323c77c0d6f..88cfb356156 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -2509,7 +2509,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -2594,7 +2597,8 @@ public Builder setInterval( } /** - * Required. Type of installment plan, one of {@code fixed_count}. + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. */ public Builder setType( InvoiceUpdateParams.PaymentSettings.PaymentMethodOptions.Card.Installments.Plan @@ -2618,8 +2622,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; @@ -3618,6 +3628,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index d92a2467291..87bb21ce830 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -93,7 +93,9 @@ public class PaymentIntentConfirmParams extends ApiRequestParams { /** * The list of payment method types (for example, a card) that this PaymentIntent can use. Use * {@code automatic_payment_methods} to manage payment methods from the Stripe Dashboard. + * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard. A list of + * valid payment method types can be found here. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -1040,6 +1042,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -1326,6 +1335,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -1379,6 +1389,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -1454,6 +1465,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -1548,6 +1561,7 @@ public PaymentIntentConfirmParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1732,6 +1746,15 @@ public Builder setCashapp(PaymentIntentConfirmParams.PaymentMethodData.Cashapp c return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(PaymentIntentConfirmParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -3320,6 +3343,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodData.Crypto build() { + return new PaymentIntentConfirmParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3921,6 +4002,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -6248,6 +6332,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6461,6 +6548,13 @@ public static class PaymentMethodOptions { @SerializedName("cashapp") Object cashapp; + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + @SerializedName("crypto") + Object crypto; + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about the * customer balance payment method options. @@ -6724,6 +6818,7 @@ private PaymentMethodOptions( Object card, Object cardPresent, Object cashapp, + Object crypto, Object customerBalance, Object eps, Map extraParams, @@ -6774,6 +6869,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -6846,6 +6942,8 @@ public static class Builder { private Object cashapp; + private Object crypto; + private Object customerBalance; private Object eps; @@ -6934,6 +7032,7 @@ public PaymentIntentConfirmParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -7242,6 +7341,24 @@ public Builder setCashapp(EmptyParam cashapp) { return this; } + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(PaymentIntentConfirmParams.PaymentMethodOptions.Crypto crypto) { + this.crypto = crypto; + return this; + } + + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(EmptyParam crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. @@ -11140,7 +11257,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, {@code + * bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -11221,7 +11341,10 @@ public Builder setInterval( return this; } - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ public Builder setType( PaymentIntentConfirmParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; @@ -11242,8 +11365,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; @@ -12753,6 +12882,137 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

If you've already set {@code setup_future_usage} and you're performing a request using a + * publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + private Crypto(Map extraParams, SetupFutureUsage setupFutureUsage) { + this.extraParams = extraParams; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private SetupFutureUsage setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Crypto build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Crypto( + this.extraParams, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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. + * + *

If you've already set {@code setup_future_usage} and you're performing a request using + * a publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + public Builder setSetupFutureUsage( + PaymentIntentConfirmParams.PaymentMethodOptions.Crypto.SetupFutureUsage + setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -14234,6 +14494,10 @@ public static class Klarna { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** On-demand details if setting up or charging an on-demand payment. */ + @SerializedName("on_demand") + OnDemand onDemand; + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ @SerializedName("preferred_locale") PreferredLocale preferredLocale; @@ -14264,15 +14528,23 @@ public static class Klarna { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + private Klarna( ApiRequestParams.EnumParam captureMethod, Map extraParams, + OnDemand onDemand, PreferredLocale preferredLocale, - SetupFutureUsage setupFutureUsage) { + SetupFutureUsage setupFutureUsage, + Object subscriptions) { this.captureMethod = captureMethod; this.extraParams = extraParams; + this.onDemand = onDemand; this.preferredLocale = preferredLocale; this.setupFutureUsage = setupFutureUsage; + this.subscriptions = subscriptions; } public static Builder builder() { @@ -14284,14 +14556,23 @@ public static class Builder { private Map extraParams; + private OnDemand onDemand; + private PreferredLocale preferredLocale; private SetupFutureUsage setupFutureUsage; + private Object subscriptions; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.PaymentMethodOptions.Klarna build() { return new PaymentIntentConfirmParams.PaymentMethodOptions.Klarna( - this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); + this.captureMethod, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.setupFutureUsage, + this.subscriptions); } /** @@ -14353,6 +14634,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** On-demand details if setting up or charging an on-demand payment. */ + public Builder setOnDemand( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ @@ -14393,26 +14681,531 @@ public Builder setSetupFutureUsage( this.setupFutureUsage = setupFutureUsage; return this; } - } - public enum CaptureMethod implements ApiRequestParams.EnumParam { - @SerializedName("manual") - MANUAL("manual"); + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList< + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription>(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link PaymentIntentConfirmParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList< + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription>(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } - CaptureMethod(String value) { - this.value = value; + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; } - } - public enum PreferredLocale implements ApiRequestParams.EnumParam { - @SerializedName("cs-CZ") - CS_CZ("cs-CZ"), + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List + subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } - @SerializedName("da-DK") - DA_DK("da-DK"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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.Klarna.OnDemand#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.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + String name; + + /** Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + String reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + String name, + NextBilling nextBilling, + String reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private String name; + + private NextBilling nextBilling; + + private String reference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. 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.Klarna.Subscription#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.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.Interval + interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + String date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, String date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), @SerializedName("de-AT") DE_AT("de-AT"), @@ -14556,7 +15349,13 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") - NONE("none"); + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a65e2217502..b25ad00fc6d 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -210,7 +210,9 @@ public class PaymentIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, a card) that this PaymentIntent can use. If you * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. + * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings. A + * list of valid payment method types can be found here. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -1567,6 +1569,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -1853,6 +1862,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -1906,6 +1916,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -1981,6 +1992,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -2075,6 +2088,7 @@ public PaymentIntentCreateParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -2256,6 +2270,15 @@ public Builder setCashapp(PaymentIntentCreateParams.PaymentMethodData.Cashapp ca return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(PaymentIntentCreateParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -3836,6 +3859,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodData.Crypto build() { + return new PaymentIntentCreateParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -4436,6 +4517,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -6762,6 +6846,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6975,6 +7062,13 @@ public static class PaymentMethodOptions { @SerializedName("cashapp") Object cashapp; + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + @SerializedName("crypto") + Object crypto; + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about the * customer balance payment method options. @@ -7238,6 +7332,7 @@ private PaymentMethodOptions( Object card, Object cardPresent, Object cashapp, + Object crypto, Object customerBalance, Object eps, Map extraParams, @@ -7288,6 +7383,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -7360,6 +7456,8 @@ public static class Builder { private Object cashapp; + private Object crypto; + private Object customerBalance; private Object eps; @@ -7448,6 +7546,7 @@ public PaymentIntentCreateParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -7756,6 +7855,24 @@ public Builder setCashapp(EmptyParam cashapp) { return this; } + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(PaymentIntentCreateParams.PaymentMethodOptions.Crypto crypto) { + this.crypto = crypto; + return this; + } + + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(EmptyParam crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. @@ -11649,7 +11766,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, {@code + * bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -11730,7 +11850,10 @@ public Builder setInterval( return this; } - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ public Builder setType( PaymentIntentCreateParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; @@ -11751,8 +11874,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; @@ -13260,6 +13389,137 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

If you've already set {@code setup_future_usage} and you're performing a request using a + * publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + private Crypto(Map extraParams, SetupFutureUsage setupFutureUsage) { + this.extraParams = extraParams; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private SetupFutureUsage setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Crypto build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Crypto( + this.extraParams, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentCreateParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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. + * + *

If you've already set {@code setup_future_usage} and you're performing a request using + * a publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + public Builder setSetupFutureUsage( + PaymentIntentCreateParams.PaymentMethodOptions.Crypto.SetupFutureUsage + setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -14741,6 +15001,10 @@ public static class Klarna { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** On-demand details if setting up or charging an on-demand payment. */ + @SerializedName("on_demand") + OnDemand onDemand; + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ @SerializedName("preferred_locale") PreferredLocale preferredLocale; @@ -14771,15 +15035,23 @@ public static class Klarna { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + private Klarna( ApiRequestParams.EnumParam captureMethod, Map extraParams, + OnDemand onDemand, PreferredLocale preferredLocale, - SetupFutureUsage setupFutureUsage) { + SetupFutureUsage setupFutureUsage, + Object subscriptions) { this.captureMethod = captureMethod; this.extraParams = extraParams; + this.onDemand = onDemand; this.preferredLocale = preferredLocale; this.setupFutureUsage = setupFutureUsage; + this.subscriptions = subscriptions; } public static Builder builder() { @@ -14791,14 +15063,23 @@ public static class Builder { private Map extraParams; + private OnDemand onDemand; + private PreferredLocale preferredLocale; private SetupFutureUsage setupFutureUsage; + private Object subscriptions; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.PaymentMethodOptions.Klarna build() { return new PaymentIntentCreateParams.PaymentMethodOptions.Klarna( - this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); + this.captureMethod, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.setupFutureUsage, + this.subscriptions); } /** @@ -14860,6 +15141,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** On-demand details if setting up or charging an on-demand payment. */ + public Builder setOnDemand( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ @@ -14899,26 +15187,529 @@ public Builder setSetupFutureUsage( this.setupFutureUsage = setupFutureUsage; return this; } - } - public enum CaptureMethod implements ApiRequestParams.EnumParam { - @SerializedName("manual") - MANUAL("manual"); + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link PaymentIntentCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } - CaptureMethod(String value) { - this.value = value; + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; } - } - public enum PreferredLocale implements ApiRequestParams.EnumParam { - @SerializedName("cs-CZ") - CS_CZ("cs-CZ"), + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List + subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } - @SerializedName("da-DK") - DA_DK("da-DK"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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.Klarna.OnDemand#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.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + String name; + + /** Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + String reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + String name, + NextBilling nextBilling, + String reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private String name; + + private NextBilling nextBilling; + + private String reference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. 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.Klarna.Subscription#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.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.Interval + interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + String date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, String date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), @SerializedName("de-AT") DE_AT("de-AT"), @@ -15062,7 +15853,13 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") - NONE("none"); + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 90f73413b52..74059b92a1d 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -122,7 +122,9 @@ public class PaymentIntentUpdateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this PaymentIntent can use. Use * {@code automatic_payment_methods} to manage payment methods from the Stripe Dashboard. + * href="https://dashboard.stripe.com/settings/payment_methods">Stripe Dashboard. A list of + * valid payment method types can be found here. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -907,6 +909,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -1193,6 +1202,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -1246,6 +1256,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -1321,6 +1332,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -1415,6 +1428,7 @@ public PaymentIntentUpdateParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1596,6 +1610,15 @@ public Builder setCashapp(PaymentIntentUpdateParams.PaymentMethodData.Cashapp ca return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(PaymentIntentUpdateParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -3275,6 +3298,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodData.Crypto build() { + return new PaymentIntentUpdateParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3875,6 +3956,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -6273,6 +6357,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6486,6 +6573,13 @@ public static class PaymentMethodOptions { @SerializedName("cashapp") Object cashapp; + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + @SerializedName("crypto") + Object crypto; + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about the * customer balance payment method options. @@ -6749,6 +6843,7 @@ private PaymentMethodOptions( Object card, Object cardPresent, Object cashapp, + Object crypto, Object customerBalance, Object eps, Map extraParams, @@ -6799,6 +6894,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -6871,6 +6967,8 @@ public static class Builder { private Object cashapp; + private Object crypto; + private Object customerBalance; private Object eps; @@ -6959,6 +7057,7 @@ public PaymentIntentUpdateParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -7267,6 +7366,24 @@ public Builder setCashapp(EmptyParam cashapp) { return this; } + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(PaymentIntentUpdateParams.PaymentMethodOptions.Crypto crypto) { + this.crypto = crypto; + return this; + } + + /** + * If this is a {@code crypto} PaymentMethod, this sub-hash contains details about the Crypto + * payment method options. + */ + public Builder setCrypto(EmptyParam crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer balance} PaymentMethod, this sub-hash contains details about * the customer balance payment method options. @@ -11236,7 +11353,10 @@ public static class Plan { @SerializedName("interval") Interval interval; - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, {@code + * bonus}, or {@code revolving}. + */ @SerializedName("type") Type type; @@ -11317,7 +11437,10 @@ public Builder setInterval( return this; } - /** Required. Type of installment plan, one of {@code fixed_count}. */ + /** + * Required. Type of installment plan, one of {@code fixed_count}, + * {@code bonus}, or {@code revolving}. + */ public Builder setType( PaymentIntentUpdateParams.PaymentMethodOptions.Card.Installments.Plan.Type type) { this.type = type; @@ -11338,8 +11461,14 @@ public enum Interval implements ApiRequestParams.EnumParam { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("bonus") + BONUS("bonus"), + @SerializedName("fixed_count") - FIXED_COUNT("fixed_count"); + FIXED_COUNT("fixed_count"), + + @SerializedName("revolving") + REVOLVING("revolving"); @Getter(onMethod_ = {@Override}) private final String value; @@ -12901,6 +13030,137 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

If you've already set {@code setup_future_usage} and you're performing a request using a + * publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + @SerializedName("setup_future_usage") + SetupFutureUsage setupFutureUsage; + + private Crypto(Map extraParams, SetupFutureUsage setupFutureUsage) { + this.extraParams = extraParams; + this.setupFutureUsage = setupFutureUsage; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private SetupFutureUsage setupFutureUsage; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Crypto build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Crypto( + this.extraParams, this.setupFutureUsage); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Crypto#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * 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. + * + *

If you've already set {@code setup_future_usage} and you're performing a request using + * a publishable key, you can only update the value from {@code on_session} to {@code + * off_session}. + */ + public Builder setSetupFutureUsage( + PaymentIntentUpdateParams.PaymentMethodOptions.Crypto.SetupFutureUsage + setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -14392,6 +14652,10 @@ public static class Klarna { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** On-demand details if setting up or charging an on-demand payment. */ + @SerializedName("on_demand") + OnDemand onDemand; + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ @SerializedName("preferred_locale") PreferredLocale preferredLocale; @@ -14422,15 +14686,23 @@ public static class Klarna { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + private Klarna( ApiRequestParams.EnumParam captureMethod, Map extraParams, + OnDemand onDemand, PreferredLocale preferredLocale, - SetupFutureUsage setupFutureUsage) { + SetupFutureUsage setupFutureUsage, + Object subscriptions) { this.captureMethod = captureMethod; this.extraParams = extraParams; + this.onDemand = onDemand; this.preferredLocale = preferredLocale; this.setupFutureUsage = setupFutureUsage; + this.subscriptions = subscriptions; } public static Builder builder() { @@ -14442,14 +14714,23 @@ public static class Builder { private Map extraParams; + private OnDemand onDemand; + private PreferredLocale preferredLocale; private SetupFutureUsage setupFutureUsage; + private Object subscriptions; + /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.PaymentMethodOptions.Klarna build() { return new PaymentIntentUpdateParams.PaymentMethodOptions.Klarna( - this.captureMethod, this.extraParams, this.preferredLocale, this.setupFutureUsage); + this.captureMethod, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.setupFutureUsage, + this.subscriptions); } /** @@ -14511,6 +14792,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** On-demand details if setting up or charging an on-demand payment. */ + public Builder setOnDemand( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + /** * Preferred language of the Klarna authorization page that the customer is redirected to. */ @@ -14550,26 +14838,553 @@ public Builder setSetupFutureUsage( this.setupFutureUsage = setupFutureUsage; return this; } - } - public enum CaptureMethod implements ApiRequestParams.EnumParam { - @SerializedName("manual") - MANUAL("manual"); + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * PaymentIntentUpdateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } - @Getter(onMethod_ = {@Override}) - private final String value; + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link PaymentIntentUpdateParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } - CaptureMethod(String value) { - this.value = value; + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; } - } - public enum PreferredLocale implements ApiRequestParams.EnumParam { - @SerializedName("cs-CZ") - CS_CZ("cs-CZ"), + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List + subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } - @SerializedName("da-DK") - DA_DK("da-DK"), + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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.Klarna.OnDemand#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.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + Object name; + + /** Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + Object reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + Object name, + NextBilling nextBilling, + Object reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private Object name; + + private NextBilling nextBilling; + + private Object reference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. 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.Klarna.Subscription#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.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.Interval + interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Name for subscription. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } + + /** Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(EmptyParam reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + Object date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, Object date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(EmptyParam date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * PaymentIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum CaptureMethod implements ApiRequestParams.EnumParam { + @SerializedName("manual") + MANUAL("manual"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + CaptureMethod(String value) { + this.value = value; + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), @SerializedName("de-AT") DE_AT("de-AT"), @@ -14713,7 +15528,13 @@ public enum PreferredLocale implements ApiRequestParams.EnumParam { public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") - NONE("none"); + NONE("none"), + + @SerializedName("off_session") + OFF_SESSION("off_session"), + + @SerializedName("on_session") + ON_SESSION("on_session"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 534a6071621..eb3fdf86ab2 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -129,6 +129,12 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment method. + */ + @SerializedName("crypto") + Crypto crypto; + /** The {@code Customer} to whom the original PaymentMethod is attached. */ @SerializedName("customer") String customer; @@ -427,6 +433,7 @@ private PaymentMethodCreateParams( Boleto boleto, Object card, Cashapp cashapp, + Crypto crypto, String customer, CustomerBalance customerBalance, Eps eps, @@ -484,6 +491,7 @@ private PaymentMethodCreateParams( this.boleto = boleto; this.card = card; this.cashapp = cashapp; + this.crypto = crypto; this.customer = customer; this.customerBalance = customerBalance; this.eps = eps; @@ -564,6 +572,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private String customer; private CustomerBalance customerBalance; @@ -665,6 +675,7 @@ public PaymentMethodCreateParams build() { this.boleto, this.card, this.cashapp, + this.crypto, this.customer, this.customerBalance, this.eps, @@ -871,6 +882,15 @@ public Builder setCashapp(PaymentMethodCreateParams.Cashapp cashapp) { return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(PaymentMethodCreateParams.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** The {@code Customer} to whom the original PaymentMethod is attached. */ public Builder setCustomer(String customer) { this.customer = customer; @@ -2674,6 +2694,62 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Crypto build() { + return new PaymentMethodCreateParams.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3263,6 +3339,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -5606,6 +5685,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 2143839fb91..41514ad42f3 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -255,6 +255,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/QuoteCreateParams.java b/src/main/java/com/stripe/param/QuoteCreateParams.java index 66900a6b21a..5585eb64daa 100644 --- a/src/main/java/com/stripe/param/QuoteCreateParams.java +++ b/src/main/java/com/stripe/param/QuoteCreateParams.java @@ -1889,6 +1889,10 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class SubscriptionData { + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -1899,10 +1903,8 @@ public static class SubscriptionData { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the subscription - * will be updated using a subscription schedule. The special value {@code current_period_end} - * can be provided to update a subscription at the end of its current period. The {@code - * effective_date} is ignored if it is in the past when the quote is accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past when + * the quote is accepted. */ @SerializedName("effective_date") Object effectiveDate; @@ -1936,11 +1938,13 @@ public static class SubscriptionData { Object trialPeriodDays; private SubscriptionData( + BillingMode billingMode, String description, Object effectiveDate, Map extraParams, Map metadata, Object trialPeriodDays) { + this.billingMode = billingMode; this.description = description; this.effectiveDate = effectiveDate; this.extraParams = extraParams; @@ -1953,6 +1957,8 @@ public static Builder builder() { } public static class Builder { + private BillingMode billingMode; + private String description; private Object effectiveDate; @@ -1966,6 +1972,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public QuoteCreateParams.SubscriptionData build() { return new QuoteCreateParams.SubscriptionData( + this.billingMode, this.description, this.effectiveDate, this.extraParams, @@ -1973,6 +1980,12 @@ public QuoteCreateParams.SubscriptionData build() { this.trialPeriodDays); } + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode(QuoteCreateParams.SubscriptionData.BillingMode billingMode) { + this.billingMode = billingMode; + return this; + } + /** * The subscription's description, meant to be displayable to the customer. Use this field to * optionally store an explanation of the subscription for rendering in Stripe surfaces and @@ -1985,11 +1998,8 @@ public Builder setDescription(String description) { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate( QuoteCreateParams.SubscriptionData.EffectiveDate effectiveDate) { @@ -1999,11 +2009,8 @@ public Builder setEffectiveDate( /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate(Long effectiveDate) { this.effectiveDate = effectiveDate; @@ -2012,11 +2019,8 @@ public Builder setEffectiveDate(Long effectiveDate) { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate(EmptyParam effectiveDate) { this.effectiveDate = effectiveDate; @@ -2094,6 +2098,92 @@ public Builder setTrialPeriodDays(EmptyParam trialPeriodDays) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public QuoteCreateParams.SubscriptionData.BillingMode build() { + return new QuoteCreateParams.SubscriptionData.BillingMode(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link QuoteCreateParams.SubscriptionData.BillingMode#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 QuoteCreateParams.SubscriptionData.BillingMode#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. */ + public Builder setType(QuoteCreateParams.SubscriptionData.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + public enum EffectiveDate implements ApiRequestParams.EnumParam { @SerializedName("current_period_end") CURRENT_PERIOD_END("current_period_end"); diff --git a/src/main/java/com/stripe/param/QuoteUpdateParams.java b/src/main/java/com/stripe/param/QuoteUpdateParams.java index bb896c7f04b..ea73937c61d 100644 --- a/src/main/java/com/stripe/param/QuoteUpdateParams.java +++ b/src/main/java/com/stripe/param/QuoteUpdateParams.java @@ -1851,10 +1851,8 @@ public static class SubscriptionData { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the subscription - * will be updated using a subscription schedule. The special value {@code current_period_end} - * can be provided to update a subscription at the end of its current period. The {@code - * effective_date} is ignored if it is in the past when the quote is accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past when + * the quote is accepted. */ @SerializedName("effective_date") Object effectiveDate; @@ -1947,11 +1945,8 @@ public Builder setDescription(EmptyParam description) { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate( QuoteUpdateParams.SubscriptionData.EffectiveDate effectiveDate) { @@ -1961,11 +1956,8 @@ public Builder setEffectiveDate( /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate(Long effectiveDate) { this.effectiveDate = effectiveDate; @@ -1974,11 +1966,8 @@ public Builder setEffectiveDate(Long effectiveDate) { /** * When creating a new subscription, the date of which the subscription schedule will start - * after the quote is accepted. When updating a subscription, the date of which the - * subscription will be updated using a subscription schedule. The special value {@code - * current_period_end} can be provided to update a subscription at the end of its current - * period. The {@code effective_date} is ignored if it is in the past when the quote is - * accepted. + * after the quote is accepted. The {@code effective_date} is ignored if it is in the past + * when the quote is accepted. */ public Builder setEffectiveDate(EmptyParam effectiveDate) { this.effectiveDate = effectiveDate; diff --git a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java index 332b78e5772..df14d4463ce 100644 --- a/src/main/java/com/stripe/param/SetupIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/SetupIntentConfirmParams.java @@ -734,6 +734,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -1020,6 +1027,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -1073,6 +1081,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -1148,6 +1157,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -1242,6 +1253,7 @@ public SetupIntentConfirmParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1423,6 +1435,15 @@ public Builder setCashapp(SetupIntentConfirmParams.PaymentMethodData.Cashapp cas return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(SetupIntentConfirmParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -3003,6 +3024,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodData.Crypto build() { + return new SetupIntentConfirmParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3603,6 +3682,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -5929,6 +6011,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6081,6 +6166,13 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + @SerializedName("klarna") + Klarna klarna; + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -6116,6 +6208,7 @@ private PaymentMethodOptions( Card card, CardPresent cardPresent, Map extraParams, + Klarna klarna, Link link, Paypal paypal, SepaDebit sepaDebit, @@ -6126,6 +6219,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.extraParams = extraParams; + this.klarna = klarna; this.link = link; this.paypal = paypal; this.sepaDebit = sepaDebit; @@ -6149,6 +6243,8 @@ public static class Builder { private Map extraParams; + private Klarna klarna; + private Link link; private Paypal paypal; @@ -6166,6 +6262,7 @@ public SetupIntentConfirmParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.extraParams, + this.klarna, this.link, this.paypal, this.sepaDebit, @@ -6245,6 +6342,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + public Builder setKlarna(SetupIntentConfirmParams.PaymentMethodOptions.Klarna klarna) { + this.klarna = klarna; + return this; + } + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -8083,6 +8189,772 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** The currency of the SetupIntent. Three letter ISO currency code. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** On-demand details if setting up a payment method for on-demand payments. */ + @SerializedName("on_demand") + OnDemand onDemand; + + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + + private Klarna( + String currency, + Map extraParams, + OnDemand onDemand, + PreferredLocale preferredLocale, + Object subscriptions) { + this.currency = currency; + this.extraParams = extraParams; + this.onDemand = onDemand; + this.preferredLocale = preferredLocale; + this.subscriptions = subscriptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private OnDemand onDemand; + + private PreferredLocale preferredLocale; + + private Object subscriptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Klarna build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Klarna( + this.currency, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.subscriptions); + } + + /** The currency of the SetupIntent. Three letter ISO currency code. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentConfirmParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** On-demand details if setting up a payment method for on-demand payments. */ + public Builder setOnDemand( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to. + */ + public Builder setPreferredLocale( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.PreferredLocale preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } + + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link SetupIntentConfirmParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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 + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand#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 + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + String name; + + /** Required. Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + String reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + String name, + NextBilling nextBilling, + String reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private String name; + + private NextBilling nextBilling; + + private String reference; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription#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 + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Required. Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + String date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, String date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 + * SetupIntentConfirmParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), + + @SerializedName("de-AT") + DE_AT("de-AT"), + + @SerializedName("de-CH") + DE_CH("de-CH"), + + @SerializedName("de-DE") + DE_DE("de-DE"), + + @SerializedName("el-GR") + EL_GR("el-GR"), + + @SerializedName("en-AT") + EN_AT("en-AT"), + + @SerializedName("en-AU") + EN_AU("en-AU"), + + @SerializedName("en-BE") + EN_BE("en-BE"), + + @SerializedName("en-CA") + EN_CA("en-CA"), + + @SerializedName("en-CH") + EN_CH("en-CH"), + + @SerializedName("en-CZ") + EN_CZ("en-CZ"), + + @SerializedName("en-DE") + EN_DE("en-DE"), + + @SerializedName("en-DK") + EN_DK("en-DK"), + + @SerializedName("en-ES") + EN_ES("en-ES"), + + @SerializedName("en-FI") + EN_FI("en-FI"), + + @SerializedName("en-FR") + EN_FR("en-FR"), + + @SerializedName("en-GB") + EN_GB("en-GB"), + + @SerializedName("en-GR") + EN_GR("en-GR"), + + @SerializedName("en-IE") + EN_IE("en-IE"), + + @SerializedName("en-IT") + EN_IT("en-IT"), + + @SerializedName("en-NL") + EN_NL("en-NL"), + + @SerializedName("en-NO") + EN_NO("en-NO"), + + @SerializedName("en-NZ") + EN_NZ("en-NZ"), + + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + + @SerializedName("en-RO") + EN_RO("en-RO"), + + @SerializedName("en-SE") + EN_SE("en-SE"), + + @SerializedName("en-US") + EN_US("en-US"), + + @SerializedName("es-ES") + ES_ES("es-ES"), + + @SerializedName("es-US") + ES_US("es-US"), + + @SerializedName("fi-FI") + FI_FI("fi-FI"), + + @SerializedName("fr-BE") + FR_BE("fr-BE"), + + @SerializedName("fr-CA") + FR_CA("fr-CA"), + + @SerializedName("fr-CH") + FR_CH("fr-CH"), + + @SerializedName("fr-FR") + FR_FR("fr-FR"), + + @SerializedName("it-CH") + IT_CH("it-CH"), + + @SerializedName("it-IT") + IT_IT("it-IT"), + + @SerializedName("nb-NO") + NB_NO("nb-NO"), + + @SerializedName("nl-BE") + NL_BE("nl-BE"), + + @SerializedName("nl-NL") + NL_NL("nl-NL"), + + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + + @SerializedName("ro-RO") + RO_RO("ro-RO"), + + @SerializedName("sv-FI") + SV_FI("sv-FI"), + + @SerializedName("sv-SE") + SV_SE("sv-SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Link { diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index f97c73a4a6c..8bad3948c70 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -135,7 +135,9 @@ public class SetupIntentCreateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can use. If you * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. + * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings. A + * list of valid payment method types can be found here. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -1208,6 +1210,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -1494,6 +1503,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -1547,6 +1557,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -1622,6 +1633,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -1716,6 +1729,7 @@ public SetupIntentCreateParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1897,6 +1911,15 @@ public Builder setCashapp(SetupIntentCreateParams.PaymentMethodData.Cashapp cash return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(SetupIntentCreateParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -3475,6 +3498,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodData.Crypto build() { + return new SetupIntentCreateParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -4075,6 +4156,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -6401,6 +6485,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6553,6 +6640,13 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + @SerializedName("klarna") + Klarna klarna; + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -6588,6 +6682,7 @@ private PaymentMethodOptions( Card card, CardPresent cardPresent, Map extraParams, + Klarna klarna, Link link, Paypal paypal, SepaDebit sepaDebit, @@ -6598,6 +6693,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.extraParams = extraParams; + this.klarna = klarna; this.link = link; this.paypal = paypal; this.sepaDebit = sepaDebit; @@ -6621,6 +6717,8 @@ public static class Builder { private Map extraParams; + private Klarna klarna; + private Link link; private Paypal paypal; @@ -6638,6 +6736,7 @@ public SetupIntentCreateParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.extraParams, + this.klarna, this.link, this.paypal, this.sepaDebit, @@ -6717,6 +6816,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + public Builder setKlarna(SetupIntentCreateParams.PaymentMethodOptions.Klarna klarna) { + this.klarna = klarna; + return this; + } + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -8553,6 +8661,772 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** The currency of the SetupIntent. Three letter ISO currency code. */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** On-demand details if setting up a payment method for on-demand payments. */ + @SerializedName("on_demand") + OnDemand onDemand; + + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + + private Klarna( + String currency, + Map extraParams, + OnDemand onDemand, + PreferredLocale preferredLocale, + Object subscriptions) { + this.currency = currency; + this.extraParams = extraParams; + this.onDemand = onDemand; + this.preferredLocale = preferredLocale; + this.subscriptions = subscriptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private OnDemand onDemand; + + private PreferredLocale preferredLocale; + + private Object subscriptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Klarna build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Klarna( + this.currency, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.subscriptions); + } + + /** The currency of the SetupIntent. Three letter ISO currency code. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentCreateParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** On-demand details if setting up a payment method for on-demand payments. */ + public Builder setOnDemand( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to. + */ + public Builder setPreferredLocale( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.PreferredLocale preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SetupIntentCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } + + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link SetupIntentCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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 + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand#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 + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + String name; + + /** Required. Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + String reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + String name, + NextBilling nextBilling, + String reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private String name; + + private NextBilling nextBilling; + + private String reference; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription#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 + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Required. Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + String date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, String date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 + * SetupIntentCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), + + @SerializedName("de-AT") + DE_AT("de-AT"), + + @SerializedName("de-CH") + DE_CH("de-CH"), + + @SerializedName("de-DE") + DE_DE("de-DE"), + + @SerializedName("el-GR") + EL_GR("el-GR"), + + @SerializedName("en-AT") + EN_AT("en-AT"), + + @SerializedName("en-AU") + EN_AU("en-AU"), + + @SerializedName("en-BE") + EN_BE("en-BE"), + + @SerializedName("en-CA") + EN_CA("en-CA"), + + @SerializedName("en-CH") + EN_CH("en-CH"), + + @SerializedName("en-CZ") + EN_CZ("en-CZ"), + + @SerializedName("en-DE") + EN_DE("en-DE"), + + @SerializedName("en-DK") + EN_DK("en-DK"), + + @SerializedName("en-ES") + EN_ES("en-ES"), + + @SerializedName("en-FI") + EN_FI("en-FI"), + + @SerializedName("en-FR") + EN_FR("en-FR"), + + @SerializedName("en-GB") + EN_GB("en-GB"), + + @SerializedName("en-GR") + EN_GR("en-GR"), + + @SerializedName("en-IE") + EN_IE("en-IE"), + + @SerializedName("en-IT") + EN_IT("en-IT"), + + @SerializedName("en-NL") + EN_NL("en-NL"), + + @SerializedName("en-NO") + EN_NO("en-NO"), + + @SerializedName("en-NZ") + EN_NZ("en-NZ"), + + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + + @SerializedName("en-RO") + EN_RO("en-RO"), + + @SerializedName("en-SE") + EN_SE("en-SE"), + + @SerializedName("en-US") + EN_US("en-US"), + + @SerializedName("es-ES") + ES_ES("es-ES"), + + @SerializedName("es-US") + ES_US("es-US"), + + @SerializedName("fi-FI") + FI_FI("fi-FI"), + + @SerializedName("fr-BE") + FR_BE("fr-BE"), + + @SerializedName("fr-CA") + FR_CA("fr-CA"), + + @SerializedName("fr-CH") + FR_CH("fr-CH"), + + @SerializedName("fr-FR") + FR_FR("fr-FR"), + + @SerializedName("it-CH") + IT_CH("it-CH"), + + @SerializedName("it-IT") + IT_IT("it-IT"), + + @SerializedName("nb-NO") + NB_NO("nb-NO"), + + @SerializedName("nl-BE") + NL_BE("nl-BE"), + + @SerializedName("nl-NL") + NL_NL("nl-NL"), + + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + + @SerializedName("ro-RO") + RO_RO("ro-RO"), + + @SerializedName("sv-FI") + SV_FI("sv-FI"), + + @SerializedName("sv-SE") + SV_SE("sv-SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Link { diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index b025db23117..73a40d01c06 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -99,7 +99,9 @@ public class SetupIntentUpdateParams extends ApiRequestParams { /** * The list of payment method types (for example, card) that this SetupIntent can set up. If you * don't provide this, Stripe will dynamically show relevant payment methods from your payment method settings. + * href="https://dashboard.stripe.com/settings/payment_methods">payment method settings. A + * list of valid payment method types can be found here. */ @SerializedName("payment_method_types") List paymentMethodTypes; @@ -545,6 +547,13 @@ public static class PaymentMethodData { @SerializedName("cashapp") Cashapp cashapp; + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + @SerializedName("crypto") + Crypto crypto; + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -831,6 +840,7 @@ private PaymentMethodData( Blik blik, Boleto boleto, Cashapp cashapp, + Crypto crypto, CustomerBalance customerBalance, Eps eps, Map extraParams, @@ -884,6 +894,7 @@ private PaymentMethodData( this.blik = blik; this.boleto = boleto; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.extraParams = extraParams; @@ -959,6 +970,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -1053,6 +1066,7 @@ public SetupIntentUpdateParams.PaymentMethodData build() { this.blik, this.boleto, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.extraParams, @@ -1234,6 +1248,15 @@ public Builder setCashapp(SetupIntentUpdateParams.PaymentMethodData.Cashapp cash return this; } + /** + * If this is a Crypto PaymentMethod, this hash contains details about the Crypto payment + * method. + */ + public Builder setCrypto(SetupIntentUpdateParams.PaymentMethodData.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * If this is a {@code customer_balance} PaymentMethod, this hash contains details about the * CustomerBalance payment method. @@ -2911,6 +2934,64 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(Map extraParams) { + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodData.Crypto build() { + return new SetupIntentUpdateParams.PaymentMethodData.Crypto(this.extraParams); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodData.Crypto#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -3511,6 +3592,9 @@ public enum Bank implements ApiRequestParams.EnumParam { @SerializedName("bunq") BUNQ("bunq"), + @SerializedName("buut") + BUUT("buut"), + @SerializedName("handelsbanken") HANDELSBANKEN("handelsbanken"), @@ -5909,6 +5993,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), @@ -6061,6 +6148,13 @@ public static class PaymentMethodOptions { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + @SerializedName("klarna") + Klarna klarna; + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -6096,6 +6190,7 @@ private PaymentMethodOptions( Card card, CardPresent cardPresent, Map extraParams, + Klarna klarna, Link link, Paypal paypal, SepaDebit sepaDebit, @@ -6106,6 +6201,7 @@ private PaymentMethodOptions( this.card = card; this.cardPresent = cardPresent; this.extraParams = extraParams; + this.klarna = klarna; this.link = link; this.paypal = paypal; this.sepaDebit = sepaDebit; @@ -6129,6 +6225,8 @@ public static class Builder { private Map extraParams; + private Klarna klarna; + private Link link; private Paypal paypal; @@ -6146,6 +6244,7 @@ public SetupIntentUpdateParams.PaymentMethodOptions build() { this.card, this.cardPresent, this.extraParams, + this.klarna, this.link, this.paypal, this.sepaDebit, @@ -6225,6 +6324,15 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * If this is a {@code klarna} PaymentMethod, this hash contains details about the Klarna + * payment method options. + */ + public Builder setKlarna(SetupIntentUpdateParams.PaymentMethodOptions.Klarna klarna) { + this.klarna = klarna; + return this; + } + /** * If this is a {@code link} PaymentMethod, this sub-hash contains details about the Link * payment method options. @@ -8135,6 +8243,802 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Klarna { + /** The currency of the SetupIntent. Three letter ISO currency code. */ + @SerializedName("currency") + Object currency; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** On-demand details if setting up a payment method for on-demand payments. */ + @SerializedName("on_demand") + OnDemand onDemand; + + /** Preferred language of the Klarna authorization page that the customer is redirected to. */ + @SerializedName("preferred_locale") + PreferredLocale preferredLocale; + + /** Subscription details if setting up or charging a subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + + private Klarna( + Object currency, + Map extraParams, + OnDemand onDemand, + PreferredLocale preferredLocale, + Object subscriptions) { + this.currency = currency; + this.extraParams = extraParams; + this.onDemand = onDemand; + this.preferredLocale = preferredLocale; + this.subscriptions = subscriptions; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object currency; + + private Map extraParams; + + private OnDemand onDemand; + + private PreferredLocale preferredLocale; + + private Object subscriptions; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Klarna build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Klarna( + this.currency, + this.extraParams, + this.onDemand, + this.preferredLocale, + this.subscriptions); + } + + /** The currency of the SetupIntent. Three letter ISO currency code. */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** The currency of the SetupIntent. Three letter ISO currency code. */ + public Builder setCurrency(EmptyParam currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SetupIntentUpdateParams.PaymentMethodOptions.Klarna#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** On-demand details if setting up a payment method for on-demand payments. */ + public Builder setOnDemand( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand onDemand) { + this.onDemand = onDemand; + return this; + } + + /** + * Preferred language of the Klarna authorization page that the customer is redirected to. + */ + public Builder setPreferredLocale( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.PreferredLocale preferredLocale) { + this.preferredLocale = preferredLocale; + return this; + } + + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .add(element); + return this; + } + + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link SetupIntentUpdateParams.PaymentMethodOptions.Klarna#subscriptions} for the + * field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) + this.subscriptions) + .addAll(elements); + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** Subscription details if setting up or charging a subscription. */ + public Builder setSubscriptions( + List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class OnDemand { + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + @SerializedName("average_amount") + Long averageAmount; + + /** + * 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 maximum value you may charge a customer per purchase. You can use a value across your + * customer base, or segment based on customer type, country, etc. + */ + @SerializedName("maximum_amount") + Long maximumAmount; + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + @SerializedName("minimum_amount") + Long minimumAmount; + + /** Interval at which the customer is making purchases. */ + @SerializedName("purchase_interval") + PurchaseInterval purchaseInterval; + + /** The number of {@code purchase_interval} between charges. */ + @SerializedName("purchase_interval_count") + Long purchaseIntervalCount; + + private OnDemand( + Long averageAmount, + Map extraParams, + Long maximumAmount, + Long minimumAmount, + PurchaseInterval purchaseInterval, + Long purchaseIntervalCount) { + this.averageAmount = averageAmount; + this.extraParams = extraParams; + this.maximumAmount = maximumAmount; + this.minimumAmount = minimumAmount; + this.purchaseInterval = purchaseInterval; + this.purchaseIntervalCount = purchaseIntervalCount; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long averageAmount; + + private Map extraParams; + + private Long maximumAmount; + + private Long minimumAmount; + + private PurchaseInterval purchaseInterval; + + private Long purchaseIntervalCount; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand( + this.averageAmount, + this.extraParams, + this.maximumAmount, + this.minimumAmount, + this.purchaseInterval, + this.purchaseIntervalCount); + } + + /** + * Your average amount value. You can use a value across your customer base, or segment + * based on customer type, country, etc. + */ + public Builder setAverageAmount(Long averageAmount) { + this.averageAmount = averageAmount; + 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 + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand#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 + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand#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 maximum value you may charge a customer per purchase. You can use a value across + * your customer base, or segment based on customer type, country, etc. + */ + public Builder setMaximumAmount(Long maximumAmount) { + this.maximumAmount = maximumAmount; + return this; + } + + /** + * The lowest or minimum value you may charge a customer per purchase. You can use a value + * across your customer base, or segment based on customer type, country, etc. + */ + public Builder setMinimumAmount(Long minimumAmount) { + this.minimumAmount = minimumAmount; + return this; + } + + /** Interval at which the customer is making purchases. */ + public Builder setPurchaseInterval( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.OnDemand.PurchaseInterval + purchaseInterval) { + this.purchaseInterval = purchaseInterval; + return this; + } + + /** The number of {@code purchase_interval} between charges. */ + public Builder setPurchaseIntervalCount(Long purchaseIntervalCount) { + this.purchaseIntervalCount = purchaseIntervalCount; + return this; + } + } + + public enum PurchaseInterval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PurchaseInterval(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + Object name; + + /** Required. Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + Object reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + Object name, + NextBilling nextBilling, + Object reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private Object name; + + private NextBilling nextBilling; + + private Object reference; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription#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 + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Name for subscription. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } + + /** Required. Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(EmptyParam reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + Object date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, Object date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private Object date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription + .NextBilling(this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(EmptyParam date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 + * SetupIntentUpdateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } + } + + public enum PreferredLocale implements ApiRequestParams.EnumParam { + @SerializedName("cs-CZ") + CS_CZ("cs-CZ"), + + @SerializedName("da-DK") + DA_DK("da-DK"), + + @SerializedName("de-AT") + DE_AT("de-AT"), + + @SerializedName("de-CH") + DE_CH("de-CH"), + + @SerializedName("de-DE") + DE_DE("de-DE"), + + @SerializedName("el-GR") + EL_GR("el-GR"), + + @SerializedName("en-AT") + EN_AT("en-AT"), + + @SerializedName("en-AU") + EN_AU("en-AU"), + + @SerializedName("en-BE") + EN_BE("en-BE"), + + @SerializedName("en-CA") + EN_CA("en-CA"), + + @SerializedName("en-CH") + EN_CH("en-CH"), + + @SerializedName("en-CZ") + EN_CZ("en-CZ"), + + @SerializedName("en-DE") + EN_DE("en-DE"), + + @SerializedName("en-DK") + EN_DK("en-DK"), + + @SerializedName("en-ES") + EN_ES("en-ES"), + + @SerializedName("en-FI") + EN_FI("en-FI"), + + @SerializedName("en-FR") + EN_FR("en-FR"), + + @SerializedName("en-GB") + EN_GB("en-GB"), + + @SerializedName("en-GR") + EN_GR("en-GR"), + + @SerializedName("en-IE") + EN_IE("en-IE"), + + @SerializedName("en-IT") + EN_IT("en-IT"), + + @SerializedName("en-NL") + EN_NL("en-NL"), + + @SerializedName("en-NO") + EN_NO("en-NO"), + + @SerializedName("en-NZ") + EN_NZ("en-NZ"), + + @SerializedName("en-PL") + EN_PL("en-PL"), + + @SerializedName("en-PT") + EN_PT("en-PT"), + + @SerializedName("en-RO") + EN_RO("en-RO"), + + @SerializedName("en-SE") + EN_SE("en-SE"), + + @SerializedName("en-US") + EN_US("en-US"), + + @SerializedName("es-ES") + ES_ES("es-ES"), + + @SerializedName("es-US") + ES_US("es-US"), + + @SerializedName("fi-FI") + FI_FI("fi-FI"), + + @SerializedName("fr-BE") + FR_BE("fr-BE"), + + @SerializedName("fr-CA") + FR_CA("fr-CA"), + + @SerializedName("fr-CH") + FR_CH("fr-CH"), + + @SerializedName("fr-FR") + FR_FR("fr-FR"), + + @SerializedName("it-CH") + IT_CH("it-CH"), + + @SerializedName("it-IT") + IT_IT("it-IT"), + + @SerializedName("nb-NO") + NB_NO("nb-NO"), + + @SerializedName("nl-BE") + NL_BE("nl-BE"), + + @SerializedName("nl-NL") + NL_NL("nl-NL"), + + @SerializedName("pl-PL") + PL_PL("pl-PL"), + + @SerializedName("pt-PT") + PT_PT("pt-PT"), + + @SerializedName("ro-RO") + RO_RO("ro-RO"), + + @SerializedName("sv-FI") + SV_FI("sv-FI"), + + @SerializedName("sv-SE") + SV_SE("sv-SE"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PreferredLocale(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Link { diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index f5858d0830f..4bdbff7e36f 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -33,17 +33,14 @@ public class SubscriptionCreateParams extends ApiRequestParams { @SerializedName("application_fee_percent") Object applicationFeePercent; - /** - * Automatic tax settings for this subscription. We recommend you only include this parameter when - * the existing value is being changed. - */ + /** Automatic tax settings for this subscription. */ @SerializedName("automatic_tax") AutomaticTax automaticTax; /** - * For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, - * the first invoice will contain a proration for the timespan between the start date and the - * current time. Can be combined with trials and the billing cycle anchor. + * A past timestamp to backdate the subscription's start date to. If set, the first invoice will + * contain line items for the timespan between the start date and the current time. Can be + * combined with trials and the billing cycle anchor. */ @SerializedName("backdate_start_date") Long backdateStartDate; @@ -66,6 +63,10 @@ public class SubscriptionCreateParams extends ApiRequestParams { @SerializedName("billing_cycle_anchor_config") BillingCycleAnchorConfig billingCycleAnchorConfig; + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * 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. @@ -84,8 +85,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -310,6 +310,7 @@ private SubscriptionCreateParams( Long backdateStartDate, Long billingCycleAnchor, BillingCycleAnchorConfig billingCycleAnchorConfig, + BillingMode billingMode, Object billingThresholds, Long cancelAt, Boolean cancelAtPeriodEnd, @@ -344,6 +345,7 @@ private SubscriptionCreateParams( this.backdateStartDate = backdateStartDate; this.billingCycleAnchor = billingCycleAnchor; this.billingCycleAnchorConfig = billingCycleAnchorConfig; + this.billingMode = billingMode; this.billingThresholds = billingThresholds; this.cancelAt = cancelAt; this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -391,6 +393,8 @@ public static class Builder { private BillingCycleAnchorConfig billingCycleAnchorConfig; + private BillingMode billingMode; + private Object billingThresholds; private Long cancelAt; @@ -456,6 +460,7 @@ public SubscriptionCreateParams build() { this.backdateStartDate, this.billingCycleAnchor, this.billingCycleAnchorConfig, + this.billingMode, this.billingThresholds, this.cancelAt, this.cancelAtPeriodEnd, @@ -538,19 +543,16 @@ public Builder setApplicationFeePercent(EmptyParam applicationFeePercent) { return this; } - /** - * Automatic tax settings for this subscription. We recommend you only include this parameter - * when the existing value is being changed. - */ + /** Automatic tax settings for this subscription. */ public Builder setAutomaticTax(SubscriptionCreateParams.AutomaticTax automaticTax) { this.automaticTax = automaticTax; return this; } /** - * For new subscriptions, a past timestamp to backdate the subscription's start date to. If set, - * the first invoice will contain a proration for the timespan between the start date and the - * current time. Can be combined with trials and the billing cycle anchor. + * A past timestamp to backdate the subscription's start date to. If set, the first invoice will + * contain line items for the timespan between the start date and the current time. Can be + * combined with trials and the billing cycle anchor. */ public Builder setBackdateStartDate(Long backdateStartDate) { this.backdateStartDate = backdateStartDate; @@ -580,6 +582,12 @@ public Builder setBillingCycleAnchorConfig( return this; } + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode(SubscriptionCreateParams.BillingMode billingMode) { + this.billingMode = billingMode; + 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. @@ -612,8 +620,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -1921,6 +1928,90 @@ public Builder setSecond(Long second) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.BillingMode build() { + return new SubscriptionCreateParams.BillingMode(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionCreateParams.BillingMode#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.BillingMode#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. */ + public Builder setType(SubscriptionCreateParams.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class BillingThresholds { @@ -5230,6 +5321,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/SubscriptionMigrateParams.java b/src/main/java/com/stripe/param/SubscriptionMigrateParams.java new file mode 100644 index 00000000000..18da721a8c8 --- /dev/null +++ b/src/main/java/com/stripe/param/SubscriptionMigrateParams.java @@ -0,0 +1,201 @@ +// 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 SubscriptionMigrateParams extends ApiRequestParams { + /** + * Required. Controls how prorations and invoices for subscriptions are + * calculated and orchestrated. + */ + @SerializedName("billing_mode") + BillingMode billingMode; + + /** 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 SubscriptionMigrateParams( + BillingMode billingMode, List expand, Map extraParams) { + this.billingMode = billingMode; + this.expand = expand; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private BillingMode billingMode; + + private List expand; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionMigrateParams build() { + return new SubscriptionMigrateParams(this.billingMode, this.expand, this.extraParams); + } + + /** + * Required. Controls how prorations and invoices for subscriptions are + * calculated and orchestrated. + */ + public Builder setBillingMode(SubscriptionMigrateParams.BillingMode billingMode) { + this.billingMode = billingMode; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * SubscriptionMigrateParams#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 + * SubscriptionMigrateParams#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 + * SubscriptionMigrateParams#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 SubscriptionMigrateParams#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 BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionMigrateParams.BillingMode build() { + return new SubscriptionMigrateParams.BillingMode(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionMigrateParams.BillingMode#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 SubscriptionMigrateParams.BillingMode#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. */ + public Builder setType(SubscriptionMigrateParams.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } +} diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 514cfa9ab56..1584ddc135f 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -15,6 +15,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class SubscriptionScheduleCreateParams extends ApiRequestParams { + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** The identifier of the customer to create the subscription schedule for. */ @SerializedName("customer") String customer; @@ -81,6 +85,7 @@ public class SubscriptionScheduleCreateParams extends ApiRequestParams { Object startDate; private SubscriptionScheduleCreateParams( + BillingMode billingMode, String customer, DefaultSettings defaultSettings, EndBehavior endBehavior, @@ -90,6 +95,7 @@ private SubscriptionScheduleCreateParams( Object metadata, List phases, Object startDate) { + this.billingMode = billingMode; this.customer = customer; this.defaultSettings = defaultSettings; this.endBehavior = endBehavior; @@ -106,6 +112,8 @@ public static Builder builder() { } public static class Builder { + private BillingMode billingMode; + private String customer; private DefaultSettings defaultSettings; @@ -127,6 +135,7 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SubscriptionScheduleCreateParams build() { return new SubscriptionScheduleCreateParams( + this.billingMode, this.customer, this.defaultSettings, this.endBehavior, @@ -138,6 +147,12 @@ public SubscriptionScheduleCreateParams build() { this.startDate); } + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode(SubscriptionScheduleCreateParams.BillingMode billingMode) { + this.billingMode = billingMode; + return this; + } + /** The identifier of the customer to create the subscription schedule for. */ public Builder setCustomer(String customer) { this.customer = customer; @@ -323,6 +338,91 @@ public Builder setStartDate(SubscriptionScheduleCreateParams.StartDate startDate } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.BillingMode build() { + return new SubscriptionScheduleCreateParams.BillingMode(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionScheduleCreateParams.BillingMode#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.BillingMode#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. */ + public Builder setType(SubscriptionScheduleCreateParams.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class DefaultSettings { diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index f8eaeee314d..68964532e5f 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -67,8 +67,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ @SerializedName("cancel_at_period_end") Boolean cancelAtPeriodEnd; @@ -575,8 +574,7 @@ 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}. This param will be removed in a future API - * version. Please use {@code cancel_at} instead. + * current_period_end}). Defaults to {@code false}. */ public Builder setCancelAtPeriodEnd(Boolean cancelAtPeriodEnd) { this.cancelAtPeriodEnd = cancelAtPeriodEnd; @@ -5648,6 +5646,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index f834ba437f5..05cfd38dfd7 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -476,6 +476,7 @@ public static class Company { @SerializedName("phone") String phone; + /** When the business was incorporated or registered. */ @SerializedName("registration_date") Object registrationDate; @@ -828,12 +829,14 @@ public Builder setPhone(String phone) { return this; } + /** When the business was incorporated or registered. */ public Builder setRegistrationDate( TokenCreateParams.Account.Company.RegistrationDate registrationDate) { this.registrationDate = registrationDate; return this; } + /** When the business was incorporated or registered. */ public Builder setRegistrationDate(EmptyParam registrationDate) { this.registrationDate = registrationDate; return this; diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 185af077bad..4d6560bb78f 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -618,7 +618,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2025_04_30_BASIL("2025-04-30.basil"), @SerializedName("2025-05-28.basil") - VERSION_2025_05_28_BASIL("2025-05-28.basil"); + VERSION_2025_05_28_BASIL("2025-05-28.basil"), + + @SerializedName("2025-06-30.basil") + VERSION_2025_06_30_BASIL("2025-06-30.basil"); @Getter(onMethod_ = {@Override}) private final String value; @@ -1231,6 +1234,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("terminal.reader.action_succeeded") TERMINAL__READER__ACTION_SUCCEEDED("terminal.reader.action_succeeded"), + @SerializedName("terminal.reader.action_updated") + TERMINAL__READER__ACTION_UPDATED("terminal.reader.action_updated"), + @SerializedName("test_helpers.test_clock.advancing") TEST_HELPERS__TEST_CLOCK__ADVANCING("test_helpers.test_clock.advancing"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index d1f9802e35d..c931493b081 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -865,6 +865,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("terminal.reader.action_succeeded") TERMINAL__READER__ACTION_SUCCEEDED("terminal.reader.action_succeeded"), + @SerializedName("terminal.reader.action_updated") + TERMINAL__READER__ACTION_UPDATED("terminal.reader.action_updated"), + @SerializedName("test_helpers.test_clock.advancing") TEST_HELPERS__TEST_CLOCK__ADVANCING("test_helpers.test_clock.advancing"), diff --git a/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java b/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java index 33176ddb7f4..bdd48d26ed0 100644 --- a/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/SessionCreateParams.java @@ -988,10 +988,7 @@ public Builder setSubscription(String subscription) { @Getter @EqualsAndHashCode(callSuper = false) public static class SubscriptionUpdateConfirm { - /** - * The coupon or promotion code to apply to this subscription update. Currently, only up to - * one may be specified. - */ + /** The coupon or promotion code to apply to this subscription update. */ @SerializedName("discounts") List discounts; diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index fd0f8858a7f..520a23b6630 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -176,7 +176,8 @@ public class SessionCreateParams extends ApiRequestParams { /** * A list of items the customer is purchasing. Use this parameter to pass one-time or recurring Prices. + * href="https://stripe.com/docs/api/prices">Prices. The parameter is required for {@code + * payment} and {@code subscription} mode. * *

For {@code payment} mode, there is a maximum of 100 line items, however it is recommended to * consolidate line items if there are more than a few dozen. @@ -10405,9 +10406,17 @@ public static class Klarna { @SerializedName("setup_future_usage") SetupFutureUsage setupFutureUsage; - private Klarna(Map extraParams, SetupFutureUsage setupFutureUsage) { + /** Subscription details if the Checkout Session sets up a future subscription. */ + @SerializedName("subscriptions") + Object subscriptions; + + private Klarna( + Map extraParams, + SetupFutureUsage setupFutureUsage, + Object subscriptions) { this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; + this.subscriptions = subscriptions; } public static Builder builder() { @@ -10419,10 +10428,12 @@ public static class Builder { private SetupFutureUsage setupFutureUsage; + private Object subscriptions; + /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.Klarna build() { return new SessionCreateParams.PaymentMethodOptions.Klarna( - this.extraParams, this.setupFutureUsage); + this.extraParams, this.setupFutureUsage, this.subscriptions); } /** @@ -10478,6 +10489,326 @@ public Builder setSetupFutureUsage( this.setupFutureUsage = setupFutureUsage; return this; } + + /** + * Add an element to `subscriptions` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * SessionCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addSubscription( + SessionCreateParams.PaymentMethodOptions.Klarna.Subscription element) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) this.subscriptions) + .add(element); + return this; + } + + /** + * Add all elements to `subscriptions` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. + * See {@link SessionCreateParams.PaymentMethodOptions.Klarna#subscriptions} for the field + * documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllSubscription( + List elements) { + if (this.subscriptions == null || this.subscriptions instanceof EmptyParam) { + this.subscriptions = + new ArrayList(); + } + ((List) this.subscriptions) + .addAll(elements); + return this; + } + + /** Subscription details if the Checkout Session sets up a future subscription. */ + public Builder setSubscriptions(EmptyParam subscriptions) { + this.subscriptions = subscriptions; + return this; + } + + /** Subscription details if the Checkout Session sets up a future subscription. */ + public Builder setSubscriptions( + List subscriptions) { + this.subscriptions = subscriptions; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Subscription { + /** + * 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. Unit of time between subscription charges. */ + @SerializedName("interval") + Interval interval; + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + @SerializedName("interval_count") + Long intervalCount; + + /** Name for subscription. */ + @SerializedName("name") + String name; + + /** Required. Describes the upcoming charge for this subscription. */ + @SerializedName("next_billing") + NextBilling nextBilling; + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + @SerializedName("reference") + String reference; + + private Subscription( + Map extraParams, + Interval interval, + Long intervalCount, + String name, + NextBilling nextBilling, + String reference) { + this.extraParams = extraParams; + this.interval = interval; + this.intervalCount = intervalCount; + this.name = name; + this.nextBilling = nextBilling; + this.reference = reference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Interval interval; + + private Long intervalCount; + + private String name; + + private NextBilling nextBilling; + + private String reference; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Klarna.Subscription build() { + return new SessionCreateParams.PaymentMethodOptions.Klarna.Subscription( + this.extraParams, + this.interval, + this.intervalCount, + this.name, + this.nextBilling, + this.reference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Klarna.Subscription#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SessionCreateParams.PaymentMethodOptions.Klarna.Subscription#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. Unit of time between subscription charges. */ + public Builder setInterval( + SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.Interval interval) { + this.interval = interval; + return this; + } + + /** + * The number of intervals (specified in the {@code interval} attribute) between + * subscription charges. For example, {@code interval=month} and {@code interval_count=3} + * charges every 3 months. + */ + public Builder setIntervalCount(Long intervalCount) { + this.intervalCount = intervalCount; + return this; + } + + /** Name for subscription. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** Required. Describes the upcoming charge for this subscription. */ + public Builder setNextBilling( + SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + nextBilling) { + this.nextBilling = nextBilling; + return this; + } + + /** + * Required. A non-customer-facing reference to correlate subscription + * charges in the Klarna app. Use a value that persists across subscription charges. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NextBilling { + /** Required. The amount of the next charge for the subscription. */ + @SerializedName("amount") + Long amount; + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + @SerializedName("date") + String date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private NextBilling(Long amount, String date, Map extraParams) { + this.amount = amount; + this.date = date; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amount; + + private String date; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling + build() { + return new SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling( + this.amount, this.date, this.extraParams); + } + + /** Required. The amount of the next charge for the subscription. */ + public Builder setAmount(Long amount) { + this.amount = amount; + return this; + } + + /** + * Required. The date of the next charge for the subscription in + * YYYY-MM-DD format. + */ + public Builder setDate(String date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SessionCreateParams.PaymentMethodOptions.Klarna.Subscription.NextBilling#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 Interval implements ApiRequestParams.EnumParam { + @SerializedName("day") + DAY("day"), + + @SerializedName("month") + MONTH("month"), + + @SerializedName("week") + WEEK("week"), + + @SerializedName("year") + YEAR("year"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Interval(String value) { + this.value = value; + } + } } public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @@ -15830,6 +16161,10 @@ public static class SubscriptionData { @SerializedName("billing_cycle_anchor") Long billingCycleAnchor; + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + @SerializedName("billing_mode") + BillingMode billingMode; + /** * The tax rates that will apply to any subscription item that does not have {@code tax_rates} * set. Invoices created will have their {@code default_tax_rates} populated from the @@ -15907,6 +16242,7 @@ public static class SubscriptionData { private SubscriptionData( BigDecimal applicationFeePercent, Long billingCycleAnchor, + BillingMode billingMode, List defaultTaxRates, String description, Map extraParams, @@ -15920,6 +16256,7 @@ private SubscriptionData( TrialSettings trialSettings) { this.applicationFeePercent = applicationFeePercent; this.billingCycleAnchor = billingCycleAnchor; + this.billingMode = billingMode; this.defaultTaxRates = defaultTaxRates; this.description = description; this.extraParams = extraParams; @@ -15942,6 +16279,8 @@ public static class Builder { private Long billingCycleAnchor; + private BillingMode billingMode; + private List defaultTaxRates; private String description; @@ -15969,6 +16308,7 @@ public SessionCreateParams.SubscriptionData build() { return new SessionCreateParams.SubscriptionData( this.applicationFeePercent, this.billingCycleAnchor, + this.billingMode, this.defaultTaxRates, this.description, this.extraParams, @@ -16001,6 +16341,12 @@ public Builder setBillingCycleAnchor(Long billingCycleAnchor) { return this; } + /** Controls how prorations and invoices for subscriptions are calculated and orchestrated. */ + public Builder setBillingMode(SessionCreateParams.SubscriptionData.BillingMode billingMode) { + this.billingMode = billingMode; + return this; + } + /** * Add an element to `defaultTaxRates` list. A list is initialized for the first `add/addAll` * call, and subsequent calls adds additional elements to the original list. See {@link @@ -16148,6 +16494,92 @@ public Builder setTrialSettings( } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BillingMode { + /** + * 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. */ + @SerializedName("type") + Type type; + + private BillingMode(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionCreateParams.SubscriptionData.BillingMode build() { + return new SessionCreateParams.SubscriptionData.BillingMode(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.SubscriptionData.BillingMode#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionCreateParams.SubscriptionData.BillingMode#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. */ + public Builder setType(SessionCreateParams.SubscriptionData.BillingMode.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("classic") + CLASSIC("classic"), + + @SerializedName("flexible") + FLEXIBLE("flexible"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class InvoiceSettings { @@ -17127,6 +17559,9 @@ public enum PaymentMethodType implements ApiRequestParams.EnumParam { @SerializedName("cashapp") CASHAPP("cashapp"), + @SerializedName("crypto") + CRYPTO("crypto"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java index 563f74e537e..bcbedb1d0a5 100644 --- a/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java +++ b/src/main/java/com/stripe/param/identity/VerificationSessionCreateParams.java @@ -55,6 +55,10 @@ public class VerificationSessionCreateParams extends ApiRequestParams { @SerializedName("related_customer") String relatedCustomer; + /** Tokens referencing a Person resource and it's associated account. */ + @SerializedName("related_person") + RelatedPerson relatedPerson; + /** The URL that the user will be redirected to upon completing the verification flow. */ @SerializedName("return_url") String returnUrl; @@ -82,6 +86,7 @@ private VerificationSessionCreateParams( Options options, ProvidedDetails providedDetails, String relatedCustomer, + RelatedPerson relatedPerson, String returnUrl, Type type, String verificationFlow) { @@ -92,6 +97,7 @@ private VerificationSessionCreateParams( this.options = options; this.providedDetails = providedDetails; this.relatedCustomer = relatedCustomer; + this.relatedPerson = relatedPerson; this.returnUrl = returnUrl; this.type = type; this.verificationFlow = verificationFlow; @@ -116,6 +122,8 @@ public static class Builder { private String relatedCustomer; + private RelatedPerson relatedPerson; + private String returnUrl; private Type type; @@ -132,6 +140,7 @@ public VerificationSessionCreateParams build() { this.options, this.providedDetails, this.relatedCustomer, + this.relatedPerson, this.returnUrl, this.type, this.verificationFlow); @@ -243,6 +252,12 @@ public Builder setRelatedCustomer(String relatedCustomer) { return this; } + /** Tokens referencing a Person resource and it's associated account. */ + public Builder setRelatedPerson(VerificationSessionCreateParams.RelatedPerson relatedPerson) { + this.relatedPerson = relatedPerson; + return this; + } + /** The URL that the user will be redirected to upon completing the verification flow. */ public Builder setReturnUrl(String returnUrl) { this.returnUrl = returnUrl; @@ -630,6 +645,102 @@ public Builder setPhone(String phone) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RelatedPerson { + /** + * Required. A token representing a connected account. If provided, the person + * parameter is also required and must be associated with the account. + */ + @SerializedName("account") + String account; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. A token referencing a Person resource that this verification is + * being used to verify. + */ + @SerializedName("person") + String person; + + private RelatedPerson(String account, Map extraParams, String person) { + this.account = account; + this.extraParams = extraParams; + this.person = person; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String account; + + private Map extraParams; + + private String person; + + /** Finalize and obtain parameter instance from this builder. */ + public VerificationSessionCreateParams.RelatedPerson build() { + return new VerificationSessionCreateParams.RelatedPerson( + this.account, this.extraParams, this.person); + } + + /** + * Required. A token representing a connected account. If provided, the + * person parameter is also required and must be associated with the account. + */ + public Builder setAccount(String account) { + this.account = account; + 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 + * VerificationSessionCreateParams.RelatedPerson#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 VerificationSessionCreateParams.RelatedPerson#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. A token referencing a Person resource that this verification is + * being used to verify. + */ + public Builder setPerson(String person) { + this.person = person; + return this; + } + } + } + public enum Type implements ApiRequestParams.EnumParam { @SerializedName("document") DOCUMENT("document"), diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index b699668442c..a50243c371e 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -570,6 +570,10 @@ public static class CountryOptions { @SerializedName("tz") Tz tz; + /** Options for the registration in UA. */ + @SerializedName("ua") + Ua ua; + /** Options for the registration in UG. */ @SerializedName("ug") Ug ug; @@ -694,6 +698,7 @@ private CountryOptions( Tj tj, Tr tr, Tz tz, + Ua ua, Ug ug, Us us, Uy uy, @@ -793,6 +798,7 @@ private CountryOptions( this.tj = tj; this.tr = tr; this.tz = tz; + this.ua = ua; this.ug = ug; this.us = us; this.uy = uy; @@ -990,6 +996,8 @@ public static class Builder { private Tz tz; + private Ua ua; + private Ug ug; private Us us; @@ -1100,6 +1108,7 @@ public RegistrationCreateParams.CountryOptions build() { this.tj, this.tr, this.tz, + this.ua, this.ug, this.us, this.uy, @@ -1677,6 +1686,12 @@ public Builder setTz(RegistrationCreateParams.CountryOptions.Tz tz) { return this; } + /** Options for the registration in UA. */ + public Builder setUa(RegistrationCreateParams.CountryOptions.Ua ua) { + this.ua = ua; + return this; + } + /** Options for the registration in UG. */ public Builder setUg(RegistrationCreateParams.CountryOptions.Ug ug) { this.ug = ug; @@ -12457,6 +12472,89 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Ua { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Type of registration to be created in {@code country}. */ + @SerializedName("type") + Type type; + + private Ua(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Ua build() { + return new RegistrationCreateParams.CountryOptions.Ua(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Ua#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Ua#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Type of registration to be created in {@code country}. */ + public Builder setType(RegistrationCreateParams.CountryOptions.Ua.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("simplified") + SIMPLIFIED("simplified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Ug { diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java new file mode 100644 index 00000000000..251ac892a71 --- /dev/null +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java @@ -0,0 +1,357 @@ +// 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 ReaderCollectPaymentMethodParams extends ApiRequestParams { + /** Configuration overrides. */ + @SerializedName("collect_config") + CollectConfig collectConfig; + + /** 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. PaymentIntent ID. */ + @SerializedName("payment_intent") + String paymentIntent; + + private ReaderCollectPaymentMethodParams( + CollectConfig collectConfig, + List expand, + Map extraParams, + String paymentIntent) { + this.collectConfig = collectConfig; + this.expand = expand; + this.extraParams = extraParams; + this.paymentIntent = paymentIntent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private CollectConfig collectConfig; + + private List expand; + + private Map extraParams; + + private String paymentIntent; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectPaymentMethodParams build() { + return new ReaderCollectPaymentMethodParams( + this.collectConfig, this.expand, this.extraParams, this.paymentIntent); + } + + /** Configuration overrides. */ + public Builder setCollectConfig(ReaderCollectPaymentMethodParams.CollectConfig collectConfig) { + this.collectConfig = collectConfig; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReaderCollectPaymentMethodParams#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 + * ReaderCollectPaymentMethodParams#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 + * ReaderCollectPaymentMethodParams#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 ReaderCollectPaymentMethodParams#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. PaymentIntent ID. */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class CollectConfig { + /** + * This field indicates whether this payment method can be shown again to its customer in a + * checkout flow. Stripe products such as Checkout and Elements use this field to determine + * whether a payment method can be shown as a saved payment method in a checkout flow. + */ + @SerializedName("allow_redisplay") + AllowRedisplay allowRedisplay; + + /** Enables cancel button on transaction screens. */ + @SerializedName("enable_customer_cancellation") + Boolean enableCustomerCancellation; + + /** + * 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; + + /** Override showing a tipping selection screen on this transaction. */ + @SerializedName("skip_tipping") + Boolean skipTipping; + + /** Tipping configuration for this transaction. */ + @SerializedName("tipping") + Tipping tipping; + + private CollectConfig( + AllowRedisplay allowRedisplay, + Boolean enableCustomerCancellation, + Map extraParams, + Boolean skipTipping, + Tipping tipping) { + this.allowRedisplay = allowRedisplay; + this.enableCustomerCancellation = enableCustomerCancellation; + this.extraParams = extraParams; + this.skipTipping = skipTipping; + this.tipping = tipping; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AllowRedisplay allowRedisplay; + + private Boolean enableCustomerCancellation; + + private Map extraParams; + + private Boolean skipTipping; + + private Tipping tipping; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectPaymentMethodParams.CollectConfig build() { + return new ReaderCollectPaymentMethodParams.CollectConfig( + this.allowRedisplay, + this.enableCustomerCancellation, + this.extraParams, + this.skipTipping, + this.tipping); + } + + /** + * This field indicates whether this payment method can be shown again to its customer in a + * checkout flow. Stripe products such as Checkout and Elements use this field to determine + * whether a payment method can be shown as a saved payment method in a checkout flow. + */ + public Builder setAllowRedisplay( + ReaderCollectPaymentMethodParams.CollectConfig.AllowRedisplay allowRedisplay) { + this.allowRedisplay = allowRedisplay; + return this; + } + + /** Enables cancel button on transaction screens. */ + public Builder setEnableCustomerCancellation(Boolean enableCustomerCancellation) { + this.enableCustomerCancellation = enableCustomerCancellation; + 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 + * ReaderCollectPaymentMethodParams.CollectConfig#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 ReaderCollectPaymentMethodParams.CollectConfig#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Override showing a tipping selection screen on this transaction. */ + public Builder setSkipTipping(Boolean skipTipping) { + this.skipTipping = skipTipping; + return this; + } + + /** Tipping configuration for this transaction. */ + public Builder setTipping(ReaderCollectPaymentMethodParams.CollectConfig.Tipping tipping) { + this.tipping = tipping; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tipping { + /** + * Amount used to calculate tip suggestions on tipping selection screen for this transaction. + * Must be a positive integer in the smallest currency unit (e.g., 100 cents to represent + * $1.00 or 100 to represent ¥100, a zero-decimal currency). + */ + @SerializedName("amount_eligible") + Long amountEligible; + + /** + * 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 Tipping(Long amountEligible, Map extraParams) { + this.amountEligible = amountEligible; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long amountEligible; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderCollectPaymentMethodParams.CollectConfig.Tipping build() { + return new ReaderCollectPaymentMethodParams.CollectConfig.Tipping( + this.amountEligible, this.extraParams); + } + + /** + * Amount used to calculate tip suggestions on tipping selection screen for this + * transaction. Must be a positive integer in the smallest currency unit (e.g., 100 cents to + * represent $1.00 or 100 to represent ¥100, a zero-decimal currency). + */ + public Builder setAmountEligible(Long amountEligible) { + this.amountEligible = amountEligible; + 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 ReaderCollectPaymentMethodParams.CollectConfig.Tipping#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 ReaderCollectPaymentMethodParams.CollectConfig.Tipping#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 AllowRedisplay implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AllowRedisplay(String value) { + this.value = value; + } + } + } +} diff --git a/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java new file mode 100644 index 00000000000..766dba8d1cf --- /dev/null +++ b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java @@ -0,0 +1,209 @@ +// 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 ReaderConfirmPaymentIntentParams extends ApiRequestParams { + /** Configuration overrides. */ + @SerializedName("confirm_config") + ConfirmConfig confirmConfig; + + /** 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. PaymentIntent ID. */ + @SerializedName("payment_intent") + String paymentIntent; + + private ReaderConfirmPaymentIntentParams( + ConfirmConfig confirmConfig, + List expand, + Map extraParams, + String paymentIntent) { + this.confirmConfig = confirmConfig; + this.expand = expand; + this.extraParams = extraParams; + this.paymentIntent = paymentIntent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private ConfirmConfig confirmConfig; + + private List expand; + + private Map extraParams; + + private String paymentIntent; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderConfirmPaymentIntentParams build() { + return new ReaderConfirmPaymentIntentParams( + this.confirmConfig, this.expand, this.extraParams, this.paymentIntent); + } + + /** Configuration overrides. */ + public Builder setConfirmConfig(ReaderConfirmPaymentIntentParams.ConfirmConfig confirmConfig) { + this.confirmConfig = confirmConfig; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * ReaderConfirmPaymentIntentParams#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 + * ReaderConfirmPaymentIntentParams#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 + * ReaderConfirmPaymentIntentParams#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 ReaderConfirmPaymentIntentParams#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. PaymentIntent ID. */ + public Builder setPaymentIntent(String paymentIntent) { + this.paymentIntent = paymentIntent; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ConfirmConfig { + /** + * 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 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; + + private ConfirmConfig(Map extraParams, String returnUrl) { + this.extraParams = extraParams; + this.returnUrl = returnUrl; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String returnUrl; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderConfirmPaymentIntentParams.ConfirmConfig build() { + return new ReaderConfirmPaymentIntentParams.ConfirmConfig(this.extraParams, this.returnUrl); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * ReaderConfirmPaymentIntentParams.ConfirmConfig#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 ReaderConfirmPaymentIntentParams.ConfirmConfig#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 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; + } + } + } +} diff --git a/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java b/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java index 5425d6a7899..b729ed58d78 100644 --- a/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java +++ b/src/main/java/com/stripe/param/treasury/FinancialAccountListParams.java @@ -42,19 +42,25 @@ public class FinancialAccountListParams extends ApiRequestParams { @SerializedName("starting_after") String startingAfter; + /** Only return FinancialAccounts that have the given status: {@code open} or {@code closed}. */ + @SerializedName("status") + Status status; + private FinancialAccountListParams( Object created, String endingBefore, List expand, Map extraParams, Long limit, - String startingAfter) { + String startingAfter, + Status status) { this.created = created; this.endingBefore = endingBefore; this.expand = expand; this.extraParams = extraParams; this.limit = limit; this.startingAfter = startingAfter; + this.status = status; } public static Builder builder() { @@ -74,6 +80,8 @@ public static class Builder { private String startingAfter; + private Status status; + /** Finalize and obtain parameter instance from this builder. */ public FinancialAccountListParams build() { return new FinancialAccountListParams( @@ -82,7 +90,8 @@ public FinancialAccountListParams build() { this.expand, this.extraParams, this.limit, - this.startingAfter); + this.startingAfter, + this.status); } /** Only return FinancialAccounts that were created during the given date interval. */ @@ -166,6 +175,12 @@ public Builder setStartingAfter(String startingAfter) { this.startingAfter = startingAfter; return this; } + + /** Only return FinancialAccounts that have the given status: {@code open} or {@code closed}. */ + public Builder setStatus(FinancialAccountListParams.Status status) { + this.status = status; + return this; + } } @Getter @@ -276,4 +291,19 @@ public Builder setLte(Long lte) { } } } + + public enum Status implements ApiRequestParams.EnumParam { + @SerializedName("closed") + CLOSED("closed"), + + @SerializedName("open") + OPEN("open"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Status(String value) { + this.value = value; + } + } } diff --git a/src/main/java/com/stripe/service/SubscriptionService.java b/src/main/java/com/stripe/service/SubscriptionService.java index af605ab14e7..445d2509e4d 100644 --- a/src/main/java/com/stripe/service/SubscriptionService.java +++ b/src/main/java/com/stripe/service/SubscriptionService.java @@ -17,6 +17,7 @@ import com.stripe.param.SubscriptionCancelParams; import com.stripe.param.SubscriptionCreateParams; import com.stripe.param.SubscriptionListParams; +import com.stripe.param.SubscriptionMigrateParams; import com.stripe.param.SubscriptionResumeParams; import com.stripe.param.SubscriptionRetrieveParams; import com.stripe.param.SubscriptionSearchParams; @@ -497,6 +498,26 @@ public StripeSearchResult search( options); return this.request(request, new TypeToken>() {}.getType()); } + /** Upgrade the billing_mode of an existing subscription. */ + public Subscription migrate(String subscription, SubscriptionMigrateParams params) + throws StripeException { + return migrate(subscription, params, (RequestOptions) null); + } + /** Upgrade the billing_mode of an existing subscription. */ + public Subscription migrate( + String subscription, SubscriptionMigrateParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/subscriptions/%s/migrate", ApiResource.urlEncodeId(subscription)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Subscription.class); + } /** * Initiates resumption of a paused subscription, optionally resetting the billing cycle anchor * and creating prorations. If a resumption invoice is generated, it must be paid or marked diff --git a/src/main/java/com/stripe/service/terminal/ReaderService.java b/src/main/java/com/stripe/service/terminal/ReaderService.java index d76702f578c..6bd247bddbc 100644 --- a/src/main/java/com/stripe/service/terminal/ReaderService.java +++ b/src/main/java/com/stripe/service/terminal/ReaderService.java @@ -14,6 +14,8 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.terminal.ReaderCancelActionParams; import com.stripe.param.terminal.ReaderCollectInputsParams; +import com.stripe.param.terminal.ReaderCollectPaymentMethodParams; +import com.stripe.param.terminal.ReaderConfirmPaymentIntentParams; import com.stripe.param.terminal.ReaderCreateParams; import com.stripe.param.terminal.ReaderListParams; import com.stripe.param.terminal.ReaderProcessPaymentIntentParams; @@ -189,6 +191,54 @@ public Reader collectInputs( options); return this.request(request, Reader.class); } + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodParams params) + throws StripeException { + return collectPaymentMethod(reader, params, (RequestOptions) null); + } + /** + * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before + * manual confirmation. + */ + public Reader collectPaymentMethod( + String reader, ReaderCollectPaymentMethodParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/collect_payment_method", ApiResource.urlEncodeId(reader)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, Reader.class); + } + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent(String reader, ReaderConfirmPaymentIntentParams params) + throws StripeException { + return confirmPaymentIntent(reader, params, (RequestOptions) null); + } + /** Finalizes a payment on a Reader. */ + public Reader confirmPaymentIntent( + String reader, ReaderConfirmPaymentIntentParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/terminal/readers/%s/confirm_payment_intent", 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/v2/core/EventDestinationService.java b/src/main/java/com/stripe/service/v2/core/EventDestinationService.java index fd421f81a09..8553d0ac58e 100644 --- a/src/main/java/com/stripe/service/v2/core/EventDestinationService.java +++ b/src/main/java/com/stripe/service/v2/core/EventDestinationService.java @@ -23,58 +23,6 @@ public EventDestinationService(StripeResponseGetter responseGetter) { super(responseGetter); } - /** Create a new event destination. */ - public EventDestination create(EventDestinationCreateParams params) throws StripeException { - return create(params, (RequestOptions) null); - } - /** Create a new event destination. */ - public EventDestination create(EventDestinationCreateParams params, RequestOptions options) - throws StripeException { - String path = "/v2/core/event_destinations"; - ApiRequest request = - new ApiRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - path, - ApiRequestParams.paramsToMap(params), - options); - return this.request(request, EventDestination.class); - } - /** Delete an event destination. */ - public EventDestination delete(String id) throws StripeException { - return delete(id, (RequestOptions) null); - } - /** Delete an event destination. */ - public EventDestination delete(String id, RequestOptions options) throws StripeException { - String path = String.format("/v2/core/event_destinations/%s", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options); - return this.request(request, EventDestination.class); - } - /** Disable an event destination. */ - public EventDestination disable(String id) throws StripeException { - return disable(id, (RequestOptions) null); - } - /** Disable an event destination. */ - public EventDestination disable(String id, RequestOptions options) throws StripeException { - String path = - String.format("/v2/core/event_destinations/%s/disable", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); - return this.request(request, EventDestination.class); - } - /** Enable an event destination. */ - public EventDestination enable(String id) throws StripeException { - return enable(id, (RequestOptions) null); - } - /** Enable an event destination. */ - public EventDestination enable(String id, RequestOptions options) throws StripeException { - String path = - String.format("/v2/core/event_destinations/%s/enable", ApiResource.urlEncodeId(id)); - ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); - return this.request(request, EventDestination.class); - } /** Lists all event destinations. */ public StripeCollection list(EventDestinationListParams params) throws StripeException { @@ -101,16 +49,33 @@ public StripeCollection list( options); return this.request(request, new TypeToken>() {}.getType()); } - /** Send a {@code ping} event to an event destination. */ - public Event ping(String id) throws StripeException { - return ping(id, (RequestOptions) null); + /** Create a new event destination. */ + public EventDestination create(EventDestinationCreateParams params) throws StripeException { + return create(params, (RequestOptions) null); } - /** Send a {@code ping} event to an event destination. */ - public Event ping(String id, RequestOptions options) throws StripeException { - String path = String.format("/v2/core/event_destinations/%s/ping", ApiResource.urlEncodeId(id)); + /** Create a new event destination. */ + public EventDestination create(EventDestinationCreateParams params, RequestOptions options) + throws StripeException { + String path = "/v2/core/event_destinations"; ApiRequest request = - new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); - return this.request(request, Event.class); + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, EventDestination.class); + } + /** Delete an event destination. */ + public EventDestination delete(String id) throws StripeException { + return delete(id, (RequestOptions) null); + } + /** Delete an event destination. */ + public EventDestination delete(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/event_destinations/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.DELETE, path, null, options); + return this.request(request, EventDestination.class); } /** Retrieves the details of an event destination. */ public EventDestination retrieve(String id, EventDestinationRetrieveParams params) @@ -166,4 +131,39 @@ public EventDestination update( options); return this.request(request, EventDestination.class); } + /** Disable an event destination. */ + public EventDestination disable(String id) throws StripeException { + return disable(id, (RequestOptions) null); + } + /** Disable an event destination. */ + public EventDestination disable(String id, RequestOptions options) throws StripeException { + String path = + String.format("/v2/core/event_destinations/%s/disable", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, EventDestination.class); + } + /** Enable an event destination. */ + public EventDestination enable(String id) throws StripeException { + return enable(id, (RequestOptions) null); + } + /** Enable an event destination. */ + public EventDestination enable(String id, RequestOptions options) throws StripeException { + String path = + String.format("/v2/core/event_destinations/%s/enable", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, EventDestination.class); + } + /** Send a {@code ping} event to an event destination. */ + public Event ping(String id) throws StripeException { + return ping(id, (RequestOptions) null); + } + /** Send a {@code ping} event to an event destination. */ + public Event ping(String id, RequestOptions options) throws StripeException { + String path = String.format("/v2/core/event_destinations/%s/ping", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, Event.class); + } } diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index cf53c746f16..96021db8d39 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -15600,29 +15600,6 @@ public void testWebhookEndpointsPost2Services() throws StripeException { null); } - @Test - public void testV2BillingMeterEventSessionPostServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/billing/meter_event_session", - null, - null, - com.stripe.model.v2.billing.MeterEventSession.class, - "{\"authentication_token\":\"authentication_token\",\"created\":\"1970-01-12T21:42:34.472Z\",\"expires_at\":\"1970-01-10T15:36:51.170Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.meter_event_session\",\"livemode\":true}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.billing.MeterEventSession meterEventSession = - client.v2().billing().meterEventSession().create(); - assertNotNull(meterEventSession); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/billing/meter_event_session", - null, - null); - } - @Test public void testV2BillingMeterEventAdjustmentPostServices() throws StripeException { stubRequest( @@ -15656,6 +15633,29 @@ public void testV2BillingMeterEventAdjustmentPostServices() throws StripeExcepti null); } + @Test + public void testV2BillingMeterEventSessionPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/meter_event_session", + null, + null, + com.stripe.model.v2.billing.MeterEventSession.class, + "{\"authentication_token\":\"authentication_token\",\"created\":\"1970-01-12T21:42:34.472Z\",\"expires_at\":\"1970-01-10T15:36:51.170Z\",\"id\":\"obj_123\",\"object\":\"v2.billing.meter_event_session\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.billing.MeterEventSession meterEventSession = + client.v2().billing().meterEventSession().create(); + assertNotNull(meterEventSession); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/meter_event_session", + null, + null); + } + @Test public void testV2BillingMeterEventStreamPostServices() throws StripeException { stubRequest( @@ -15717,6 +15717,34 @@ public void testV2BillingMeterEventPostServices() throws StripeException { null); } + @Test + public void testV2CoreEventDestinationGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/event_destinations", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.EventDestination>>() {}.getType(), + "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.EventDestinationListParams params = + com.stripe.param.v2.core.EventDestinationListParams.builder().build(); + + com.stripe.model.v2.StripeCollection stripeCollection = + client.v2().core().eventDestinations().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/event_destinations", + params.toMap(), + null); + } + @Test public void testV2CoreEventDestinationPostServices() throws StripeException { stubRequest( @@ -15773,124 +15801,100 @@ public void testV2CoreEventDestinationDeleteServices() throws StripeException { } @Test - public void testV2CoreEventDestinationPost2Services() throws StripeException { + public void testV2CoreEventDestinationGet2Services() throws StripeException { stubRequest( BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/disable", + ApiResource.RequestMethod.GET, + "/v2/core/event_destinations/id_123", null, null, com.stripe.model.v2.EventDestination.class, "{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.core.EventDestinationRetrieveParams params = + com.stripe.param.v2.core.EventDestinationRetrieveParams.builder().build(); + com.stripe.model.v2.EventDestination eventDestination = - client.v2().core().eventDestinations().disable("id_123"); + client.v2().core().eventDestinations().retrieve("id_123", params); assertNotNull(eventDestination); verifyRequest( BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/disable", - null, + ApiResource.RequestMethod.GET, + "/v2/core/event_destinations/id_123", + params.toMap(), null); } @Test - public void testV2CoreEventDestinationPost3Services() throws StripeException { + public void testV2CoreEventDestinationPost2Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/enable", + "/v2/core/event_destinations/id_123", null, null, com.stripe.model.v2.EventDestination.class, "{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}"); StripeClient client = new StripeClient(networkSpy); + com.stripe.param.v2.core.EventDestinationUpdateParams params = + com.stripe.param.v2.core.EventDestinationUpdateParams.builder().build(); + com.stripe.model.v2.EventDestination eventDestination = - client.v2().core().eventDestinations().enable("id_123"); + client.v2().core().eventDestinations().update("id_123", params); assertNotNull(eventDestination); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/enable", - null, - null); - } - - @Test - public void testV2CoreEventDestinationGetServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/event_destinations", - null, - null, - new TypeToken< - com.stripe.model.v2.StripeCollection< - com.stripe.model.v2.EventDestination>>() {}.getType(), - "{\"data\":[{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}],\"next_page_url\":null,\"previous_page_url\":null}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.core.EventDestinationListParams params = - com.stripe.param.v2.core.EventDestinationListParams.builder().build(); - - com.stripe.model.v2.StripeCollection stripeCollection = - client.v2().core().eventDestinations().list(params); - assertNotNull(stripeCollection); - verifyRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/event_destinations", + "/v2/core/event_destinations/id_123", params.toMap(), null); } @Test - public void testV2CoreEventDestinationPost4Services() throws StripeException { + public void testV2CoreEventDestinationPost3Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/ping", + "/v2/core/event_destinations/id_123/disable", null, null, - com.stripe.model.v2.Event.class, - "{\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"reason\":null,\"type\":\"type\",\"livemode\":true}"); + com.stripe.model.v2.EventDestination.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.model.v2.Event event = client.v2().core().eventDestinations().ping("id_123"); - assertNotNull(event); + com.stripe.model.v2.EventDestination eventDestination = + client.v2().core().eventDestinations().disable("id_123"); + assertNotNull(eventDestination); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123/ping", + "/v2/core/event_destinations/id_123/disable", null, null); } @Test - public void testV2CoreEventDestinationGet2Services() throws StripeException { + public void testV2CoreEventDestinationPost4Services() throws StripeException { stubRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/event_destinations/id_123", + ApiResource.RequestMethod.POST, + "/v2/core/event_destinations/id_123/enable", null, null, com.stripe.model.v2.EventDestination.class, "{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.param.v2.core.EventDestinationRetrieveParams params = - com.stripe.param.v2.core.EventDestinationRetrieveParams.builder().build(); - com.stripe.model.v2.EventDestination eventDestination = - client.v2().core().eventDestinations().retrieve("id_123", params); + client.v2().core().eventDestinations().enable("id_123"); assertNotNull(eventDestination); verifyRequest( BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/event_destinations/id_123", - params.toMap(), + ApiResource.RequestMethod.POST, + "/v2/core/event_destinations/id_123/enable", + null, null); } @@ -15899,24 +15903,20 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123", + "/v2/core/event_destinations/id_123/ping", null, null, - com.stripe.model.v2.EventDestination.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"description\":\"description\",\"enabled_events\":[\"enabled_events\"],\"event_payload\":\"thin\",\"events_from\":null,\"id\":\"obj_123\",\"metadata\":null,\"name\":\"name\",\"object\":\"v2.core.event_destination\",\"snapshot_api_version\":null,\"status\":\"disabled\",\"status_details\":null,\"type\":\"amazon_eventbridge\",\"updated\":\"1970-01-03T17:07:10.277Z\",\"livemode\":true,\"amazon_eventbridge\":null,\"webhook_endpoint\":null}"); + com.stripe.model.v2.Event.class, + "{\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"reason\":null,\"type\":\"type\",\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.param.v2.core.EventDestinationUpdateParams params = - com.stripe.param.v2.core.EventDestinationUpdateParams.builder().build(); - - com.stripe.model.v2.EventDestination eventDestination = - client.v2().core().eventDestinations().update("id_123", params); - assertNotNull(eventDestination); + com.stripe.model.v2.Event event = client.v2().core().eventDestinations().ping("id_123"); + assertNotNull(event); verifyRequest( BaseAddress.API, ApiResource.RequestMethod.POST, - "/v2/core/event_destinations/id_123", - params.toMap(), + "/v2/core/event_destinations/id_123/ping", + null, null); }