diff --git a/CHANGELOG.md b/CHANGELOG.md index c459cd0c45f..f25279a1113 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,27 @@ # Changelog +## 28.1.0 - 2024-11-20 +* [#1923](https://github.com/stripe/stripe-java/pull/1923) This release changes the pinned API version to `2024-11-20.acacia`. + * Add support for `respond` test helper method on resource `Issuing.Authorization` + * Add support for `authorizer` on `AccountPersonsParams.relationship` and `TokenCreateParams.person.relationship` + * Add support for `adaptive_pricing` on `Checkout.Session` and `checkout.SessionCreateParams` + * Add support for `mandate_options` on `Checkout.Session.payment_method_options.bacs_debit`, `Checkout.Session.payment_method_options.sepa_debit`, `checkout.SessionCreateParams.payment_method_options.bacs_debit`, and `checkout.SessionCreateParams.payment_method_options.sepa_debit` + * Add support for `request_extended_authorization`, `request_incremental_authorization`, `request_multicapture`, and `request_overcapture` on `Checkout.Session.payment_method_options.card` and `checkout.SessionCreateParams.payment_method_options.card` + * Add support for `capture_method` on `checkout.SessionCreateParams.payment_method_options.kakao_pay`, `checkout.SessionCreateParams.payment_method_options.kr_card`, `checkout.SessionCreateParams.payment_method_options.naver_pay`, `checkout.SessionCreateParams.payment_method_options.payco`, and `checkout.SessionCreateParams.payment_method_options.samsung_pay` + * Add support for new value `subscribe` on enums `PaymentLinkCreateParams.submit_type` and `checkout.SessionCreateParams.submit_type` + * Add support for new value `li_vat` on enums `CustomerCreateParams.tax_id_data[].type`, `InvoiceCreatePreviewParams.customer_details.tax_ids[].type`, `InvoiceUpcomingLinesParams.customer_details.tax_ids[].type`, `InvoiceUpcomingParams.customer_details.tax_ids[].type`, `TaxIdCreateParams.type`, and `tax.CalculationCreateParams.customer_details.tax_ids[].type` + * Add support for new value `financial_account_statement` on enum `FileListParams.purpose` + * Add support for `account_holder_address`, `account_holder_name`, `account_type`, and `bank_address` on `FundingInstructions.bank_transfer.financial_addresses[].aba`, `FundingInstructions.bank_transfer.financial_addresses[].swift`, `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].aba`, and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].swift` + * Add support for new value `service_tax` on enums `InvoiceAddLinesParams.lines[].tax_amounts[].tax_rate_data.tax_type`, `InvoiceUpdateLinesParams.lines[].tax_amounts[].tax_rate_data.tax_type`, `TaxRateCreateParams.tax_type`, and `TaxRateUpdateParams.tax_type` + * Add support for `merchant_amount` and `merchant_currency` on `issuing.AuthorizationCreateParams` + * Change `issuing.AuthorizationCreateParams.amount` to be optional + * Add support for `fraud_challenges` and `verified_by_fraud_challenge` on `Issuing.Authorization` + * Add support for new value `link` on enums `PaymentIntentConfirmParams.payment_method_options.card.network`, `PaymentIntentCreateParams.payment_method_options.card.network`, `PaymentIntentUpdateParams.payment_method_options.card.network`, `SetupIntentConfirmParams.payment_method_options.card.network`, `SetupIntentCreateParams.payment_method_options.card.network`, `SetupIntentUpdateParams.payment_method_options.card.network`, `SubscriptionCreateParams.payment_settings.payment_method_options.card.network`, and `SubscriptionUpdateParams.payment_settings.payment_method_options.card.network` + * Add support for `submit_type` on `PaymentLinkUpdateParams` + * Add support for `trace_id` on `Payout` + * Add support for `network_decline_code` on `Refund.destination_details.blik` and `Refund.destination_details.swish` + * Add support for new value `2024-11-20.acacia` on enum `WebhookEndpointCreateParams.api_version` + ## 28.1.0-beta.3 - 2024-11-14 * [#1922](https://github.com/stripe/stripe-java/pull/1922) Update generated code for beta * Add support for `account_holder_address` and `bank_address` on `FundingInstructions.bank_transfer.financial_addresses[].iban`, `FundingInstructions.bank_transfer.financial_addresses[].sort_code`, `FundingInstructions.bank_transfer.financial_addresses[].spei`, `FundingInstructions.bank_transfer.financial_addresses[].zengin`, `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].iban`, `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].sort_code`, `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].spei`, and `PaymentIntent.next_action.display_bank_transfer_instructions.financial_addresses[].zengin` @@ -44,8 +66,6 @@ ## 28.0.1 - 2024-11-06 * [#1919](https://github.com/stripe/stripe-java/pull/1919) Catch `JsonSyntaxException` when processing all errors -* [#1916](https://github.com/stripe/stripe-java/pull/1916) Restore `testReportsRawRequestUsageTelemetry` test -* [#1915](https://github.com/stripe/stripe-java/pull/1915) add major version blurb to changelog ## 28.0.0 - 2024-10-29 diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index 20cbdd30484..0380667751b 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v1356 \ No newline at end of file +v1370 \ No newline at end of file diff --git a/src/main/java/com/stripe/model/AccountSession.java b/src/main/java/com/stripe/model/AccountSession.java index ea1c2feaa05..eefb39a4b44 100644 --- a/src/main/java/com/stripe/model/AccountSession.java +++ b/src/main/java/com/stripe/model/AccountSession.java @@ -193,10 +193,10 @@ public static class AccountManagement extends StripeObject { public static class Features extends StripeObject { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -238,10 +238,10 @@ public static class AccountOnboarding extends StripeObject { public static class Features extends StripeObject { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -283,10 +283,10 @@ public static class Balances extends StripeObject { public static class Features extends StripeObject { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -449,10 +449,10 @@ public static class NotificationBanner extends StripeObject { public static class Features extends StripeObject { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -594,10 +594,10 @@ public static class Payouts extends StripeObject { public static class Features extends StripeObject { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 95f47a4bd4e..42034e3ed55 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -1028,6 +1028,20 @@ public static class LineItem extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Outcome extends StripeObject { + /** + * For charges declined by the network, a 2 digit code which indicates the advice returned by + * the network on how to proceed with an error. + */ + @SerializedName("network_advice_code") + String networkAdviceCode; + + /** + * For charges declined by the network, a brand specific 2, 3, or 4 digit code which indicates + * the reason the authorization failed. + */ + @SerializedName("network_decline_code") + String networkDeclineCode; + /** * Possible values are {@code approved_by_network}, {@code declined_by_network}, {@code * not_sent_to_network}, and {@code reversed_after_approval}. The value {@code @@ -1497,7 +1511,73 @@ public static class Alma extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class AmazonPay extends StripeObject {} + public static class AmazonPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } /** * For more details about AuBecsDebit, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PartialAuthorization extends StripeObject { + /** + * Indicates whether the transaction requested for partial authorization feature and the + * authorization outcome. + * + *

One of {@code declined}, {@code fully_authorized}, {@code not_requested}, or {@code + * partially_authorized}. + */ + @SerializedName("status") + String status; + } + /** * For more details about ThreeDSecure, please refer to the API Reference. @@ -3445,7 +3551,73 @@ public static class Rechnung extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class RevolutPay extends StripeObject {} + public static class RevolutPay extends StripeObject { + @SerializedName("funding") + Funding funding; + + /** + * For more details about Funding, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Funding extends StripeObject { + @SerializedName("card") + Card card; + + /** + * funding type of the underlying payment method. + * + *

Equal to {@code card}. + */ + @SerializedName("type") + String type; + + /** + * For more details about Card, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Card extends StripeObject { + /** + * Card brand. Can be {@code amex}, {@code diners}, {@code discover}, {@code eftpos_au}, + * {@code jcb}, {@code link}, {@code mastercard}, {@code unionpay}, {@code visa}, or + * {@code unknown}. + */ + @SerializedName("brand") + String brand; + + /** + * Two-letter ISO code representing the country of the card. You could use this attribute + * to get a sense of the international breakdown of cards you've collected. + */ + @SerializedName("country") + String country; + + /** Two-digit number representing the card's expiration month. */ + @SerializedName("exp_month") + Long expMonth; + + /** Four-digit number representing the card's expiration year. */ + @SerializedName("exp_year") + Long expYear; + + /** + * Card funding type. Can be {@code credit}, {@code debit}, {@code prepaid}, or {@code + * unknown}. + */ + @SerializedName("funding") + String funding; + + /** The last four digits of the card. */ + @SerializedName("last4") + String last4; + } + } + } /** * For more details about SamsungPay, please refer to the discounts; + @SerializedName("display") + Display display; + /** Unique identifier for the object. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") String id; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. + */ + @SerializedName("metadata") + Map metadata; + /** * String representing the object's type. Objects of the same type share the same value. * @@ -100,6 +115,24 @@ public void setProductObject(Product expandableObject) { this.product = new ExpandableField(expandableObject.getId(), expandableObject); } + /** + * For more details about AdjustableQuantity, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class AdjustableQuantity extends StripeObject { + @SerializedName("enabled") + Boolean enabled; + + @SerializedName("maximum") + Long maximum; + + @SerializedName("minimum") + Long minimum; + } + /** * For more details about Discount, please refer to the API * Reference. @@ -125,6 +158,24 @@ public static class Discount extends StripeObject { com.stripe.model.Discount discount; } + /** + * For more details about Display, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Display extends StripeObject { + @SerializedName("description") + String description; + + @SerializedName("images") + List images; + + @SerializedName("name") + String name; + } + /** * For more details about Tax, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/PaymentIntent.java b/src/main/java/com/stripe/model/PaymentIntent.java index 9d502f49767..a33b50ed677 100644 --- a/src/main/java/com/stripe/model/PaymentIntent.java +++ b/src/main/java/com/stripe/model/PaymentIntent.java @@ -3737,6 +3737,14 @@ public static class Card extends StripeObject { @SerializedName("request_overcapture") String requestOvercapture; + /** + * Request partial authorization on this PaymentIntent. + * + *

One of {@code if_available}, or {@code never}. + */ + @SerializedName("request_partial_authorization") + String requestPartialAuthorization; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and Default is {@code client_only}. Stripe Checkout client will automatically update the + * line items. If set to {@code server_only}, only your server is allowed to update the line + * items. + * + *

When set to {@code server_only}, you must add the onLineItemsChange event handler when + * initializing the Stripe Checkout client and manually update the line items from your server + * using the Stripe API. + * + *

One of {@code client_only}, or {@code server_only}. + */ + @SerializedName("line_items") + String lineItems; + /** * Determines which entity is allowed to update the shipping details. * diff --git a/src/main/java/com/stripe/param/AccountSessionCreateParams.java b/src/main/java/com/stripe/param/AccountSessionCreateParams.java index 55880118c46..62fea18419a 100644 --- a/src/main/java/com/stripe/param/AccountSessionCreateParams.java +++ b/src/main/java/com/stripe/param/AccountSessionCreateParams.java @@ -655,10 +655,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -713,10 +713,10 @@ public AccountSessionCreateParams.Components.AccountManagement.Features build() /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -858,10 +858,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -916,10 +916,10 @@ public AccountSessionCreateParams.Components.AccountOnboarding.Features build() /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -1446,10 +1446,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -1540,10 +1540,10 @@ public AccountSessionCreateParams.Components.Balances.Features build() { /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -2445,10 +2445,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -2515,10 +2515,10 @@ public AccountSessionCreateParams.Components.FinancialAccount.Features build() { /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -3266,10 +3266,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -3324,10 +3324,10 @@ public AccountSessionCreateParams.Components.NotificationBanner.Features build() /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { @@ -4065,10 +4065,10 @@ public Builder setFeatures( public static class Features { /** * Disables Stripe user authentication for this embedded component. This feature can only be - * false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this feature - * is {@code false} when {@code external_account_collection} is enabled and {@code true} - * otherwise. + * {@code true} for accounts where you’re responsible for collecting updated information + * when requirements are due or change, like Custom accounts. The default value for this + * feature is {@code false} when {@code external_account_collection} is enabled and {@code + * true} otherwise. */ @SerializedName("disable_stripe_user_authentication") Boolean disableStripeUserAuthentication; @@ -4159,10 +4159,10 @@ public AccountSessionCreateParams.Components.Payouts.Features build() { /** * Disables Stripe user authentication for this embedded component. This feature can only - * be false for accounts where you’re responsible for collecting updated information when - * requirements are due or change, like custom accounts. The default value for this - * feature is {@code false} when {@code external_account_collection} is enabled and {@code - * true} otherwise. + * be {@code true} for accounts where you’re responsible for collecting updated + * information when requirements are due or change, like Custom accounts. The default + * value for this feature is {@code false} when {@code external_account_collection} is + * enabled and {@code true} otherwise. */ public Builder setDisableStripeUserAuthentication( Boolean disableStripeUserAuthentication) { diff --git a/src/main/java/com/stripe/param/InvoiceCreateParams.java b/src/main/java/com/stripe/param/InvoiceCreateParams.java index 47f2ef78817..bbb525bfd4e 100644 --- a/src/main/java/com/stripe/param/InvoiceCreateParams.java +++ b/src/main/java/com/stripe/param/InvoiceCreateParams.java @@ -1996,6 +1996,7 @@ public static class PaymentSettings { * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ @SerializedName("payment_method_types") Object paymentMethodTypes; @@ -2126,6 +2127,7 @@ public Builder addAllPaymentMethodType( * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; @@ -2138,6 +2140,7 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ public Builder setPaymentMethodTypes( List paymentMethodTypes) { diff --git a/src/main/java/com/stripe/param/InvoiceUpdateParams.java b/src/main/java/com/stripe/param/InvoiceUpdateParams.java index 2528dcf0a99..7a6b5336bc5 100644 --- a/src/main/java/com/stripe/param/InvoiceUpdateParams.java +++ b/src/main/java/com/stripe/param/InvoiceUpdateParams.java @@ -2006,6 +2006,7 @@ public static class PaymentSettings { * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ @SerializedName("payment_method_types") Object paymentMethodTypes; @@ -2136,6 +2137,7 @@ public Builder addAllPaymentMethodType( * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { this.paymentMethodTypes = paymentMethodTypes; @@ -2148,6 +2150,7 @@ public Builder setPaymentMethodTypes(EmptyParam paymentMethodTypes) { * invoice’s default payment method, the subscription’s default payment method, the customer’s * default payment method, and your invoice template settings. + * Should not be specified with payment_method_configuration */ public Builder setPaymentMethodTypes( List paymentMethodTypes) { diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 02872b92ec4..6b2a957b49c 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -15036,6 +15036,10 @@ public static class Card { @SerializedName("request_overcapture") RequestOvercapture requestOvercapture; + /** Request partial authorization on this PaymentIntent. */ + @SerializedName("request_partial_authorization") + RequestPartialAuthorization requestPartialAuthorization; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and metadata; + /** Payment method-specific configuration for this PaymentIntent. */ + @SerializedName("payment_method_options") + PaymentMethodOptions paymentMethodOptions; + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -85,6 +89,7 @@ private PaymentIntentIncrementAuthorizationParams( List expand, Map extraParams, Map metadata, + PaymentMethodOptions paymentMethodOptions, String statementDescriptor, TransferData transferData) { this.amount = amount; @@ -94,6 +99,7 @@ private PaymentIntentIncrementAuthorizationParams( this.expand = expand; this.extraParams = extraParams; this.metadata = metadata; + this.paymentMethodOptions = paymentMethodOptions; this.statementDescriptor = statementDescriptor; this.transferData = transferData; } @@ -117,6 +123,8 @@ public static class Builder { private Map metadata; + private PaymentMethodOptions paymentMethodOptions; + private String statementDescriptor; private TransferData transferData; @@ -131,6 +139,7 @@ public PaymentIntentIncrementAuthorizationParams build() { this.expand, this.extraParams, this.metadata, + this.paymentMethodOptions, this.statementDescriptor, this.transferData); } @@ -248,6 +257,13 @@ public Builder putAllMetadata(Map map) { return this; } + /** Payment method-specific configuration for this PaymentIntent. */ + public Builder setPaymentMethodOptions( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions paymentMethodOptions) { + this.paymentMethodOptions = paymentMethodOptions; + return this; + } + /** * Text that appears on the customer's statement as the statement descriptor for a non-card or * card charge. This value overrides the account's default statement descriptor. For information @@ -507,6 +523,171 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + public static class PaymentMethodOptions { + /** Configuration for any card payments attempted on this PaymentIntent. */ + @SerializedName("card") + Card card; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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 PaymentMethodOptions(Card card, Map extraParams) { + this.card = card; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Card card; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions( + this.card, this.extraParams); + } + + /** Configuration for any card payments attempted on this PaymentIntent. */ + public Builder setCard( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card card) { + this.card = card; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + public static class Card { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Request partial authorization on this PaymentIntent. */ + @SerializedName("request_partial_authorization") + RequestPartialAuthorization requestPartialAuthorization; + + private Card( + Map extraParams, + RequestPartialAuthorization requestPartialAuthorization) { + this.extraParams = extraParams; + this.requestPartialAuthorization = requestPartialAuthorization; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private RequestPartialAuthorization requestPartialAuthorization; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card build() { + return new PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card( + this.extraParams, this.requestPartialAuthorization); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Request partial authorization on this PaymentIntent. */ + public Builder setRequestPartialAuthorization( + PaymentIntentIncrementAuthorizationParams.PaymentMethodOptions.Card + .RequestPartialAuthorization + requestPartialAuthorization) { + this.requestPartialAuthorization = requestPartialAuthorization; + return this; + } + } + + public enum RequestPartialAuthorization implements ApiRequestParams.EnumParam { + @SerializedName("if_available") + IF_AVAILABLE("if_available"), + + @SerializedName("never") + NEVER("never"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + RequestPartialAuthorization(String value) { + this.value = value; + } + } + } + } + @Getter public static class TransferData { /** The amount that will be transferred automatically when a charge succeeds. */ diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 0cd2436510f..ae694af9bd2 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -15752,6 +15752,10 @@ public static class Card { @SerializedName("request_overcapture") RequestOvercapture requestOvercapture; + /** Request partial authorization on this PaymentIntent. */ + @SerializedName("request_partial_authorization") + RequestPartialAuthorization requestPartialAuthorization; + /** * We strongly recommend that you rely on our SCA Engine to automatically prompt your * customers for authentication based on risk level and Required. If {@code true}, tax will be calculated automatically using the - * customer's location. + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes the payment link to collect any billing address information + * necessary for tax calculation. */ @SerializedName("enabled") Boolean enabled; @@ -1053,8 +1057,12 @@ public PaymentLinkCreateParams.AutomaticTax build() { } /** - * Required. If {@code true}, tax will be calculated automatically using the - * customer's location. + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes the payment link to collect any billing address + * information necessary for tax calculation. */ public Builder setEnabled(Boolean enabled) { this.enabled = enabled; diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index b8660d7e1cb..907ac43774e 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -917,8 +917,12 @@ public enum Type implements ApiRequestParams.EnumParam { @Getter public static class AutomaticTax { /** - * Required. If {@code true}, tax will be calculated automatically using the - * customer's location. + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes the payment link to collect any billing address information + * necessary for tax calculation. */ @SerializedName("enabled") Boolean enabled; @@ -964,8 +968,12 @@ public PaymentLinkUpdateParams.AutomaticTax build() { } /** - * Required. If {@code true}, tax will be calculated automatically using the - * customer's location. + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes the payment link to collect any billing address + * information necessary for tax calculation. */ public Builder setEnabled(Boolean enabled) { this.enabled = enabled; diff --git a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java index a0687d33064..aafa8fa1791 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointCreateParams.java @@ -935,6 +935,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.overdue") INVOICE__OVERDUE("invoice.overdue"), + @SerializedName("invoice.overpaid") + INVOICE__OVERPAID("invoice.overpaid"), + @SerializedName("invoice.paid") INVOICE__PAID("invoice.paid"), diff --git a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java index 73e8e77d4a3..3917187c2da 100644 --- a/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java +++ b/src/main/java/com/stripe/param/WebhookEndpointUpdateParams.java @@ -590,6 +590,9 @@ public enum EnabledEvent implements ApiRequestParams.EnumParam { @SerializedName("invoice.overdue") INVOICE__OVERDUE("invoice.overdue"), + @SerializedName("invoice.overpaid") + INVOICE__OVERPAID("invoice.overpaid"), + @SerializedName("invoice.paid") INVOICE__PAID("invoice.paid"), diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index 6114c21f4c0..63aeb7ca614 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -1392,7 +1392,14 @@ public Builder putAllExtraParam(Map map) { @Getter public static class AutomaticTax { - /** Required. Set to true to enable automatic taxes. */ + /** + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes Checkout to collect any billing address information + * necessary for tax calculation. + */ @SerializedName("enabled") Boolean enabled; @@ -1435,7 +1442,14 @@ public SessionCreateParams.AutomaticTax build() { return new SessionCreateParams.AutomaticTax(this.enabled, this.extraParams, this.liability); } - /** Required. Set to true to enable automatic taxes. */ + /** + * Required. Set to {@code true} to calculate tax automatically using the customer's + * location. + * + *

Enabling this parameter causes Checkout to collect any billing address information + * necessary for tax calculation. + */ public Builder setEnabled(Boolean enabled) { this.enabled = enabled; return this; @@ -3929,6 +3943,15 @@ public static class LineItem { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. 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 ID of the Price or Plan object. One of {@code price} or {@code @@ -3962,6 +3985,7 @@ private LineItem( AdjustableQuantity adjustableQuantity, List dynamicTaxRates, Map extraParams, + Map metadata, String price, PriceData priceData, Long quantity, @@ -3969,6 +3993,7 @@ private LineItem( this.adjustableQuantity = adjustableQuantity; this.dynamicTaxRates = dynamicTaxRates; this.extraParams = extraParams; + this.metadata = metadata; this.price = price; this.priceData = priceData; this.quantity = quantity; @@ -3986,6 +4011,8 @@ public static class Builder { private Map extraParams; + private Map metadata; + private String price; private PriceData priceData; @@ -4000,6 +4027,7 @@ public SessionCreateParams.LineItem build() { this.adjustableQuantity, this.dynamicTaxRates, this.extraParams, + this.metadata, this.price, this.priceData, this.quantity, @@ -4068,6 +4096,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * SessionCreateParams.LineItem#metadata} for the field documentation. + */ + public Builder putMetadata(String key, String value) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SessionCreateParams.LineItem#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + /** * The ID of the Price or Plan object. One of {@code price} or {@code @@ -13355,6 +13409,20 @@ public static class Update { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * Determines which entity is allowed to update the line items. + * + *

Default is {@code client_only}. Stripe Checkout client will automatically update the + * line items. If set to {@code server_only}, only your server is allowed to update the line + * items. + * + *

When set to {@code server_only}, you must add the onLineItemsChange event handler when + * initializing the Stripe Checkout client and manually update the line items from your server + * using the Stripe API. + */ + @SerializedName("line_items") + LineItems lineItems; + /** * Determines which entity is allowed to update the shipping details. * @@ -13369,8 +13437,10 @@ public static class Update { @SerializedName("shipping_details") ShippingDetails shippingDetails; - private Update(Map extraParams, ShippingDetails shippingDetails) { + private Update( + Map extraParams, LineItems lineItems, ShippingDetails shippingDetails) { this.extraParams = extraParams; + this.lineItems = lineItems; this.shippingDetails = shippingDetails; } @@ -13381,11 +13451,14 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private LineItems lineItems; + private ShippingDetails shippingDetails; /** Finalize and obtain parameter instance from this builder. */ public SessionCreateParams.Permissions.Update build() { - return new SessionCreateParams.Permissions.Update(this.extraParams, this.shippingDetails); + return new SessionCreateParams.Permissions.Update( + this.extraParams, this.lineItems, this.shippingDetails); } /** @@ -13416,6 +13489,22 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Determines which entity is allowed to update the line items. + * + *

Default is {@code client_only}. Stripe Checkout client will automatically update the + * line items. If set to {@code server_only}, only your server is allowed to update the line + * items. + * + *

When set to {@code server_only}, you must add the onLineItemsChange event handler when + * initializing the Stripe Checkout client and manually update the line items from your + * server using the Stripe API. + */ + public Builder setLineItems(SessionCreateParams.Permissions.Update.LineItems lineItems) { + this.lineItems = lineItems; + return this; + } + /** * Determines which entity is allowed to update the shipping details. * @@ -13434,6 +13523,21 @@ public Builder setShippingDetails( } } + public enum LineItems implements ApiRequestParams.EnumParam { + @SerializedName("client_only") + CLIENT_ONLY("client_only"), + + @SerializedName("server_only") + SERVER_ONLY("server_only"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + LineItems(String value) { + this.value = value; + } + } + public enum ShippingDetails implements ApiRequestParams.EnumParam { @SerializedName("client_only") CLIENT_ONLY("client_only"), diff --git a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java index a01d7e98265..f2a296f7066 100644 --- a/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionUpdateParams.java @@ -29,6 +29,26 @@ public class SessionUpdateParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * A list of items the customer is purchasing. + * + *

When updating line items, the entire array of line items must be retransmitted. + * + *

To retain an existing line item, specify its {@code id}. + * + *

To update an existing line item, specify its {@code id} along with the new values of the + * fields to be updated. + * + *

To add a new line item, specify a {@code price} and {@code quantity}. Recurring prices are + * not supported yet. + * + *

To remove an existing line item, omit the line item's ID from the retransmitted array. + * + *

To reorder a line item, specify it at the desired position in the retransmitted array. + */ + @SerializedName("line_items") + List lineItems; + /** * 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 @@ -46,11 +66,13 @@ private SessionUpdateParams( CollectedInformation collectedInformation, List expand, Map extraParams, + List lineItems, Object metadata, Object shippingOptions) { this.collectedInformation = collectedInformation; this.expand = expand; this.extraParams = extraParams; + this.lineItems = lineItems; this.metadata = metadata; this.shippingOptions = shippingOptions; } @@ -66,6 +88,8 @@ public static class Builder { private Map extraParams; + private List lineItems; + private Object metadata; private Object shippingOptions; @@ -76,6 +100,7 @@ public SessionUpdateParams build() { this.collectedInformation, this.expand, this.extraParams, + this.lineItems, this.metadata, this.shippingOptions); } @@ -139,6 +164,32 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * Add an element to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * SessionUpdateParams#lineItems} for the field documentation. + */ + public Builder addLineItem(SessionUpdateParams.LineItem element) { + if (this.lineItems == null) { + this.lineItems = new ArrayList<>(); + } + this.lineItems.add(element); + return this; + } + + /** + * Add all elements to `lineItems` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * SessionUpdateParams#lineItems} for the field documentation. + */ + public Builder addAllLineItem(List elements) { + if (this.lineItems == null) { + this.lineItems = new ArrayList<>(); + } + this.lineItems.addAll(elements); + return this; + } + /** * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, * and subsequent calls add additional key/value pairs to the original map. See {@link @@ -588,6 +639,380 @@ public Builder setState(EmptyParam state) { } } + @Getter + public static class LineItem { + /** + * When set, provides configuration for this item’s quantity to be adjusted by the customer + * during Checkout. + */ + @SerializedName("adjustable_quantity") + AdjustableQuantity adjustableQuantity; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** ID of an existing line item. */ + @SerializedName("id") + Object id; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + /** The ID of the Price. */ + @SerializedName("price") + Object price; + + /** The quantity of the line item being purchased. */ + @SerializedName("quantity") + Long quantity; + + /** + * The tax rates which apply to this line + * item. + */ + @SerializedName("tax_rates") + Object taxRates; + + private LineItem( + AdjustableQuantity adjustableQuantity, + Map extraParams, + Object id, + Object metadata, + Object price, + Long quantity, + Object taxRates) { + this.adjustableQuantity = adjustableQuantity; + this.extraParams = extraParams; + this.id = id; + this.metadata = metadata; + this.price = price; + this.quantity = quantity; + this.taxRates = taxRates; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private AdjustableQuantity adjustableQuantity; + + private Map extraParams; + + private Object id; + + private Object metadata; + + private Object price; + + private Long quantity; + + private Object taxRates; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionUpdateParams.LineItem build() { + return new SessionUpdateParams.LineItem( + this.adjustableQuantity, + this.extraParams, + this.id, + this.metadata, + this.price, + this.quantity, + this.taxRates); + } + + /** + * When set, provides configuration for this item’s quantity to be adjusted by the customer + * during Checkout. + */ + public Builder setAdjustableQuantity( + SessionUpdateParams.LineItem.AdjustableQuantity adjustableQuantity) { + this.adjustableQuantity = adjustableQuantity; + 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 + * SessionUpdateParams.LineItem#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SessionUpdateParams.LineItem#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** ID of an existing line item. */ + public Builder setId(String id) { + this.id = id; + return this; + } + + /** ID of an existing line item. */ + public Builder setId(EmptyParam id) { + this.id = id; + 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 + * SessionUpdateParams.LineItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link SessionUpdateParams.LineItem#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the object + * in a structured format. Individual keys can be unset by posting an empty value to them. All + * keys can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can + * attach to an object. This can be useful for storing additional information about the object + * in a structured format. Individual keys can be unset by posting an empty value to them. All + * keys can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** The ID of the Price. */ + public Builder setPrice(String price) { + this.price = price; + return this; + } + + /** The ID of the Price. */ + public Builder setPrice(EmptyParam price) { + this.price = price; + return this; + } + + /** The quantity of the line item being purchased. */ + public Builder setQuantity(Long quantity) { + this.quantity = quantity; + return this; + } + + /** + * Add an element to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * SessionUpdateParams.LineItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addTaxRate(String element) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).add(element); + return this; + } + + /** + * Add all elements to `taxRates` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * SessionUpdateParams.LineItem#taxRates} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllTaxRate(List elements) { + if (this.taxRates == null || this.taxRates instanceof EmptyParam) { + this.taxRates = new ArrayList(); + } + ((List) this.taxRates).addAll(elements); + return this; + } + + /** + * The tax rates which apply to this line + * item. + */ + public Builder setTaxRates(EmptyParam taxRates) { + this.taxRates = taxRates; + return this; + } + + /** + * The tax rates which apply to this line + * item. + */ + public Builder setTaxRates(List taxRates) { + this.taxRates = taxRates; + return this; + } + } + + @Getter + public static class AdjustableQuantity { + /** + * Required. Set to true if the quantity can be adjusted to any positive + * integer. Setting to false will remove any previously specified constraints on quantity. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * The maximum quantity the customer can purchase for the Checkout Session. By default this + * value is 99. You can specify a value up to 999999. + */ + @SerializedName("maximum") + Long maximum; + + /** + * The minimum quantity the customer must purchase for the Checkout Session. By default this + * value is 0. + */ + @SerializedName("minimum") + Long minimum; + + private AdjustableQuantity( + Boolean enabled, Map extraParams, Long maximum, Long minimum) { + this.enabled = enabled; + this.extraParams = extraParams; + this.maximum = maximum; + this.minimum = minimum; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Long maximum; + + private Long minimum; + + /** Finalize and obtain parameter instance from this builder. */ + public SessionUpdateParams.LineItem.AdjustableQuantity build() { + return new SessionUpdateParams.LineItem.AdjustableQuantity( + this.enabled, this.extraParams, this.maximum, this.minimum); + } + + /** + * Required. Set to true if the quantity can be adjusted to any positive + * integer. Setting to false will remove any previously specified constraints on quantity. + */ + 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 SessionUpdateParams.LineItem.AdjustableQuantity#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link SessionUpdateParams.LineItem.AdjustableQuantity#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * The maximum quantity the customer can purchase for the Checkout Session. By default this + * value is 99. You can specify a value up to 999999. + */ + public Builder setMaximum(Long maximum) { + this.maximum = maximum; + return this; + } + + /** + * The minimum quantity the customer must purchase for the Checkout Session. By default this + * value is 0. + */ + public Builder setMinimum(Long minimum) { + this.minimum = minimum; + return this; + } + } + } + } + @Getter public static class ShippingOption { /** diff --git a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java index f2989e6def0..bdcd34e505d 100644 --- a/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/LocationUpdateParams.java @@ -13,9 +13,9 @@ @Getter public class LocationUpdateParams extends ApiRequestParams { /** - * The full address of the location. If you're updating the {@code address} field, avoid changing - * the {@code country}. If you need to modify the {@code country} field, create a new {@code - * Location} object and re-register any existing readers to that location. + * The full address of the location. You can't change the location's {@code country}. If you need + * to modify the {@code country} field, create a new {@code Location} object and re-register any + * existing readers to that location. */ @SerializedName("address") Address address; @@ -94,9 +94,9 @@ public LocationUpdateParams build() { } /** - * The full address of the location. If you're updating the {@code address} field, avoid - * changing the {@code country}. If you need to modify the {@code country} field, create a new - * {@code Location} object and re-register any existing readers to that location. + * The full address of the location. You can't change the location's {@code country}. If you + * need to modify the {@code country} field, create a new {@code Location} object and + * re-register any existing readers to that location. */ public Builder setAddress(LocationUpdateParams.Address address) { this.address = address;