diff --git a/API_VERSION b/API_VERSION index 40f35337b3c..0336d6a3a58 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -2025-07-30.basil \ No newline at end of file +2025-08-27.basil \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 7b0334ddc01..6598803dc33 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1868 \ No newline at end of file +v1932 \ 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 eba9ee380c7..b78ef170199 100644 --- a/src/main/java/com/stripe/ApiVersion.java +++ b/src/main/java/com/stripe/ApiVersion.java @@ -2,6 +2,6 @@ package com.stripe; final class ApiVersion { - public static final String CURRENT = "2025-07-30.basil"; + public static final String CURRENT = "2025-08-27.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 44850090bcb..b039480686c 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1714,7 +1714,8 @@ public static class Document extends StripeObject { /** * The back of a document returned by a file upload with a {@code purpose} - * value of {@code additional_verification}. + * value of {@code additional_verification}. Note that {@code additional_verification} files + * are not downloadable. */ @SerializedName("back") @Getter(lombok.AccessLevel.NONE) @@ -1740,7 +1741,8 @@ public static class Document extends StripeObject { /** * The front of a document returned by a file upload with a {@code purpose} - * value of {@code additional_verification}. + * value of {@code additional_verification}. Note that {@code additional_verification} files + * are not downloadable. */ @SerializedName("front") @Getter(lombok.AccessLevel.NONE) diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index d2ea7cc66f8..9cd529209eb 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -132,6 +132,9 @@ public static class Components extends StripeObject { @SerializedName("account_onboarding") AccountOnboarding accountOnboarding; + @SerializedName("balance_report") + BalanceReport balanceReport; + @SerializedName("balances") Balances balances; @@ -168,6 +171,12 @@ public static class Components extends StripeObject { @SerializedName("payments") Payments payments; + @SerializedName("payout_details") + PayoutDetails payoutDetails; + + @SerializedName("payout_reconciliation_report") + PayoutReconciliationReport payoutReconciliationReport; + @SerializedName("payouts") Payouts payouts; @@ -268,6 +277,31 @@ public static class Features extends StripeObject { } } + /** + * For more details about BalanceReport, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class BalanceReport extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject {} + } + /** * For more details about Balances, please refer to the API Reference. @@ -823,6 +857,56 @@ public static class Features extends StripeObject { } } + /** + * For more details about PayoutDetails, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayoutDetails extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject {} + } + + /** + * For more details about PayoutReconciliationReport, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PayoutReconciliationReport extends StripeObject { + /** Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("features") + Features features; + + /** + * For more details about Features, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject {} + } + /** * For more details about Payouts, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/Balance.java b/src/main/java/com/stripe/model/Balance.java index 217563f689f..97b50660c93 100644 --- a/src/main/java/com/stripe/model/Balance.java +++ b/src/main/java/com/stripe/model/Balance.java @@ -20,15 +20,12 @@ * This is an object representing your Stripe balance. You can retrieve it to see the balance * currently on your Stripe account. * - *

You can also retrieve the balance history, which contains a list of transactions that - * contributed to the balance (charges, payouts, and so forth). + *

The top-level {@code available} and {@code pending} comprise your "payments + * balance." * - *

The available and pending amounts for each currency are broken down further by payment source - * types. - * - *

Related guide: Understanding - * Connect account balances + *

Related guide: Balances and settlement + * time, Understanding Connect + * account balances */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index fbd148cb0da..0952ca5cd80 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1032,8 +1032,8 @@ public static class Outcome extends StripeObject { String networkAdviceCode; /** - * For charges declined by the network, a brand specific 2, 3, or 4 digit code which indicates - * the reason the authorization failed. + * For charges declined by the network, an alphanumeric code which indicates the reason the + * charge failed. */ @SerializedName("network_decline_code") String networkDeclineCode; @@ -1052,9 +1052,10 @@ public static class Outcome extends StripeObject { * An enumerated value providing a more detailed explanation of the outcome's {@code type}. * Charges blocked by Radar's default block rule have the value {@code highest_risk_level}. * Charges placed in review by Radar's default review rule have the value {@code - * elevated_risk_level}. Charges authorized, blocked, or placed in review by custom rules have - * the value {@code rule}. See understanding - * declines for more details. + * elevated_risk_level}. Charges blocked because the payment is unlikely to be authorized have + * the value {@code low_probability_of_authorization}. Charges authorized, blocked, or placed in + * review by custom rules have the value {@code rule}. See understanding declines for more details. */ @SerializedName("reason") String reason; @@ -1504,7 +1505,27 @@ public static class Alipay extends StripeObject { @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Alma extends StripeObject {} + public static class Alma extends StripeObject { + @SerializedName("installments") + Installments installments; + + /** The Alma transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + + /** + * For more details about Installments, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Installments extends StripeObject { + /** The number of installments. */ + @SerializedName("count") + Long count; + } + } /** * For more details about AmazonPay, please refer to the API Reference. @@ -1738,7 +1763,11 @@ public void setGeneratedSepaDebitMandateObject(Mandate expandableObject) { @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Billie extends StripeObject {} + public static class Billie extends StripeObject { + /** The Billie transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } /** * For more details about Blik, please refer to the API @@ -3101,6 +3130,10 @@ public static class KakaoPay extends StripeObject { /** A unique identifier for the buyer as determined by the local payment processor. */ @SerializedName("buyer_id") String buyerId; + + /** The Kakao Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; } /** @@ -3223,6 +3256,10 @@ public static class KrCard extends StripeObject { /** The last four digits of the card. This may not be present for American Express cards. */ @SerializedName("last4") String last4; + + /** The Korean Card transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; } /** @@ -3311,6 +3348,10 @@ public static class NaverPay extends StripeObject { /** A unique identifier for the buyer as determined by the local payment processor. */ @SerializedName("buyer_id") String buyerId; + + /** The Naver Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; } /** @@ -3416,6 +3457,10 @@ public static class Payco extends StripeObject { /** A unique identifier for the buyer as determined by the local payment processor. */ @SerializedName("buyer_id") String buyerId; + + /** The Payco transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; } /** @@ -3426,6 +3471,20 @@ public static class Payco extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Paynow extends StripeObject { + /** + * ID of the location that this + * transaction's reader is assigned to. + */ + @SerializedName("location") + String location; + + /** + * ID of the reader this + * transaction was made on. + */ + @SerializedName("reader") + String reader; + /** Reference number associated with this PayNow payment. */ @SerializedName("reference") String reference; @@ -3535,6 +3594,10 @@ public static class RevolutPay extends StripeObject { @SerializedName("funding") Funding funding; + /** The Revolut Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + /** * For more details about Funding, please refer to the API Reference. @@ -3610,6 +3673,10 @@ public static class SamsungPay extends StripeObject { /** A unique identifier for the buyer as determined by the local payment processor. */ @SerializedName("buyer_id") String buyerId; + + /** The Samsung Pay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; } /** @@ -3619,7 +3686,11 @@ public static class SamsungPay extends StripeObject { @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Satispay extends StripeObject {} + public static class Satispay extends StripeObject { + /** The Satispay transaction ID associated with this payment. */ + @SerializedName("transaction_id") + String transactionId; + } /** * For more details about SepaCreditTransfer, please refer to the One of {@code lost}, {@code needs_response}, {@code under_review}, {@code warning_closed}, * {@code warning_needs_response}, {@code warning_under_review}, or {@code won}. @@ -1166,7 +1166,8 @@ 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}, {@code compliance}, or {@code inquiry}. + *

One of {@code block}, {@code chargeback}, {@code compliance}, {@code inquiry}, or {@code + * resolution}. */ @SerializedName("case_type") String caseType; diff --git a/src/main/java/com/stripe/model/File.java b/src/main/java/com/stripe/model/File.java index 09ba4022a2b..39b436af72a 100644 --- a/src/main/java/com/stripe/model/File.java +++ b/src/main/java/com/stripe/model/File.java @@ -70,8 +70,8 @@ public class File extends ApiResource implements HasId { * document_provider_identity_document}, {@code finance_report_run}, {@code * financial_account_statement}, {@code identity_document}, {@code * identity_document_downloadable}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, or {@code - * terminal_reader_splashscreen}. + * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, {@code + * terminal_android_apk}, or {@code terminal_reader_splashscreen}. */ @SerializedName("purpose") String purpose; diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index ad24764c842..2be3c903202 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -175,6 +175,10 @@ public class PaymentIntent extends ApiResource implements HasId, MetadataStore

excludedPaymentMethodTypes; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") @@ -4443,6 +4447,14 @@ public static class Paypal extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Pix extends StripeObject { + /** + * Determines if the amount includes the IOF tax. + * + *

One of {@code always}, or {@code never}. + */ + @SerializedName("amount_includes_iof") + String amountIncludesIof; + /** The number of seconds (between 10 and 1209600) after which Pix payment will expire. */ @SerializedName("expires_after_seconds") Long expiresAfterSeconds; diff --git a/src/main/java/com/stripe/model/Payout.java b/src/main/java/com/stripe/model/Payout.java index 3bc8183df69..8285426488d 100644 --- a/src/main/java/com/stripe/model/Payout.java +++ b/src/main/java/com/stripe/model/Payout.java @@ -166,6 +166,10 @@ public class Payout extends ApiResource implements MetadataStore, Balanc @Setter(lombok.AccessLevel.NONE) ExpandableField originalPayout; + /** ID of the v2 FinancialAccount the funds are sent to. */ + @SerializedName("payout_method") + String payoutMethod; + /** * If {@code completed}, you can use the Balance diff --git a/src/main/java/com/stripe/model/PromotionCode.java b/src/main/java/com/stripe/model/PromotionCode.java index 36d73b9edd8..f7269e5afb7 100644 --- a/src/main/java/com/stripe/model/PromotionCode.java +++ b/src/main/java/com/stripe/model/PromotionCode.java @@ -20,8 +20,14 @@ /** * A Promotion Code represents a customer-redeemable code for a coupon. It can be used to create multiple codes - * for a single coupon. + * href="https://stripe.com/docs/api#coupons">coupon. You can create multiple codes for a single + * coupon. + * + *

If you enable promotion codes in your customer portal + * configuration, then customers can redeem a code themselves when updating a subscription in + * the portal. Customers can also view the currently active promotion codes and coupons on each of + * their subscriptions in the portal. */ @Getter @Setter diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index d258c52348d..e287d7944bf 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -44,25 +44,26 @@ public class StripeError extends StripeObject { * charge_invalid_parameter}, {@code charge_not_refundable}, {@code clearing_code_unsupported}, * {@code country_code_invalid}, {@code country_unsupported}, {@code coupon_expired}, {@code * customer_max_payment_methods}, {@code customer_max_subscriptions}, {@code - * customer_tax_location_invalid}, {@code debit_not_authorized}, {@code email_invalid}, {@code - * expired_card}, {@code financial_connections_account_inactive}, {@code - * financial_connections_no_successful_transaction_refresh}, {@code forwarding_api_inactive}, - * {@code forwarding_api_invalid_parameter}, {@code forwarding_api_retryable_upstream_error}, - * {@code forwarding_api_upstream_connection_error}, {@code - * forwarding_api_upstream_connection_timeout}, {@code forwarding_api_upstream_error}, {@code - * idempotency_key_in_use}, {@code incorrect_address}, {@code incorrect_cvc}, {@code - * incorrect_number}, {@code incorrect_zip}, {@code instant_payouts_config_disabled}, {@code - * instant_payouts_currency_disabled}, {@code instant_payouts_limit_exceeded}, {@code - * instant_payouts_unsupported}, {@code insufficient_funds}, {@code intent_invalid_state}, {@code - * intent_verification_method_missing}, {@code invalid_card_type}, {@code invalid_characters}, - * {@code invalid_charge_amount}, {@code invalid_cvc}, {@code invalid_expiry_month}, {@code - * invalid_expiry_year}, {@code invalid_mandate_reference_prefix_format}, {@code invalid_number}, - * {@code invalid_source_usage}, {@code invalid_tax_location}, {@code - * invoice_no_customer_line_items}, {@code invoice_no_payment_method_types}, {@code - * invoice_no_subscription_line_items}, {@code invoice_not_editable}, {@code - * invoice_on_behalf_of_not_editable}, {@code invoice_payment_intent_requires_action}, {@code - * invoice_upcoming_none}, {@code livemode_mismatch}, {@code lock_timeout}, {@code missing}, - * {@code no_account}, {@code not_allowed_on_standard_account}, {@code out_of_inventory}, {@code + * customer_session_expired}, {@code customer_tax_location_invalid}, {@code debit_not_authorized}, + * {@code email_invalid}, {@code expired_card}, {@code financial_connections_account_inactive}, + * {@code financial_connections_no_successful_transaction_refresh}, {@code + * forwarding_api_inactive}, {@code forwarding_api_invalid_parameter}, {@code + * forwarding_api_retryable_upstream_error}, {@code forwarding_api_upstream_connection_error}, + * {@code forwarding_api_upstream_connection_timeout}, {@code forwarding_api_upstream_error}, + * {@code idempotency_key_in_use}, {@code incorrect_address}, {@code incorrect_cvc}, {@code + * incorrect_number}, {@code incorrect_zip}, {@code india_recurring_payment_mandate_canceled}, + * {@code instant_payouts_config_disabled}, {@code instant_payouts_currency_disabled}, {@code + * instant_payouts_limit_exceeded}, {@code instant_payouts_unsupported}, {@code + * insufficient_funds}, {@code intent_invalid_state}, {@code intent_verification_method_missing}, + * {@code invalid_card_type}, {@code invalid_characters}, {@code invalid_charge_amount}, {@code + * invalid_cvc}, {@code invalid_expiry_month}, {@code invalid_expiry_year}, {@code + * invalid_mandate_reference_prefix_format}, {@code invalid_number}, {@code invalid_source_usage}, + * {@code invalid_tax_location}, {@code invoice_no_customer_line_items}, {@code + * invoice_no_payment_method_types}, {@code invoice_no_subscription_line_items}, {@code + * invoice_not_editable}, {@code invoice_on_behalf_of_not_editable}, {@code + * invoice_payment_intent_requires_action}, {@code invoice_upcoming_none}, {@code + * livemode_mismatch}, {@code lock_timeout}, {@code missing}, {@code no_account}, {@code + * not_allowed_on_standard_account}, {@code out_of_inventory}, {@code * ownership_declaration_not_allowed}, {@code parameter_invalid_empty}, {@code * parameter_invalid_integer}, {@code parameter_invalid_string_blank}, {@code * parameter_invalid_string_empty}, {@code parameter_missing}, {@code parameter_unknown}, {@code @@ -138,8 +139,8 @@ public class StripeError extends StripeObject { String networkAdviceCode; /** - * For card errors resulting from a card issuer decline, a brand specific 2, 3, or 4 digit code - * which indicates the reason the authorization failed. + * For payments declined by the network, an alphanumeric code which indicates the reason the + * payment failed. */ @SerializedName("network_decline_code") String networkDeclineCode; diff --git a/src/main/java/com/stripe/model/SubscriptionSchedule.java b/src/main/java/com/stripe/model/SubscriptionSchedule.java index a2efba6bc13..f014e1895f4 100644 --- a/src/main/java/com/stripe/model/SubscriptionSchedule.java +++ b/src/main/java/com/stripe/model/SubscriptionSchedule.java @@ -1167,6 +1167,17 @@ public static class AddInvoiceItem extends StripeObject { @SerializedName("discounts") List discounts; + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the object + * in a structured format. + */ + @SerializedName("metadata") + Map metadata; + + @SerializedName("period") + Period period; + /** ID of the price used to generate the invoice item. */ @SerializedName("price") @Getter(lombok.AccessLevel.NONE) @@ -1285,6 +1296,69 @@ public void setPromotionCodeObject(PromotionCode expandableObject) { new ExpandableField(expandableObject.getId(), expandableObject); } } + + /** + * For more details about Period, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Period extends StripeObject { + @SerializedName("end") + End end; + + @SerializedName("start") + Start start; + + /** + * For more details about End, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class End extends StripeObject { + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Select how to calculate the end of the invoice item period. + * + *

One of {@code min_item_period_end}, {@code phase_end}, or {@code timestamp}. + */ + @SerializedName("type") + String type; + } + + /** + * For more details about Start, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Start extends StripeObject { + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Select how to calculate the start of the invoice item period. + * + *

One of {@code max_item_period_start}, {@code phase_start}, or {@code timestamp}. + */ + @SerializedName("type") + String type; + } + } } /** diff --git a/src/main/java/com/stripe/model/billing/Meter.java b/src/main/java/com/stripe/model/billing/Meter.java index 425eefbbcc3..3eb2b3a91d8 100644 --- a/src/main/java/com/stripe/model/billing/Meter.java +++ b/src/main/java/com/stripe/model/billing/Meter.java @@ -57,7 +57,7 @@ public class Meter extends ApiResource implements HasId { String eventName; /** - * The time window to pre-aggregate meter events for, if any. + * The time window which meter events have been pre-aggregated for, if any. * *

One of {@code day}, or {@code hour}. */ diff --git a/src/main/java/com/stripe/model/billingportal/Configuration.java b/src/main/java/com/stripe/model/billingportal/Configuration.java index 89077de319b..29ef889e4f0 100644 --- a/src/main/java/com/stripe/model/billingportal/Configuration.java +++ b/src/main/java/com/stripe/model/billingportal/Configuration.java @@ -90,6 +90,10 @@ public class Configuration extends ApiResource implements HasId, MetadataStore metadata; + /** The name of the configuration. */ + @SerializedName("name") + String name; + /** * String representing the object's type. Objects of the same type share the same value. * diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index f3f13a69d76..d767167fe2d 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -876,7 +876,11 @@ public Session update(SessionUpdateParams params, RequestOptions options) throws @Setter @EqualsAndHashCode(callSuper = false) public static class AdaptivePricing extends StripeObject { - /** Whether Adaptive Pricing is enabled. */ + /** + * If enabled, Adaptive Pricing is available on eligible + * sessions. + */ @SerializedName("enabled") Boolean enabled; } @@ -3213,6 +3217,14 @@ public static class Paypal extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Pix extends StripeObject { + /** + * Determines if the amount includes the IOF tax. + * + *

One of {@code always}, or {@code never}. + */ + @SerializedName("amount_includes_iof") + String amountIncludesIof; + /** The number of seconds after which Pix payment will expire. */ @SerializedName("expires_after_seconds") Long expiresAfterSeconds; diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index cf9dfab40be..afa388f1568 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -401,6 +401,9 @@ public static class Tipping extends StripeObject { @SerializedName("jpy") Jpy jpy; + @SerializedName("mxn") + Mxn mxn; + @SerializedName("myr") Myr myr; @@ -713,6 +716,30 @@ public static class Jpy extends StripeObject { Long smartTipThreshold; } + /** + * For more details about Mxn, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Mxn extends StripeObject { + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + } + /** * For more details about Myr, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index f4d98236ef8..6cda259d079 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -153,6 +153,14 @@ public static class Components { @SerializedName("account_onboarding") AccountOnboarding accountOnboarding; + /** + * Configuration for the balance + * report embedded component. + */ + @SerializedName("balance_report") + BalanceReport balanceReport; + /** * Configuration for the balances @@ -258,6 +266,22 @@ public static class Components { @SerializedName("payments") Payments payments; + /** + * Configuration for the payout + * details embedded component. + */ + @SerializedName("payout_details") + PayoutDetails payoutDetails; + + /** + * Configuration for the payout + * reconciliation report embedded component. + */ + @SerializedName("payout_reconciliation_report") + PayoutReconciliationReport payoutReconciliationReport; + /** * Configuration for the payouts embedded @@ -293,6 +317,7 @@ public static class Components { private Components( AccountManagement accountManagement, AccountOnboarding accountOnboarding, + BalanceReport balanceReport, Balances balances, DisputesList disputesList, Documents documents, @@ -306,12 +331,15 @@ private Components( PaymentDetails paymentDetails, PaymentDisputes paymentDisputes, Payments payments, + PayoutDetails payoutDetails, + PayoutReconciliationReport payoutReconciliationReport, Payouts payouts, PayoutsList payoutsList, TaxRegistrations taxRegistrations, TaxSettings taxSettings) { this.accountManagement = accountManagement; this.accountOnboarding = accountOnboarding; + this.balanceReport = balanceReport; this.balances = balances; this.disputesList = disputesList; this.documents = documents; @@ -325,6 +353,8 @@ private Components( this.paymentDetails = paymentDetails; this.paymentDisputes = paymentDisputes; this.payments = payments; + this.payoutDetails = payoutDetails; + this.payoutReconciliationReport = payoutReconciliationReport; this.payouts = payouts; this.payoutsList = payoutsList; this.taxRegistrations = taxRegistrations; @@ -340,6 +370,8 @@ public static class Builder { private AccountOnboarding accountOnboarding; + private BalanceReport balanceReport; + private Balances balances; private DisputesList disputesList; @@ -366,6 +398,10 @@ public static class Builder { private Payments payments; + private PayoutDetails payoutDetails; + + private PayoutReconciliationReport payoutReconciliationReport; + private Payouts payouts; private PayoutsList payoutsList; @@ -379,6 +415,7 @@ public AccountSessionCreateParams.Components build() { return new AccountSessionCreateParams.Components( this.accountManagement, this.accountOnboarding, + this.balanceReport, this.balances, this.disputesList, this.documents, @@ -392,6 +429,8 @@ public AccountSessionCreateParams.Components build() { this.paymentDetails, this.paymentDisputes, this.payments, + this.payoutDetails, + this.payoutReconciliationReport, this.payouts, this.payoutsList, this.taxRegistrations, @@ -420,6 +459,17 @@ public Builder setAccountOnboarding( return this; } + /** + * Configuration for the balance + * report embedded component. + */ + public Builder setBalanceReport( + AccountSessionCreateParams.Components.BalanceReport balanceReport) { + this.balanceReport = balanceReport; + return this; + } + /** * Configuration for the balances @@ -575,6 +625,29 @@ public Builder setPayments(AccountSessionCreateParams.Components.Payments paymen return this; } + /** + * Configuration for the payout + * details embedded component. + */ + public Builder setPayoutDetails( + AccountSessionCreateParams.Components.PayoutDetails payoutDetails) { + this.payoutDetails = payoutDetails; + return this; + } + + /** + * Configuration for the payout + * reconciliation report embedded component. + */ + public Builder setPayoutReconciliationReport( + AccountSessionCreateParams.Components.PayoutReconciliationReport + payoutReconciliationReport) { + this.payoutReconciliationReport = payoutReconciliationReport; + return this; + } + /** * Configuration for the payouts @@ -1025,6 +1098,154 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class BalanceReport { + /** Required. Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** An empty list, because this embedded component has no features. */ + @SerializedName("features") + Features features; + + private BalanceReport(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountSessionCreateParams.Components.BalanceReport build() { + return new AccountSessionCreateParams.Components.BalanceReport( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the embedded component is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.BalanceReport#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.BalanceReport#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An empty list, because this embedded component has no features. */ + public Builder setFeatures( + AccountSessionCreateParams.Components.BalanceReport.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Features(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 AccountSessionCreateParams.Components.BalanceReport.Features build() { + return new AccountSessionCreateParams.Components.BalanceReport.Features( + 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 + * AccountSessionCreateParams.Components.BalanceReport.Features#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountSessionCreateParams.Components.BalanceReport.Features#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Balances { @@ -1539,7 +1760,7 @@ public static class Documents { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ @SerializedName("features") Features features; @@ -1600,7 +1821,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ public Builder setFeatures( AccountSessionCreateParams.Components.Documents.Features features) { this.features = features; @@ -3607,6 +3828,305 @@ public Builder setRefundManagement(Boolean refundManagement) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PayoutDetails { + /** Required. Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** An empty list, because this embedded component has no features. */ + @SerializedName("features") + Features features; + + private PayoutDetails(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountSessionCreateParams.Components.PayoutDetails build() { + return new AccountSessionCreateParams.Components.PayoutDetails( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the embedded component is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.PayoutDetails#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountSessionCreateParams.Components.PayoutDetails#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An empty list, because this embedded component has no features. */ + public Builder setFeatures( + AccountSessionCreateParams.Components.PayoutDetails.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Features(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 AccountSessionCreateParams.Components.PayoutDetails.Features build() { + return new AccountSessionCreateParams.Components.PayoutDetails.Features( + 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 + * AccountSessionCreateParams.Components.PayoutDetails.Features#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountSessionCreateParams.Components.PayoutDetails.Features#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PayoutReconciliationReport { + /** Required. Whether the embedded component is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** An empty list, because this embedded component has no features. */ + @SerializedName("features") + Features features; + + private PayoutReconciliationReport( + Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountSessionCreateParams.Components.PayoutReconciliationReport build() { + return new AccountSessionCreateParams.Components.PayoutReconciliationReport( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the embedded component is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountSessionCreateParams.Components.PayoutReconciliationReport#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountSessionCreateParams.Components.PayoutReconciliationReport#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** An empty list, because this embedded component has no features. */ + public Builder setFeatures( + AccountSessionCreateParams.Components.PayoutReconciliationReport.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Features(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 AccountSessionCreateParams.Components.PayoutReconciliationReport.Features build() { + return new AccountSessionCreateParams.Components.PayoutReconciliationReport.Features( + 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 + * AccountSessionCreateParams.Components.PayoutReconciliationReport.Features#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountSessionCreateParams.Components.PayoutReconciliationReport.Features#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Payouts { @@ -3893,7 +4413,7 @@ public static class PayoutsList { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ @SerializedName("features") Features features; @@ -3954,7 +4474,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ public Builder setFeatures( AccountSessionCreateParams.Components.PayoutsList.Features features) { this.features = features; @@ -4038,7 +4558,7 @@ public static class TaxRegistrations { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ @SerializedName("features") Features features; @@ -4100,7 +4620,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ public Builder setFeatures( AccountSessionCreateParams.Components.TaxRegistrations.Features features) { this.features = features; @@ -4187,7 +4707,7 @@ public static class TaxSettings { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ @SerializedName("features") Features features; @@ -4248,7 +4768,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The list of features enabled in the embedded component. */ + /** An empty list, because this embedded component has no features. */ public Builder setFeatures( AccountSessionCreateParams.Components.TaxSettings.Features features) { this.features = features; diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index ea0afac7f61..6c4828056bf 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -883,7 +883,10 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ @SerializedName("refund") String refund; @@ -945,7 +948,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ public Builder setRefund(String refund) { this.refund = refund; return this; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index 681af744339..dd6aeabb1ac 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -956,7 +956,10 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ @SerializedName("refund") String refund; @@ -1019,7 +1022,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ public Builder setRefund(String refund) { this.refund = refund; return this; diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index 3c1d564b083..65db4a6c8cf 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -883,7 +883,10 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ @SerializedName("refund") String refund; @@ -945,7 +948,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** ID of an existing refund to link this credit note to. */ + /** + * ID of an existing refund to link this credit note to. Required when {@code type} is {@code + * refund}. + */ public Builder setRefund(String refund) { this.refund = refund; return this; diff --git a/src/main/java/com/stripe/param/FileCreateParams.java b/src/main/java/com/stripe/param/FileCreateParams.java index 49afc2ddcb7..55026b17719 100644 --- a/src/main/java/com/stripe/param/FileCreateParams.java +++ b/src/main/java/com/stripe/param/FileCreateParams.java @@ -181,7 +181,8 @@ public static class FileLinkData { * created file. Creating a link is only possible when the file's {@code purpose} is one of the * following: {@code business_icon}, {@code business_logo}, {@code customer_signature}, {@code * dispute_evidence}, {@code issuing_regulatory_reporting}, {@code pci_document}, {@code - * tax_document_user_upload}, or {@code terminal_reader_splashscreen}. + * tax_document_user_upload}, {@code terminal_android_apk}, or {@code + * terminal_reader_splashscreen}. */ @SerializedName("create") Boolean create; @@ -240,7 +241,8 @@ public FileCreateParams.FileLinkData build() { * created file. Creating a link is only possible when the file's {@code purpose} is one of * the following: {@code business_icon}, {@code business_logo}, {@code customer_signature}, * {@code dispute_evidence}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code tax_document_user_upload}, or {@code terminal_reader_splashscreen}. + * {@code tax_document_user_upload}, {@code terminal_android_apk}, or {@code + * terminal_reader_splashscreen}. */ public Builder setCreate(Boolean create) { this.create = create; @@ -362,6 +364,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("tax_document_user_upload") TAX_DOCUMENT_USER_UPLOAD("tax_document_user_upload"), + @SerializedName("terminal_android_apk") + TERMINAL_ANDROID_APK("terminal_android_apk"), + @SerializedName("terminal_reader_splashscreen") TERMINAL_READER_SPLASHSCREEN("terminal_reader_splashscreen"); diff --git a/src/main/java/com/stripe/param/FileLinkCreateParams.java b/src/main/java/com/stripe/param/FileLinkCreateParams.java index 7075f826386..29436ba56f9 100644 --- a/src/main/java/com/stripe/param/FileLinkCreateParams.java +++ b/src/main/java/com/stripe/param/FileLinkCreateParams.java @@ -36,8 +36,8 @@ public class FileLinkCreateParams extends ApiRequestParams { * following: {@code business_icon}, {@code business_logo}, {@code customer_signature}, {@code * dispute_evidence}, {@code finance_report_run}, {@code financial_account_statement}, {@code * identity_document_downloadable}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, or {@code - * terminal_reader_splashscreen}. + * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, {@code + * terminal_android_apk}, or {@code terminal_reader_splashscreen}. */ @SerializedName("file") String file; @@ -148,8 +148,8 @@ public Builder putAllExtraParam(Map map) { * following: {@code business_icon}, {@code business_logo}, {@code customer_signature}, {@code * dispute_evidence}, {@code finance_report_run}, {@code financial_account_statement}, {@code * identity_document_downloadable}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, or {@code - * terminal_reader_splashscreen}. + * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, {@code + * terminal_android_apk}, or {@code terminal_reader_splashscreen}. */ public Builder setFile(String file) { this.file = file; diff --git a/src/main/java/com/stripe/param/FileListParams.java b/src/main/java/com/stripe/param/FileListParams.java index 4d9fde0382c..ad1192cacea 100644 --- a/src/main/java/com/stripe/param/FileListParams.java +++ b/src/main/java/com/stripe/param/FileListParams.java @@ -372,6 +372,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("tax_document_user_upload") TAX_DOCUMENT_USER_UPLOAD("tax_document_user_upload"), + @SerializedName("terminal_android_apk") + TERMINAL_ANDROID_APK("terminal_android_apk"), + @SerializedName("terminal_reader_splashscreen") TERMINAL_READER_SPLASHSCREEN("terminal_reader_splashscreen"); diff --git a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java index fea5699926e..48f858575e5 100644 --- a/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreatePreviewParams.java @@ -3986,6 +3986,22 @@ public static class AddInvoiceItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the + * object in a structured format. Individual keys can be unset by posting an empty value to + * them. All keys can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + @SerializedName("period") + Period period; + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ @SerializedName("price") String price; @@ -4012,12 +4028,16 @@ private AddInvoiceItem( List discounts, Map extraParams, + Map metadata, + Period period, String price, PriceData priceData, Long quantity, Object taxRates) { this.discounts = discounts; this.extraParams = extraParams; + this.metadata = metadata; + this.period = period; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -4034,6 +4054,10 @@ public static class Builder { private Map extraParams; + private Map metadata; + + private Period period; + private String price; private PriceData priceData; @@ -4047,6 +4071,8 @@ public InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem build() { return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem( this.discounts, this.extraParams, + this.metadata, + this.period, this.price, this.priceData, this.quantity, @@ -4114,6 +4140,45 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See + * {@link InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem#metadata} for + * the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem#metadata} for the field + * documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + public Builder setPeriod( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period period) { + this.period = period; + return this; + } + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ public Builder setPrice(String price) { this.price = price; @@ -4291,6 +4356,339 @@ public Builder setPromotionCode(String promotionCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Period { + /** Required. End of the invoice item period. */ + @SerializedName("end") + End end; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Start of the invoice item period. */ + @SerializedName("start") + Start start; + + private Period(End end, Map extraParams, Start start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private End end; + + private Map extraParams; + + private Start start; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** Required. End of the invoice item period. */ + public Builder setEnd( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.End end) { + this.end = end; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period#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. Start of the invoice item period. */ + public Builder setStart( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.Start + start) { + this.start = start; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class End { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} + * value. Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the end of the invoice item + * period. + */ + @SerializedName("type") + Type type; + + private End(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.End + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period + .End(this.extraParams, this.timestamp, 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.Phase.AddInvoiceItem.Period.End#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the + * first `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.End#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater + * than or equal to {@code period.start}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the end of the invoice item + * period. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.End.Type + type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("min_item_period_end") + MIN_ITEM_PERIOD_END("min_item_period_end"), + + @SerializedName("phase_end") + PHASE_END("phase_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Start { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} + * value. Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than + * or equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + @SerializedName("type") + Type type; + + private Start(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.Start + build() { + return new InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period + .Start(this.extraParams, this.timestamp, 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.Phase.AddInvoiceItem.Period.Start#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the + * first `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.Start#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less + * than or equal to {@code period.end}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + public Builder setType( + InvoiceCreatePreviewParams.ScheduleDetails.Phase.AddInvoiceItem.Period.Start.Type + type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("max_item_period_start") + MAX_ITEM_PERIOD_START("max_item_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PriceData { diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 954da504fb7..2f014205a73 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -17758,6 +17758,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + @SerializedName("amount_includes_iof") + AmountIncludesIof amountIncludesIof; + /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. * Defaults to 86400 seconds. @@ -17808,10 +17812,12 @@ public static class Pix { SetupFutureUsage setupFutureUsage; private Pix( + AmountIncludesIof amountIncludesIof, Long expiresAfterSeconds, Long expiresAt, Map extraParams, SetupFutureUsage setupFutureUsage) { + this.amountIncludesIof = amountIncludesIof; this.expiresAfterSeconds = expiresAfterSeconds; this.expiresAt = expiresAt; this.extraParams = extraParams; @@ -17823,6 +17829,8 @@ public static Builder builder() { } public static class Builder { + private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; private Long expiresAt; @@ -17834,7 +17842,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentConfirmParams.PaymentMethodOptions.Pix build() { return new PaymentIntentConfirmParams.PaymentMethodOptions.Pix( - this.expiresAfterSeconds, this.expiresAt, this.extraParams, this.setupFutureUsage); + this.amountIncludesIof, + this.expiresAfterSeconds, + this.expiresAt, + this.extraParams, + this.setupFutureUsage); + } + + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + public Builder setAmountIncludesIof( + PaymentIntentConfirmParams.PaymentMethodOptions.Pix.AmountIncludesIof + amountIncludesIof) { + this.amountIncludesIof = amountIncludesIof; + return this; } /** @@ -17914,6 +17934,21 @@ public Builder setSetupFutureUsage( } } + public enum AmountIncludesIof implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountIncludesIof(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"); diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index bc9438d3f35..f8ef09a66c0 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -115,6 +115,10 @@ public class PaymentIntentCreateParams extends ApiRequestParams { @SerializedName("error_on_requires_action") Boolean errorOnRequiresAction; + /** The list of payment method types to exclude from use with this payment. */ + @SerializedName("excluded_payment_method_types") + List excludedPaymentMethodTypes; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -325,6 +329,7 @@ private PaymentIntentCreateParams( String customer, String description, Boolean errorOnRequiresAction, + List excludedPaymentMethodTypes, List expand, Map extraParams, String mandate, @@ -358,6 +363,7 @@ private PaymentIntentCreateParams( this.customer = customer; this.description = description; this.errorOnRequiresAction = errorOnRequiresAction; + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; this.expand = expand; this.extraParams = extraParams; this.mandate = mandate; @@ -409,6 +415,8 @@ public static class Builder { private Boolean errorOnRequiresAction; + private List excludedPaymentMethodTypes; + private List expand; private Map extraParams; @@ -467,6 +475,7 @@ public PaymentIntentCreateParams build() { this.customer, this.description, this.errorOnRequiresAction, + this.excludedPaymentMethodTypes, this.expand, this.extraParams, this.mandate, @@ -617,6 +626,34 @@ public Builder setErrorOnRequiresAction(Boolean errorOnRequiresAction) { return this; } + /** + * Add an element to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link PaymentIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addExcludedPaymentMethodType( + PaymentIntentCreateParams.ExcludedPaymentMethodType element) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.add(element); + return this; + } + + /** + * Add all elements to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link PaymentIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addAllExcludedPaymentMethodType( + List elements) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.addAll(elements); + return this; + } + /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -18257,6 +18294,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + @SerializedName("amount_includes_iof") + AmountIncludesIof amountIncludesIof; + /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. * Defaults to 86400 seconds. @@ -18307,10 +18348,12 @@ public static class Pix { SetupFutureUsage setupFutureUsage; private Pix( + AmountIncludesIof amountIncludesIof, Long expiresAfterSeconds, Long expiresAt, Map extraParams, SetupFutureUsage setupFutureUsage) { + this.amountIncludesIof = amountIncludesIof; this.expiresAfterSeconds = expiresAfterSeconds; this.expiresAt = expiresAt; this.extraParams = extraParams; @@ -18322,6 +18365,8 @@ public static Builder builder() { } public static class Builder { + private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; private Long expiresAt; @@ -18333,7 +18378,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentCreateParams.PaymentMethodOptions.Pix build() { return new PaymentIntentCreateParams.PaymentMethodOptions.Pix( - this.expiresAfterSeconds, this.expiresAt, this.extraParams, this.setupFutureUsage); + this.amountIncludesIof, + this.expiresAfterSeconds, + this.expiresAt, + this.extraParams, + this.setupFutureUsage); + } + + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + public Builder setAmountIncludesIof( + PaymentIntentCreateParams.PaymentMethodOptions.Pix.AmountIncludesIof + amountIncludesIof) { + this.amountIncludesIof = amountIncludesIof; + return this; } /** @@ -18413,6 +18470,21 @@ public Builder setSetupFutureUsage( } } + public enum AmountIncludesIof implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountIncludesIof(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"); @@ -21558,6 +21630,156 @@ public enum ConfirmationMethod implements ApiRequestParams.EnumParam { } } + public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("acss_debit") + ACSS_DEBIT("acss_debit"), + + @SerializedName("affirm") + AFFIRM("affirm"), + + @SerializedName("afterpay_clearpay") + AFTERPAY_CLEARPAY("afterpay_clearpay"), + + @SerializedName("alipay") + ALIPAY("alipay"), + + @SerializedName("alma") + ALMA("alma"), + + @SerializedName("amazon_pay") + AMAZON_PAY("amazon_pay"), + + @SerializedName("au_becs_debit") + AU_BECS_DEBIT("au_becs_debit"), + + @SerializedName("bacs_debit") + BACS_DEBIT("bacs_debit"), + + @SerializedName("bancontact") + BANCONTACT("bancontact"), + + @SerializedName("billie") + BILLIE("billie"), + + @SerializedName("blik") + BLIK("blik"), + + @SerializedName("boleto") + BOLETO("boleto"), + + @SerializedName("card") + CARD("card"), + + @SerializedName("cashapp") + CASHAPP("cashapp"), + + @SerializedName("crypto") + CRYPTO("crypto"), + + @SerializedName("customer_balance") + CUSTOMER_BALANCE("customer_balance"), + + @SerializedName("eps") + EPS("eps"), + + @SerializedName("fpx") + FPX("fpx"), + + @SerializedName("giropay") + GIROPAY("giropay"), + + @SerializedName("grabpay") + GRABPAY("grabpay"), + + @SerializedName("ideal") + IDEAL("ideal"), + + @SerializedName("kakao_pay") + KAKAO_PAY("kakao_pay"), + + @SerializedName("klarna") + KLARNA("klarna"), + + @SerializedName("konbini") + KONBINI("konbini"), + + @SerializedName("kr_card") + KR_CARD("kr_card"), + + @SerializedName("mobilepay") + MOBILEPAY("mobilepay"), + + @SerializedName("multibanco") + MULTIBANCO("multibanco"), + + @SerializedName("naver_pay") + NAVER_PAY("naver_pay"), + + @SerializedName("nz_bank_account") + NZ_BANK_ACCOUNT("nz_bank_account"), + + @SerializedName("oxxo") + OXXO("oxxo"), + + @SerializedName("p24") + P24("p24"), + + @SerializedName("pay_by_bank") + PAY_BY_BANK("pay_by_bank"), + + @SerializedName("payco") + PAYCO("payco"), + + @SerializedName("paynow") + PAYNOW("paynow"), + + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("pix") + PIX("pix"), + + @SerializedName("promptpay") + PROMPTPAY("promptpay"), + + @SerializedName("revolut_pay") + REVOLUT_PAY("revolut_pay"), + + @SerializedName("samsung_pay") + SAMSUNG_PAY("samsung_pay"), + + @SerializedName("satispay") + SATISPAY("satispay"), + + @SerializedName("sepa_debit") + SEPA_DEBIT("sepa_debit"), + + @SerializedName("sofort") + SOFORT("sofort"), + + @SerializedName("swish") + SWISH("swish"), + + @SerializedName("twint") + TWINT("twint"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"), + + @SerializedName("wechat_pay") + WECHAT_PAY("wechat_pay"), + + @SerializedName("zip") + ZIP("zip"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ExcludedPaymentMethodType(String value) { + this.value = value; + } + } + public enum OffSession implements ApiRequestParams.EnumParam { @SerializedName("one_off") ONE_OFF("one_off"), diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 68580b2b0b3..fddc49d028e 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -17967,6 +17967,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + @SerializedName("amount_includes_iof") + AmountIncludesIof amountIncludesIof; + /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. * Defaults to 86400 seconds. @@ -18017,10 +18021,12 @@ public static class Pix { SetupFutureUsage setupFutureUsage; private Pix( + AmountIncludesIof amountIncludesIof, Long expiresAfterSeconds, Long expiresAt, Map extraParams, SetupFutureUsage setupFutureUsage) { + this.amountIncludesIof = amountIncludesIof; this.expiresAfterSeconds = expiresAfterSeconds; this.expiresAt = expiresAt; this.extraParams = extraParams; @@ -18032,6 +18038,8 @@ public static Builder builder() { } public static class Builder { + private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; private Long expiresAt; @@ -18043,7 +18051,19 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public PaymentIntentUpdateParams.PaymentMethodOptions.Pix build() { return new PaymentIntentUpdateParams.PaymentMethodOptions.Pix( - this.expiresAfterSeconds, this.expiresAt, this.extraParams, this.setupFutureUsage); + this.amountIncludesIof, + this.expiresAfterSeconds, + this.expiresAt, + this.extraParams, + this.setupFutureUsage); + } + + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + public Builder setAmountIncludesIof( + PaymentIntentUpdateParams.PaymentMethodOptions.Pix.AmountIncludesIof + amountIncludesIof) { + this.amountIncludesIof = amountIncludesIof; + return this; } /** @@ -18123,6 +18143,21 @@ public Builder setSetupFutureUsage( } } + public enum AmountIncludesIof implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountIncludesIof(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"); diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 9ada1856d78..6df7f9ff706 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -3424,7 +3424,8 @@ public static class LineItem { /** * The ID of the Price or Plan object. + * href="https://stripe.com/docs/api/plans">Plan object. One of {@code price} or {@code + * price_data} is required. */ @SerializedName("price") String price; @@ -3512,7 +3513,8 @@ public Builder putAllExtraParam(Map map) { /** * The ID of the Price or Plan object. + * href="https://stripe.com/docs/api/plans">Plan object. One of {@code price} or {@code + * price_data} is required. */ public Builder setPrice(String price) { this.price = price; diff --git a/src/main/java/com/stripe/param/PayoutCreateParams.java b/src/main/java/com/stripe/param/PayoutCreateParams.java index 6145a83b57a..9502c4927ee 100644 --- a/src/main/java/com/stripe/param/PayoutCreateParams.java +++ b/src/main/java/com/stripe/param/PayoutCreateParams.java @@ -67,6 +67,10 @@ public class PayoutCreateParams extends ApiRequestParams { @SerializedName("method") Method method; + /** The ID of a v2 FinancialAccount to send funds to. */ + @SerializedName("payout_method") + String payoutMethod; + /** * The balance type of your Stripe balance to draw this payout from. Balances for different * payment sources are kept separately. You can find the amounts with the Balances API. One of @@ -93,6 +97,7 @@ private PayoutCreateParams( Map extraParams, Map metadata, Method method, + String payoutMethod, SourceType sourceType, String statementDescriptor) { this.amount = amount; @@ -103,6 +108,7 @@ private PayoutCreateParams( this.extraParams = extraParams; this.metadata = metadata; this.method = method; + this.payoutMethod = payoutMethod; this.sourceType = sourceType; this.statementDescriptor = statementDescriptor; } @@ -128,6 +134,8 @@ public static class Builder { private Method method; + private String payoutMethod; + private SourceType sourceType; private String statementDescriptor; @@ -143,6 +151,7 @@ public PayoutCreateParams build() { this.extraParams, this.metadata, this.method, + this.payoutMethod, this.sourceType, this.statementDescriptor); } @@ -267,6 +276,12 @@ public Builder setMethod(PayoutCreateParams.Method method) { return this; } + /** The ID of a v2 FinancialAccount to send funds to. */ + public Builder setPayoutMethod(String payoutMethod) { + this.payoutMethod = payoutMethod; + return this; + } + /** * The balance type of your Stripe balance to draw this payout from. Balances for different * payment sources are kept separately. You can find the amounts with the Balances API. One of diff --git a/src/main/java/com/stripe/param/SubscriptionCreateParams.java b/src/main/java/com/stripe/param/SubscriptionCreateParams.java index 5e49bee33b6..d185813b887 100644 --- a/src/main/java/com/stripe/param/SubscriptionCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionCreateParams.java @@ -1110,6 +1110,22 @@ public static class AddInvoiceItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The period associated with this invoice item. Defaults to the current period of the + * subscription. + */ + @SerializedName("period") + Period period; + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ @SerializedName("price") String price; @@ -1135,12 +1151,16 @@ public static class AddInvoiceItem { private AddInvoiceItem( List discounts, Map extraParams, + Map metadata, + Period period, String price, PriceData priceData, Long quantity, Object taxRates) { this.discounts = discounts; this.extraParams = extraParams; + this.metadata = metadata; + this.period = period; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -1156,6 +1176,10 @@ public static class Builder { private Map extraParams; + private Map metadata; + + private Period period; + private String price; private PriceData priceData; @@ -1169,6 +1193,8 @@ public SubscriptionCreateParams.AddInvoiceItem build() { return new SubscriptionCreateParams.AddInvoiceItem( this.discounts, this.extraParams, + this.metadata, + this.period, this.price, this.priceData, this.quantity, @@ -1229,6 +1255,41 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionCreateParams.AddInvoiceItem#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionCreateParams.AddInvoiceItem#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * The period associated with this invoice item. Defaults to the current period of the + * subscription. + */ + public Builder setPeriod(SubscriptionCreateParams.AddInvoiceItem.Period period) { + this.period = period; + return this; + } + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ public Builder setPrice(String price) { this.price = price; @@ -1396,6 +1457,317 @@ public Builder setPromotionCode(String promotionCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Period { + /** Required. End of the invoice item period. */ + @SerializedName("end") + End end; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Start of the invoice item period. */ + @SerializedName("start") + Start start; + + private Period(End end, Map extraParams, Start start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private End end; + + private Map extraParams; + + private Start start; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.AddInvoiceItem.Period build() { + return new SubscriptionCreateParams.AddInvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** Required. End of the invoice item period. */ + public Builder setEnd(SubscriptionCreateParams.AddInvoiceItem.Period.End end) { + this.end = end; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionCreateParams.AddInvoiceItem.Period#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.AddInvoiceItem.Period#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. Start of the invoice item period. */ + public Builder setStart(SubscriptionCreateParams.AddInvoiceItem.Period.Start start) { + this.start = start; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class End { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than or + * equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + @SerializedName("type") + Type type; + + private End(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.AddInvoiceItem.Period.End build() { + return new SubscriptionCreateParams.AddInvoiceItem.Period.End( + this.extraParams, this.timestamp, 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.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + public Builder setType(SubscriptionCreateParams.AddInvoiceItem.Period.End.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("min_item_period_end") + MIN_ITEM_PERIOD_END("min_item_period_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Start { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the start of the invoice item period. + */ + @SerializedName("type") + Type type; + + private Start(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionCreateParams.AddInvoiceItem.Period.Start build() { + return new SubscriptionCreateParams.AddInvoiceItem.Period.Start( + this.extraParams, this.timestamp, 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.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. 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.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + public Builder setType(SubscriptionCreateParams.AddInvoiceItem.Period.Start.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("max_item_period_start") + MAX_ITEM_PERIOD_START("max_item_period_start"), + + @SerializedName("now") + NOW("now"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PriceData { @@ -1797,8 +2169,7 @@ public enum Type implements ApiRequestParams.EnumParam { @EqualsAndHashCode(callSuper = false) public static class BillingCycleAnchorConfig { /** - * Required. The day of the month the billing_cycle_anchor should be. Ranges - * from 1 to 31. + * Required. The day of the month the anchor should be. Ranges from 1 to 31. */ @SerializedName("day_of_month") Long dayOfMonth; @@ -1812,19 +2183,19 @@ public static class BillingCycleAnchorConfig { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. */ + /** The hour of the day the anchor should be. Ranges from 0 to 23. */ @SerializedName("hour") Long hour; - /** The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. */ + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ @SerializedName("minute") Long minute; - /** The month to start full cycle billing periods. Ranges from 1 to 12. */ + /** The month to start full cycle periods. Ranges from 1 to 12. */ @SerializedName("month") Long month; - /** The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. */ + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ @SerializedName("second") Long second; @@ -1867,8 +2238,7 @@ public SubscriptionCreateParams.BillingCycleAnchorConfig build() { } /** - * Required. The day of the month the billing_cycle_anchor should be. Ranges - * from 1 to 31. + * Required. The day of the month the anchor should be. Ranges from 1 to 31. */ public Builder setDayOfMonth(Long dayOfMonth) { this.dayOfMonth = dayOfMonth; @@ -1902,25 +2272,25 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The hour of the day the billing_cycle_anchor should be. Ranges from 0 to 23. */ + /** The hour of the day the anchor should be. Ranges from 0 to 23. */ public Builder setHour(Long hour) { this.hour = hour; return this; } - /** The minute of the hour the billing_cycle_anchor should be. Ranges from 0 to 59. */ + /** The minute of the hour the anchor should be. Ranges from 0 to 59. */ public Builder setMinute(Long minute) { this.minute = minute; return this; } - /** The month to start full cycle billing periods. Ranges from 1 to 12. */ + /** The month to start full cycle periods. Ranges from 1 to 12. */ public Builder setMonth(Long month) { this.month = month; return this; } - /** The second of the minute the billing_cycle_anchor should be. Ranges from 0 to 59. */ + /** The second of the minute the anchor should be. Ranges from 0 to 59. */ public Builder setSecond(Long second) { this.second = second; return this; diff --git a/src/main/java/com/stripe/param/SubscriptionListParams.java b/src/main/java/com/stripe/param/SubscriptionListParams.java index e60f0193a59..1a348e7fa44 100644 --- a/src/main/java/com/stripe/param/SubscriptionListParams.java +++ b/src/main/java/com/stripe/param/SubscriptionListParams.java @@ -28,11 +28,17 @@ public class SubscriptionListParams extends ApiRequestParams { @SerializedName("created") Object created; - /** Only return subscriptions whose current_period_end falls within the given date interval. */ + /** + * Only return subscriptions whose minimum item current_period_end falls within the given date + * interval. + */ @SerializedName("current_period_end") Object currentPeriodEnd; - /** Only return subscriptions whose current_period_start falls within the given date interval. */ + /** + * Only return subscriptions whose maximum item current_period_start falls within the given date + * interval. + */ @SerializedName("current_period_start") Object currentPeriodStart; @@ -219,20 +225,27 @@ public Builder setCreated(Long created) { return this; } - /** Only return subscriptions whose current_period_end falls within the given date interval. */ + /** + * Only return subscriptions whose minimum item current_period_end falls within the given date + * interval. + */ public Builder setCurrentPeriodEnd(SubscriptionListParams.CurrentPeriodEnd currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } - /** Only return subscriptions whose current_period_end falls within the given date interval. */ + /** + * Only return subscriptions whose minimum item current_period_end falls within the given date + * interval. + */ public Builder setCurrentPeriodEnd(Long currentPeriodEnd) { this.currentPeriodEnd = currentPeriodEnd; return this; } /** - * Only return subscriptions whose current_period_start falls within the given date interval. + * Only return subscriptions whose maximum item current_period_start falls within the given date + * interval. */ public Builder setCurrentPeriodStart( SubscriptionListParams.CurrentPeriodStart currentPeriodStart) { @@ -241,7 +254,8 @@ public Builder setCurrentPeriodStart( } /** - * Only return subscriptions whose current_period_start falls within the given date interval. + * Only return subscriptions whose maximum item current_period_start falls within the given date + * interval. */ public Builder setCurrentPeriodStart(Long currentPeriodStart) { this.currentPeriodStart = currentPeriodStart; diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java index 0270cabd68c..7c7ab3da5e7 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleCreateParams.java @@ -2176,6 +2176,22 @@ public static class AddInvoiceItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the object + * in a structured format. Individual keys can be unset by posting an empty value to them. All + * keys can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + @SerializedName("period") + Period period; + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ @SerializedName("price") String price; @@ -2201,12 +2217,16 @@ public static class AddInvoiceItem { private AddInvoiceItem( List discounts, Map extraParams, + Map metadata, + Period period, String price, PriceData priceData, Long quantity, Object taxRates) { this.discounts = discounts; this.extraParams = extraParams; + this.metadata = metadata; + this.period = period; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -2222,6 +2242,10 @@ public static class Builder { private Map extraParams; + private Map metadata; + + private Period period; + private String price; private PriceData priceData; @@ -2235,6 +2259,8 @@ public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem build() { return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem( this.discounts, this.extraParams, + this.metadata, + this.period, this.price, this.priceData, this.quantity, @@ -2299,6 +2325,44 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem#metadata} for the field + * documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionScheduleCreateParams.Phase.AddInvoiceItem#metadata} for the + * field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + public Builder setPeriod( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period period) { + this.period = period; + return this; + } + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ public Builder setPrice(String price) { this.price = price; @@ -2472,6 +2536,333 @@ public Builder setPromotionCode(String promotionCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Period { + /** Required. End of the invoice item period. */ + @SerializedName("end") + End end; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Start of the invoice item period. */ + @SerializedName("start") + Start start; + + private Period(End end, Map extraParams, Start start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private End end; + + private Map extraParams; + + private Start start; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** Required. End of the invoice item period. */ + public Builder setEnd( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.End end) { + this.end = end; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period#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. Start of the invoice item period. */ + public Builder setStart( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.Start start) { + this.start = start; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class End { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + @SerializedName("type") + Type type; + + private End(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.End build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.End( + this.extraParams, this.timestamp, 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.Phase.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the end of the invoice item + * period. + */ + public Builder setType( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.End.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("min_item_period_end") + MIN_ITEM_PERIOD_END("min_item_period_end"), + + @SerializedName("phase_end") + PHASE_END("phase_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Start { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + @SerializedName("type") + Type type; + + private Start(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.Start build() { + return new SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.Start( + this.extraParams, this.timestamp, 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.Phase.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than + * or equal to {@code period.end}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + public Builder setType( + SubscriptionScheduleCreateParams.Phase.AddInvoiceItem.Period.Start.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("max_item_period_start") + MAX_ITEM_PERIOD_START("max_item_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PriceData { diff --git a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java index 20ef8fd960e..270c9eddf41 100644 --- a/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionScheduleUpdateParams.java @@ -2125,6 +2125,22 @@ public static class AddInvoiceItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the object + * in a structured format. Individual keys can be unset by posting an empty value to them. All + * keys can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + @SerializedName("period") + Period period; + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ @SerializedName("price") Object price; @@ -2150,12 +2166,16 @@ public static class AddInvoiceItem { private AddInvoiceItem( List discounts, Map extraParams, + Map metadata, + Period period, Object price, PriceData priceData, Long quantity, Object taxRates) { this.discounts = discounts; this.extraParams = extraParams; + this.metadata = metadata; + this.period = period; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -2171,6 +2191,10 @@ public static class Builder { private Map extraParams; + private Map metadata; + + private Period period; + private Object price; private PriceData priceData; @@ -2184,6 +2208,8 @@ public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem build() { return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem( this.discounts, this.extraParams, + this.metadata, + this.period, this.price, this.priceData, this.quantity, @@ -2248,6 +2274,44 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#metadata} for the field + * documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem#metadata} for the + * field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * The period associated with this invoice item. Defaults to the period of the underlying + * subscription that surrounds the start of the phase. + */ + public Builder setPeriod( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period period) { + this.period = period; + return this; + } + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ public Builder setPrice(String price) { this.price = price; @@ -2445,6 +2509,333 @@ public Builder setPromotionCode(EmptyParam promotionCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Period { + /** Required. End of the invoice item period. */ + @SerializedName("end") + End end; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Start of the invoice item period. */ + @SerializedName("start") + Start start; + + private Period(End end, Map extraParams, Start start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private End end; + + private Map extraParams; + + private Start start; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** Required. End of the invoice item period. */ + public Builder setEnd( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End end) { + this.end = end; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period#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. Start of the invoice item period. */ + public Builder setStart( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start start) { + this.start = start; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class End { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + @SerializedName("type") + Type type; + + private End(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End( + this.extraParams, this.timestamp, 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 + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the end of the invoice item + * period. + */ + public Builder setType( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.End.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("min_item_period_end") + MIN_ITEM_PERIOD_END("min_item_period_end"), + + @SerializedName("phase_end") + PHASE_END("phase_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Start { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + @SerializedName("type") + Type type; + + private Start(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start build() { + return new SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start( + this.extraParams, this.timestamp, 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 + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than + * or equal to {@code period.end}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + public Builder setType( + SubscriptionScheduleUpdateParams.Phase.AddInvoiceItem.Period.Start.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("max_item_period_start") + MAX_ITEM_PERIOD_START("max_item_period_start"), + + @SerializedName("phase_start") + PHASE_START("phase_start"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PriceData { diff --git a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java index 442aea6742a..5d7f25626e0 100644 --- a/src/main/java/com/stripe/param/SubscriptionUpdateParams.java +++ b/src/main/java/com/stripe/param/SubscriptionUpdateParams.java @@ -1121,6 +1121,22 @@ public static class AddInvoiceItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Map metadata; + + /** + * The period associated with this invoice item. Defaults to the current period of the + * subscription. + */ + @SerializedName("period") + Period period; + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ @SerializedName("price") Object price; @@ -1146,12 +1162,16 @@ public static class AddInvoiceItem { private AddInvoiceItem( List discounts, Map extraParams, + Map metadata, + Period period, Object price, PriceData priceData, Long quantity, Object taxRates) { this.discounts = discounts; this.extraParams = extraParams; + this.metadata = metadata; + this.period = period; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -1167,6 +1187,10 @@ public static class Builder { private Map extraParams; + private Map metadata; + + private Period period; + private Object price; private PriceData priceData; @@ -1180,6 +1204,8 @@ public SubscriptionUpdateParams.AddInvoiceItem build() { return new SubscriptionUpdateParams.AddInvoiceItem( this.discounts, this.extraParams, + this.metadata, + this.period, this.price, this.priceData, this.quantity, @@ -1240,6 +1266,41 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SubscriptionUpdateParams.AddInvoiceItem#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SubscriptionUpdateParams.AddInvoiceItem#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + + /** + * The period associated with this invoice item. Defaults to the current period of the + * subscription. + */ + public Builder setPeriod(SubscriptionUpdateParams.AddInvoiceItem.Period period) { + this.period = period; + return this; + } + /** The ID of the price object. One of {@code price} or {@code price_data} is required. */ public Builder setPrice(String price) { this.price = price; @@ -1431,6 +1492,317 @@ public Builder setPromotionCode(EmptyParam promotionCode) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Period { + /** Required. End of the invoice item period. */ + @SerializedName("end") + End end; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-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. Start of the invoice item period. */ + @SerializedName("start") + Start start; + + private Period(End end, Map extraParams, Start start) { + this.end = end; + this.extraParams = extraParams; + this.start = start; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private End end; + + private Map extraParams; + + private Start start; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.AddInvoiceItem.Period build() { + return new SubscriptionUpdateParams.AddInvoiceItem.Period( + this.end, this.extraParams, this.start); + } + + /** Required. End of the invoice item period. */ + public Builder setEnd(SubscriptionUpdateParams.AddInvoiceItem.Period.End end) { + this.end = end; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.AddInvoiceItem.Period#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.AddInvoiceItem.Period#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. Start of the invoice item period. */ + public Builder setStart(SubscriptionUpdateParams.AddInvoiceItem.Period.Start start) { + this.start = start; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class End { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than or + * equal to {@code period.start}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + @SerializedName("type") + Type type; + + private End(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.AddInvoiceItem.Period.End build() { + return new SubscriptionUpdateParams.AddInvoiceItem.Period.End( + this.extraParams, this.timestamp, 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 SubscriptionUpdateParams.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.AddInvoiceItem.Period.End#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the end of the invoice item period. Must be greater than + * or equal to {@code period.start}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the end of the invoice item period. + */ + public Builder setType(SubscriptionUpdateParams.AddInvoiceItem.Period.End.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("min_item_period_end") + MIN_ITEM_PERIOD_END("min_item_period_end"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Start { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + @SerializedName("timestamp") + Long timestamp; + + /** + * Required. Select how to calculate the start of the invoice item period. + */ + @SerializedName("type") + Type type; + + private Start(Map extraParams, Long timestamp, Type type) { + this.extraParams = extraParams; + this.timestamp = timestamp; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long timestamp; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public SubscriptionUpdateParams.AddInvoiceItem.Period.Start build() { + return new SubscriptionUpdateParams.AddInvoiceItem.Period.Start( + this.extraParams, this.timestamp, 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 SubscriptionUpdateParams.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SubscriptionUpdateParams.AddInvoiceItem.Period.Start#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * A precise Unix timestamp for the start of the invoice item period. Must be less than or + * equal to {@code period.end}. + */ + public Builder setTimestamp(Long timestamp) { + this.timestamp = timestamp; + return this; + } + + /** + * Required. Select how to calculate the start of the invoice item + * period. + */ + public Builder setType(SubscriptionUpdateParams.AddInvoiceItem.Period.Start.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("max_item_period_start") + MAX_ITEM_PERIOD_START("max_item_period_start"), + + @SerializedName("now") + NOW("now"), + + @SerializedName("timestamp") + TIMESTAMP("timestamp"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PriceData { diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index 9bec31706ad..86aa5ae65b0 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -624,7 +624,10 @@ public enum ApiVersion implements ApiRequestParams.EnumParam { VERSION_2025_06_30_BASIL("2025-06-30.basil"), @SerializedName("2025-07-30.basil") - VERSION_2025_07_30_BASIL("2025-07-30.basil"); + VERSION_2025_07_30_BASIL("2025-07-30.basil"), + + @SerializedName("2025-08-27.basil") + VERSION_2025_08_27_BASIL("2025-08-27.basil"); @Getter(onMethod_ = {@Override}) private final String value; diff --git a/src/main/java/com/stripe/param/billing/MeterCreateParams.java b/src/main/java/com/stripe/param/billing/MeterCreateParams.java index 603fc90340b..2081cf3fe27 100644 --- a/src/main/java/com/stripe/param/billing/MeterCreateParams.java +++ b/src/main/java/com/stripe/param/billing/MeterCreateParams.java @@ -32,7 +32,7 @@ public class MeterCreateParams extends ApiRequestParams { @SerializedName("event_name") String eventName; - /** The time window to pre-aggregate meter events for, if any. */ + /** The time window which meter events have been pre-aggregated for, if any. */ @SerializedName("event_time_window") EventTimeWindow eventTimeWindow; @@ -133,7 +133,7 @@ public Builder setEventName(String eventName) { return this; } - /** The time window to pre-aggregate meter events for, if any. */ + /** The time window which meter events have been pre-aggregated for, if any. */ public Builder setEventTimeWindow(MeterCreateParams.EventTimeWindow eventTimeWindow) { this.eventTimeWindow = eventTimeWindow; return this; diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java index ae5e12548f6..bb3be2904af 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java @@ -61,6 +61,10 @@ public class ConfigurationCreateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** The name of the configuration. */ + @SerializedName("name") + Object name; + private ConfigurationCreateParams( BusinessProfile businessProfile, Object defaultReturnUrl, @@ -68,7 +72,8 @@ private ConfigurationCreateParams( Map extraParams, Features features, LoginPage loginPage, - Map metadata) { + Map metadata, + Object name) { this.businessProfile = businessProfile; this.defaultReturnUrl = defaultReturnUrl; this.expand = expand; @@ -76,6 +81,7 @@ private ConfigurationCreateParams( this.features = features; this.loginPage = loginPage; this.metadata = metadata; + this.name = name; } public static Builder builder() { @@ -97,6 +103,8 @@ public static class Builder { private Map metadata; + private Object name; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationCreateParams build() { return new ConfigurationCreateParams( @@ -106,7 +114,8 @@ public ConfigurationCreateParams build() { this.extraParams, this.features, this.loginPage, - this.metadata); + this.metadata, + this.name); } /** The business information shown to customers in the portal. */ @@ -231,6 +240,18 @@ public Builder putAllMetadata(Map map) { this.metadata.putAll(map); return this; } + + /** The name of the configuration. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The name of the configuration. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java index 110944aed30..87418baeec9 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java @@ -65,6 +65,10 @@ public class ConfigurationUpdateParams extends ApiRequestParams { @SerializedName("metadata") Object metadata; + /** The name of the configuration. */ + @SerializedName("name") + Object name; + private ConfigurationUpdateParams( Boolean active, BusinessProfile businessProfile, @@ -73,7 +77,8 @@ private ConfigurationUpdateParams( Map extraParams, Features features, LoginPage loginPage, - Object metadata) { + Object metadata, + Object name) { this.active = active; this.businessProfile = businessProfile; this.defaultReturnUrl = defaultReturnUrl; @@ -82,6 +87,7 @@ private ConfigurationUpdateParams( this.features = features; this.loginPage = loginPage; this.metadata = metadata; + this.name = name; } public static Builder builder() { @@ -105,6 +111,8 @@ public static class Builder { private Object metadata; + private Object name; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationUpdateParams build() { return new ConfigurationUpdateParams( @@ -115,7 +123,8 @@ public ConfigurationUpdateParams build() { this.extraParams, this.features, this.loginPage, - this.metadata); + this.metadata, + this.name); } /** Whether the configuration is active and can be used to create portal sessions. */ @@ -270,6 +279,18 @@ public Builder setMetadata(Map metadata) { this.metadata = metadata; return this; } + + /** The name of the configuration. */ + public Builder setName(String name) { + this.name = name; + return this; + } + + /** The name of the configuration. */ + public Builder setName(EmptyParam name) { + this.name = name; + return this; + } } @Getter diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 2edcefa567b..bfb540a7e3d 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -231,9 +231,6 @@ public class SessionCreateParams extends ApiRequestParams { /** * Where the user is coming from. This informs the optimizations that are applied to the session. - * For example, a session originating from a mobile app may behave more like a native app, - * depending on the platform. This parameter is currently not allowed if {@code ui_mode} is {@code - * custom}. */ @SerializedName("origin_context") OriginContext originContext; @@ -1003,9 +1000,7 @@ public Builder addAllOptionalItem(List element /** * Where the user is coming from. This informs the optimizations that are applied to the - * session. For example, a session originating from a mobile app may behave more like a native - * app, depending on the platform. This parameter is currently not allowed if {@code ui_mode} is - * {@code custom}. + * session. */ public Builder setOriginContext(SessionCreateParams.OriginContext originContext) { this.originContext = originContext; @@ -1244,10 +1239,10 @@ public Builder setWalletOptions(SessionCreateParams.WalletOptions walletOptions) @EqualsAndHashCode(callSuper = false) public static class AdaptivePricing { /** - * Set to {@code true} to enable Adaptive Pricing. - * Defaults to your dashboard - * setting. + * If set to {@code true}, Adaptive Pricing is available on eligible + * sessions. Defaults to your dashboard setting. */ @SerializedName("enabled") Boolean enabled; @@ -1281,10 +1276,10 @@ public SessionCreateParams.AdaptivePricing build() { } /** - * Set to {@code true} to enable Adaptive Pricing. - * Defaults to your dashboard - * setting. + * If set to {@code true}, Adaptive Pricing is available on eligible + * sessions. Defaults to your dashboard setting. */ public Builder setEnabled(Boolean enabled) { this.enabled = enabled; @@ -12574,6 +12569,10 @@ public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Pix { + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + @SerializedName("amount_includes_iof") + AmountIncludesIof amountIncludesIof; + /** * The number of seconds (between 10 and 1209600) after which Pix payment will expire. * Defaults to 86400 seconds. @@ -12613,9 +12612,11 @@ public static class Pix { SetupFutureUsage setupFutureUsage; private Pix( + AmountIncludesIof amountIncludesIof, Long expiresAfterSeconds, Map extraParams, SetupFutureUsage setupFutureUsage) { + this.amountIncludesIof = amountIncludesIof; this.expiresAfterSeconds = expiresAfterSeconds; this.extraParams = extraParams; this.setupFutureUsage = setupFutureUsage; @@ -12626,6 +12627,8 @@ public static Builder builder() { } public static class Builder { + private AmountIncludesIof amountIncludesIof; + private Long expiresAfterSeconds; private Map extraParams; @@ -12635,7 +12638,17 @@ public static class Builder { /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.PaymentMethodOptions.Pix build() { return new SessionCreateParams.PaymentMethodOptions.Pix( - this.expiresAfterSeconds, this.extraParams, this.setupFutureUsage); + this.amountIncludesIof, + this.expiresAfterSeconds, + this.extraParams, + this.setupFutureUsage); + } + + /** Determines if the amount includes the IOF tax. Defaults to {@code never}. */ + public Builder setAmountIncludesIof( + SessionCreateParams.PaymentMethodOptions.Pix.AmountIncludesIof amountIncludesIof) { + this.amountIncludesIof = amountIncludesIof; + return this; } /** @@ -12702,6 +12715,21 @@ public Builder setSetupFutureUsage( } } + public enum AmountIncludesIof implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + AmountIncludesIof(String value) { + this.value = value; + } + } + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { @SerializedName("none") NONE("none"); diff --git a/src/main/java/com/stripe/param/issuing/CardCreateParams.java b/src/main/java/com/stripe/param/issuing/CardCreateParams.java index c7f5247f253..74b78490be4 100644 --- a/src/main/java/com/stripe/param/issuing/CardCreateParams.java +++ b/src/main/java/com/stripe/param/issuing/CardCreateParams.java @@ -25,6 +25,22 @@ public class CardCreateParams extends ApiRequestParams { @SerializedName("currency") String currency; + /** + * The desired expiration month (1-12) for this card if specifying + * a custom expiration date. + */ + @SerializedName("exp_month") + Long expMonth; + + /** + * The desired 4-digit expiration year for this card if specifying + * a custom expiration date. + */ + @SerializedName("exp_year") + Long expYear; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -105,6 +121,8 @@ public class CardCreateParams extends ApiRequestParams { private CardCreateParams( String cardholder, String currency, + Long expMonth, + Long expYear, List expand, Map extraParams, String financialAccount, @@ -120,6 +138,8 @@ private CardCreateParams( Type type) { this.cardholder = cardholder; this.currency = currency; + this.expMonth = expMonth; + this.expYear = expYear; this.expand = expand; this.extraParams = extraParams; this.financialAccount = financialAccount; @@ -144,6 +164,10 @@ public static class Builder { private String currency; + private Long expMonth; + + private Long expYear; + private List expand; private Map extraParams; @@ -175,6 +199,8 @@ public CardCreateParams build() { return new CardCreateParams( this.cardholder, this.currency, + this.expMonth, + this.expYear, this.expand, this.extraParams, this.financialAccount, @@ -205,6 +231,26 @@ public Builder setCurrency(String currency) { return this; } + /** + * The desired expiration month (1-12) for this card if specifying + * a custom expiration date. + */ + public Builder setExpMonth(Long expMonth) { + this.expMonth = expMonth; + return this; + } + + /** + * The desired 4-digit expiration year for this card if specifying + * a custom expiration date. + */ + public Builder setExpYear(Long expYear) { + this.expYear = expYear; + 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 diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index 4b96784ac91..c19d0be2d03 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -622,6 +622,10 @@ public static class Tipping { @SerializedName("jpy") Jpy jpy; + /** Tipping configuration for MXN. */ + @SerializedName("mxn") + Mxn mxn; + /** Tipping configuration for MYR. */ @SerializedName("myr") Myr myr; @@ -668,6 +672,7 @@ private Tipping( Hkd hkd, Huf huf, Jpy jpy, + Mxn mxn, Myr myr, Nok nok, Nzd nzd, @@ -689,6 +694,7 @@ private Tipping( this.hkd = hkd; this.huf = huf; this.jpy = jpy; + this.mxn = mxn; this.myr = myr; this.nok = nok; this.nzd = nzd; @@ -730,6 +736,8 @@ public static class Builder { private Jpy jpy; + private Mxn mxn; + private Myr myr; private Nok nok; @@ -762,6 +770,7 @@ public ConfigurationCreateParams.Tipping build() { this.hkd, this.huf, this.jpy, + this.mxn, this.myr, this.nok, this.nzd, @@ -870,6 +879,12 @@ public Builder setJpy(ConfigurationCreateParams.Tipping.Jpy jpy) { return this; } + /** Tipping configuration for MXN. */ + public Builder setMxn(ConfigurationCreateParams.Tipping.Mxn mxn) { + this.mxn = mxn; + return this; + } + /** Tipping configuration for MYR. */ public Builder setMyr(ConfigurationCreateParams.Tipping.Myr myr) { this.myr = myr; @@ -2695,6 +2710,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Mxn { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Mxn( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationCreateParams.Tipping.Mxn build() { + return new ConfigurationCreateParams.Tipping.Mxn( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationCreateParams.Tipping.Mxn#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationCreateParams.Tipping.Mxn#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Mxn#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Mxn#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Mxn#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Mxn#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Myr { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 19a7ca81a31..5dce706c41c 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -652,6 +652,10 @@ public static class Tipping { @SerializedName("jpy") Jpy jpy; + /** Tipping configuration for MXN. */ + @SerializedName("mxn") + Mxn mxn; + /** Tipping configuration for MYR. */ @SerializedName("myr") Myr myr; @@ -698,6 +702,7 @@ private Tipping( Hkd hkd, Huf huf, Jpy jpy, + Mxn mxn, Myr myr, Nok nok, Nzd nzd, @@ -719,6 +724,7 @@ private Tipping( this.hkd = hkd; this.huf = huf; this.jpy = jpy; + this.mxn = mxn; this.myr = myr; this.nok = nok; this.nzd = nzd; @@ -760,6 +766,8 @@ public static class Builder { private Jpy jpy; + private Mxn mxn; + private Myr myr; private Nok nok; @@ -792,6 +800,7 @@ public ConfigurationUpdateParams.Tipping build() { this.hkd, this.huf, this.jpy, + this.mxn, this.myr, this.nok, this.nzd, @@ -900,6 +909,12 @@ public Builder setJpy(ConfigurationUpdateParams.Tipping.Jpy jpy) { return this; } + /** Tipping configuration for MXN. */ + public Builder setMxn(ConfigurationUpdateParams.Tipping.Mxn mxn) { + this.mxn = mxn; + return this; + } + /** Tipping configuration for MYR. */ public Builder setMyr(ConfigurationUpdateParams.Tipping.Myr myr) { this.myr = myr; @@ -2725,6 +2740,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Mxn { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Mxn( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationUpdateParams.Tipping.Mxn build() { + return new ConfigurationUpdateParams.Tipping.Mxn( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationUpdateParams.Tipping.Mxn#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationUpdateParams.Tipping.Mxn#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Mxn#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Mxn#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Mxn#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Mxn#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Myr { diff --git a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java index eadc8cd74ef..e2fb109db94 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -17,6 +17,10 @@ public class ReaderPresentPaymentMethodParams extends ApiRequestParams { @SerializedName("amount_tip") Long amountTip; + /** Simulated data for the card payment method. */ + @SerializedName("card") + Card card; + /** Simulated data for the card_present payment method. */ @SerializedName("card_present") CardPresent cardPresent; @@ -44,12 +48,14 @@ public class ReaderPresentPaymentMethodParams extends ApiRequestParams { private ReaderPresentPaymentMethodParams( Long amountTip, + Card card, CardPresent cardPresent, List expand, Map extraParams, InteracPresent interacPresent, Type type) { this.amountTip = amountTip; + this.card = card; this.cardPresent = cardPresent; this.expand = expand; this.extraParams = extraParams; @@ -64,6 +70,8 @@ public static Builder builder() { public static class Builder { private Long amountTip; + private Card card; + private CardPresent cardPresent; private List expand; @@ -78,6 +86,7 @@ public static class Builder { public ReaderPresentPaymentMethodParams build() { return new ReaderPresentPaymentMethodParams( this.amountTip, + this.card, this.cardPresent, this.expand, this.extraParams, @@ -91,6 +100,12 @@ public Builder setAmountTip(Long amountTip) { return this; } + /** Simulated data for the card payment method. */ + public Builder setCard(ReaderPresentPaymentMethodParams.Card card) { + this.card = card; + return this; + } + /** Simulated data for the card_present payment method. */ public Builder setCardPresent(ReaderPresentPaymentMethodParams.CardPresent cardPresent) { this.cardPresent = cardPresent; @@ -163,6 +178,121 @@ public Builder setType(ReaderPresentPaymentMethodParams.Type type) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Card { + /** Card security code. */ + @SerializedName("cvc") + String cvc; + + /** Required. Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** + * Required. Two- or four-digit number representing the card's expiration year. + */ + @SerializedName("exp_year") + Long expYear; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. The card number, as a string without any separators. */ + @SerializedName("number") + String number; + + private Card( + String cvc, Long expMonth, Long expYear, Map extraParams, String number) { + this.cvc = cvc; + this.expMonth = expMonth; + this.expYear = expYear; + this.extraParams = extraParams; + this.number = number; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String cvc; + + private Long expMonth; + + private Long expYear; + + private Map extraParams; + + private String number; + + /** Finalize and obtain parameter instance from this builder. */ + public ReaderPresentPaymentMethodParams.Card build() { + return new ReaderPresentPaymentMethodParams.Card( + this.cvc, this.expMonth, this.expYear, this.extraParams, this.number); + } + + /** Card security code. */ + public Builder setCvc(String cvc) { + this.cvc = cvc; + return this; + } + + /** Required. Two-digit number representing the card's expiration month. */ + public Builder setExpMonth(Long expMonth) { + this.expMonth = expMonth; + return this; + } + + /** + * Required. Two- or four-digit number representing the card's expiration + * year. + */ + public Builder setExpYear(Long expYear) { + this.expYear = expYear; + 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 + * ReaderPresentPaymentMethodParams.Card#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link ReaderPresentPaymentMethodParams.Card#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. The card number, as a string without any separators. */ + public Builder setNumber(String number) { + this.number = number; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CardPresent { @@ -304,6 +434,9 @@ public Builder setNumber(String number) { } public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("card") + CARD("card"), + @SerializedName("card_present") CARD_PRESENT("card_present"), diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index 4536562e132..dd1bdc86832 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -24361,6 +24361,35 @@ public void testWebhookEndpointsPost2ServicesNonNamespaced() throws StripeExcept null); } + @Test + public void testV2BillingMeterEventPostServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/meter_events", + null, + null, + com.stripe.model.v2.billing.MeterEvent.class, + "{\"created\":\"1970-01-12T21:42:34.472Z\",\"event_name\":\"event_name\",\"identifier\":\"identifier\",\"object\":\"v2.billing.meter_event\",\"payload\":{\"key\":\"payload\"},\"timestamp\":\"1970-01-01T15:18:46.294Z\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.billing.MeterEventCreateParams params = + com.stripe.param.v2.billing.MeterEventCreateParams.builder() + .setEventName("event_name") + .putPayload("key", "payload") + .build(); + + com.stripe.model.v2.billing.MeterEvent meterEvent = + client.v2().billing().meterEvents().create(params); + assertNotNull(meterEvent); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/billing/meter_events", + params.toMap(), + null); + } + @Test public void testV2BillingMeterEventAdjustmentPostServices() throws StripeException { stubRequest( @@ -24450,32 +24479,44 @@ public void testV2BillingMeterEventStreamPostServices() throws StripeException { } @Test - public void testV2BillingMeterEventPostServices() throws StripeException { + public void testV2CoreEventGetServices() throws StripeException { stubRequest( BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/billing/meter_events", + ApiResource.RequestMethod.GET, + "/v2/core/events", null, null, - com.stripe.model.v2.billing.MeterEvent.class, - "{\"created\":\"1970-01-12T21:42:34.472Z\",\"event_name\":\"event_name\",\"identifier\":\"identifier\",\"object\":\"v2.billing.meter_event\",\"payload\":{\"key\":\"payload\"},\"timestamp\":\"1970-01-01T15:18:46.294Z\",\"livemode\":true}"); + new TypeToken< + com.stripe.model.v2.StripeCollection>() {}.getType(), + "{\"data\":[{\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"reason\":null,\"type\":\"type\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); StripeClient client = new StripeClient(networkSpy); - com.stripe.param.v2.billing.MeterEventCreateParams params = - com.stripe.param.v2.billing.MeterEventCreateParams.builder() - .setEventName("event_name") - .putPayload("key", "payload") - .build(); + com.stripe.param.v2.core.EventListParams params = + com.stripe.param.v2.core.EventListParams.builder().setObjectId("object_id").build(); - com.stripe.model.v2.billing.MeterEvent meterEvent = - client.v2().billing().meterEvents().create(params); - assertNotNull(meterEvent); + com.stripe.model.v2.StripeCollection stripeCollection = + client.v2().core().events().list(params); + assertNotNull(stripeCollection); verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events", params.toMap(), null); + } + + @Test + public void testV2CoreEventGet2Services() throws StripeException { + stubRequest( BaseAddress.API, - ApiResource.RequestMethod.POST, - "/v2/billing/meter_events", - params.toMap(), - null); + ApiResource.RequestMethod.GET, + "/v2/core/events/id_123", + 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}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.Event event = client.v2().core().events().retrieve("id_123"); + assertNotNull(event); + verifyRequest( + BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events/id_123", null, null); } @Test @@ -24681,47 +24722,6 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } - @Test - public void testV2CoreEventGetServices() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/events", - null, - null, - new TypeToken< - com.stripe.model.v2.StripeCollection>() {}.getType(), - "{\"data\":[{\"context\":null,\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.core.event\",\"reason\":null,\"type\":\"type\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.param.v2.core.EventListParams params = - com.stripe.param.v2.core.EventListParams.builder().setObjectId("object_id").build(); - - com.stripe.model.v2.StripeCollection stripeCollection = - client.v2().core().events().list(params); - assertNotNull(stripeCollection); - verifyRequest( - BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events", params.toMap(), null); - } - - @Test - public void testV2CoreEventGet2Services() throws StripeException { - stubRequest( - BaseAddress.API, - ApiResource.RequestMethod.GET, - "/v2/core/events/id_123", - 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}"); - StripeClient client = new StripeClient(networkSpy); - - com.stripe.model.v2.Event event = client.v2().core().events().retrieve("id_123"); - assertNotNull(event); - verifyRequest( - BaseAddress.API, ApiResource.RequestMethod.GET, "/v2/core/events/id_123", null, null); - } - @Test public void testTemporarySessionExpiredErrorServices() throws StripeException { stubRequestReturnError(