diff --git a/API_VERSION b/API_VERSION index 012d1278dbd..7fa3a2d3c56 100644 --- a/API_VERSION +++ b/API_VERSION @@ -1 +1 @@ -0de52cdca31a7c51c6d11187fc88ab23ea3a1c5b \ No newline at end of file +577fcb57736b925392ea563c0284df9002c75ac9 \ No newline at end of file diff --git a/OPENAPI_VERSION b/OPENAPI_VERSION index c6ee373b912..edaae7f4520 100644 --- a/OPENAPI_VERSION +++ b/OPENAPI_VERSION @@ -1 +1 @@ -v2031 \ No newline at end of file +v2099 \ No newline at end of file diff --git a/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java b/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java deleted file mode 100644 index 9efdc01d006..00000000000 --- a/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEvent.java +++ /dev/null @@ -1,36 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.events; - -import com.google.gson.annotations.SerializedName; -import com.stripe.exception.StripeException; -import com.stripe.model.v2.billing.BillSetting; -import com.stripe.model.v2.core.Event; -import com.stripe.model.v2.core.Event.RelatedObject; -import java.time.Instant; -import lombok.Getter; -import lombok.Setter; - -@Getter -public final class V2BillingBillSettingUpdatedEvent extends Event { - /** Data for the v2.billing.bill_setting.updated event. */ - @SerializedName("data") - V2BillingBillSettingUpdatedEvent.EventData data; - - @Getter - @Setter - public static final class EventData { - /** Timestamp of when the object was updated. */ - @SerializedName("updated") - Instant updated; - } - - @SerializedName("related_object") - - /** Object containing the reference to API resource relevant to the event. */ - RelatedObject relatedObject; - - /** Retrieves the related object from the API. Make an API request on every call. */ - public BillSetting fetchRelatedObject() throws StripeException { - return (BillSetting) super.fetchRelatedObject(this.relatedObject); - } -} diff --git a/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEventNotification.java b/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEventNotification.java deleted file mode 100644 index 2ab8a832875..00000000000 --- a/src/main/java/com/stripe/events/V2BillingBillSettingUpdatedEventNotification.java +++ /dev/null @@ -1,27 +0,0 @@ -// File generated from our OpenAPI spec -package com.stripe.events; - -import com.google.gson.annotations.SerializedName; -import com.stripe.exception.StripeException; -import com.stripe.model.v2.billing.BillSetting; -import com.stripe.model.v2.core.Event.RelatedObject; -import com.stripe.model.v2.core.EventNotification; -import lombok.Getter; - -@Getter -public final class V2BillingBillSettingUpdatedEventNotification extends EventNotification { - @SerializedName("related_object") - - /** Object containing the reference to API resource relevant to the event. */ - RelatedObject relatedObject; - - /** Retrieves the related object from the API. Make an API request on every call. */ - public BillSetting fetchRelatedObject() throws StripeException { - return (BillSetting) super.fetchRelatedObject(this.relatedObject); - } - /** Retrieve the corresponding full event from the Stripe API. */ - @Override - public V2BillingBillSettingUpdatedEvent fetchEvent() throws StripeException { - return (V2BillingBillSettingUpdatedEvent) super.fetchEvent(); - } -} diff --git a/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java b/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java index cade559a382..834b719f513 100644 --- a/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java +++ b/src/main/java/com/stripe/events/V2MoneyManagementTransactionCreatedEvent.java @@ -7,9 +7,22 @@ import com.stripe.model.v2.core.Event.RelatedObject; import com.stripe.model.v2.moneymanagement.Transaction; import lombok.Getter; +import lombok.Setter; @Getter public final class V2MoneyManagementTransactionCreatedEvent extends Event { + /** Data for the v2.money_management.transaction.created event. */ + @SerializedName("data") + V2MoneyManagementTransactionCreatedEvent.EventData data; + + @Getter + @Setter + public static final class EventData { + /** Id of the v1 Transaction corresponding to this Transaction. */ + @SerializedName("v1_id") + String v1Id; + } + @SerializedName("related_object") /** Object containing the reference to API resource relevant to the event. */ diff --git a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java index 7bc809e4266..728b786d83f 100644 --- a/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java +++ b/src/main/java/com/stripe/examples/EventNotificationWebhookHandler.java @@ -6,7 +6,6 @@ import com.stripe.events.V1BillingMeterErrorReportTriggeredEventNotification; import com.stripe.exception.StripeException; import com.stripe.model.billing.Meter; -import com.stripe.model.v2.core.Event; import com.stripe.model.v2.core.EventNotification; import com.sun.net.httpserver.HttpExchange; import com.sun.net.httpserver.HttpHandler; @@ -67,33 +66,39 @@ public void handle(HttpExchange exchange) throws IOException { String sigHeader = exchange.getRequestHeaders().getFirst("Stripe-Signature"); try { - EventNotification eventNotif = + EventNotification notif = client.parseEventNotification(webhookBody, sigHeader, WEBHOOK_SECRET); - // determine what sort of event you have - if (eventNotif instanceof V1BillingMeterErrorReportTriggeredEventNotification) { + if (notif instanceof V1BillingMeterErrorReportTriggeredEventNotification) { V1BillingMeterErrorReportTriggeredEventNotification eventNotification = - (V1BillingMeterErrorReportTriggeredEventNotification) eventNotif; + (V1BillingMeterErrorReportTriggeredEventNotification) notif; - // after casting, can fetch the related object (which is correctly typed) - Meter meter = eventNotification.fetchRelatedObject(); - System.out.println(meter.getId()); + // there's basic info about the related object in the notification + System.out.println( + "Meter w/ id " + eventNotification.getRelatedObject().getId() + " had a problem"); + // or you can fetch the full object form the API for more details + Meter meter = eventNotification.fetchRelatedObject(); + StringBuilder sb = new StringBuilder(); + sb.append("Meter ") + .append(meter.getDisplayName()) + .append(" (") + .append(meter.getId()) + .append(") had a problem"); + System.out.println(sb.toString()); + + // And you can always fetch the full event: V1BillingMeterErrorReportTriggeredEvent event = eventNotification.fetchEvent(); - System.out.println(event.getData().getDeveloperMessageSummary()); - - // add additional logic - } - // ... check other event types you know about - else if (eventNotif instanceof UnknownEventNotification) { - UnknownEventNotification unknownEvent = (UnknownEventNotification) eventNotif; - System.out.println("Received unknown event: " + unknownEvent.getId()); - // can keep matching on the "type" field - // other helper methods still work, but you'll have to handle types yourself + System.out.println("More info: " + event.getData().getDeveloperMessageSummary()); + } else if (notif instanceof UnknownEventNotification) { + // Events that were introduced after this SDK version release are + // represented as `UnknownEventNotification`s. + // They're valid, the SDK just doesn't have corresponding classes for them. + // You must match on the "type" property instead. + UnknownEventNotification unknownEvent = (UnknownEventNotification) notif; if (unknownEvent.getType().equals("some.new.event")) { - Event event = unknownEvent.fetchEvent(); - System.out.println(event.getReason()); - // handle + // you can still `.fetchEvent()` and `.fetchRelatedObject()`, but the latter may + // return `null` if that event type doesn't have a related object. } } diff --git a/src/main/java/com/stripe/exception/AlreadyCanceledException.java b/src/main/java/com/stripe/exception/AlreadyCanceledException.java index f0e2c0fe267..8afb343d196 100644 --- a/src/main/java/com/stripe/exception/AlreadyCanceledException.java +++ b/src/main/java/com/stripe/exception/AlreadyCanceledException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Error returned when user tries to cancel an OutboundPayment that was already canceled. */ public final class AlreadyCanceledException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/AlreadyExistsException.java b/src/main/java/com/stripe/exception/AlreadyExistsException.java index 24d496994c2..317c4407b9b 100644 --- a/src/main/java/com/stripe/exception/AlreadyExistsException.java +++ b/src/main/java/com/stripe/exception/AlreadyExistsException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** The resource already exists. */ public final class AlreadyExistsException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/BlockedByStripeException.java b/src/main/java/com/stripe/exception/BlockedByStripeException.java index c62049f1617..9cbca500927 100644 --- a/src/main/java/com/stripe/exception/BlockedByStripeException.java +++ b/src/main/java/com/stripe/exception/BlockedByStripeException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Returned when the bank account cannot be added due to previous suspicious activity. */ public final class BlockedByStripeException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/ControlledByDashboardException.java b/src/main/java/com/stripe/exception/ControlledByDashboardException.java index 1326e4a1f4e..cac7b66e44b 100644 --- a/src/main/java/com/stripe/exception/ControlledByDashboardException.java +++ b/src/main/java/com/stripe/exception/ControlledByDashboardException.java @@ -6,7 +6,10 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** + * Returned when the PayoutMethodBankAccount object is controlled by the Stripe Dashboard, and + * cannot be archived. + */ public final class ControlledByDashboardException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/FeatureNotEnabledException.java b/src/main/java/com/stripe/exception/FeatureNotEnabledException.java index 5e77d0d93d1..a1e24a0e4d1 100644 --- a/src/main/java/com/stripe/exception/FeatureNotEnabledException.java +++ b/src/main/java/com/stripe/exception/FeatureNotEnabledException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** The user attempts to create an outbound flow from a closed Financial Account. */ public final class FeatureNotEnabledException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/FinancialAccountNotOpenException.java b/src/main/java/com/stripe/exception/FinancialAccountNotOpenException.java index f9cc6c3b0be..66a745010d4 100644 --- a/src/main/java/com/stripe/exception/FinancialAccountNotOpenException.java +++ b/src/main/java/com/stripe/exception/FinancialAccountNotOpenException.java @@ -6,7 +6,6 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ public final class FinancialAccountNotOpenException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/InsufficientFundsException.java b/src/main/java/com/stripe/exception/InsufficientFundsException.java index 2d477585167..e28c0065d0d 100644 --- a/src/main/java/com/stripe/exception/InsufficientFundsException.java +++ b/src/main/java/com/stripe/exception/InsufficientFundsException.java @@ -6,7 +6,10 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** + * Error returned when the balance of provided financial account and balance type in the + * OutboundPayment/OutboundTransfer request does not have enough funds. + */ public final class InsufficientFundsException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/InvalidPaymentMethodException.java b/src/main/java/com/stripe/exception/InvalidPaymentMethodException.java index 597a5e06fa2..320cee6e260 100644 --- a/src/main/java/com/stripe/exception/InvalidPaymentMethodException.java +++ b/src/main/java/com/stripe/exception/InvalidPaymentMethodException.java @@ -8,7 +8,10 @@ import com.stripe.net.StripeResponseGetter; import lombok.Getter; -/** Information about the error that occurred. */ +/** + * Returned in cases where the bank account provided is not valid (wrong format of account number or + * a routing number that does not correspond to a banking institution). + */ public final class InvalidPaymentMethodException extends ApiException { private static final long serialVersionUID = 2L; @Getter String invalidParam; diff --git a/src/main/java/com/stripe/exception/InvalidPayoutMethodException.java b/src/main/java/com/stripe/exception/InvalidPayoutMethodException.java index e10ea5a4a3c..1b92d726743 100644 --- a/src/main/java/com/stripe/exception/InvalidPayoutMethodException.java +++ b/src/main/java/com/stripe/exception/InvalidPayoutMethodException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Returned in cases where the ID provided doesn't correspond to a valid payout method. */ public final class InvalidPayoutMethodException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/NonZeroBalanceException.java b/src/main/java/com/stripe/exception/NonZeroBalanceException.java index 3f032e51c63..e9ffb6bc220 100644 --- a/src/main/java/com/stripe/exception/NonZeroBalanceException.java +++ b/src/main/java/com/stripe/exception/NonZeroBalanceException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Error thrown if a user tries to close an account that has non-zero balances. */ public final class NonZeroBalanceException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/NotCancelableException.java b/src/main/java/com/stripe/exception/NotCancelableException.java index 9f669ddcdc9..d1a93541b2e 100644 --- a/src/main/java/com/stripe/exception/NotCancelableException.java +++ b/src/main/java/com/stripe/exception/NotCancelableException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Error returned when user tries to cancel an OutboundPayment that is not cancelable. */ public final class NotCancelableException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/QuotaExceededException.java b/src/main/java/com/stripe/exception/QuotaExceededException.java index 9d568ac104d..8428fe11abb 100644 --- a/src/main/java/com/stripe/exception/QuotaExceededException.java +++ b/src/main/java/com/stripe/exception/QuotaExceededException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** Returned when attempting to update an archived card. */ public final class QuotaExceededException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/RecipientNotNotifiableException.java b/src/main/java/com/stripe/exception/RecipientNotNotifiableException.java index 9e4ccfb2473..c6e7d2f6d93 100644 --- a/src/main/java/com/stripe/exception/RecipientNotNotifiableException.java +++ b/src/main/java/com/stripe/exception/RecipientNotNotifiableException.java @@ -6,7 +6,10 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** + * Error returned when the user enables notifications in the OutboundPayment request, but an email + * is not set up on the recipient account. + */ public final class RecipientNotNotifiableException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/exception/TemporarySessionExpiredException.java b/src/main/java/com/stripe/exception/TemporarySessionExpiredException.java index 9a9977b273e..376c73a885b 100644 --- a/src/main/java/com/stripe/exception/TemporarySessionExpiredException.java +++ b/src/main/java/com/stripe/exception/TemporarySessionExpiredException.java @@ -6,7 +6,7 @@ import com.stripe.model.StripeObject; import com.stripe.net.StripeResponseGetter; -/** Information about the error that occurred. */ +/** The temporary session token has expired. */ public final class TemporarySessionExpiredException extends ApiException { private static final long serialVersionUID = 2L; diff --git a/src/main/java/com/stripe/model/Account.java b/src/main/java/com/stripe/model/Account.java index 15e129a6dcd..eb11d409b51 100644 --- a/src/main/java/com/stripe/model/Account.java +++ b/src/main/java/com/stripe/model/Account.java @@ -1640,6 +1640,13 @@ public static class Company extends StripeObject { @SerializedName("registration_date") RegistrationDate registrationDate; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. Also available * for accounts where API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration extends StripeObject { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** The IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user-agent string from the browser where the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + } + /** * For more details about Verification, please refer to the API Reference. @@ -2208,29 +2239,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, @@ -2411,29 +2442,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, diff --git a/src/main/java/com/stripe/model/BankAccount.java b/src/main/java/com/stripe/model/BankAccount.java index 5284ebe11fe..7431969d2d4 100644 --- a/src/main/java/com/stripe/model/BankAccount.java +++ b/src/main/java/com/stripe/model/BankAccount.java @@ -579,29 +579,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, @@ -708,29 +708,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, diff --git a/src/main/java/com/stripe/model/Capability.java b/src/main/java/com/stripe/model/Capability.java index 0b49c7c1f22..d7bf55d6cb2 100644 --- a/src/main/java/com/stripe/model/Capability.java +++ b/src/main/java/com/stripe/model/Capability.java @@ -273,29 +273,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, @@ -459,29 +459,29 @@ public static class Errors extends StripeObject { * invalid_url_website_incomplete_terms_and_conditions}, {@code * invalid_url_website_incomplete_under_construction}, {@code invalid_url_website_other}, * {@code invalid_value_other}, {@code unsupported_business_type}, {@code - * verification_directors_mismatch}, {@code verification_document_address_mismatch}, {@code - * verification_document_address_missing}, {@code verification_document_corrupt}, {@code - * verification_document_country_not_supported}, {@code - * verification_document_directors_mismatch}, {@code verification_document_dob_mismatch}, - * {@code verification_document_duplicate_type}, {@code verification_document_expired}, {@code - * verification_document_failed_copy}, {@code verification_document_failed_greyscale}, {@code - * verification_document_failed_other}, {@code verification_document_failed_test_mode}, {@code - * verification_document_fraudulent}, {@code verification_document_id_number_mismatch}, {@code - * verification_document_id_number_missing}, {@code verification_document_incomplete}, {@code - * verification_document_invalid}, {@code verification_document_issue_or_expiry_date_missing}, - * {@code verification_document_manipulated}, {@code verification_document_missing_back}, - * {@code verification_document_missing_front}, {@code verification_document_name_mismatch}, - * {@code verification_document_name_missing}, {@code - * verification_document_nationality_mismatch}, {@code verification_document_not_readable}, - * {@code verification_document_not_signed}, {@code verification_document_not_uploaded}, - * {@code verification_document_photo_mismatch}, {@code verification_document_too_large}, - * {@code verification_document_type_not_supported}, {@code - * verification_extraneous_directors}, {@code verification_failed_address_match}, {@code - * verification_failed_authorizer_authority}, {@code verification_failed_business_iec_number}, - * {@code verification_failed_document_match}, {@code verification_failed_id_number_match}, - * {@code verification_failed_keyed_identity}, {@code verification_failed_keyed_match}, {@code - * verification_failed_name_match}, {@code verification_failed_other}, {@code - * verification_failed_representative_authority}, {@code + * verification_data_not_found}, {@code verification_directors_mismatch}, {@code + * verification_document_address_mismatch}, {@code verification_document_address_missing}, + * {@code verification_document_corrupt}, {@code verification_document_country_not_supported}, + * {@code verification_document_directors_mismatch}, {@code + * verification_document_dob_mismatch}, {@code verification_document_duplicate_type}, {@code + * verification_document_expired}, {@code verification_document_failed_copy}, {@code + * verification_document_failed_greyscale}, {@code verification_document_failed_other}, {@code + * verification_document_failed_test_mode}, {@code verification_document_fraudulent}, {@code + * verification_document_id_number_mismatch}, {@code verification_document_id_number_missing}, + * {@code verification_document_incomplete}, {@code verification_document_invalid}, {@code + * verification_document_issue_or_expiry_date_missing}, {@code + * verification_document_manipulated}, {@code verification_document_missing_back}, {@code + * verification_document_missing_front}, {@code verification_document_name_mismatch}, {@code + * verification_document_name_missing}, {@code verification_document_nationality_mismatch}, + * {@code verification_document_not_readable}, {@code verification_document_not_signed}, + * {@code verification_document_not_uploaded}, {@code verification_document_photo_mismatch}, + * {@code verification_document_too_large}, {@code verification_document_type_not_supported}, + * {@code verification_extraneous_directors}, {@code verification_failed_address_match}, + * {@code verification_failed_authorizer_authority}, {@code + * verification_failed_business_iec_number}, {@code verification_failed_document_match}, + * {@code verification_failed_id_number_match}, {@code verification_failed_keyed_identity}, + * {@code verification_failed_keyed_match}, {@code verification_failed_name_match}, {@code + * verification_failed_other}, {@code verification_failed_representative_authority}, {@code * verification_failed_residential_address}, {@code verification_failed_tax_id_match}, {@code * verification_failed_tax_id_not_issued}, {@code * verification_legal_entity_structure_mismatch}, {@code verification_missing_directors}, diff --git a/src/main/java/com/stripe/model/Charge.java b/src/main/java/com/stripe/model/Charge.java index 847f58d9b32..1faa0ea3319 100644 --- a/src/main/java/com/stripe/model/Charge.java +++ b/src/main/java/com/stripe/model/Charge.java @@ -2768,7 +2768,7 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

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

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. */ @SerializedName("network") String network; @@ -3802,7 +3802,11 @@ public static class Qris extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Rechnung extends StripeObject {} + public static class Rechnung extends StripeObject { + /** Payment portal URL. */ + @SerializedName("payment_portal_url") + String paymentPortalUrl; + } /** * For more details about RevolutPay, please refer to the One of {@code acss_debit}, {@code affirm}, {@code afterpay_clearpay}, {@code alipay}, * {@code alma}, {@code amazon_pay}, {@code au_becs_debit}, {@code bacs_debit}, {@code * bancontact}, {@code billie}, {@code blik}, {@code boleto}, {@code card}, {@code - * card_present}, {@code cashapp}, {@code crypto}, {@code customer_balance}, {@code eps}, {@code - * fpx}, {@code giropay}, {@code gopay}, {@code grabpay}, {@code id_bank_transfer}, {@code - * ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, {@code konbini}, {@code - * kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code multibanco}, {@code - * naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code pay_by_bank}, {@code - * payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code payto}, {@code pix}, {@code - * promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, {@code samsung_pay}, {@code - * satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, {@code stripe_balance}, - * {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, or {@code zip}. + * card_present}, {@code cashapp}, {@code crypto}, {@code custom}, {@code customer_balance}, + * {@code eps}, {@code fpx}, {@code giropay}, {@code gopay}, {@code grabpay}, {@code + * id_bank_transfer}, {@code ideal}, {@code interac_present}, {@code kakao_pay}, {@code klarna}, + * {@code konbini}, {@code kr_card}, {@code link}, {@code mb_way}, {@code mobilepay}, {@code + * multibanco}, {@code naver_pay}, {@code nz_bank_account}, {@code oxxo}, {@code p24}, {@code + * pay_by_bank}, {@code payco}, {@code paynow}, {@code paypal}, {@code paypay}, {@code payto}, + * {@code pix}, {@code promptpay}, {@code qris}, {@code rechnung}, {@code revolut_pay}, {@code + * samsung_pay}, {@code satispay}, {@code sepa_debit}, {@code shopeepay}, {@code sofort}, {@code + * stripe_balance}, {@code swish}, {@code twint}, {@code us_bank_account}, {@code wechat_pay}, + * or {@code zip}. */ @SerializedName("type") String type; diff --git a/src/main/java/com/stripe/model/CreditNote.java b/src/main/java/com/stripe/model/CreditNote.java index de8eb46eb6b..3d4fb10eb12 100644 --- a/src/main/java/com/stripe/model/CreditNote.java +++ b/src/main/java/com/stripe/model/CreditNote.java @@ -743,12 +743,20 @@ public static class Refund extends StripeObject { @SerializedName("amount_refunded") Long amountRefunded; + /** The PaymentRecord refund details associated with this credit note refund. */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** ID of the refund. */ @SerializedName("refund") @Getter(lombok.AccessLevel.NONE) @Setter(lombok.AccessLevel.NONE) ExpandableField refund; + /** Type of the refund, one of {@code refund} or {@code payment_record_refund}. */ + @SerializedName("type") + String type; + /** Get ID of expandable {@code refund} object. */ public String getRefund() { return (this.refund != null) ? this.refund.getId() : null; @@ -767,6 +775,23 @@ public void setRefundObject(com.stripe.model.Refund expandableObject) { this.refund = new ExpandableField(expandableObject.getId(), expandableObject); } + + /** + * For more details about PaymentRecordRefund, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund extends StripeObject { + /** ID of the payment record. */ + @SerializedName("payment_record") + String paymentRecord; + + /** ID of the refund group. */ + @SerializedName("refund_group") + String refundGroup; + } } /** diff --git a/src/main/java/com/stripe/model/Customer.java b/src/main/java/com/stripe/model/Customer.java index 572ea0d2d9d..8918954d5b8 100644 --- a/src/main/java/com/stripe/model/Customer.java +++ b/src/main/java/com/stripe/model/Customer.java @@ -982,6 +982,15 @@ public static class Tax extends StripeObject { @SerializedName("location") Location location; + /** + * The tax calculation provider used for location resolution. Defaults to {@code stripe} when + * not using a third-party provider. + * + *

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

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

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

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

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

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

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

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

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

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

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

One of {@code always}, {@code limited}, or {@code unspecified}. + */ + @SerializedName("payment_method_save_allow_redisplay_override") + String paymentMethodSaveAllowRedisplayOverride; + } + } + /** This hash contains whether the Payment Element is enabled and the features it supports. */ @Getter @Setter @@ -277,6 +430,51 @@ public static class PricingTable extends StripeObject { @SerializedName("enabled") Boolean enabled; } + + /** This hash contains whether the Tax ID Element is enabled and the features it supports. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class TaxIdElement extends StripeObject { + /** Whether the Tax ID Element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** This hash defines whether the Tax ID Element supports certain features. */ + @SerializedName("features") + Features features; + + /** This hash defines whether the Tax ID Element supports certain features. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Features extends StripeObject { + /** + * Controls whether the Tax ID Element displays saved tax IDs for the customer. This + * parameter defaults to {@code disabled}. + * + *

When enabled, the Tax ID Element will show existing tax IDs associated with the + * customer, allowing them to select from previously saved tax identification numbers. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("tax_id_redisplay") + String taxIdRedisplay; + + /** + * Controls whether the Tax ID Element allows merchants to save new tax IDs for their + * customer. This parameter defaults to {@code disabled}. + * + *

When enabled, customers can enter and save new tax identification numbers during the + * payment flow, which will be stored securely and associated with their customer object for + * future use. + * + *

One of {@code disabled}, or {@code enabled}. + */ + @SerializedName("tax_id_save") + String taxIdSave; + } + } } @Override diff --git a/src/main/java/com/stripe/model/File.java b/src/main/java/com/stripe/model/File.java index 39b436af72a..f11567995b5 100644 --- a/src/main/java/com/stripe/model/File.java +++ b/src/main/java/com/stripe/model/File.java @@ -70,8 +70,9 @@ public class File extends ApiResource implements HasId { * document_provider_identity_document}, {@code finance_report_run}, {@code * financial_account_statement}, {@code identity_document}, {@code * identity_document_downloadable}, {@code issuing_regulatory_reporting}, {@code pci_document}, - * {@code selfie}, {@code sigma_scheduled_query}, {@code tax_document_user_upload}, {@code - * terminal_android_apk}, or {@code terminal_reader_splashscreen}. + * {@code platform_terms_of_service}, {@code selfie}, {@code sigma_scheduled_query}, {@code + * tax_document_user_upload}, {@code terminal_android_apk}, or {@code + * terminal_reader_splashscreen}. */ @SerializedName("purpose") String purpose; diff --git a/src/main/java/com/stripe/model/PaymentAttemptRecord.java b/src/main/java/com/stripe/model/PaymentAttemptRecord.java index fe50e661329..d597a64705a 100644 --- a/src/main/java/com/stripe/model/PaymentAttemptRecord.java +++ b/src/main/java/com/stripe/model/PaymentAttemptRecord.java @@ -1666,7 +1666,7 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

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

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. */ @SerializedName("network") String network; @@ -2721,7 +2721,11 @@ public static class Qris extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Rechnung extends StripeObject {} + public static class Rechnung extends StripeObject { + /** Payment portal URL. */ + @SerializedName("payment_portal_url") + String paymentPortalUrl; + } /** * For more details about RevolutPay, please refer to the metadata; + @SerializedName("name_collection") + NameCollection nameCollection; + /** * String representing the object's type. Objects of the same type share the same value. * @@ -1040,6 +1043,61 @@ public static class RenderingOptions extends StripeObject { } } + /** + * For more details about NameCollection, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection extends StripeObject { + @SerializedName("business") + Business business; + + @SerializedName("individual") + Individual individual; + + /** + * For more details about Business, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Business extends StripeObject { + /** Indicates whether business name collection is enabled for the payment link. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Whether the customer is required to complete the field before checking out. Defaults to + * {@code false}. + */ + @SerializedName("optional") + Boolean optional; + } + + /** + * For more details about Individual, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Individual extends StripeObject { + /** Indicates whether individual name collection is enabled for the payment link. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Whether the customer is required to complete the field before checking out. Defaults to + * {@code false}. + */ + @SerializedName("optional") + Boolean optional; + } + } + /** * For more details about OptionalItem, please refer to the API Reference. @@ -1433,6 +1491,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(customText, responseGetter); trySetResponseGetter(invoiceCreation, responseGetter); trySetResponseGetter(lineItems, responseGetter); + trySetResponseGetter(nameCollection, responseGetter); trySetResponseGetter(onBehalfOf, responseGetter); trySetResponseGetter(paymentIntentData, responseGetter); trySetResponseGetter(phoneNumberCollection, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentMethod.java b/src/main/java/com/stripe/model/PaymentMethod.java index 19bdb4a6418..e9493807d2c 100644 --- a/src/main/java/com/stripe/model/PaymentMethod.java +++ b/src/main/java/com/stripe/model/PaymentMethod.java @@ -99,6 +99,9 @@ public class PaymentMethod extends ApiResource implements HasId, MetadataStore

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

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

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

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

One of {@code off}, or {@code on}. + */ + @SerializedName("value") + String value; + } + } + /** * For more details about Mobilepay, please refer to the API * Reference. @@ -3343,6 +3451,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(card, responseGetter); trySetResponseGetter(cartesBancaires, responseGetter); trySetResponseGetter(cashapp, responseGetter); + trySetResponseGetter(crypto, responseGetter); trySetResponseGetter(customerBalance, responseGetter); trySetResponseGetter(eps, responseGetter); trySetResponseGetter(fpx, responseGetter); @@ -3358,6 +3467,7 @@ public void setResponseGetter(StripeResponseGetter responseGetter) { trySetResponseGetter(konbini, responseGetter); trySetResponseGetter(krCard, responseGetter); trySetResponseGetter(link, responseGetter); + trySetResponseGetter(mbWay, responseGetter); trySetResponseGetter(mobilepay, responseGetter); trySetResponseGetter(multibanco, responseGetter); trySetResponseGetter(naverPay, responseGetter); diff --git a/src/main/java/com/stripe/model/PaymentRecord.java b/src/main/java/com/stripe/model/PaymentRecord.java index 4a59357d016..660d2fd45d7 100644 --- a/src/main/java/com/stripe/model/PaymentRecord.java +++ b/src/main/java/com/stripe/model/PaymentRecord.java @@ -15,6 +15,7 @@ import com.stripe.param.PaymentRecordReportPaymentAttemptInformationalParams; import com.stripe.param.PaymentRecordReportPaymentAttemptParams; import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordReportRefundParams; import com.stripe.param.PaymentRecordRetrieveParams; import java.util.List; import java.util.Map; @@ -423,6 +424,44 @@ public PaymentRecord reportPaymentAttemptInformational( return getResponseGetter().request(request, PaymentRecord.class); } + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(Map params) throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(Map params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_refund", ApiResource.urlEncodeId(this.getId())); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, params, options); + return getResponseGetter().request(request, PaymentRecord.class); + } + + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(PaymentRecordReportRefundParams params) throws StripeException { + return reportRefund(params, (RequestOptions) null); + } + + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(PaymentRecordReportRefundParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v1/payment_records/%s/report_refund", ApiResource.urlEncodeId(this.getId())); + ApiResource.checkNullTypedParams(path, params); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return getResponseGetter().request(request, PaymentRecord.class); + } + /** Retrieves a Payment Record with the given ID. */ public static PaymentRecord retrieve(String id) throws StripeException { return retrieve(id, (Map) null, (RequestOptions) null); @@ -1921,7 +1960,7 @@ public static class Crypto extends StripeObject { /** * The blockchain network that the transaction was sent on. * - *

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

One of {@code base}, {@code ethereum}, {@code polygon}, or {@code solana}. */ @SerializedName("network") String network; @@ -2975,7 +3014,11 @@ public static class Qris extends StripeObject {} @Getter @Setter @EqualsAndHashCode(callSuper = false) - public static class Rechnung extends StripeObject {} + public static class Rechnung extends StripeObject { + /** Payment portal URL. */ + @SerializedName("payment_portal_url") + String paymentPortalUrl; + } /** * For more details about RevolutPay, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Crypto extends StripeObject { + /** The transaction hash of the refund. */ + @SerializedName("reference") + String reference; + } + /** * For more details about CustomerCashBalance, please refer to the API Reference. diff --git a/src/main/java/com/stripe/model/SetupIntent.java b/src/main/java/com/stripe/model/SetupIntent.java index d77c78cba77..81e94bf8ba6 100644 --- a/src/main/java/com/stripe/model/SetupIntent.java +++ b/src/main/java/com/stripe/model/SetupIntent.java @@ -122,6 +122,10 @@ public class SetupIntent extends ApiResource implements HasId, MetadataStore excludedPaymentMethodTypes; + /** * Indicates the directions of money movement for which this payment method is intended to be * used. diff --git a/src/main/java/com/stripe/model/StripeError.java b/src/main/java/com/stripe/model/StripeError.java index b15a46f540f..557dd25acde 100644 --- a/src/main/java/com/stripe/model/StripeError.java +++ b/src/main/java/com/stripe/model/StripeError.java @@ -75,12 +75,12 @@ public class StripeError extends StripeObject { * {@code payment_intent_invalid_parameter}, {@code * payment_intent_konbini_rejected_confirmation_number}, {@code payment_intent_mandate_invalid}, * {@code payment_intent_payment_attempt_expired}, {@code payment_intent_payment_attempt_failed}, - * {@code payment_intent_unexpected_state}, {@code payment_method_bank_account_already_verified}, - * {@code payment_method_bank_account_blocked}, {@code - * payment_method_billing_details_address_missing}, {@code payment_method_configuration_failures}, - * {@code payment_method_currency_mismatch}, {@code payment_method_customer_decline}, {@code - * payment_method_invalid_parameter}, {@code payment_method_invalid_parameter_testmode}, {@code - * payment_method_microdeposit_failed}, {@code + * {@code payment_intent_rate_limit_exceeded}, {@code payment_intent_unexpected_state}, {@code + * payment_method_bank_account_already_verified}, {@code payment_method_bank_account_blocked}, + * {@code payment_method_billing_details_address_missing}, {@code + * payment_method_configuration_failures}, {@code payment_method_currency_mismatch}, {@code + * payment_method_customer_decline}, {@code payment_method_invalid_parameter}, {@code + * payment_method_invalid_parameter_testmode}, {@code payment_method_microdeposit_failed}, {@code * payment_method_microdeposit_verification_amounts_invalid}, {@code * payment_method_microdeposit_verification_amounts_mismatch}, {@code * payment_method_microdeposit_verification_attempts_exceeded}, {@code diff --git a/src/main/java/com/stripe/model/billingportal/Configuration.java b/src/main/java/com/stripe/model/billingportal/Configuration.java index 3a3b455e6d8..917bad09db9 100644 --- a/src/main/java/com/stripe/model/billingportal/Configuration.java +++ b/src/main/java/com/stripe/model/billingportal/Configuration.java @@ -24,7 +24,11 @@ import lombok.Getter; import lombok.Setter; -/** A portal configuration describes the functionality and behavior of a portal session. */ +/** + * A portal configuration describes the functionality and behavior you embed in a portal session. + * Related guide: Configure the + * customer portal. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) diff --git a/src/main/java/com/stripe/model/checkout/Session.java b/src/main/java/com/stripe/model/checkout/Session.java index 4a65ade6130..ab224ada7d0 100644 --- a/src/main/java/com/stripe/model/checkout/Session.java +++ b/src/main/java/com/stripe/model/checkout/Session.java @@ -2139,6 +2139,9 @@ public static class PaymentMethodOptions extends StripeObject { @SerializedName("swish") Swish swish; + @SerializedName("twint") + Twint twint; + @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -3972,6 +3975,39 @@ public static class Swish extends StripeObject { String reference; } + /** + * For more details about Twint, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Twint extends StripeObject { + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

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

Equal to {@code simplified}. + */ + @SerializedName("type") + String type; + } + /** * For more details about Tz, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/terminal/Configuration.java b/src/main/java/com/stripe/model/terminal/Configuration.java index ea48c740df3..c01718d5c1e 100644 --- a/src/main/java/com/stripe/model/terminal/Configuration.java +++ b/src/main/java/com/stripe/model/terminal/Configuration.java @@ -444,6 +444,9 @@ public static class Tipping extends StripeObject { @SerializedName("gbp") Gbp gbp; + @SerializedName("gip") + Gip gip; + @SerializedName("hkd") Hkd hkd; @@ -696,6 +699,30 @@ public static class Gbp extends StripeObject { Long smartTipThreshold; } + /** + * For more details about Gip, please refer to the API + * Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Gip extends StripeObject { + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + } + /** * For more details about Hkd, please refer to the API * Reference. diff --git a/src/main/java/com/stripe/model/terminal/Reader.java b/src/main/java/com/stripe/model/terminal/Reader.java index 895eb52dc5d..ccf2c064aee 100644 --- a/src/main/java/com/stripe/model/terminal/Reader.java +++ b/src/main/java/com/stripe/model/terminal/Reader.java @@ -149,22 +149,38 @@ public void setLocationObject(Location expandableObject) { this.location = new ExpandableField(expandableObject.getId(), expandableObject); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction() throws StripeException { return cancelAction((Map) null, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(RequestOptions options) throws StripeException { return cancelAction((Map) null, options); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(Map params) throws StripeException { return cancelAction(params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(Map params, RequestOptions options) throws StripeException { String path = @@ -175,12 +191,20 @@ public Reader cancelAction(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(ReaderCancelActionParams params) throws StripeException { return cancelAction(params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(ReaderCancelActionParams params, RequestOptions options) throws StripeException { String path = @@ -197,12 +221,20 @@ public Reader cancelAction(ReaderCancelActionParams params, RequestOptions optio return getResponseGetter().request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(Map params) throws StripeException { return collectInputs(params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(Map params, RequestOptions options) throws StripeException { String path = @@ -213,12 +245,20 @@ public Reader collectInputs(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(ReaderCollectInputsParams params) throws StripeException { return collectInputs(params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions options) throws StripeException { String path = @@ -237,7 +277,9 @@ public Reader collectInputs(ReaderCollectInputsParams params, RequestOptions opt /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(Map params) throws StripeException { return collectPaymentMethod(params, (RequestOptions) null); @@ -245,7 +287,9 @@ public Reader collectPaymentMethod(Map params) throws StripeExce /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(Map params, RequestOptions options) throws StripeException { @@ -260,7 +304,9 @@ public Reader collectPaymentMethod(Map params, RequestOptions op /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params) throws StripeException { @@ -269,7 +315,9 @@ public Reader collectPaymentMethod(ReaderCollectPaymentMethodParams params) /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod( ReaderCollectPaymentMethodParams params, RequestOptions options) throws StripeException { @@ -288,12 +336,20 @@ public Reader collectPaymentMethod( return getResponseGetter().request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(Map params) throws StripeException { return confirmPaymentIntent(params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -305,13 +361,21 @@ public Reader confirmPaymentIntent(Map params, RequestOptions op return getResponseGetter().request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(ReaderConfirmPaymentIntentParams params) throws StripeException { return confirmPaymentIntent(params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent( ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException { String path = @@ -420,12 +484,20 @@ public static ReaderCollection list(ReaderListParams params, RequestOptions opti return getGlobalResponseGetter().request(request, ReaderCollection.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(Map params) throws StripeException { return processPaymentIntent(params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -437,13 +509,21 @@ public Reader processPaymentIntent(Map params, RequestOptions op return getResponseGetter().request(request, Reader.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(ReaderProcessPaymentIntentParams params) throws StripeException { return processPaymentIntent(params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent( ReaderProcessPaymentIntentParams params, RequestOptions options) throws StripeException { String path = @@ -461,12 +541,20 @@ public Reader processPaymentIntent( return getResponseGetter().request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(Map params) throws StripeException { return processSetupIntent(params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(Map params, RequestOptions options) throws StripeException { String path = @@ -477,12 +565,20 @@ public Reader processSetupIntent(Map params, RequestOptions opti return getResponseGetter().request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(ReaderProcessSetupIntentParams params) throws StripeException { return processSetupIntent(params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestOptions options) throws StripeException { String path = @@ -499,22 +595,38 @@ public Reader processSetupIntent(ReaderProcessSetupIntentParams params, RequestO return getResponseGetter().request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment() throws StripeException { return refundPayment((Map) null, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(RequestOptions options) throws StripeException { return refundPayment((Map) null, options); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(Map params) throws StripeException { return refundPayment(params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(Map params, RequestOptions options) throws StripeException { String path = @@ -525,12 +637,20 @@ public Reader refundPayment(Map params, RequestOptions options) return getResponseGetter().request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(ReaderRefundPaymentParams params) throws StripeException { return refundPayment(params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(ReaderRefundPaymentParams params, RequestOptions options) throws StripeException { String path = @@ -581,12 +701,18 @@ public static Reader retrieve(String reader, ReaderRetrieveParams params, Reques return getGlobalResponseGetter().request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(Map params) throws StripeException { return setReaderDisplay(params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(Map params, RequestOptions options) throws StripeException { String path = @@ -597,12 +723,18 @@ public Reader setReaderDisplay(Map params, RequestOptions option return getResponseGetter().request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(ReaderSetReaderDisplayParams params) throws StripeException { return setReaderDisplay(params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(ReaderSetReaderDisplayParams params, RequestOptions options) throws StripeException { String path = @@ -870,20 +1002,16 @@ public static class Selection extends StripeObject implements HasId { @Setter @EqualsAndHashCode(callSuper = false) public static class Choice extends StripeObject implements HasId { - /** The id to be selected. */ + /** The identifier for the selected choice. Maximum 50 characters. */ @Getter(onMethod_ = {@Override}) @SerializedName("id") String id; - /** - * The button style for the choice - * - *

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

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

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

Equal to {@code cart}. */ diff --git a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java index 45ccf1be14d..75fe5e952fd 100644 --- a/src/main/java/com/stripe/model/v2/EventDataClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventDataClassLookup.java @@ -103,9 +103,6 @@ public final class EventDataClassLookup { com.stripe.events.V1BillingMeterErrorReportTriggeredEvent.class); eventClassLookup.put( "v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEvent.class); - eventClassLookup.put( - "v2.billing.bill_setting.updated", - com.stripe.events.V2BillingBillSettingUpdatedEvent.class); eventClassLookup.put( "v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEvent.class); eventClassLookup.put( diff --git a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java index bb18ac069be..f8760c0b9b2 100644 --- a/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java +++ b/src/main/java/com/stripe/model/v2/EventNotificationClassLookup.java @@ -22,9 +22,6 @@ public final class EventNotificationClassLookup { eventClassLookup.put( "v1.billing.meter.no_meter_found", com.stripe.events.V1BillingMeterNoMeterFoundEventNotification.class); - eventClassLookup.put( - "v2.billing.bill_setting.updated", - com.stripe.events.V2BillingBillSettingUpdatedEventNotification.class); eventClassLookup.put( "v2.core.account.closed", com.stripe.events.V2CoreAccountClosedEventNotification.class); eventClassLookup.put( diff --git a/src/main/java/com/stripe/model/v2/billing/Cadence.java b/src/main/java/com/stripe/model/v2/billing/Cadence.java index d2ee08750fe..206cc7eb82d 100644 --- a/src/main/java/com/stripe/model/v2/billing/Cadence.java +++ b/src/main/java/com/stripe/model/v2/billing/Cadence.java @@ -506,15 +506,15 @@ public static class Collection extends StripeObject { @EqualsAndHashCode(callSuper = false) public static class EmailDelivery extends StripeObject { /** - * Controls emails for when the payment is due. For example after the invoice is finilized - * and transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized + * and transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; /** - * Controls emails for when the payment is due. For example after the invoice is finilized - * and transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized + * and transitions to Open state. */ @Getter @Setter @@ -525,7 +525,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of + * If true the payment link to hosted invoice page would be included in email and PDF of * the invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java index 5825c0a88b5..5e699c71989 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSetting.java @@ -98,15 +98,15 @@ public class CollectionSetting extends StripeObject implements HasId { @EqualsAndHashCode(callSuper = false) public static class EmailDelivery extends StripeObject { /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @Getter @Setter @@ -117,7 +117,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of the + * If true the payment link to hosted invoice page would be included in email and PDF of the * invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java index d111fb5721c..2b620865a26 100644 --- a/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java +++ b/src/main/java/com/stripe/model/v2/billing/CollectionSettingVersion.java @@ -72,15 +72,15 @@ public class CollectionSettingVersion extends StripeObject implements HasId { @EqualsAndHashCode(callSuper = false) public static class EmailDelivery extends StripeObject { /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @Getter @Setter @@ -91,7 +91,7 @@ public static class PaymentDue extends StripeObject { Boolean enabled; /** - * If true the payment link to hosted invocie page would be included in email and PDF of the + * If true the payment link to hosted invoice page would be included in email and PDF of the * invoice. */ @SerializedName("include_payment_link") diff --git a/src/main/java/com/stripe/model/v2/core/Account.java b/src/main/java/com/stripe/model/v2/core/Account.java index f4abbe9a3b7..ae678c427f9 100644 --- a/src/main/java/com/stripe/model/v2/core/Account.java +++ b/src/main/java/com/stripe/model/v2/core/Account.java @@ -28,6 +28,10 @@ public class Account extends StripeObject implements HasId { @SerializedName("applied_configurations") List appliedConfigurations; + /** A value indicating if the Account has been closed. */ + @SerializedName("closed") + Boolean closed; + /** * An Account Configuration which allows the Account to take on a key persona across Stripe * products. @@ -218,7 +222,8 @@ public static class AutomaticIndirectTax extends StripeObject { * 'identity_address'. Will only be used for automatic tax calculation on the customer's * Invoices and Subscriptions. * - *

One of {@code identity_address}, {@code ip_address}, or {@code shipping_address}. + *

One of {@code identity_address}, {@code ip_address}, {@code payment_method}, or {@code + * shipping_address}. */ @SerializedName("location_source") String locationSource; @@ -3885,6 +3890,10 @@ public static class HoldsCurrencies extends StripeObject { @SerializedName("gbp") Gbp gbp; + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + /** Can hold storage-type funds on Stripe in GBP. */ @Getter @Setter @@ -3940,6 +3949,62 @@ public static class StatusDetail extends StripeObject { String resolution; } } + + /** Can hold storage-type funds on Stripe in USD. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Usd extends StripeObject { + /** Whether the Capability has been requested. */ + @SerializedName("requested") + Boolean requested; + + /** + * The status of the Capability. + * + *

One of {@code active}, {@code pending}, {@code restricted}, or {@code + * unsupported}. + */ + @SerializedName("status") + String status; + + /** + * Additional details regarding the status of the Capability. {@code status_details} + * will be empty if the Capability's status is {@code active}. + */ + @SerializedName("status_details") + List + statusDetails; + + /** + * For more details about StatusDetail, please refer to the API Reference. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class StatusDetail extends StripeObject { + /** + * Machine-readable code explaining the reason for the Capability to be in its current + * status. + * + *

One of {@code determining_status}, {@code requirements_past_due}, {@code + * requirements_pending_verification}, {@code restricted_other}, {@code + * unsupported_business}, {@code unsupported_country}, or {@code + * unsupported_entity_type}. + */ + @SerializedName("code") + String code; + + /** + * Machine-readable code explaining how to make the Capability active. + * + *

One of {@code contact_stripe}, {@code no_resolution}, or {@code provide_info}. + */ + @SerializedName("resolution") + String resolution; + } + } } /** Can pull funds from an external source, owned by yourself, to a FinancialAccount. */ @@ -4402,7 +4467,8 @@ public static class Responsibilities extends StripeObject { * A value indicating the responsible payer of a bundle of Stripe fees for pricing-control * eligible products on this Account. * - *

One of {@code application}, or {@code stripe}. + *

One of {@code application}, {@code application_custom}, {@code application_express}, or + * {@code stripe}. */ @SerializedName("fees_collector") String feesCollector; @@ -4423,7 +4489,10 @@ public static class Responsibilities extends StripeObject { @Setter @EqualsAndHashCode(callSuper = false) public static class Identity extends StripeObject { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -4455,7 +4524,10 @@ public static class Identity extends StripeObject { @SerializedName("individual") Individual individual; - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @Getter @Setter @EqualsAndHashCode(callSuper = false) @@ -4478,6 +4550,13 @@ public static class Attestations extends StripeObject { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -4570,6 +4649,31 @@ public static class PersonsProvided extends StripeObject { String ownershipExemptionReason; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration extends StripeObject { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** The IP address from which the representative attestation was made. */ + @SerializedName("ip") + String ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + String userAgent; + } + /** Attestations of accepted terms of service agreements. */ @Getter @Setter @@ -6151,8 +6255,8 @@ public static class RestrictsCapability extends StripeObject { * cards}, {@code card_payments}, {@code cartes_bancaires_payments}, {@code * cashapp_payments}, {@code eps_payments}, {@code financial_addresses.bank_accounts}, * {@code fpx_payments}, {@code gb_bank_transfer_payments}, {@code grabpay_payments}, - * {@code holds_currencies.gbp}, {@code ideal_payments}, {@code - * inbound_transfers.financial_accounts}, {@code jcb_payments}, {@code + * {@code holds_currencies.gbp}, {@code holds_currencies.usd}, {@code ideal_payments}, + * {@code inbound_transfers.financial_accounts}, {@code jcb_payments}, {@code * jp_bank_transfer_payments}, {@code kakao_pay_payments}, {@code klarna_payments}, {@code * konbini_payments}, {@code kr_card_payments}, {@code link_payments}, {@code * mobilepay_payments}, {@code multibanco_payments}, {@code mx_bank_transfer_payments}, diff --git a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java index a2ac614c1c3..9dd736d44fc 100644 --- a/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java +++ b/src/main/java/com/stripe/model/v2/core/vault/UsBankAccount.java @@ -72,4 +72,49 @@ public class UsBankAccount extends StripeObject implements HasId { /** The ACH routing number of the bank account. */ @SerializedName("routing_number") String routingNumber; + + /** The bank account verification details. */ + @SerializedName("verification") + Verification verification; + + /** The bank account verification details. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class Verification extends StripeObject { + /** The microdeposit verification details if the status is awaiting verification. */ + @SerializedName("microdeposit_verification_details") + MicrodepositVerificationDetails microdepositVerificationDetails; + + /** + * The bank account verification status. + * + *

One of {@code awaiting_verification}, {@code unverified}, {@code verification_failed}, or + * {@code verified}. + */ + @SerializedName("status") + String status; + + /** The microdeposit verification details if the status is awaiting verification. */ + @Getter + @Setter + @EqualsAndHashCode(callSuper = false) + public static class MicrodepositVerificationDetails extends StripeObject { + /** Time when microdeposits will expire and have to be re-sent. */ + @SerializedName("expires") + Instant expires; + + /** + * Microdeposit type can be amounts or descriptor_type. + * + *

One of {@code amounts}, or {@code descriptor_code}. + */ + @SerializedName("microdeposit_type") + String microdepositType; + + /** Time when microdeposits were sent. */ + @SerializedName("sent") + Instant sent; + } + } } diff --git a/src/main/java/com/stripe/param/AccountCreateParams.java b/src/main/java/com/stripe/param/AccountCreateParams.java index 5fd61455fb6..1022f5aa67e 100644 --- a/src/main/java/com/stripe/param/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/AccountCreateParams.java @@ -8551,6 +8551,13 @@ public static class Company { @SerializedName("registration_number") String registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -8600,6 +8607,7 @@ private Company( String phone, Object registrationDate, String registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, @@ -8623,6 +8631,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -8671,6 +8680,8 @@ public static class Builder { private String registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -8702,6 +8713,7 @@ public AccountCreateParams.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -8895,6 +8907,16 @@ public Builder setRegistrationNumber(String registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountCreateParams.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -9745,6 +9767,111 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Company.RepresentativeDeclaration build() { + return new AccountCreateParams.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** The Unix timestamp marking when the representative declaration attestation was made. */ + public Builder setDate(Long date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountCreateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/AccountUpdateParams.java b/src/main/java/com/stripe/param/AccountUpdateParams.java index c24be6d00bf..b8f79658e1e 100644 --- a/src/main/java/com/stripe/param/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/AccountUpdateParams.java @@ -8648,6 +8648,13 @@ public static class Company { @SerializedName("registration_number") Object registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -8697,6 +8704,7 @@ private Company( Object phone, Object registrationDate, Object registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, Object taxId, Object taxIdRegistrar, @@ -8720,6 +8728,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -8768,6 +8777,8 @@ public static class Builder { private Object registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private Object taxId; @@ -8799,6 +8810,7 @@ public AccountUpdateParams.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -9040,6 +9052,16 @@ public Builder setRegistrationNumber(EmptyParam registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountUpdateParams.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -10070,6 +10092,126 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + Object ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + Object userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, Object ip, Object userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private Object ip; + + private Object userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Company.RepresentativeDeclaration build() { + return new AccountUpdateParams.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** The Unix timestamp marking when the representative declaration attestation was made. */ + public Builder setDate(Long date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link AccountUpdateParams.Company.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The IP address from which the representative declaration attestation was made. */ + public Builder setIp(EmptyParam ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(EmptyParam userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/CreditNoteCreateParams.java b/src/main/java/com/stripe/param/CreditNoteCreateParams.java index 6c4828056bf..53c7738c60f 100644 --- a/src/main/java/com/stripe/param/CreditNoteCreateParams.java +++ b/src/main/java/com/stripe/param/CreditNoteCreateParams.java @@ -883,6 +883,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -890,10 +897,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -905,12 +926,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNoteCreateParams.Refund build() { return new CreditNoteCreateParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -948,6 +977,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNoteCreateParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -956,6 +995,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNoteCreateParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNoteCreateParams.Refund.PaymentRecordRefund build() { + return new CreditNoteCreateParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNoteCreateParams.Refund.PaymentRecordRefund#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNoteCreateParams.Refund.PaymentRecordRefund#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java index dd6aeabb1ac..4445a387a6b 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewLinesListParams.java @@ -956,6 +956,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -963,10 +970,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -978,12 +999,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNotePreviewLinesListParams.Refund build() { return new CreditNotePreviewLinesListParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -1022,6 +1051,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -1030,6 +1069,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNotePreviewLinesListParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund build() { + return new CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNotePreviewLinesListParams.Refund.PaymentRecordRefund#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CreditNotePreviewParams.java b/src/main/java/com/stripe/param/CreditNotePreviewParams.java index 65db4a6c8cf..1ca061957bc 100644 --- a/src/main/java/com/stripe/param/CreditNotePreviewParams.java +++ b/src/main/java/com/stripe/param/CreditNotePreviewParams.java @@ -883,6 +883,13 @@ public static class Refund { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + @SerializedName("payment_record_refund") + PaymentRecordRefund paymentRecordRefund; + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -890,10 +897,24 @@ public static class Refund { @SerializedName("refund") String refund; - private Refund(Long amountRefunded, Map extraParams, String refund) { + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + @SerializedName("type") + Type type; + + private Refund( + Long amountRefunded, + Map extraParams, + PaymentRecordRefund paymentRecordRefund, + String refund, + Type type) { this.amountRefunded = amountRefunded; this.extraParams = extraParams; + this.paymentRecordRefund = paymentRecordRefund; this.refund = refund; + this.type = type; } public static Builder builder() { @@ -905,12 +926,20 @@ public static class Builder { private Map extraParams; + private PaymentRecordRefund paymentRecordRefund; + private String refund; + private Type type; + /** Finalize and obtain parameter instance from this builder. */ public CreditNotePreviewParams.Refund build() { return new CreditNotePreviewParams.Refund( - this.amountRefunded, this.extraParams, this.refund); + this.amountRefunded, + this.extraParams, + this.paymentRecordRefund, + this.refund, + this.type); } /** @@ -948,6 +977,16 @@ public Builder putAllExtraParam(Map map) { return this; } + /** + * The PaymentRecord refund details to link to this credit note. Required when {@code type} is + * {@code payment_record_refund}. + */ + public Builder setPaymentRecordRefund( + CreditNotePreviewParams.Refund.PaymentRecordRefund paymentRecordRefund) { + this.paymentRecordRefund = paymentRecordRefund; + return this; + } + /** * ID of an existing refund to link this credit note to. Required when {@code type} is {@code * refund}. @@ -956,6 +995,132 @@ public Builder setRefund(String refund) { this.refund = refund; return this; } + + /** + * Type of the refund, one of {@code refund} or {@code payment_record_refund}. Defaults to + * {@code refund}. + */ + public Builder setType(CreditNotePreviewParams.Refund.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class PaymentRecordRefund { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + @SerializedName("payment_record") + String paymentRecord; + + /** + * Required. The PaymentRecord refund group to link to this credit note. For + * refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on the + * PaymentRecord. + */ + @SerializedName("refund_group") + String refundGroup; + + private PaymentRecordRefund( + Map extraParams, String paymentRecord, String refundGroup) { + this.extraParams = extraParams; + this.paymentRecord = paymentRecord; + this.refundGroup = refundGroup; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String paymentRecord; + + private String refundGroup; + + /** Finalize and obtain parameter instance from this builder. */ + public CreditNotePreviewParams.Refund.PaymentRecordRefund build() { + return new CreditNotePreviewParams.Refund.PaymentRecordRefund( + this.extraParams, this.paymentRecord, this.refundGroup); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNotePreviewParams.Refund.PaymentRecordRefund#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CreditNotePreviewParams.Refund.PaymentRecordRefund#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The ID of the PaymentRecord with the refund to link to this + * credit note. + */ + public Builder setPaymentRecord(String paymentRecord) { + this.paymentRecord = paymentRecord; + return this; + } + + /** + * Required. The PaymentRecord refund group to link to this credit note. + * For refunds processed off-Stripe, this will correspond to the {@code + * processor_details.custom.refund_reference} field provided when reporting the refund on + * the PaymentRecord. + */ + public Builder setRefundGroup(String refundGroup) { + this.refundGroup = refundGroup; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("payment_record_refund") + PAYMENT_RECORD_REFUND("payment_record_refund"), + + @SerializedName("refund") + REFUND("refund"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } } } diff --git a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java index e16d8e81610..fe47391d356 100644 --- a/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java +++ b/src/main/java/com/stripe/param/CustomerListPaymentMethodsParams.java @@ -285,6 +285,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java index 6423cc1287b..430a8956192 100644 --- a/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/CustomerPaymentMethodListParams.java @@ -285,6 +285,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java index 315f12ca54c..a7738272279 100644 --- a/src/main/java/com/stripe/param/CustomerSessionCreateParams.java +++ b/src/main/java/com/stripe/param/CustomerSessionCreateParams.java @@ -156,6 +156,10 @@ public static class Components { @SerializedName("buy_button") BuyButton buyButton; + /** Configuration for the customer sheet. */ + @SerializedName("customer_sheet") + CustomerSheet customerSheet; + /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each @@ -165,6 +169,10 @@ public static class Components { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Configuration for the mobile payment element. */ + @SerializedName("mobile_payment_element") + MobilePaymentElement mobilePaymentElement; + /** Configuration for the Payment Element. */ @SerializedName("payment_element") PaymentElement paymentElement; @@ -173,15 +181,25 @@ public static class Components { @SerializedName("pricing_table") PricingTable pricingTable; + /** Configuration for the Tax ID Element. */ + @SerializedName("tax_id_element") + TaxIdElement taxIdElement; + private Components( BuyButton buyButton, + CustomerSheet customerSheet, Map extraParams, + MobilePaymentElement mobilePaymentElement, PaymentElement paymentElement, - PricingTable pricingTable) { + PricingTable pricingTable, + TaxIdElement taxIdElement) { this.buyButton = buyButton; + this.customerSheet = customerSheet; this.extraParams = extraParams; + this.mobilePaymentElement = mobilePaymentElement; this.paymentElement = paymentElement; this.pricingTable = pricingTable; + this.taxIdElement = taxIdElement; } public static Builder builder() { @@ -191,16 +209,28 @@ public static Builder builder() { public static class Builder { private BuyButton buyButton; + private CustomerSheet customerSheet; + private Map extraParams; + private MobilePaymentElement mobilePaymentElement; + private PaymentElement paymentElement; private PricingTable pricingTable; + private TaxIdElement taxIdElement; + /** Finalize and obtain parameter instance from this builder. */ public CustomerSessionCreateParams.Components build() { return new CustomerSessionCreateParams.Components( - this.buyButton, this.extraParams, this.paymentElement, this.pricingTable); + this.buyButton, + this.customerSheet, + this.extraParams, + this.mobilePaymentElement, + this.paymentElement, + this.pricingTable, + this.taxIdElement); } /** Configuration for buy button. */ @@ -209,6 +239,13 @@ public Builder setBuyButton(CustomerSessionCreateParams.Components.BuyButton buy return this; } + /** Configuration for the customer sheet. */ + public Builder setCustomerSheet( + CustomerSessionCreateParams.Components.CustomerSheet customerSheet) { + this.customerSheet = customerSheet; + return this; + } + /** * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` * call, and subsequent calls add additional key/value pairs to the original map. See {@link @@ -235,6 +272,13 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Configuration for the mobile payment element. */ + public Builder setMobilePaymentElement( + CustomerSessionCreateParams.Components.MobilePaymentElement mobilePaymentElement) { + this.mobilePaymentElement = mobilePaymentElement; + return this; + } + /** Configuration for the Payment Element. */ public Builder setPaymentElement( CustomerSessionCreateParams.Components.PaymentElement paymentElement) { @@ -248,6 +292,13 @@ public Builder setPricingTable( this.pricingTable = pricingTable; return this; } + + /** Configuration for the Tax ID Element. */ + public Builder setTaxIdElement( + CustomerSessionCreateParams.Components.TaxIdElement taxIdElement) { + this.taxIdElement = taxIdElement; + return this; + } } @Getter @@ -275,49 +326,750 @@ public static Builder builder() { return new Builder(); } - public static class Builder { - private Boolean enabled; + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.BuyButton build() { + return new CustomerSessionCreateParams.Components.BuyButton( + this.enabled, this.extraParams); + } + + /** Required. Whether the buy button is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.BuyButton#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.BuyButton#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 CustomerSheet { + /** Required. Whether the customer sheet is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** This hash defines whether the customer sheet supports certain features. */ + @SerializedName("features") + Features features; + + private CustomerSheet(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.CustomerSheet build() { + return new CustomerSessionCreateParams.Components.CustomerSheet( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the customer sheet is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.CustomerSheet#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.CustomerSheet#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This hash defines whether the customer sheet supports certain features. */ + public Builder setFeatures( + CustomerSessionCreateParams.Components.CustomerSheet.Features features) { + this.features = features; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Features { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * A list of {@code + * allow_redisplay} values that controls which saved payment methods the customer sheet + * displays by filtering to only show payment methods with an {@code allow_redisplay} value + * that is present in this list. + * + *

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

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

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

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

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

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

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

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

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

If not specified, defaults to {@code nil} (no override value). + */ + public Builder setPaymentMethodSaveAllowRedisplayOverride( + CustomerSessionCreateParams.Components.MobilePaymentElement.Features + .PaymentMethodSaveAllowRedisplayOverride + paymentMethodSaveAllowRedisplayOverride) { + this.paymentMethodSaveAllowRedisplayOverride = paymentMethodSaveAllowRedisplayOverride; + return this; + } + } + + public enum PaymentMethodAllowRedisplayFilter implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodAllowRedisplayFilter(String value) { + this.value = value; + } + } + + public enum PaymentMethodRedisplay implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); - private Map extraParams; + @Getter(onMethod_ = {@Override}) + private final String value; - /** Finalize and obtain parameter instance from this builder. */ - public CustomerSessionCreateParams.Components.BuyButton build() { - return new CustomerSessionCreateParams.Components.BuyButton( - this.enabled, this.extraParams); + PaymentMethodRedisplay(String value) { + this.value = value; + } } - /** Required. Whether the buy button is enabled. */ - public Builder setEnabled(Boolean enabled) { - this.enabled = enabled; - return this; + public enum PaymentMethodRemove implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodRemove(String value) { + this.value = value; + } } - /** - * Add a key/value pair to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link CustomerSessionCreateParams.Components.BuyButton#extraParams} for the - * field documentation. - */ - public Builder putExtraParam(String key, Object value) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public enum PaymentMethodSave implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSave(String value) { + this.value = value; } - this.extraParams.put(key, value); - return this; } - /** - * Add all map key/value pairs to `extraParams` map. A map is initialized for the first - * `put/putAll` call, and subsequent calls add additional key/value pairs to the original - * map. See {@link CustomerSessionCreateParams.Components.BuyButton#extraParams} for the - * field documentation. - */ - public Builder putAllExtraParam(Map map) { - if (this.extraParams == null) { - this.extraParams = new HashMap<>(); + public enum PaymentMethodSaveAllowRedisplayOverride implements ApiRequestParams.EnumParam { + @SerializedName("always") + ALWAYS("always"), + + @SerializedName("limited") + LIMITED("limited"), + + @SerializedName("unspecified") + UNSPECIFIED("unspecified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + PaymentMethodSaveAllowRedisplayOverride(String value) { + this.value = value; } - this.extraParams.putAll(map); - return this; } } } @@ -838,5 +1590,239 @@ public Builder putAllExtraParam(Map map) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class TaxIdElement { + /** Required. Whether the Tax ID Element is enabled. */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** This hash defines whether the Tax ID Element supports certain features. */ + @SerializedName("features") + Features features; + + private TaxIdElement(Boolean enabled, Map extraParams, Features features) { + this.enabled = enabled; + this.extraParams = extraParams; + this.features = features; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Features features; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.TaxIdElement build() { + return new CustomerSessionCreateParams.Components.TaxIdElement( + this.enabled, this.extraParams, this.features); + } + + /** Required. Whether the Tax ID Element is enabled. */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.TaxIdElement#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link CustomerSessionCreateParams.Components.TaxIdElement#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** This hash defines whether the Tax ID Element supports certain features. */ + public Builder setFeatures( + CustomerSessionCreateParams.Components.TaxIdElement.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; + + /** + * Controls whether the Tax ID Element displays saved tax IDs for the customer. This + * parameter defaults to {@code disabled}. + * + *

When enabled, the Tax ID Element will show existing tax IDs associated with the + * customer, allowing them to select from previously saved tax identification numbers. + */ + @SerializedName("tax_id_redisplay") + TaxIdRedisplay taxIdRedisplay; + + /** + * Controls whether the Tax ID Element allows merchants to save new tax IDs for their + * customer. This parameter defaults to {@code disabled}. + * + *

When enabled, customers can enter and save new tax identification numbers during the + * payment flow, which will be stored securely and associated with their customer object for + * future use. + */ + @SerializedName("tax_id_save") + TaxIdSave taxIdSave; + + private Features( + Map extraParams, TaxIdRedisplay taxIdRedisplay, TaxIdSave taxIdSave) { + this.extraParams = extraParams; + this.taxIdRedisplay = taxIdRedisplay; + this.taxIdSave = taxIdSave; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private TaxIdRedisplay taxIdRedisplay; + + private TaxIdSave taxIdSave; + + /** Finalize and obtain parameter instance from this builder. */ + public CustomerSessionCreateParams.Components.TaxIdElement.Features build() { + return new CustomerSessionCreateParams.Components.TaxIdElement.Features( + this.extraParams, this.taxIdRedisplay, this.taxIdSave); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * CustomerSessionCreateParams.Components.TaxIdElement.Features#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * CustomerSessionCreateParams.Components.TaxIdElement.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; + } + + /** + * Controls whether the Tax ID Element displays saved tax IDs for the customer. This + * parameter defaults to {@code disabled}. + * + *

When enabled, the Tax ID Element will show existing tax IDs associated with the + * customer, allowing them to select from previously saved tax identification numbers. + */ + public Builder setTaxIdRedisplay( + CustomerSessionCreateParams.Components.TaxIdElement.Features.TaxIdRedisplay + taxIdRedisplay) { + this.taxIdRedisplay = taxIdRedisplay; + return this; + } + + /** + * Controls whether the Tax ID Element allows merchants to save new tax IDs for their + * customer. This parameter defaults to {@code disabled}. + * + *

When enabled, customers can enter and save new tax identification numbers during the + * payment flow, which will be stored securely and associated with their customer object + * for future use. + */ + public Builder setTaxIdSave( + CustomerSessionCreateParams.Components.TaxIdElement.Features.TaxIdSave taxIdSave) { + this.taxIdSave = taxIdSave; + return this; + } + } + + public enum TaxIdRedisplay implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxIdRedisplay(String value) { + this.value = value; + } + } + + public enum TaxIdSave implements ApiRequestParams.EnumParam { + @SerializedName("disabled") + DISABLED("disabled"), + + @SerializedName("enabled") + ENABLED("enabled"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + TaxIdSave(String value) { + this.value = value; + } + } + } + } } } diff --git a/src/main/java/com/stripe/param/FileCreateParams.java b/src/main/java/com/stripe/param/FileCreateParams.java index 55026b17719..665a984b1b9 100644 --- a/src/main/java/com/stripe/param/FileCreateParams.java +++ b/src/main/java/com/stripe/param/FileCreateParams.java @@ -361,6 +361,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("pci_document") PCI_DOCUMENT("pci_document"), + @SerializedName("platform_terms_of_service") + PLATFORM_TERMS_OF_SERVICE("platform_terms_of_service"), + @SerializedName("tax_document_user_upload") TAX_DOCUMENT_USER_UPLOAD("tax_document_user_upload"), diff --git a/src/main/java/com/stripe/param/FileListParams.java b/src/main/java/com/stripe/param/FileListParams.java index ad1192cacea..f0085ee3138 100644 --- a/src/main/java/com/stripe/param/FileListParams.java +++ b/src/main/java/com/stripe/param/FileListParams.java @@ -363,6 +363,9 @@ public enum Purpose implements ApiRequestParams.EnumParam { @SerializedName("pci_document") PCI_DOCUMENT("pci_document"), + @SerializedName("platform_terms_of_service") + PLATFORM_TERMS_OF_SERVICE("platform_terms_of_service"), + @SerializedName("selfie") SELFIE("selfie"), diff --git a/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java index 85a48339197..3a68f81ca90 100644 --- a/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java +++ b/src/main/java/com/stripe/param/PaymentAttemptRecordListParams.java @@ -37,12 +37,26 @@ public class PaymentAttemptRecordListParams extends ApiRequestParams { @SerializedName("payment_record") String paymentRecord; + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your place + * in the list. For instance, if you make a list request and receive 100 objects, ending with + * {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in order to + * fetch the next page of the list. + */ + @SerializedName("starting_after") + String startingAfter; + private PaymentAttemptRecordListParams( - List expand, Map extraParams, Long limit, String paymentRecord) { + List expand, + Map extraParams, + Long limit, + String paymentRecord, + String startingAfter) { this.expand = expand; this.extraParams = extraParams; this.limit = limit; this.paymentRecord = paymentRecord; + this.startingAfter = startingAfter; } public static Builder builder() { @@ -58,10 +72,12 @@ public static class Builder { private String paymentRecord; + private String startingAfter; + /** Finalize and obtain parameter instance from this builder. */ public PaymentAttemptRecordListParams build() { return new PaymentAttemptRecordListParams( - this.expand, this.extraParams, this.limit, this.paymentRecord); + this.expand, this.extraParams, this.limit, this.paymentRecord, this.startingAfter); } /** @@ -130,5 +146,16 @@ public Builder setPaymentRecord(String paymentRecord) { this.paymentRecord = paymentRecord; return this; } + + /** + * A cursor for use in pagination. {@code starting_after} is an object ID that defines your + * place in the list. For instance, if you make a list request and receive 100 objects, ending + * with {@code obj_foo}, your subsequent call can include {@code starting_after=obj_foo} in + * order to fetch the next page of the list. + */ + public Builder setStartingAfter(String startingAfter) { + this.startingAfter = startingAfter; + return this; + } } } diff --git a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java index 42477c19f00..3e9f5d28667 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCaptureParams.java @@ -1070,6 +1070,13 @@ public static class Klarna { @SerializedName("product_url") String productUrl; + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + /** Reference for the subscription this line item is for. */ @SerializedName("subscription_reference") String subscriptionReference; @@ -1078,10 +1085,12 @@ private Klarna( Map extraParams, String imageUrl, String productUrl, + String reference, String subscriptionReference) { this.extraParams = extraParams; this.imageUrl = imageUrl; this.productUrl = productUrl; + this.reference = reference; this.subscriptionReference = subscriptionReference; } @@ -1096,6 +1105,8 @@ public static class Builder { private String productUrl; + private String reference; + private String subscriptionReference; /** Finalize and obtain parameter instance from this builder. */ @@ -1103,7 +1114,11 @@ public static class Builder { build() { return new PaymentIntentCaptureParams.AmountDetails.LineItem.PaymentMethodOptions .Klarna( - this.extraParams, this.imageUrl, this.productUrl, this.subscriptionReference); + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); } /** @@ -1148,6 +1163,15 @@ public Builder setProductUrl(String productUrl) { return this; } + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + /** Reference for the subscription this line item is for. */ public Builder setSubscriptionReference(String subscriptionReference) { this.subscriptionReference = subscriptionReference; diff --git a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java index 4e328804c8b..f3db094fa27 100644 --- a/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentConfirmParams.java @@ -1428,6 +1428,13 @@ public static class Klarna { @SerializedName("product_url") String productUrl; + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + /** Reference for the subscription this line item is for. */ @SerializedName("subscription_reference") String subscriptionReference; @@ -1436,10 +1443,12 @@ private Klarna( Map extraParams, String imageUrl, String productUrl, + String reference, String subscriptionReference) { this.extraParams = extraParams; this.imageUrl = imageUrl; this.productUrl = productUrl; + this.reference = reference; this.subscriptionReference = subscriptionReference; } @@ -1454,6 +1463,8 @@ public static class Builder { private String productUrl; + private String reference; + private String subscriptionReference; /** Finalize and obtain parameter instance from this builder. */ @@ -1461,7 +1472,11 @@ public static class Builder { build() { return new PaymentIntentConfirmParams.AmountDetails.LineItem.PaymentMethodOptions .Klarna( - this.extraParams, this.imageUrl, this.productUrl, this.subscriptionReference); + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); } /** @@ -1506,6 +1521,15 @@ public Builder setProductUrl(String productUrl) { return this; } + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + /** Reference for the subscription this line item is for. */ public Builder setSubscriptionReference(String subscriptionReference) { this.subscriptionReference = subscriptionReference; diff --git a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java index a5bc099012d..177a0f4f512 100644 --- a/src/main/java/com/stripe/param/PaymentIntentCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentCreateParams.java @@ -1810,6 +1810,13 @@ public static class Klarna { @SerializedName("product_url") String productUrl; + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + /** Reference for the subscription this line item is for. */ @SerializedName("subscription_reference") String subscriptionReference; @@ -1818,10 +1825,12 @@ private Klarna( Map extraParams, String imageUrl, String productUrl, + String reference, String subscriptionReference) { this.extraParams = extraParams; this.imageUrl = imageUrl; this.productUrl = productUrl; + this.reference = reference; this.subscriptionReference = subscriptionReference; } @@ -1836,6 +1845,8 @@ public static class Builder { private String productUrl; + private String reference; + private String subscriptionReference; /** Finalize and obtain parameter instance from this builder. */ @@ -1843,7 +1854,11 @@ public static class Builder { build() { return new PaymentIntentCreateParams.AmountDetails.LineItem.PaymentMethodOptions .Klarna( - this.extraParams, this.imageUrl, this.productUrl, this.subscriptionReference); + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); } /** @@ -1888,6 +1903,15 @@ public Builder setProductUrl(String productUrl) { return this; } + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + /** Reference for the subscription this line item is for. */ public Builder setSubscriptionReference(String subscriptionReference) { this.subscriptionReference = subscriptionReference; diff --git a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java index 7b5b7a5886a..189253fa850 100644 --- a/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentIncrementAuthorizationParams.java @@ -1035,6 +1035,13 @@ public static class Klarna { @SerializedName("product_url") String productUrl; + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + String reference; + /** Reference for the subscription this line item is for. */ @SerializedName("subscription_reference") String subscriptionReference; @@ -1043,10 +1050,12 @@ private Klarna( Map extraParams, String imageUrl, String productUrl, + String reference, String subscriptionReference) { this.extraParams = extraParams; this.imageUrl = imageUrl; this.productUrl = productUrl; + this.reference = reference; this.subscriptionReference = subscriptionReference; } @@ -1061,6 +1070,8 @@ public static class Builder { private String productUrl; + private String reference; + private String subscriptionReference; /** Finalize and obtain parameter instance from this builder. */ @@ -1069,7 +1080,11 @@ public static class Builder { build() { return new PaymentIntentIncrementAuthorizationParams.AmountDetails.LineItem .PaymentMethodOptions.Klarna( - this.extraParams, this.imageUrl, this.productUrl, this.subscriptionReference); + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); } /** @@ -1114,6 +1129,15 @@ public Builder setProductUrl(String productUrl) { return this; } + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + /** Reference for the subscription this line item is for. */ public Builder setSubscriptionReference(String subscriptionReference) { this.subscriptionReference = subscriptionReference; diff --git a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java index 98d98ae635f..bd2c517c7e1 100644 --- a/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentIntentUpdateParams.java @@ -1728,6 +1728,13 @@ public static class Klarna { @SerializedName("product_url") Object productUrl; + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + @SerializedName("reference") + Object reference; + /** Reference for the subscription this line item is for. */ @SerializedName("subscription_reference") Object subscriptionReference; @@ -1736,10 +1743,12 @@ private Klarna( Map extraParams, Object imageUrl, Object productUrl, + Object reference, Object subscriptionReference) { this.extraParams = extraParams; this.imageUrl = imageUrl; this.productUrl = productUrl; + this.reference = reference; this.subscriptionReference = subscriptionReference; } @@ -1754,6 +1763,8 @@ public static class Builder { private Object productUrl; + private Object reference; + private Object subscriptionReference; /** Finalize and obtain parameter instance from this builder. */ @@ -1761,7 +1772,11 @@ public static class Builder { build() { return new PaymentIntentUpdateParams.AmountDetails.LineItem.PaymentMethodOptions .Klarna( - this.extraParams, this.imageUrl, this.productUrl, this.subscriptionReference); + this.extraParams, + this.imageUrl, + this.productUrl, + this.reference, + this.subscriptionReference); } /** @@ -1818,6 +1833,24 @@ public Builder setProductUrl(EmptyParam productUrl) { return this; } + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(String reference) { + this.reference = reference; + return this; + } + + /** + * Unique reference for this line item to correlate it with your system’s internal + * records. The field is displayed in the Klarna Consumer App if passed. + */ + public Builder setReference(EmptyParam reference) { + this.reference = reference; + return this; + } + /** Reference for the subscription this line item is for. */ public Builder setSubscriptionReference(String subscriptionReference) { this.subscriptionReference = subscriptionReference; diff --git a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java index 5e4b9b3a407..fe94aaaa8c2 100644 --- a/src/main/java/com/stripe/param/PaymentLinkCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkCreateParams.java @@ -119,6 +119,10 @@ public class PaymentLinkCreateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** Controls settings applied for collecting the customer's name. */ + @SerializedName("name_collection") + NameCollection nameCollection; + /** The account on behalf of which to charge. */ @SerializedName("on_behalf_of") String onBehalfOf; @@ -233,6 +237,7 @@ private PaymentLinkCreateParams( InvoiceCreation invoiceCreation, List lineItems, Map metadata, + NameCollection nameCollection, String onBehalfOf, List optionalItems, PaymentIntentData paymentIntentData, @@ -263,6 +268,7 @@ private PaymentLinkCreateParams( this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.metadata = metadata; + this.nameCollection = nameCollection; this.onBehalfOf = onBehalfOf; this.optionalItems = optionalItems; this.paymentIntentData = paymentIntentData; @@ -317,6 +323,8 @@ public static class Builder { private Map metadata; + private NameCollection nameCollection; + private String onBehalfOf; private List optionalItems; @@ -363,6 +371,7 @@ public PaymentLinkCreateParams build() { this.invoiceCreation, this.lineItems, this.metadata, + this.nameCollection, this.onBehalfOf, this.optionalItems, this.paymentIntentData, @@ -599,6 +608,12 @@ public Builder putAllMetadata(Map map) { return this; } + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(PaymentLinkCreateParams.NameCollection nameCollection) { + this.nameCollection = nameCollection; + return this; + } + /** The account on behalf of which to charge. */ public Builder setOnBehalfOf(String onBehalfOf) { this.onBehalfOf = onBehalfOf; @@ -4238,6 +4253,284 @@ public enum TaxBehavior implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection { + /** Controls settings applied for collecting the customer's business name. */ + @SerializedName("business") + Business business; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Controls settings applied for collecting the customer's individual name. */ + @SerializedName("individual") + Individual individual; + + private NameCollection( + Business business, Map extraParams, Individual individual) { + this.business = business; + this.extraParams = extraParams; + this.individual = individual; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Business business; + + private Map extraParams; + + private Individual individual; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection build() { + return new PaymentLinkCreateParams.NameCollection( + this.business, this.extraParams, this.individual); + } + + /** Controls settings applied for collecting the customer's business name. */ + public Builder setBusiness(PaymentLinkCreateParams.NameCollection.Business business) { + this.business = business; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLinkCreateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLinkCreateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Controls settings applied for collecting the customer's individual name. */ + public Builder setIndividual(PaymentLinkCreateParams.NameCollection.Individual individual) { + this.individual = individual; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Business { + /** + * Required. Enable business name collection on the payment link. Defaults to + * {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Business(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection.Business build() { + return new PaymentLinkCreateParams.NameCollection.Business( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable business name collection on the payment link. Defaults + * to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Individual { + /** + * Required. Enable individual name collection on the payment link. Defaults + * to {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Individual(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkCreateParams.NameCollection.Individual build() { + return new PaymentLinkCreateParams.NameCollection.Individual( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable individual name collection on the payment link. + * Defaults to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkCreateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class OptionalItem { diff --git a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java index 39b3df23c26..c732d0704e5 100644 --- a/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentLinkUpdateParams.java @@ -96,6 +96,10 @@ public class PaymentLinkUpdateParams extends ApiRequestParams { @SerializedName("metadata") Map metadata; + /** Controls settings applied for collecting the customer's name. */ + @SerializedName("name_collection") + Object nameCollection; + /** * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. @@ -176,6 +180,7 @@ private PaymentLinkUpdateParams( InvoiceCreation invoiceCreation, List lineItems, Map metadata, + Object nameCollection, PaymentIntentData paymentIntentData, PaymentMethodCollection paymentMethodCollection, Object paymentMethodTypes, @@ -199,6 +204,7 @@ private PaymentLinkUpdateParams( this.invoiceCreation = invoiceCreation; this.lineItems = lineItems; this.metadata = metadata; + this.nameCollection = nameCollection; this.paymentIntentData = paymentIntentData; this.paymentMethodCollection = paymentMethodCollection; this.paymentMethodTypes = paymentMethodTypes; @@ -243,6 +249,8 @@ public static class Builder { private Map metadata; + private Object nameCollection; + private PaymentIntentData paymentIntentData; private PaymentMethodCollection paymentMethodCollection; @@ -278,6 +286,7 @@ public PaymentLinkUpdateParams build() { this.invoiceCreation, this.lineItems, this.metadata, + this.nameCollection, this.paymentIntentData, this.paymentMethodCollection, this.paymentMethodTypes, @@ -507,6 +516,18 @@ public Builder putAllMetadata(Map map) { return this; } + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(PaymentLinkUpdateParams.NameCollection nameCollection) { + this.nameCollection = nameCollection; + return this; + } + + /** Controls settings applied for collecting the customer's name. */ + public Builder setNameCollection(EmptyParam nameCollection) { + this.nameCollection = nameCollection; + return this; + } + /** * A subset of parameters to be passed to PaymentIntent creation for Checkout Sessions in {@code * payment} mode. @@ -3394,6 +3415,284 @@ public Builder setMinimum(Long minimum) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class NameCollection { + /** Controls settings applied for collecting the customer's business name. */ + @SerializedName("business") + Business business; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Controls settings applied for collecting the customer's individual name. */ + @SerializedName("individual") + Individual individual; + + private NameCollection( + Business business, Map extraParams, Individual individual) { + this.business = business; + this.extraParams = extraParams; + this.individual = individual; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Business business; + + private Map extraParams; + + private Individual individual; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection build() { + return new PaymentLinkUpdateParams.NameCollection( + this.business, this.extraParams, this.individual); + } + + /** Controls settings applied for collecting the customer's business name. */ + public Builder setBusiness(PaymentLinkUpdateParams.NameCollection.Business business) { + this.business = business; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentLinkUpdateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentLinkUpdateParams.NameCollection#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Controls settings applied for collecting the customer's individual name. */ + public Builder setIndividual(PaymentLinkUpdateParams.NameCollection.Individual individual) { + this.individual = individual; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Business { + /** + * Required. Enable business name collection on the payment link. Defaults to + * {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Business(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection.Business build() { + return new PaymentLinkUpdateParams.NameCollection.Business( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable business name collection on the payment link. Defaults + * to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Business#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their business name before checking out. + * Defaults to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Individual { + /** + * Required. Enable individual name collection on the payment link. Defaults + * to {@code false}. + */ + @SerializedName("enabled") + Boolean enabled; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + @SerializedName("optional") + Boolean optional; + + private Individual(Boolean enabled, Map extraParams, Boolean optional) { + this.enabled = enabled; + this.extraParams = extraParams; + this.optional = optional; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Boolean enabled; + + private Map extraParams; + + private Boolean optional; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentLinkUpdateParams.NameCollection.Individual build() { + return new PaymentLinkUpdateParams.NameCollection.Individual( + this.enabled, this.extraParams, this.optional); + } + + /** + * Required. Enable individual name collection on the payment link. + * Defaults to {@code false}. + */ + public Builder setEnabled(Boolean enabled) { + this.enabled = enabled; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentLinkUpdateParams.NameCollection.Individual#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Whether the customer is required to provide their full name before checking out. Defaults + * to {@code false}. + */ + public Builder setOptional(Boolean optional) { + this.optional = optional; + return this; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class PaymentIntentData { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java index f2cc29dee10..9046e4215fb 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationCreateParams.java @@ -159,6 +159,13 @@ public class PaymentMethodConfigurationCreateParams extends ApiRequestParams { @SerializedName("cashapp") Cashapp cashapp; + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and Metamask. + */ + @SerializedName("crypto") + Crypto crypto; + /** * Uses a customer’s cash balance * for the payment. The cash balance can be funded via a bank transfer. Check this page for more details. + */ + @SerializedName("mb_way") + MbWay mbWay; + /** * MobilePay is a single-use * card wallet payment method used in Denmark and Finland. It allows customers to expand, @@ -573,6 +589,7 @@ private PaymentMethodConfigurationCreateParams( Konbini konbini, KrCard krCard, Link link, + MbWay mbWay, Mobilepay mobilepay, Multibanco multibanco, String name, @@ -618,6 +635,7 @@ private PaymentMethodConfigurationCreateParams( this.card = card; this.cartesBancaires = cartesBancaires; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.expand = expand; @@ -636,6 +654,7 @@ private PaymentMethodConfigurationCreateParams( this.konbini = konbini; this.krCard = krCard; this.link = link; + this.mbWay = mbWay; this.mobilepay = mobilepay; this.multibanco = multibanco; this.name = name; @@ -705,6 +724,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -741,6 +762,8 @@ public static class Builder { private Link link; + private MbWay mbWay; + private Mobilepay mobilepay; private Multibanco multibanco; @@ -817,6 +840,7 @@ public PaymentMethodConfigurationCreateParams build() { this.card, this.cartesBancaires, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.expand, @@ -835,6 +859,7 @@ public PaymentMethodConfigurationCreateParams build() { this.konbini, this.krCard, this.link, + this.mbWay, this.mobilepay, this.multibanco, this.name, @@ -1048,6 +1073,16 @@ public Builder setCashapp(PaymentMethodConfigurationCreateParams.Cashapp cashapp return this; } + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and + * Metamask. + */ + public Builder setCrypto(PaymentMethodConfigurationCreateParams.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * Uses a customer’s cash * balance for the payment. The cash balance can be funded via a bank transfer. Check this @@ -1275,6 +1310,16 @@ public Builder setLink(PaymentMethodConfigurationCreateParams.Link link) { return this; } + /** + * MB WAY is the most popular wallet in Portugal. After entering their phone number in your + * checkout, customers approve the payment directly in their MB WAY app. Check this page for more details. + */ + public Builder setMbWay(PaymentMethodConfigurationCreateParams.MbWay mbWay) { + this.mbWay = mbWay; + return this; + } + /** * MobilePay is a single-use card wallet @@ -4385,6 +4430,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Crypto build() { + return new PaymentMethodConfigurationCreateParams.Crypto( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationCreateParams.Crypto#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.Crypto.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -7035,6 +7245,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MbWay { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MbWay(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.MbWay build() { + return new PaymentMethodConfigurationCreateParams.MbWay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationCreateParams.MbWay#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference build() { + return new PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationCreateParams.MbWay.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Mobilepay { diff --git a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java index 1928a9e1e73..1b7324c79fc 100644 --- a/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodConfigurationUpdateParams.java @@ -164,6 +164,13 @@ public class PaymentMethodConfigurationUpdateParams extends ApiRequestParams { @SerializedName("cashapp") Cashapp cashapp; + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and Metamask. + */ + @SerializedName("crypto") + Crypto crypto; + /** * Uses a customer’s cash balance * for the payment. The cash balance can be funded via a bank transfer. Check this page for more details. + */ + @SerializedName("mb_way") + MbWay mbWay; + /** * MobilePay is a single-use * card wallet payment method used in Denmark and Finland. It allows customers to expand, @@ -575,6 +591,7 @@ private PaymentMethodConfigurationUpdateParams( Konbini konbini, KrCard krCard, Link link, + MbWay mbWay, Mobilepay mobilepay, Multibanco multibanco, Object name, @@ -620,6 +637,7 @@ private PaymentMethodConfigurationUpdateParams( this.card = card; this.cartesBancaires = cartesBancaires; this.cashapp = cashapp; + this.crypto = crypto; this.customerBalance = customerBalance; this.eps = eps; this.expand = expand; @@ -638,6 +656,7 @@ private PaymentMethodConfigurationUpdateParams( this.konbini = konbini; this.krCard = krCard; this.link = link; + this.mbWay = mbWay; this.mobilepay = mobilepay; this.multibanco = multibanco; this.name = name; @@ -708,6 +727,8 @@ public static class Builder { private Cashapp cashapp; + private Crypto crypto; + private CustomerBalance customerBalance; private Eps eps; @@ -744,6 +765,8 @@ public static class Builder { private Link link; + private MbWay mbWay; + private Mobilepay mobilepay; private Multibanco multibanco; @@ -819,6 +842,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.card, this.cartesBancaires, this.cashapp, + this.crypto, this.customerBalance, this.eps, this.expand, @@ -837,6 +861,7 @@ public PaymentMethodConfigurationUpdateParams build() { this.konbini, this.krCard, this.link, + this.mbWay, this.mobilepay, this.multibanco, this.name, @@ -1055,6 +1080,16 @@ public Builder setCashapp(PaymentMethodConfigurationUpdateParams.Cashapp cashapp return this; } + /** + * Stablecoin payments enable + * customers to pay in stablecoins like USDC from 100s of wallets including Phantom and + * Metamask. + */ + public Builder setCrypto(PaymentMethodConfigurationUpdateParams.Crypto crypto) { + this.crypto = crypto; + return this; + } + /** * Uses a customer’s cash * balance for the payment. The cash balance can be funded via a bank transfer. Check this @@ -1282,6 +1317,16 @@ public Builder setLink(PaymentMethodConfigurationUpdateParams.Link link) { return this; } + /** + * MB WAY is the most popular wallet in Portugal. After entering their phone number in your + * checkout, customers approve the payment directly in their MB WAY app. Check this page for more details. + */ + public Builder setMbWay(PaymentMethodConfigurationUpdateParams.MbWay mbWay) { + this.mbWay = mbWay; + return this; + } + /** * MobilePay is a single-use card wallet @@ -4392,6 +4437,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Crypto { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private Crypto(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Crypto build() { + return new PaymentMethodConfigurationUpdateParams.Crypto( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationUpdateParams.Crypto#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference#extraParams} for the + * field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.Crypto.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -7042,6 +7252,171 @@ public enum Preference implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class MbWay { + /** Whether or not the payment method should be displayed. */ + @SerializedName("display_preference") + DisplayPreference displayPreference; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + private MbWay(DisplayPreference displayPreference, Map extraParams) { + this.displayPreference = displayPreference; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private DisplayPreference displayPreference; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.MbWay build() { + return new PaymentMethodConfigurationUpdateParams.MbWay( + this.displayPreference, this.extraParams); + } + + /** Whether or not the payment method should be displayed. */ + public Builder setDisplayPreference( + PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference displayPreference) { + this.displayPreference = displayPreference; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodConfigurationUpdateParams.MbWay#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class DisplayPreference { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The account's preference for whether or not to display this payment method. */ + @SerializedName("preference") + Preference preference; + + private DisplayPreference(Map extraParams, Preference preference) { + this.extraParams = extraParams; + this.preference = preference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Preference preference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference build() { + return new PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference( + this.extraParams, this.preference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The account's preference for whether or not to display this payment method. */ + public Builder setPreference( + PaymentMethodConfigurationUpdateParams.MbWay.DisplayPreference.Preference preference) { + this.preference = preference; + return this; + } + } + + public enum Preference implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"), + + @SerializedName("off") + OFF("off"), + + @SerializedName("on") + ON("on"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Preference(String value) { + this.value = value; + } + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Mobilepay { diff --git a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java index 352519ee9ce..903ff56de2a 100644 --- a/src/main/java/com/stripe/param/PaymentMethodCreateParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodCreateParams.java @@ -135,6 +135,13 @@ public class PaymentMethodCreateParams extends ApiRequestParams { @SerializedName("crypto") Crypto crypto; + /** + * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom payment + * method. + */ + @SerializedName("custom") + Custom custom; + /** The {@code Customer} to whom the original PaymentMethod is attached. */ @SerializedName("customer") String customer; @@ -492,6 +499,7 @@ private PaymentMethodCreateParams( Object card, Cashapp cashapp, Crypto crypto, + Custom custom, String customer, CustomerBalance customerBalance, Eps eps, @@ -559,6 +567,7 @@ private PaymentMethodCreateParams( this.card = card; this.cashapp = cashapp; this.crypto = crypto; + this.custom = custom; this.customer = customer; this.customerBalance = customerBalance; this.eps = eps; @@ -650,6 +659,8 @@ public static class Builder { private Crypto crypto; + private Custom custom; + private String customer; private CustomerBalance customerBalance; @@ -770,6 +781,7 @@ public PaymentMethodCreateParams build() { this.card, this.cashapp, this.crypto, + this.custom, this.customer, this.customerBalance, this.eps, @@ -994,6 +1006,15 @@ public Builder setCrypto(PaymentMethodCreateParams.Crypto crypto) { return this; } + /** + * If this is a {@code custom} PaymentMethod, this hash contains details about the Custom + * payment method. + */ + public Builder setCustom(PaymentMethodCreateParams.Custom custom) { + this.custom = custom; + return this; + } + /** The {@code Customer} to whom the original PaymentMethod is attached. */ public Builder setCustomer(String customer) { this.customer = customer; @@ -2930,6 +2951,81 @@ public Builder putAllExtraParam(Map map) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. ID of the Dashboard-only CustomPaymentMethodType. This field is + * used by Stripe products' internal code to support CPMs. + */ + @SerializedName("type") + String type; + + private Custom(Map extraParams, String type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentMethodCreateParams.Custom build() { + return new PaymentMethodCreateParams.Custom(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentMethodCreateParams.Custom#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentMethodCreateParams.Custom#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. ID of the Dashboard-only CustomPaymentMethodType. This field is + * used by Stripe products' internal code to support CPMs. + */ + public Builder setType(String type) { + this.type = type; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class CustomerBalance { @@ -6616,6 +6712,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/PaymentMethodListParams.java b/src/main/java/com/stripe/param/PaymentMethodListParams.java index 9993da80ca3..6803165f83e 100644 --- a/src/main/java/com/stripe/param/PaymentMethodListParams.java +++ b/src/main/java/com/stripe/param/PaymentMethodListParams.java @@ -56,9 +56,9 @@ public class PaymentMethodListParams extends ApiRequestParams { String startingAfter; /** - * An optional filter on the list, based on the object {@code type} field. Without the filter, the - * list includes all current and future payment method types. If your integration expects only one - * type of payment method in the response, make sure to provide a type value in the request. + * Filters the list by the object {@code type} field. Unfiltered, the list returns all payment + * method types except {@code custom}. If your integration expects only one type of payment method + * in the response, specify that type value in the request to reduce your payload. */ @SerializedName("type") Type type; @@ -201,10 +201,9 @@ public Builder setStartingAfter(String startingAfter) { } /** - * An optional filter on the list, based on the object {@code type} field. Without the filter, - * the list includes all current and future payment method types. If your integration expects - * only one type of payment method in the response, make sure to provide a type value in the - * request. + * Filters the list by the object {@code type} field. Unfiltered, the list returns all payment + * method types except {@code custom}. If your integration expects only one type of payment + * method in the response, specify that type value in the request to reduce your payload. */ public Builder setType(PaymentMethodListParams.Type type) { this.type = type; @@ -258,6 +257,9 @@ public enum Type implements ApiRequestParams.EnumParam { @SerializedName("crypto") CRYPTO("crypto"), + @SerializedName("custom") + CUSTOM("custom"), + @SerializedName("customer_balance") CUSTOMER_BALANCE("customer_balance"), diff --git a/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java new file mode 100644 index 00000000000..992e5c875ce --- /dev/null +++ b/src/main/java/com/stripe/param/PaymentRecordReportRefundParams.java @@ -0,0 +1,622 @@ +// File generated from our OpenAPI spec +package com.stripe.param; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class PaymentRecordReportRefundParams extends ApiRequestParams { + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + @SerializedName("amount") + Amount amount; + + /** Specifies which fields in the response should be expanded. */ + @SerializedName("expand") + List expand; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** When the reported refund was initiated. Measured in seconds since the Unix epoch. */ + @SerializedName("initiated_at") + Long initiatedAt; + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys can + * be unset by posting an empty value to {@code metadata}. + */ + @SerializedName("metadata") + Object metadata; + + /** Required. The outcome of the reported refund. */ + @SerializedName("outcome") + Outcome outcome; + + /** Required. Processor information for this refund. */ + @SerializedName("processor_details") + ProcessorDetails processorDetails; + + /** Required. Information about the payment attempt refund. */ + @SerializedName("refunded") + Refunded refunded; + + private PaymentRecordReportRefundParams( + Amount amount, + List expand, + Map extraParams, + Long initiatedAt, + Object metadata, + Outcome outcome, + ProcessorDetails processorDetails, + Refunded refunded) { + this.amount = amount; + this.expand = expand; + this.extraParams = extraParams; + this.initiatedAt = initiatedAt; + this.metadata = metadata; + this.outcome = outcome; + this.processorDetails = processorDetails; + this.refunded = refunded; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Amount amount; + + private List expand; + + private Map extraParams; + + private Long initiatedAt; + + private Object metadata; + + private Outcome outcome; + + private ProcessorDetails processorDetails; + + private Refunded refunded; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams build() { + return new PaymentRecordReportRefundParams( + this.amount, + this.expand, + this.extraParams, + this.initiatedAt, + this.metadata, + this.outcome, + this.processorDetails, + this.refunded); + } + + /** + * A positive integer in the smallest + * currency unit representing how much of this payment to refund. Can refund only up to the + * remaining, unrefunded amount of the payment. + */ + public Builder setAmount(PaymentRecordReportRefundParams.Amount amount) { + this.amount = amount; + return this; + } + + /** + * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentRecordReportRefundParams#expand} for the field documentation. + */ + public Builder addExpand(String element) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.add(element); + return this; + } + + /** + * Add all elements to `expand` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * PaymentRecordReportRefundParams#expand} for the field documentation. + */ + public Builder addAllExpand(List elements) { + if (this.expand == null) { + this.expand = new ArrayList<>(); + } + this.expand.addAll(elements); + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** When the reported refund was initiated. Measured in seconds since the Unix epoch. */ + public Builder setInitiatedAt(Long initiatedAt) { + this.initiatedAt = initiatedAt; + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putMetadata(String key, String value) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `metadata` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams#metadata} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder putAllMetadata(Map map) { + if (this.metadata == null || this.metadata instanceof EmptyParam) { + this.metadata = new HashMap(); + } + ((Map) this.metadata).putAll(map); + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(EmptyParam metadata) { + this.metadata = metadata; + return this; + } + + /** + * Set of key-value pairs that you can attach + * to an object. This can be useful for storing additional information about the object in a + * structured format. Individual keys can be unset by posting an empty value to them. All keys + * can be unset by posting an empty value to {@code metadata}. + */ + public Builder setMetadata(Map metadata) { + this.metadata = metadata; + return this; + } + + /** Required. The outcome of the reported refund. */ + public Builder setOutcome(PaymentRecordReportRefundParams.Outcome outcome) { + this.outcome = outcome; + return this; + } + + /** Required. Processor information for this refund. */ + public Builder setProcessorDetails( + PaymentRecordReportRefundParams.ProcessorDetails processorDetails) { + this.processorDetails = processorDetails; + return this; + } + + /** Required. Information about the payment attempt refund. */ + public Builder setRefunded(PaymentRecordReportRefundParams.Refunded refunded) { + this.refunded = refunded; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Amount { + /** + * Required. Three-letter ISO currency code, in lowercase. + * Must be a supported currency. + */ + @SerializedName("currency") + String currency; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + @SerializedName("value") + Long value; + + private Amount(String currency, Map extraParams, Long value) { + this.currency = currency; + this.extraParams = extraParams; + this.value = value; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private String currency; + + private Map extraParams; + + private Long value; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.Amount build() { + return new PaymentRecordReportRefundParams.Amount( + this.currency, this.extraParams, this.value); + } + + /** + * Required. Three-letter ISO currency code, in + * lowercase. Must be a supported currency. + */ + public Builder setCurrency(String currency) { + this.currency = currency; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams.Amount#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams.Amount#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. A positive integer representing the amount in the currency's minor unit. For example, {@code + * 100} can represent 1 USD or 100 JPY. + */ + public Builder setValue(Long value) { + this.value = value; + return this; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class ProcessorDetails { + /** Information about the custom processor used to make this refund. */ + @SerializedName("custom") + Custom custom; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. The type of the processor details. An additional hash is included + * on processor_details with a name matching this value. It contains additional information + * specific to the processor. + */ + @SerializedName("type") + Type type; + + private ProcessorDetails(Custom custom, Map extraParams, Type type) { + this.custom = custom; + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Custom custom; + + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.ProcessorDetails build() { + return new PaymentRecordReportRefundParams.ProcessorDetails( + this.custom, this.extraParams, this.type); + } + + /** Information about the custom processor used to make this refund. */ + public Builder setCustom(PaymentRecordReportRefundParams.ProcessorDetails.Custom custom) { + this.custom = custom; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams.ProcessorDetails#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams.ProcessorDetails#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. The type of the processor details. An additional hash is + * included on processor_details with a name matching this value. It contains additional + * information specific to the processor. + */ + public Builder setType(PaymentRecordReportRefundParams.ProcessorDetails.Type type) { + this.type = type; + return this; + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Custom { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. A reference to the external refund. This field must be unique + * across all refunds. + */ + @SerializedName("refund_reference") + String refundReference; + + private Custom(Map extraParams, String refundReference) { + this.extraParams = extraParams; + this.refundReference = refundReference; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private String refundReference; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.ProcessorDetails.Custom build() { + return new PaymentRecordReportRefundParams.ProcessorDetails.Custom( + this.extraParams, this.refundReference); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentRecordReportRefundParams.ProcessorDetails.Custom#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link PaymentRecordReportRefundParams.ProcessorDetails.Custom#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. A reference to the external refund. This field must be unique + * across all refunds. + */ + public Builder setRefundReference(String refundReference) { + this.refundReference = refundReference; + return this; + } + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("custom") + CUSTOM("custom"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Refunded { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Required. When the reported refund completed. Measured in seconds since the + * Unix epoch. + */ + @SerializedName("refunded_at") + Long refundedAt; + + private Refunded(Map extraParams, Long refundedAt) { + this.extraParams = extraParams; + this.refundedAt = refundedAt; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long refundedAt; + + /** Finalize and obtain parameter instance from this builder. */ + public PaymentRecordReportRefundParams.Refunded build() { + return new PaymentRecordReportRefundParams.Refunded(this.extraParams, this.refundedAt); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * PaymentRecordReportRefundParams.Refunded#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link PaymentRecordReportRefundParams.Refunded#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Required. When the reported refund completed. Measured in seconds since + * the Unix epoch. + */ + public Builder setRefundedAt(Long refundedAt) { + this.refundedAt = refundedAt; + return this; + } + } + } + + public enum Outcome implements ApiRequestParams.EnumParam { + @SerializedName("refunded") + REFUNDED("refunded"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Outcome(String value) { + this.value = value; + } + } +} diff --git a/src/main/java/com/stripe/param/SetupIntentCreateParams.java b/src/main/java/com/stripe/param/SetupIntentCreateParams.java index 80ddcb778a9..aabcc00847f 100644 --- a/src/main/java/com/stripe/param/SetupIntentCreateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentCreateParams.java @@ -70,6 +70,10 @@ public class SetupIntentCreateParams extends ApiRequestParams { @SerializedName("description") String description; + /** The list of payment method types to exclude from use with this SetupIntent. */ + @SerializedName("excluded_payment_method_types") + List excludedPaymentMethodTypes; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -194,6 +198,7 @@ private SetupIntentCreateParams( String customer, String customerAccount, String description, + List excludedPaymentMethodTypes, List expand, Map extraParams, List flowDirections, @@ -216,6 +221,7 @@ private SetupIntentCreateParams( this.customer = customer; this.customerAccount = customerAccount; this.description = description; + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; this.expand = expand; this.extraParams = extraParams; this.flowDirections = flowDirections; @@ -252,6 +258,8 @@ public static class Builder { private String description; + private List excludedPaymentMethodTypes; + private List expand; private Map extraParams; @@ -292,6 +300,7 @@ public SetupIntentCreateParams build() { this.customer, this.customerAccount, this.description, + this.excludedPaymentMethodTypes, this.expand, this.extraParams, this.flowDirections, @@ -384,6 +393,34 @@ public Builder setDescription(String description) { return this; } + /** + * Add an element to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addExcludedPaymentMethodType( + SetupIntentCreateParams.ExcludedPaymentMethodType element) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.add(element); + return this; + } + + /** + * Add all elements to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentCreateParams#excludedPaymentMethodTypes} for the field documentation. + */ + public Builder addAllExcludedPaymentMethodType( + List elements) { + if (this.excludedPaymentMethodTypes == null) { + this.excludedPaymentMethodTypes = new ArrayList<>(); + } + this.excludedPaymentMethodTypes.addAll(elements); + return this; + } + /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -12567,6 +12604,183 @@ public Builder putAllExtraParam(Map map) { } } + public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("acss_debit") + ACSS_DEBIT("acss_debit"), + + @SerializedName("affirm") + AFFIRM("affirm"), + + @SerializedName("afterpay_clearpay") + AFTERPAY_CLEARPAY("afterpay_clearpay"), + + @SerializedName("alipay") + ALIPAY("alipay"), + + @SerializedName("alma") + ALMA("alma"), + + @SerializedName("amazon_pay") + AMAZON_PAY("amazon_pay"), + + @SerializedName("au_becs_debit") + AU_BECS_DEBIT("au_becs_debit"), + + @SerializedName("bacs_debit") + BACS_DEBIT("bacs_debit"), + + @SerializedName("bancontact") + BANCONTACT("bancontact"), + + @SerializedName("billie") + BILLIE("billie"), + + @SerializedName("blik") + BLIK("blik"), + + @SerializedName("boleto") + BOLETO("boleto"), + + @SerializedName("card") + CARD("card"), + + @SerializedName("cashapp") + CASHAPP("cashapp"), + + @SerializedName("crypto") + CRYPTO("crypto"), + + @SerializedName("customer_balance") + CUSTOMER_BALANCE("customer_balance"), + + @SerializedName("eps") + EPS("eps"), + + @SerializedName("fpx") + FPX("fpx"), + + @SerializedName("giropay") + GIROPAY("giropay"), + + @SerializedName("gopay") + GOPAY("gopay"), + + @SerializedName("grabpay") + GRABPAY("grabpay"), + + @SerializedName("id_bank_transfer") + ID_BANK_TRANSFER("id_bank_transfer"), + + @SerializedName("ideal") + IDEAL("ideal"), + + @SerializedName("kakao_pay") + KAKAO_PAY("kakao_pay"), + + @SerializedName("klarna") + KLARNA("klarna"), + + @SerializedName("konbini") + KONBINI("konbini"), + + @SerializedName("kr_card") + KR_CARD("kr_card"), + + @SerializedName("mb_way") + MB_WAY("mb_way"), + + @SerializedName("mobilepay") + MOBILEPAY("mobilepay"), + + @SerializedName("multibanco") + MULTIBANCO("multibanco"), + + @SerializedName("naver_pay") + NAVER_PAY("naver_pay"), + + @SerializedName("nz_bank_account") + NZ_BANK_ACCOUNT("nz_bank_account"), + + @SerializedName("oxxo") + OXXO("oxxo"), + + @SerializedName("p24") + P24("p24"), + + @SerializedName("pay_by_bank") + PAY_BY_BANK("pay_by_bank"), + + @SerializedName("payco") + PAYCO("payco"), + + @SerializedName("paynow") + PAYNOW("paynow"), + + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("paypay") + PAYPAY("paypay"), + + @SerializedName("payto") + PAYTO("payto"), + + @SerializedName("pix") + PIX("pix"), + + @SerializedName("promptpay") + PROMPTPAY("promptpay"), + + @SerializedName("qris") + QRIS("qris"), + + @SerializedName("rechnung") + RECHNUNG("rechnung"), + + @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("shopeepay") + SHOPEEPAY("shopeepay"), + + @SerializedName("sofort") + SOFORT("sofort"), + + @SerializedName("stripe_balance") + STRIPE_BALANCE("stripe_balance"), + + @SerializedName("swish") + SWISH("swish"), + + @SerializedName("twint") + TWINT("twint"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"), + + @SerializedName("wechat_pay") + WECHAT_PAY("wechat_pay"), + + @SerializedName("zip") + ZIP("zip"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ExcludedPaymentMethodType(String value) { + this.value = value; + } + } + public enum FlowDirection implements ApiRequestParams.EnumParam { @SerializedName("inbound") INBOUND("inbound"), diff --git a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java index d4f25238692..ae67567c368 100644 --- a/src/main/java/com/stripe/param/SetupIntentUpdateParams.java +++ b/src/main/java/com/stripe/param/SetupIntentUpdateParams.java @@ -46,6 +46,10 @@ public class SetupIntentUpdateParams extends ApiRequestParams { @SerializedName("description") Object description; + /** The list of payment method types to exclude from use with this SetupIntent. */ + @SerializedName("excluded_payment_method_types") + Object excludedPaymentMethodTypes; + /** Specifies which fields in the response should be expanded. */ @SerializedName("expand") List expand; @@ -120,6 +124,7 @@ private SetupIntentUpdateParams( Object customer, Object customerAccount, Object description, + Object excludedPaymentMethodTypes, List expand, Map extraParams, List flowDirections, @@ -133,6 +138,7 @@ private SetupIntentUpdateParams( this.customer = customer; this.customerAccount = customerAccount; this.description = description; + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; this.expand = expand; this.extraParams = extraParams; this.flowDirections = flowDirections; @@ -157,6 +163,8 @@ public static class Builder { private Object description; + private Object excludedPaymentMethodTypes; + private List expand; private Map extraParams; @@ -182,6 +190,7 @@ public SetupIntentUpdateParams build() { this.customer, this.customerAccount, this.description, + this.excludedPaymentMethodTypes, this.expand, this.extraParams, this.flowDirections, @@ -265,6 +274,55 @@ public Builder setDescription(EmptyParam description) { return this; } + /** + * Add an element to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentUpdateParams#excludedPaymentMethodTypes} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addExcludedPaymentMethodType( + SetupIntentUpdateParams.ExcludedPaymentMethodType element) { + if (this.excludedPaymentMethodTypes == null + || this.excludedPaymentMethodTypes instanceof EmptyParam) { + this.excludedPaymentMethodTypes = + new ArrayList(); + } + ((List) this.excludedPaymentMethodTypes) + .add(element); + return this; + } + + /** + * Add all elements to `excludedPaymentMethodTypes` list. A list is initialized for the first + * `add/addAll` call, and subsequent calls adds additional elements to the original list. See + * {@link SetupIntentUpdateParams#excludedPaymentMethodTypes} for the field documentation. + */ + @SuppressWarnings("unchecked") + public Builder addAllExcludedPaymentMethodType( + List elements) { + if (this.excludedPaymentMethodTypes == null + || this.excludedPaymentMethodTypes instanceof EmptyParam) { + this.excludedPaymentMethodTypes = + new ArrayList(); + } + ((List) this.excludedPaymentMethodTypes) + .addAll(elements); + return this; + } + + /** The list of payment method types to exclude from use with this SetupIntent. */ + public Builder setExcludedPaymentMethodTypes(EmptyParam excludedPaymentMethodTypes) { + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; + return this; + } + + /** The list of payment method types to exclude from use with this SetupIntent. */ + public Builder setExcludedPaymentMethodTypes( + List excludedPaymentMethodTypes) { + this.excludedPaymentMethodTypes = excludedPaymentMethodTypes; + return this; + } + /** * Add an element to `expand` list. A list is initialized for the first `add/addAll` call, and * subsequent calls adds additional elements to the original list. See {@link @@ -12197,6 +12255,183 @@ public enum VerificationMethod implements ApiRequestParams.EnumParam { } } + public enum ExcludedPaymentMethodType implements ApiRequestParams.EnumParam { + @SerializedName("acss_debit") + ACSS_DEBIT("acss_debit"), + + @SerializedName("affirm") + AFFIRM("affirm"), + + @SerializedName("afterpay_clearpay") + AFTERPAY_CLEARPAY("afterpay_clearpay"), + + @SerializedName("alipay") + ALIPAY("alipay"), + + @SerializedName("alma") + ALMA("alma"), + + @SerializedName("amazon_pay") + AMAZON_PAY("amazon_pay"), + + @SerializedName("au_becs_debit") + AU_BECS_DEBIT("au_becs_debit"), + + @SerializedName("bacs_debit") + BACS_DEBIT("bacs_debit"), + + @SerializedName("bancontact") + BANCONTACT("bancontact"), + + @SerializedName("billie") + BILLIE("billie"), + + @SerializedName("blik") + BLIK("blik"), + + @SerializedName("boleto") + BOLETO("boleto"), + + @SerializedName("card") + CARD("card"), + + @SerializedName("cashapp") + CASHAPP("cashapp"), + + @SerializedName("crypto") + CRYPTO("crypto"), + + @SerializedName("customer_balance") + CUSTOMER_BALANCE("customer_balance"), + + @SerializedName("eps") + EPS("eps"), + + @SerializedName("fpx") + FPX("fpx"), + + @SerializedName("giropay") + GIROPAY("giropay"), + + @SerializedName("gopay") + GOPAY("gopay"), + + @SerializedName("grabpay") + GRABPAY("grabpay"), + + @SerializedName("id_bank_transfer") + ID_BANK_TRANSFER("id_bank_transfer"), + + @SerializedName("ideal") + IDEAL("ideal"), + + @SerializedName("kakao_pay") + KAKAO_PAY("kakao_pay"), + + @SerializedName("klarna") + KLARNA("klarna"), + + @SerializedName("konbini") + KONBINI("konbini"), + + @SerializedName("kr_card") + KR_CARD("kr_card"), + + @SerializedName("mb_way") + MB_WAY("mb_way"), + + @SerializedName("mobilepay") + MOBILEPAY("mobilepay"), + + @SerializedName("multibanco") + MULTIBANCO("multibanco"), + + @SerializedName("naver_pay") + NAVER_PAY("naver_pay"), + + @SerializedName("nz_bank_account") + NZ_BANK_ACCOUNT("nz_bank_account"), + + @SerializedName("oxxo") + OXXO("oxxo"), + + @SerializedName("p24") + P24("p24"), + + @SerializedName("pay_by_bank") + PAY_BY_BANK("pay_by_bank"), + + @SerializedName("payco") + PAYCO("payco"), + + @SerializedName("paynow") + PAYNOW("paynow"), + + @SerializedName("paypal") + PAYPAL("paypal"), + + @SerializedName("paypay") + PAYPAY("paypay"), + + @SerializedName("payto") + PAYTO("payto"), + + @SerializedName("pix") + PIX("pix"), + + @SerializedName("promptpay") + PROMPTPAY("promptpay"), + + @SerializedName("qris") + QRIS("qris"), + + @SerializedName("rechnung") + RECHNUNG("rechnung"), + + @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("shopeepay") + SHOPEEPAY("shopeepay"), + + @SerializedName("sofort") + SOFORT("sofort"), + + @SerializedName("stripe_balance") + STRIPE_BALANCE("stripe_balance"), + + @SerializedName("swish") + SWISH("swish"), + + @SerializedName("twint") + TWINT("twint"), + + @SerializedName("us_bank_account") + US_BANK_ACCOUNT("us_bank_account"), + + @SerializedName("wechat_pay") + WECHAT_PAY("wechat_pay"), + + @SerializedName("zip") + ZIP("zip"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + ExcludedPaymentMethodType(String value) { + this.value = value; + } + } + public enum FlowDirection implements ApiRequestParams.EnumParam { @SerializedName("inbound") INBOUND("inbound"), diff --git a/src/main/java/com/stripe/param/TokenCreateParams.java b/src/main/java/com/stripe/param/TokenCreateParams.java index 97f43408949..857516bf055 100644 --- a/src/main/java/com/stripe/param/TokenCreateParams.java +++ b/src/main/java/com/stripe/param/TokenCreateParams.java @@ -489,6 +489,13 @@ public static class Company { @SerializedName("registration_number") String registrationNumber; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -539,6 +546,7 @@ private Company( String phone, Object registrationDate, String registrationNumber, + RepresentativeDeclaration representativeDeclaration, ApiRequestParams.EnumParam structure, String taxId, String taxIdRegistrar, @@ -563,6 +571,7 @@ private Company( this.phone = phone; this.registrationDate = registrationDate; this.registrationNumber = registrationNumber; + this.representativeDeclaration = representativeDeclaration; this.structure = structure; this.taxId = taxId; this.taxIdRegistrar = taxIdRegistrar; @@ -613,6 +622,8 @@ public static class Builder { private String registrationNumber; + private RepresentativeDeclaration representativeDeclaration; + private ApiRequestParams.EnumParam structure; private String taxId; @@ -645,6 +656,7 @@ public TokenCreateParams.Account.Company build() { this.phone, this.registrationDate, this.registrationNumber, + this.representativeDeclaration, this.structure, this.taxId, this.taxIdRegistrar, @@ -853,6 +865,16 @@ public Builder setRegistrationNumber(String registrationNumber) { return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + TokenCreateParams.Account.Company.RepresentativeDeclaration representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** * The category identifying the legal structure of the company or legal entity. See Business @@ -1712,6 +1734,116 @@ public Builder setYear(Long year) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** The Unix timestamp marking when the representative declaration attestation was made. */ + @SerializedName("date") + Long date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The IP address from which the representative declaration attestation was made. */ + @SerializedName("ip") + String ip; + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Long date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Long date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public TokenCreateParams.Account.Company.RepresentativeDeclaration build() { + return new TokenCreateParams.Account.Company.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The Unix timestamp marking when the representative declaration attestation was made. + */ + public Builder setDate(Long date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * TokenCreateParams.Account.Company.RepresentativeDeclaration#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * TokenCreateParams.Account.Company.RepresentativeDeclaration#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The IP address from which the representative declaration attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** + * The user agent of the browser from which the representative declaration attestation was + * made. + */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Verification { diff --git a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java index bac2030d6c6..bd04b05c851 100644 --- a/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java +++ b/src/main/java/com/stripe/param/billing/CreditGrantCreateParams.java @@ -25,7 +25,7 @@ public class CreditGrantCreateParams extends ApiRequestParams { @SerializedName("applicability_config") ApplicabilityConfig applicabilityConfig; - /** Required. The category of this credit grant. */ + /** The category of this credit grant. It defaults to {@code paid} if not specified. */ @SerializedName("category") Category category; @@ -171,7 +171,7 @@ public Builder setApplicabilityConfig( return this; } - /** Required. The category of this credit grant. */ + /** The category of this credit grant. It defaults to {@code paid} if not specified. */ public Builder setCategory(CreditGrantCreateParams.Category category) { this.category = category; return this; diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java index d6db907fe3a..2b6d5ac1d0f 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationCreateParams.java @@ -752,9 +752,21 @@ public static class PaymentMethodUpdate { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodUpdate(Boolean enabled, Map extraParams) { + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able to + * update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + @SerializedName("payment_method_configuration") + Object paymentMethodConfiguration; + + private PaymentMethodUpdate( + Boolean enabled, Map extraParams, Object paymentMethodConfiguration) { this.enabled = enabled; this.extraParams = extraParams; + this.paymentMethodConfiguration = paymentMethodConfiguration; } public static Builder builder() { @@ -766,10 +778,12 @@ public static class Builder { private Map extraParams; + private Object paymentMethodConfiguration; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationCreateParams.Features.PaymentMethodUpdate build() { return new ConfigurationCreateParams.Features.PaymentMethodUpdate( - this.enabled, this.extraParams); + this.enabled, this.extraParams, this.paymentMethodConfiguration); } /** Required. Whether the feature is enabled. */ @@ -805,6 +819,30 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } } } diff --git a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java index f8937cb78fe..cc2c2da7c24 100644 --- a/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/billingportal/ConfigurationUpdateParams.java @@ -803,9 +803,21 @@ public static class PaymentMethodUpdate { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - private PaymentMethodUpdate(Boolean enabled, Map extraParams) { + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able to + * update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + @SerializedName("payment_method_configuration") + Object paymentMethodConfiguration; + + private PaymentMethodUpdate( + Boolean enabled, Map extraParams, Object paymentMethodConfiguration) { this.enabled = enabled; this.extraParams = extraParams; + this.paymentMethodConfiguration = paymentMethodConfiguration; } public static Builder builder() { @@ -817,10 +829,12 @@ public static class Builder { private Map extraParams; + private Object paymentMethodConfiguration; + /** Finalize and obtain parameter instance from this builder. */ public ConfigurationUpdateParams.Features.PaymentMethodUpdate build() { return new ConfigurationUpdateParams.Features.PaymentMethodUpdate( - this.enabled, this.extraParams); + this.enabled, this.extraParams, this.paymentMethodConfiguration); } /** Required. Whether the feature is enabled. */ @@ -856,6 +870,30 @@ public Builder putAllExtraParam(Map map) { this.extraParams.putAll(map); return this; } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(String paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } + + /** + * The Payment Method + * Configuration to use for this portal session. When specified, customers will be able + * to update their payment method to one of the options specified by the payment method + * configuration. If not set or set to an empty string, the default payment method + * configuration is used. + */ + public Builder setPaymentMethodConfiguration(EmptyParam paymentMethodConfiguration) { + this.paymentMethodConfiguration = paymentMethodConfiguration; + return this; + } } } diff --git a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java index f5f29d32ddb..7cc7e4dc507 100644 --- a/src/main/java/com/stripe/param/checkout/SessionCreateParams.java +++ b/src/main/java/com/stripe/param/checkout/SessionCreateParams.java @@ -1817,7 +1817,11 @@ public static class BrandingSettings { @SerializedName("button_color") Object buttonColor; - /** A string to override the business name shown on the Checkout Session. */ + /** + * A string to override the business name shown on the Checkout Session. This only shows at the + * top of the Checkout page, and your business name still appears in terms, receipts, and other + * places. + */ @SerializedName("display_name") String displayName; @@ -1838,11 +1842,11 @@ public static class BrandingSettings { @SerializedName("font_family") ApiRequestParams.EnumParam fontFamily; - /** The icon for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The icon for the Checkout Session. For best results, use a square image. */ @SerializedName("icon") Icon icon; - /** The logo for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The logo for the Checkout Session. */ @SerializedName("logo") Logo logo; @@ -1947,7 +1951,11 @@ public Builder setButtonColor(EmptyParam buttonColor) { return this; } - /** A string to override the business name shown on the Checkout Session. */ + /** + * A string to override the business name shown on the Checkout Session. This only shows at + * the top of the Checkout page, and your business name still appears in terms, receipts, and + * other places. + */ public Builder setDisplayName(String displayName) { this.displayName = displayName; return this; @@ -1999,13 +2007,13 @@ public Builder setFontFamily(EmptyParam fontFamily) { return this; } - /** The icon for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The icon for the Checkout Session. For best results, use a square image. */ public Builder setIcon(SessionCreateParams.BrandingSettings.Icon icon) { this.icon = icon; return this; } - /** The logo for the Checkout Session. You cannot set both {@code logo} and {@code icon}. */ + /** The logo for the Checkout Session. */ public Builder setLogo(SessionCreateParams.BrandingSettings.Logo logo) { this.logo = logo; return this; @@ -7578,6 +7586,10 @@ public static class PaymentMethodOptions { @SerializedName("swish") Swish swish; + /** contains details about the TWINT payment method options. */ + @SerializedName("twint") + Twint twint; + /** contains details about the Us Bank Account payment method options. */ @SerializedName("us_bank_account") UsBankAccount usBankAccount; @@ -7630,6 +7642,7 @@ private PaymentMethodOptions( SepaDebit sepaDebit, Sofort sofort, Swish swish, + Twint twint, UsBankAccount usBankAccount, WechatPay wechatPay) { this.acssDebit = acssDebit; @@ -7675,6 +7688,7 @@ private PaymentMethodOptions( this.sepaDebit = sepaDebit; this.sofort = sofort; this.swish = swish; + this.twint = twint; this.usBankAccount = usBankAccount; this.wechatPay = wechatPay; } @@ -7770,6 +7784,8 @@ public static class Builder { private Swish swish; + private Twint twint; + private UsBankAccount usBankAccount; private WechatPay wechatPay; @@ -7820,6 +7836,7 @@ public SessionCreateParams.PaymentMethodOptions build() { this.sepaDebit, this.sofort, this.swish, + this.twint, this.usBankAccount, this.wechatPay); } @@ -8106,6 +8123,12 @@ public Builder setSwish(SessionCreateParams.PaymentMethodOptions.Swish swish) { return this; } + /** contains details about the TWINT payment method options. */ + public Builder setTwint(SessionCreateParams.PaymentMethodOptions.Twint twint) { + this.twint = twint; + return this; + } + /** contains details about the Us Bank Account payment method options. */ public Builder setUsBankAccount( SessionCreateParams.PaymentMethodOptions.UsBankAccount usBankAccount) { @@ -16260,6 +16283,128 @@ public Builder setReference(String reference) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Twint { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * Indicates that you intend to make future payments with this PaymentIntent's payment method. + * + *

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

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

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

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

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

When processing card payments, Stripe uses {@code setup_future_usage} to help you + * comply with regional legislation and network rules, such as SCA. + */ + public Builder setSetupFutureUsage( + SessionCreateParams.PaymentMethodOptions.Twint.SetupFutureUsage setupFutureUsage) { + this.setupFutureUsage = setupFutureUsage; + return this; + } + } + + public enum SetupFutureUsage implements ApiRequestParams.EnumParam { + @SerializedName("none") + NONE("none"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + SetupFutureUsage(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class UsBankAccount { diff --git a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java index 537c6f76860..52cfac9b0c1 100644 --- a/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java +++ b/src/main/java/com/stripe/param/tax/RegistrationCreateParams.java @@ -566,6 +566,10 @@ public static class CountryOptions { @SerializedName("tr") Tr tr; + /** Options for the registration in TW. */ + @SerializedName("tw") + Tw tw; + /** Options for the registration in TZ. */ @SerializedName("tz") Tz tz; @@ -697,6 +701,7 @@ private CountryOptions( Th th, Tj tj, Tr tr, + Tw tw, Tz tz, Ua ua, Ug ug, @@ -797,6 +802,7 @@ private CountryOptions( this.th = th; this.tj = tj; this.tr = tr; + this.tw = tw; this.tz = tz; this.ua = ua; this.ug = ug; @@ -994,6 +1000,8 @@ public static class Builder { private Tr tr; + private Tw tw; + private Tz tz; private Ua ua; @@ -1107,6 +1115,7 @@ public RegistrationCreateParams.CountryOptions build() { this.th, this.tj, this.tr, + this.tw, this.tz, this.ua, this.ug, @@ -1680,6 +1689,12 @@ public Builder setTr(RegistrationCreateParams.CountryOptions.Tr tr) { return this; } + /** Options for the registration in TW. */ + public Builder setTw(RegistrationCreateParams.CountryOptions.Tw tw) { + this.tw = tw; + return this; + } + /** Options for the registration in TZ. */ public Builder setTz(RegistrationCreateParams.CountryOptions.Tz tz) { this.tz = tz; @@ -15278,6 +15293,89 @@ public enum Type implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Tw { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Required. Type of registration to be created in {@code country}. */ + @SerializedName("type") + Type type; + + private Tw(Map extraParams, Type type) { + this.extraParams = extraParams; + this.type = type; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Type type; + + /** Finalize and obtain parameter instance from this builder. */ + public RegistrationCreateParams.CountryOptions.Tw build() { + return new RegistrationCreateParams.CountryOptions.Tw(this.extraParams, this.type); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Tw#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link RegistrationCreateParams.CountryOptions.Tw#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Required. Type of registration to be created in {@code country}. */ + public Builder setType(RegistrationCreateParams.CountryOptions.Tw.Type type) { + this.type = type; + return this; + } + } + + public enum Type implements ApiRequestParams.EnumParam { + @SerializedName("simplified") + SIMPLIFIED("simplified"); + + @Getter(onMethod_ = {@Override}) + private final String value; + + Type(String value) { + this.value = value; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Tz { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java index 0707a70d15f..a641a4b7a13 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationCreateParams.java @@ -799,6 +799,10 @@ public static class Tipping { @SerializedName("gbp") Gbp gbp; + /** Tipping configuration for GIP. */ + @SerializedName("gip") + Gip gip; + /** Tipping configuration for HKD. */ @SerializedName("hkd") Hkd hkd; @@ -858,6 +862,7 @@ private Tipping( Eur eur, Map extraParams, Gbp gbp, + Gip gip, Hkd hkd, Huf huf, Jpy jpy, @@ -880,6 +885,7 @@ private Tipping( this.eur = eur; this.extraParams = extraParams; this.gbp = gbp; + this.gip = gip; this.hkd = hkd; this.huf = huf; this.jpy = jpy; @@ -919,6 +925,8 @@ public static class Builder { private Gbp gbp; + private Gip gip; + private Hkd hkd; private Huf huf; @@ -956,6 +964,7 @@ public ConfigurationCreateParams.Tipping build() { this.eur, this.extraParams, this.gbp, + this.gip, this.hkd, this.huf, this.jpy, @@ -1050,6 +1059,12 @@ public Builder setGbp(ConfigurationCreateParams.Tipping.Gbp gbp) { return this; } + /** Tipping configuration for GIP. */ + public Builder setGip(ConfigurationCreateParams.Tipping.Gip gip) { + this.gip = gip; + return this; + } + /** Tipping configuration for HKD. */ public Builder setHkd(ConfigurationCreateParams.Tipping.Hkd hkd) { this.hkd = hkd; @@ -2455,6 +2470,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Gip { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Gip( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationCreateParams.Tipping.Gip build() { + return new ConfigurationCreateParams.Tipping.Gip( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationCreateParams.Tipping.Gip#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationCreateParams.Tipping.Gip#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationCreateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Hkd { diff --git a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java index 6fb6482fe1a..f0c9de33cba 100644 --- a/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java +++ b/src/main/java/com/stripe/param/terminal/ConfigurationUpdateParams.java @@ -835,6 +835,10 @@ public static class Tipping { @SerializedName("gbp") Gbp gbp; + /** Tipping configuration for GIP. */ + @SerializedName("gip") + Gip gip; + /** Tipping configuration for HKD. */ @SerializedName("hkd") Hkd hkd; @@ -894,6 +898,7 @@ private Tipping( Eur eur, Map extraParams, Gbp gbp, + Gip gip, Hkd hkd, Huf huf, Jpy jpy, @@ -916,6 +921,7 @@ private Tipping( this.eur = eur; this.extraParams = extraParams; this.gbp = gbp; + this.gip = gip; this.hkd = hkd; this.huf = huf; this.jpy = jpy; @@ -955,6 +961,8 @@ public static class Builder { private Gbp gbp; + private Gip gip; + private Hkd hkd; private Huf huf; @@ -992,6 +1000,7 @@ public ConfigurationUpdateParams.Tipping build() { this.eur, this.extraParams, this.gbp, + this.gip, this.hkd, this.huf, this.jpy, @@ -1086,6 +1095,12 @@ public Builder setGbp(ConfigurationUpdateParams.Tipping.Gbp gbp) { return this; } + /** Tipping configuration for GIP. */ + public Builder setGip(ConfigurationUpdateParams.Tipping.Gip gip) { + this.gip = gip; + return this; + } + /** Tipping configuration for HKD. */ public Builder setHkd(ConfigurationUpdateParams.Tipping.Hkd hkd) { this.hkd = hkd; @@ -2491,6 +2506,154 @@ public Builder setSmartTipThreshold(Long smartTipThreshold) { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Gip { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field (serialized) + * name in this param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Fixed amounts displayed when collecting a tip. */ + @SerializedName("fixed_amounts") + List fixedAmounts; + + /** Percentages displayed when collecting a tip. */ + @SerializedName("percentages") + List percentages; + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + @SerializedName("smart_tip_threshold") + Long smartTipThreshold; + + private Gip( + Map extraParams, + List fixedAmounts, + List percentages, + Long smartTipThreshold) { + this.extraParams = extraParams; + this.fixedAmounts = fixedAmounts; + this.percentages = percentages; + this.smartTipThreshold = smartTipThreshold; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private List fixedAmounts; + + private List percentages; + + private Long smartTipThreshold; + + /** Finalize and obtain parameter instance from this builder. */ + public ConfigurationUpdateParams.Tipping.Gip build() { + return new ConfigurationUpdateParams.Tipping.Gip( + this.extraParams, this.fixedAmounts, this.percentages, this.smartTipThreshold); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationUpdateParams.Tipping.Gip#extraParams} for the field + * documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link ConfigurationUpdateParams.Tipping.Gip#extraParams} for the field + * documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add an element to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addFixedAmount(Long element) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.add(element); + return this; + } + + /** + * Add all elements to `fixedAmounts` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#fixedAmounts} for the field documentation. + */ + public Builder addAllFixedAmount(List elements) { + if (this.fixedAmounts == null) { + this.fixedAmounts = new ArrayList<>(); + } + this.fixedAmounts.addAll(elements); + return this; + } + + /** + * Add an element to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addPercentage(Long element) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.add(element); + return this; + } + + /** + * Add all elements to `percentages` list. A list is initialized for the first `add/addAll` + * call, and subsequent calls adds additional elements to the original list. See {@link + * ConfigurationUpdateParams.Tipping.Gip#percentages} for the field documentation. + */ + public Builder addAllPercentage(List elements) { + if (this.percentages == null) { + this.percentages = new ArrayList<>(); + } + this.percentages.addAll(elements); + return this; + } + + /** + * Below this amount, fixed amounts will be displayed; above it, percentages will be + * displayed. + */ + public Builder setSmartTipThreshold(Long smartTipThreshold) { + this.smartTipThreshold = smartTipThreshold; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class Hkd { diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java index efe83e3e0e8..e7bcf72ca73 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectInputsParams.java @@ -26,7 +26,10 @@ public class ReaderCollectInputsParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. List of inputs to be collected using the Reader */ + /** + * Required. List of inputs to be collected from the customer using the Reader. + * Maximum 5 inputs. + */ @SerializedName("inputs") List inputs; @@ -348,11 +351,11 @@ public static class CustomText { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The skip button text. */ + /** Custom text for the skip button. Maximum 14 characters. */ @SerializedName("skip_button") String skipButton; - /** The submit button text. */ + /** Custom text for the submit button. Maximum 30 characters. */ @SerializedName("submit_button") String submitButton; @@ -428,13 +431,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The skip button text. */ + /** Custom text for the skip button. Maximum 14 characters. */ public Builder setSkipButton(String skipButton) { this.skipButton = skipButton; return this; } - /** The submit button text. */ + /** Custom text for the submit button. Maximum 30 characters. */ public Builder setSubmitButton(String submitButton) { this.submitButton = submitButton; return this; @@ -560,7 +563,10 @@ public static class Choice { @SerializedName("id") String id; - /** The style of the button which will be shown for this choice. */ + /** + * The style of the button which will be shown for this choice. Can be {@code primary} or + * {@code secondary}. + */ @SerializedName("style") Style style; @@ -628,7 +634,10 @@ public Builder setId(String id) { return this; } - /** The style of the button which will be shown for this choice. */ + /** + * The style of the button which will be shown for this choice. Can be {@code primary} or + * {@code secondary}. + */ public Builder setStyle(ReaderCollectInputsParams.Input.Selection.Choice.Style style) { this.style = style; return this; @@ -663,11 +672,14 @@ public enum Style implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Toggle { - /** The default value of the toggle. */ + /** The default value of the toggle. Can be {@code enabled} or {@code disabled}. */ @SerializedName("default_value") DefaultValue defaultValue; - /** The description which will be displayed for the toggle. */ + /** + * The description which will be displayed for the toggle. Maximum 50 characters. At least one + * of title or description must be provided. + */ @SerializedName("description") String description; @@ -680,7 +692,10 @@ public static class Toggle { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** The title which will be displayed for the toggle. */ + /** + * The title which will be displayed for the toggle. Maximum 50 characters. At least one of + * title or description must be provided. + */ @SerializedName("title") String title; @@ -714,14 +729,17 @@ public ReaderCollectInputsParams.Input.Toggle build() { this.defaultValue, this.description, this.extraParams, this.title); } - /** The default value of the toggle. */ + /** The default value of the toggle. Can be {@code enabled} or {@code disabled}. */ public Builder setDefaultValue( ReaderCollectInputsParams.Input.Toggle.DefaultValue defaultValue) { this.defaultValue = defaultValue; return this; } - /** The description which will be displayed for the toggle. */ + /** + * The description which will be displayed for the toggle. Maximum 50 characters. At least + * one of title or description must be provided. + */ public Builder setDescription(String description) { this.description = description; return this; @@ -755,7 +773,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** The title which will be displayed for the toggle. */ + /** + * The title which will be displayed for the toggle. Maximum 50 characters. At least one of + * title or description must be provided. + */ public Builder setTitle(String title) { this.title = title; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java index 251ac892a71..19a0d2d5dd4 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderCollectPaymentMethodParams.java @@ -13,7 +13,10 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderCollectPaymentMethodParams extends ApiRequestParams { - /** Configuration overrides. */ + /** + * Configuration overrides for this collection, such as tipping, surcharging, and customer + * cancellation settings. + */ @SerializedName("collect_config") CollectConfig collectConfig; @@ -30,7 +33,7 @@ public class ReaderCollectPaymentMethodParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to collect a payment method for. */ @SerializedName("payment_intent") String paymentIntent; @@ -64,7 +67,10 @@ public ReaderCollectPaymentMethodParams build() { this.collectConfig, this.expand, this.extraParams, this.paymentIntent); } - /** Configuration overrides. */ + /** + * Configuration overrides for this collection, such as tipping, surcharging, and customer + * cancellation settings. + */ public Builder setCollectConfig(ReaderCollectPaymentMethodParams.CollectConfig collectConfig) { this.collectConfig = collectConfig; return this; @@ -122,7 +128,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to collect a payment method for. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java index 766dba8d1cf..978c59329a7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderConfirmPaymentIntentParams.java @@ -13,7 +13,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderConfirmPaymentIntentParams extends ApiRequestParams { - /** Configuration overrides. */ + /** Configuration overrides for this confirmation, such as surcharge settings and return URL. */ @SerializedName("confirm_config") ConfirmConfig confirmConfig; @@ -30,7 +30,7 @@ public class ReaderConfirmPaymentIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to confirm. */ @SerializedName("payment_intent") String paymentIntent; @@ -64,7 +64,7 @@ public ReaderConfirmPaymentIntentParams build() { this.confirmConfig, this.expand, this.extraParams, this.paymentIntent); } - /** Configuration overrides. */ + /** Configuration overrides for this confirmation, such as surcharge settings and return URL. */ public Builder setConfirmConfig(ReaderConfirmPaymentIntentParams.ConfirmConfig confirmConfig) { this.confirmConfig = confirmConfig; return this; @@ -122,7 +122,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID. */ + /** Required. The ID of the PaymentIntent to confirm. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java index e2fb109db94..e1ff2e6accd 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderPresentPaymentMethodParams.java @@ -375,7 +375,7 @@ public static class InteracPresent { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Card Number. */ + /** The Interac card number. */ @SerializedName("number") String number; @@ -425,7 +425,7 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Card Number. */ + /** The Interac card number. */ public Builder setNumber(String number) { this.number = number; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java index 826c2e8bcc9..1c151700007 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessPaymentIntentParams.java @@ -26,11 +26,14 @@ public class ReaderProcessPaymentIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. PaymentIntent ID */ + /** Required. The ID of the PaymentIntent to process on the reader. */ @SerializedName("payment_intent") String paymentIntent; - /** Configuration overrides. */ + /** + * Configuration overrides for this transaction, such as tipping and customer cancellation + * settings. + */ @SerializedName("process_config") ProcessConfig processConfig; @@ -116,13 +119,16 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. PaymentIntent ID */ + /** Required. The ID of the PaymentIntent to process on the reader. */ public Builder setPaymentIntent(String paymentIntent) { this.paymentIntent = paymentIntent; return this; } - /** Configuration overrides. */ + /** + * Configuration overrides for this transaction, such as tipping and customer cancellation + * settings. + */ public Builder setProcessConfig(ReaderProcessPaymentIntentParams.ProcessConfig processConfig) { this.processConfig = processConfig; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java b/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java index 74272ee0f8a..cae1b068ad7 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderProcessSetupIntentParams.java @@ -35,11 +35,11 @@ public class ReaderProcessSetupIntentParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Configuration overrides. */ + /** Configuration overrides for this setup, such as MOTO and customer cancellation settings. */ @SerializedName("process_config") ProcessConfig processConfig; - /** Required. SetupIntent ID */ + /** Required. The ID of the SetupIntent to process on the reader. */ @SerializedName("setup_intent") String setupIntent; @@ -140,13 +140,13 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Configuration overrides. */ + /** Configuration overrides for this setup, such as MOTO and customer cancellation settings. */ public Builder setProcessConfig(ReaderProcessSetupIntentParams.ProcessConfig processConfig) { this.processConfig = processConfig; return this; } - /** Required. SetupIntent ID */ + /** Required. The ID of the SetupIntent to process on the reader. */ public Builder setSetupIntent(String setupIntent) { this.setupIntent = setupIntent; return this; diff --git a/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java b/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java index 69eeb69343e..dbfd525ecb1 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderRefundPaymentParams.java @@ -58,7 +58,7 @@ public class ReaderRefundPaymentParams extends ApiRequestParams { @SerializedName("refund_application_fee") Boolean refundApplicationFee; - /** Configuration overrides. */ + /** Configuration overrides for this refund, such as customer cancellation settings. */ @SerializedName("refund_payment_config") RefundPaymentConfig refundPaymentConfig; @@ -237,7 +237,7 @@ public Builder setRefundApplicationFee(Boolean refundApplicationFee) { return this; } - /** Configuration overrides. */ + /** Configuration overrides for this refund, such as customer cancellation settings. */ public Builder setRefundPaymentConfig( ReaderRefundPaymentParams.RefundPaymentConfig refundPaymentConfig) { this.refundPaymentConfig = refundPaymentConfig; diff --git a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java index 1c1c79b1b1a..aa22daaa933 100644 --- a/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java +++ b/src/main/java/com/stripe/param/terminal/ReaderSetReaderDisplayParams.java @@ -13,7 +13,7 @@ @Getter @EqualsAndHashCode(callSuper = false) public class ReaderSetReaderDisplayParams extends ApiRequestParams { - /** Cart. */ + /** Cart details to display on the reader screen, including line items, amounts, and currency. */ @SerializedName("cart") Cart cart; @@ -30,7 +30,10 @@ public class ReaderSetReaderDisplayParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Type */ + /** + * Required. Type of information to display. Only {@code cart} is currently + * supported. + */ @SerializedName("type") Type type; @@ -60,7 +63,9 @@ public ReaderSetReaderDisplayParams build() { return new ReaderSetReaderDisplayParams(this.cart, this.expand, this.extraParams, this.type); } - /** Cart. */ + /** + * Cart details to display on the reader screen, including line items, amounts, and currency. + */ public Builder setCart(ReaderSetReaderDisplayParams.Cart cart) { this.cart = cart; return this; @@ -118,7 +123,10 @@ public Builder putAllExtraParam(Map map) { return this; } - /** Required. Type */ + /** + * Required. Type of information to display. Only {@code cart} is currently + * supported. + */ public Builder setType(ReaderSetReaderDisplayParams.Type type) { this.type = type; return this; @@ -145,15 +153,21 @@ public static class Cart { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; - /** Required. Array of line items that were purchased. */ + /** Required. Array of line items to display. */ @SerializedName("line_items") List lineItems; - /** The amount of tax in cents. */ + /** + * The amount of tax in the smallest + * currency unit. + */ @SerializedName("tax") Long tax; - /** Required. Total balance of cart due in cents. */ + /** + * Required. Total balance of cart due in the smallest currency unit. + */ @SerializedName("total") Long total; @@ -253,13 +267,19 @@ public Builder addAllLineItem(List e return this; } - /** The amount of tax in cents. */ + /** + * The amount of tax in the smallest + * currency unit. + */ public Builder setTax(Long tax) { this.tax = tax; return this; } - /** Required. Total balance of cart due in cents. */ + /** + * Required. Total balance of cart due in the smallest currency unit. + */ public Builder setTotal(Long total) { this.total = total; return this; @@ -269,7 +289,10 @@ public Builder setTotal(Long total) { @Getter @EqualsAndHashCode(callSuper = false) public static class LineItem { - /** Required. The price of the item in cents. */ + /** + * Required. The price of the item in the smallest currency unit. + */ @SerializedName("amount") Long amount; @@ -317,7 +340,10 @@ public ReaderSetReaderDisplayParams.Cart.LineItem build() { this.amount, this.description, this.extraParams, this.quantity); } - /** Required. The price of the item in cents. */ + /** + * Required. The price of the item in the smallest currency unit. + */ public Builder setAmount(Long amount) { this.amount = amount; return this; diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java index 1e5d4125b6f..216a38bbeb0 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingCreateParams.java @@ -200,8 +200,8 @@ public static class EmailDelivery { Map extraParams; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; @@ -253,8 +253,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ public Builder setPaymentDue( CollectionSettingCreateParams.EmailDelivery.PaymentDue paymentDue) { @@ -283,7 +283,7 @@ public static class PaymentDue { Map extraParams; /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ @SerializedName("include_payment_link") @@ -351,7 +351,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ public Builder setIncludePaymentLink(Boolean includePaymentLink) { diff --git a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java index 2642012da02..e5b51c5d994 100644 --- a/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/billing/CollectionSettingUpdateParams.java @@ -263,8 +263,8 @@ public static class EmailDelivery { Map extraParams; /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ @SerializedName("payment_due") PaymentDue paymentDue; @@ -316,8 +316,8 @@ public Builder putAllExtraParam(Map map) { } /** - * Controls emails for when the payment is due. For example after the invoice is finilized and - * transition to Open state. + * Controls emails for when the payment is due. For example after the invoice is finalized and + * transitions to Open state. */ public Builder setPaymentDue( CollectionSettingUpdateParams.EmailDelivery.PaymentDue paymentDue) { @@ -346,7 +346,7 @@ public static class PaymentDue { Map extraParams; /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ @SerializedName("include_payment_link") @@ -414,7 +414,7 @@ public Builder putAllExtraParam(Map map) { } /** - * Required. If true the payment link to hosted invocie page would be + * Required. If true the payment link to hosted invoice page would be * included in email and PDF of the invoice. */ public Builder setIncludePaymentLink(Boolean includePaymentLink) { diff --git a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java index 5fd4d469f2b..b0d4b07e0b4 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountCreateParams.java @@ -691,6 +691,9 @@ public enum LocationSource implements ApiRequestParams.EnumParam { @SerializedName("ip_address") IP_ADDRESS("ip_address"), + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + @SerializedName("shipping_address") SHIPPING_ADDRESS("shipping_address"); @@ -8058,9 +8061,14 @@ public static class HoldsCurrencies { @SerializedName("gbp") Gbp gbp; - private HoldsCurrencies(Map extraParams, Gbp gbp) { + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + + private HoldsCurrencies(Map extraParams, Gbp gbp, Usd usd) { this.extraParams = extraParams; this.gbp = gbp; + this.usd = usd; } public static Builder builder() { @@ -8072,10 +8080,12 @@ public static class Builder { private Gbp gbp; + private Usd usd; + /** Finalize and obtain parameter instance from this builder. */ public AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies build() { return new AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies( - this.extraParams, this.gbp); + this.extraParams, this.gbp, this.usd); } /** @@ -8114,6 +8124,13 @@ public Builder setGbp( this.gbp = gbp; return this; } + + /** Can hold storage-type funds on Stripe in USD. */ + public Builder setUsd( + AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd usd) { + this.usd = usd; + return this; + } } @Getter @@ -8197,6 +8214,88 @@ public Builder setRequested(Boolean requested) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Usd { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} + * value. Instead, each key/value pair is serialized as if the key is a root-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. To request a new Capability for an account, pass true. + * There can be a delay before the requested Capability becomes active. + */ + @SerializedName("requested") + Boolean requested; + + private Usd(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd + build() { + return new AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies + .Usd(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the + * first `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountCreateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#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. To request a new Capability for an account, pass true. + * There can be a delay before the requested Capability becomes active. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } } @Getter @@ -9353,6 +9452,12 @@ public enum FeesCollector implements ApiRequestParams.EnumParam { @SerializedName("application") APPLICATION("application"), + @SerializedName("application_custom") + APPLICATION_CUSTOM("application_custom"), + + @SerializedName("application_express") + APPLICATION_EXPRESS("application_express"), + @SerializedName("stripe") STRIPE("stripe"); @@ -9645,7 +9750,10 @@ public enum Locale implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Identity { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -9721,7 +9829,10 @@ public AccountCreateParams.Identity build() { this.individual); } - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ public Builder setAttestations(AccountCreateParams.Identity.Attestations attestations) { this.attestations = attestations; return this; @@ -9814,6 +9925,13 @@ public static class Attestations { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -9823,11 +9941,13 @@ private Attestations( Map extraParams, OwnershipDeclaration ownershipDeclaration, PersonsProvided personsProvided, + RepresentativeDeclaration representativeDeclaration, TermsOfService termsOfService) { this.directorshipDeclaration = directorshipDeclaration; this.extraParams = extraParams; this.ownershipDeclaration = ownershipDeclaration; this.personsProvided = personsProvided; + this.representativeDeclaration = representativeDeclaration; this.termsOfService = termsOfService; } @@ -9844,6 +9964,8 @@ public static class Builder { private PersonsProvided personsProvided; + private RepresentativeDeclaration representativeDeclaration; + private TermsOfService termsOfService; /** Finalize and obtain parameter instance from this builder. */ @@ -9853,6 +9975,7 @@ public AccountCreateParams.Identity.Attestations build() { this.extraParams, this.ownershipDeclaration, this.personsProvided, + this.representativeDeclaration, this.termsOfService); } @@ -9912,6 +10035,17 @@ public Builder setPersonsProvided( return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountCreateParams.Identity.Attestations.RepresentativeDeclaration + representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** Attestations of accepted terms of service agreements. */ public Builder setTermsOfService( AccountCreateParams.Identity.Attestations.TermsOfService termsOfService) { @@ -10301,6 +10435,116 @@ public enum OwnershipExemptionReason implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The IP address from which the representative attestation was made. */ + @SerializedName("ip") + String ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + String userAgent; + + private RepresentativeDeclaration( + Instant date, Map extraParams, String ip, String userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Instant date; + + private Map extraParams; + + private String ip; + + private String userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountCreateParams.Identity.Attestations.RepresentativeDeclaration build() { + return new AccountCreateParams.Identity.Attestations.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The time marking when the representative attestation was made. Represented as a RFC + * 3339 date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + public Builder setDate(Instant date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountCreateParams.Identity.Attestations.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountCreateParams.Identity.Attestations.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The IP address from which the representative attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TermsOfService { diff --git a/src/main/java/com/stripe/param/v2/core/AccountListParams.java b/src/main/java/com/stripe/param/v2/core/AccountListParams.java index a80c11fec53..9f6d976161c 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountListParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountListParams.java @@ -20,6 +20,12 @@ public class AccountListParams extends ApiRequestParams { @SerializedName("applied_configurations") List appliedConfigurations; + /** + * Filter by whether the account is closed. If omitted, returns only Accounts that are not closed. + */ + @SerializedName("closed") + Boolean closed; + /** * Map of extra parameters for custom features not available in this client library. The content * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each @@ -34,8 +40,12 @@ public class AccountListParams extends ApiRequestParams { Long limit; private AccountListParams( - List appliedConfigurations, Map extraParams, Long limit) { + List appliedConfigurations, + Boolean closed, + Map extraParams, + Long limit) { this.appliedConfigurations = appliedConfigurations; + this.closed = closed; this.extraParams = extraParams; this.limit = limit; } @@ -47,13 +57,16 @@ public static Builder builder() { public static class Builder { private List appliedConfigurations; + private Boolean closed; + private Map extraParams; private Long limit; /** Finalize and obtain parameter instance from this builder. */ public AccountListParams build() { - return new AccountListParams(this.appliedConfigurations, this.extraParams, this.limit); + return new AccountListParams( + this.appliedConfigurations, this.closed, this.extraParams, this.limit); } /** @@ -82,6 +95,15 @@ public Builder addAllAppliedConfiguration(List elements) { return this; } + /** + * Filter by whether the account is closed. If omitted, returns only Accounts that are not + * closed. + */ + public Builder setClosed(Boolean closed) { + this.closed = closed; + 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 diff --git a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java index 73b482e98db..b54cb34eb10 100644 --- a/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java +++ b/src/main/java/com/stripe/param/v2/core/AccountUpdateParams.java @@ -792,6 +792,9 @@ public enum LocationSource implements ApiRequestParams.EnumParam { @SerializedName("ip_address") IP_ADDRESS("ip_address"), + @SerializedName("payment_method") + PAYMENT_METHOD("payment_method"), + @SerializedName("shipping_address") SHIPPING_ADDRESS("shipping_address"); @@ -8537,9 +8540,14 @@ public static class HoldsCurrencies { @SerializedName("gbp") Gbp gbp; - private HoldsCurrencies(Map extraParams, Gbp gbp) { + /** Can hold storage-type funds on Stripe in USD. */ + @SerializedName("usd") + Usd usd; + + private HoldsCurrencies(Map extraParams, Gbp gbp, Usd usd) { this.extraParams = extraParams; this.gbp = gbp; + this.usd = usd; } public static Builder builder() { @@ -8551,10 +8559,12 @@ public static class Builder { private Gbp gbp; + private Usd usd; + /** Finalize and obtain parameter instance from this builder. */ public AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies build() { return new AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies( - this.extraParams, this.gbp); + this.extraParams, this.gbp, this.usd); } /** @@ -8593,6 +8603,13 @@ public Builder setGbp( this.gbp = gbp; return this; } + + /** Can hold storage-type funds on Stripe in USD. */ + public Builder setUsd( + AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd usd) { + this.usd = usd; + return this; + } } @Getter @@ -8676,6 +8693,88 @@ public Builder setRequested(Boolean requested) { } } } + + @Getter + @EqualsAndHashCode(callSuper = false) + public static class Usd { + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} + * value. Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its + * parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** + * To request a new Capability for an account, pass true. There can be a delay before + * the requested Capability becomes active. + */ + @SerializedName("requested") + Boolean requested; + + private Usd(Map extraParams, Boolean requested) { + this.extraParams = extraParams; + this.requested = requested; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Boolean requested; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd + build() { + return new AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies + .Usd(this.extraParams, this.requested); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#extraParams} + * for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the + * first `put/putAll` call, and subsequent calls add additional key/value pairs to the + * original map. See {@link + * AccountUpdateParams.Configuration.Storer.Capabilities.HoldsCurrencies.Usd#extraParams} + * for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * To request a new Capability for an account, pass true. There can be a delay before + * the requested Capability becomes active. + */ + public Builder setRequested(Boolean requested) { + this.requested = requested; + return this; + } + } + } } @Getter @@ -9863,6 +9962,12 @@ public enum FeesCollector implements ApiRequestParams.EnumParam { @SerializedName("application") APPLICATION("application"), + @SerializedName("application_custom") + APPLICATION_CUSTOM("application_custom"), + + @SerializedName("application_express") + APPLICATION_EXPRESS("application_express"), + @SerializedName("stripe") STRIPE("stripe"); @@ -10155,7 +10260,10 @@ public enum Locale implements ApiRequestParams.EnumParam { @Getter @EqualsAndHashCode(callSuper = false) public static class Identity { - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ @SerializedName("attestations") Attestations attestations; @@ -10234,7 +10342,10 @@ public AccountUpdateParams.Identity build() { this.individual); } - /** Attestations from the identity's key people, e.g. owners, executives, directors. */ + /** + * Attestations from the identity's key people, e.g. owners, executives, directors, + * representatives. + */ public Builder setAttestations(AccountUpdateParams.Identity.Attestations attestations) { this.attestations = attestations; return this; @@ -10341,6 +10452,13 @@ public static class Attestations { @SerializedName("persons_provided") PersonsProvided personsProvided; + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + @SerializedName("representative_declaration") + RepresentativeDeclaration representativeDeclaration; + /** Attestations of accepted terms of service agreements. */ @SerializedName("terms_of_service") TermsOfService termsOfService; @@ -10350,11 +10468,13 @@ private Attestations( Map extraParams, OwnershipDeclaration ownershipDeclaration, PersonsProvided personsProvided, + RepresentativeDeclaration representativeDeclaration, TermsOfService termsOfService) { this.directorshipDeclaration = directorshipDeclaration; this.extraParams = extraParams; this.ownershipDeclaration = ownershipDeclaration; this.personsProvided = personsProvided; + this.representativeDeclaration = representativeDeclaration; this.termsOfService = termsOfService; } @@ -10371,6 +10491,8 @@ public static class Builder { private PersonsProvided personsProvided; + private RepresentativeDeclaration representativeDeclaration; + private TermsOfService termsOfService; /** Finalize and obtain parameter instance from this builder. */ @@ -10380,6 +10502,7 @@ public AccountUpdateParams.Identity.Attestations build() { this.extraParams, this.ownershipDeclaration, this.personsProvided, + this.representativeDeclaration, this.termsOfService); } @@ -10439,6 +10562,17 @@ public Builder setPersonsProvided( return this; } + /** + * This hash is used to attest that the representative is authorized to act as the + * representative of their legal entity. + */ + public Builder setRepresentativeDeclaration( + AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration + representativeDeclaration) { + this.representativeDeclaration = representativeDeclaration; + return this; + } + /** Attestations of accepted terms of service agreements. */ public Builder setTermsOfService( AccountUpdateParams.Identity.Attestations.TermsOfService termsOfService) { @@ -10852,6 +10986,128 @@ public enum OwnershipExemptionReason implements ApiRequestParams.EnumParam { } } + @Getter + @EqualsAndHashCode(callSuper = false) + public static class RepresentativeDeclaration { + /** + * The time marking when the representative attestation was made. Represented as a RFC 3339 + * date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + @SerializedName("date") + Instant date; + + /** + * Map of extra parameters for custom features not available in this client library. The + * content in this map is not serialized under this field's {@code @SerializedName} value. + * Instead, each key/value pair is serialized as if the key is a root-level field + * (serialized) name in this param object. Effectively, this map is flattened to its parent + * instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** The IP address from which the representative attestation was made. */ + @SerializedName("ip") + Object ip; + + /** The user agent of the browser from which the representative attestation was made. */ + @SerializedName("user_agent") + Object userAgent; + + private RepresentativeDeclaration( + Instant date, Map extraParams, Object ip, Object userAgent) { + this.date = date; + this.extraParams = extraParams; + this.ip = ip; + this.userAgent = userAgent; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Instant date; + + private Map extraParams; + + private Object ip; + + private Object userAgent; + + /** Finalize and obtain parameter instance from this builder. */ + public AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration build() { + return new AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration( + this.date, this.extraParams, this.ip, this.userAgent); + } + + /** + * The time marking when the representative attestation was made. Represented as a RFC + * 3339 date & time UTC value in millisecond precision, for example: + * 2022-09-18T13:22:18.123Z. + */ + public Builder setDate(Instant date) { + this.date = date; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original + * map. See {@link + * AccountUpdateParams.Identity.Attestations.RepresentativeDeclaration#extraParams} for + * the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** The IP address from which the representative attestation was made. */ + public Builder setIp(String ip) { + this.ip = ip; + return this; + } + + /** The IP address from which the representative attestation was made. */ + public Builder setIp(EmptyParam ip) { + this.ip = ip; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(String userAgent) { + this.userAgent = userAgent; + return this; + } + + /** The user agent of the browser from which the representative attestation was made. */ + public Builder setUserAgent(EmptyParam userAgent) { + this.userAgent = userAgent; + return this; + } + } + } + @Getter @EqualsAndHashCode(callSuper = false) public static class TermsOfService { diff --git a/src/main/java/com/stripe/param/v2/core/EventListParams.java b/src/main/java/com/stripe/param/v2/core/EventListParams.java index b80d95056b9..be4f3b17dbd 100644 --- a/src/main/java/com/stripe/param/v2/core/EventListParams.java +++ b/src/main/java/com/stripe/param/v2/core/EventListParams.java @@ -3,7 +3,10 @@ import com.google.gson.annotations.SerializedName; import com.stripe.net.ApiRequestParams; +import java.time.Instant; +import java.util.ArrayList; import java.util.HashMap; +import java.util.List; import java.util.Map; import lombok.EqualsAndHashCode; import lombok.Getter; @@ -20,18 +23,51 @@ public class EventListParams extends ApiRequestParams { @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) Map extraParams; + /** Filter for events created after the specified timestamp. */ + @SerializedName("gt") + Instant gt; + + /** Filter for events created at or after the specified timestamp. */ + @SerializedName("gte") + Instant gte; + /** The page size. */ @SerializedName("limit") Long limit; - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + @SerializedName("lt") + Instant lt; + + /** Filter for events created at or before the specified timestamp. */ + @SerializedName("lte") + Instant lte; + + /** Primary object ID used to retrieve related events. */ @SerializedName("object_id") String objectId; - private EventListParams(Map extraParams, Long limit, String objectId) { + /** An array of up to 20 strings containing specific event names. */ + @SerializedName("types") + List types; + + private EventListParams( + Map extraParams, + Instant gt, + Instant gte, + Long limit, + Instant lt, + Instant lte, + String objectId, + List types) { this.extraParams = extraParams; + this.gt = gt; + this.gte = gte; this.limit = limit; + this.lt = lt; + this.lte = lte; this.objectId = objectId; + this.types = types; } public static Builder builder() { @@ -41,13 +77,31 @@ public static Builder builder() { public static class Builder { private Map extraParams; + private Instant gt; + + private Instant gte; + private Long limit; + private Instant lt; + + private Instant lte; + private String objectId; + private List types; + /** Finalize and obtain parameter instance from this builder. */ public EventListParams build() { - return new EventListParams(this.extraParams, this.limit, this.objectId); + return new EventListParams( + this.extraParams, + this.gt, + this.gte, + this.limit, + this.lt, + this.lte, + this.objectId, + this.types); } /** @@ -76,16 +130,66 @@ public Builder putAllExtraParam(Map map) { return this; } + /** Filter for events created after the specified timestamp. */ + public Builder setGt(Instant gt) { + this.gt = gt; + return this; + } + + /** Filter for events created at or after the specified timestamp. */ + public Builder setGte(Instant gte) { + this.gte = gte; + return this; + } + /** The page size. */ public Builder setLimit(Long limit) { this.limit = limit; return this; } - /** Required. Primary object ID used to retrieve related events. */ + /** Filter for events created before the specified timestamp. */ + public Builder setLt(Instant lt) { + this.lt = lt; + return this; + } + + /** Filter for events created at or before the specified timestamp. */ + public Builder setLte(Instant lte) { + this.lte = lte; + return this; + } + + /** Primary object ID used to retrieve related events. */ public Builder setObjectId(String objectId) { this.objectId = objectId; return this; } + + /** + * Add an element to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addType(String element) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.add(element); + return this; + } + + /** + * Add all elements to `types` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * EventListParams#types} for the field documentation. + */ + public Builder addAllType(List elements) { + if (this.types == null) { + this.types = new ArrayList<>(); + } + this.types.addAll(elements); + return this; + } } } diff --git a/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java new file mode 100644 index 00000000000..3d7e78d1eee --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/GbBankAccountListParams.java @@ -0,0 +1,78 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class GbBankAccountListParams extends ApiRequestParams { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + @SerializedName("limit") + Long limit; + + private GbBankAccountListParams(Map extraParams, Long limit) { + this.extraParams = extraParams; + this.limit = limit; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + /** Finalize and obtain parameter instance from this builder. */ + public GbBankAccountListParams build() { + return new GbBankAccountListParams(this.extraParams, this.limit); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * GbBankAccountListParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link GbBankAccountListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java new file mode 100644 index 00000000000..d2594269dce --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountConfirmMicrodepositsParams.java @@ -0,0 +1,124 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class UsBankAccountConfirmMicrodepositsParams extends ApiRequestParams { + /** + * Two amounts received through Send Microdeposits must match the input to Confirm Microdeposits + * to verify US Bank Account. + */ + @SerializedName("amounts") + List amounts; + + /** + * Descriptor code received through Send Microdeposits must match the input to Confirm + * Microdeposits to verify US Bank Account. + */ + @SerializedName("descriptor_code") + String descriptorCode; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-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 UsBankAccountConfirmMicrodepositsParams( + List amounts, String descriptorCode, Map extraParams) { + this.amounts = amounts; + this.descriptorCode = descriptorCode; + this.extraParams = extraParams; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private List amounts; + + private String descriptorCode; + + private Map extraParams; + + /** Finalize and obtain parameter instance from this builder. */ + public UsBankAccountConfirmMicrodepositsParams build() { + return new UsBankAccountConfirmMicrodepositsParams( + this.amounts, this.descriptorCode, this.extraParams); + } + + /** + * Add an element to `amounts` list. A list is initialized for the first `add/addAll` call, and + * subsequent calls adds additional elements to the original list. See {@link + * UsBankAccountConfirmMicrodepositsParams#amounts} for the field documentation. + */ + public Builder addAmount(Long element) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.add(element); + return this; + } + + /** + * Add all elements to `amounts` list. A list is initialized for the first `add/addAll` call, + * and subsequent calls adds additional elements to the original list. See {@link + * UsBankAccountConfirmMicrodepositsParams#amounts} for the field documentation. + */ + public Builder addAllAmount(List elements) { + if (this.amounts == null) { + this.amounts = new ArrayList<>(); + } + this.amounts.addAll(elements); + return this; + } + + /** + * Descriptor code received through Send Microdeposits must match the input to Confirm + * Microdeposits to verify US Bank Account. + */ + public Builder setDescriptorCode(String descriptorCode) { + this.descriptorCode = descriptorCode; + 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 + * UsBankAccountConfirmMicrodepositsParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link UsBankAccountConfirmMicrodepositsParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java new file mode 100644 index 00000000000..b8003413924 --- /dev/null +++ b/src/main/java/com/stripe/param/v2/core/vault/UsBankAccountListParams.java @@ -0,0 +1,98 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.core.vault; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class UsBankAccountListParams extends ApiRequestParams { + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + @SerializedName("limit") + Long limit; + + /** + * Optionally filter by verification status. Mutually exclusive with {@code unverified}, {@code + * verified}, {@code awaiting_verification}, and {@code verification_failed}. + */ + @SerializedName("verification_status") + String verificationStatus; + + private UsBankAccountListParams( + Map extraParams, Long limit, String verificationStatus) { + this.extraParams = extraParams; + this.limit = limit; + this.verificationStatus = verificationStatus; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Map extraParams; + + private Long limit; + + private String verificationStatus; + + /** Finalize and obtain parameter instance from this builder. */ + public UsBankAccountListParams build() { + return new UsBankAccountListParams(this.extraParams, this.limit, this.verificationStatus); + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * UsBankAccountListParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link UsBankAccountListParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** Optionally set the maximum number of results per page. Defaults to 10. */ + public Builder setLimit(Long limit) { + this.limit = limit; + return this; + } + + /** + * Optionally filter by verification status. Mutually exclusive with {@code unverified}, {@code + * verified}, {@code awaiting_verification}, and {@code verification_failed}. + */ + public Builder setVerificationStatus(String verificationStatus) { + this.verificationStatus = verificationStatus; + return this; + } + } +} diff --git a/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java new file mode 100644 index 00000000000..8c023e0b68c --- /dev/null +++ b/src/main/java/com/stripe/param/v2/moneymanagement/FinancialAccountUpdateParams.java @@ -0,0 +1,146 @@ +// File generated from our OpenAPI spec +package com.stripe.param.v2.moneymanagement; + +import com.google.gson.annotations.SerializedName; +import com.stripe.net.ApiRequestParams; +import com.stripe.param.common.EmptyParam; +import java.util.HashMap; +import java.util.Map; +import lombok.EqualsAndHashCode; +import lombok.Getter; + +@Getter +@EqualsAndHashCode(callSuper = false) +public class FinancialAccountUpdateParams extends ApiRequestParams { + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + @SerializedName("display_name") + Object displayName; + + /** + * Map of extra parameters for custom features not available in this client library. The content + * in this map is not serialized under this field's {@code @SerializedName} value. Instead, each + * key/value pair is serialized as if the key is a root-level field (serialized) name in this + * param object. Effectively, this map is flattened to its parent instance. + */ + @SerializedName(ApiRequestParams.EXTRA_PARAMS_KEY) + Map extraParams; + + /** Metadata associated with the FinancialAccount. */ + @SerializedName("metadata") + Map metadata; + + private FinancialAccountUpdateParams( + Object displayName, Map extraParams, Map metadata) { + this.displayName = displayName; + this.extraParams = extraParams; + this.metadata = metadata; + } + + public static Builder builder() { + return new Builder(); + } + + public static class Builder { + private Object displayName; + + private Map extraParams; + + private Map metadata; + + /** Finalize and obtain parameter instance from this builder. */ + public FinancialAccountUpdateParams build() { + return new FinancialAccountUpdateParams(this.displayName, this.extraParams, this.metadata); + } + + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + public Builder setDisplayName(String displayName) { + this.displayName = displayName; + return this; + } + + /** + * A descriptive name for the FinancialAccount, up to 50 characters long. This name will be used + * in the Stripe Dashboard and embedded components. + */ + public Builder setDisplayName(EmptyParam displayName) { + this.displayName = displayName; + return this; + } + + /** + * Add a key/value pair to `extraParams` map. A map is initialized for the first `put/putAll` + * call, and subsequent calls add additional key/value pairs to the original map. See {@link + * FinancialAccountUpdateParams#extraParams} for the field documentation. + */ + public Builder putExtraParam(String key, Object value) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.put(key, value); + return this; + } + + /** + * Add all map key/value pairs to `extraParams` map. A map is initialized for the first + * `put/putAll` call, and subsequent calls add additional key/value pairs to the original map. + * See {@link FinancialAccountUpdateParams#extraParams} for the field documentation. + */ + public Builder putAllExtraParam(Map map) { + if (this.extraParams == null) { + this.extraParams = new HashMap<>(); + } + this.extraParams.putAll(map); + return this; + } + + /** + * Add a key/value pair to `metadata` map. A map is initialized for the first `put/putAll` call, + * and subsequent calls add additional key/value pairs to the original map. See {@link + * FinancialAccountUpdateParams#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 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 + * FinancialAccountUpdateParams#metadata} for the field documentation. + */ + public Builder putMetadata(String key, EmptyParam 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. + * Map values can only be one of the following types: `String`, `EmptyParam`. See {@link + * FinancialAccountUpdateParams#metadata} for the field documentation. + */ + public Builder putAllMetadata(Map map) { + if (!map.values().stream().allMatch(v -> v instanceof String || v instanceof EmptyParam)) { + throw new IllegalArgumentException( + "All map values must one of the following types: String, EmptyParam"); + } + if (this.metadata == null) { + this.metadata = new HashMap<>(); + } + this.metadata.putAll(map); + return this; + } + } +} diff --git a/src/main/java/com/stripe/service/PaymentRecordService.java b/src/main/java/com/stripe/service/PaymentRecordService.java index a0a45a0f08e..8ab61a4ef4d 100644 --- a/src/main/java/com/stripe/service/PaymentRecordService.java +++ b/src/main/java/com/stripe/service/PaymentRecordService.java @@ -16,6 +16,7 @@ import com.stripe.param.PaymentRecordReportPaymentAttemptInformationalParams; import com.stripe.param.PaymentRecordReportPaymentAttemptParams; import com.stripe.param.PaymentRecordReportPaymentParams; +import com.stripe.param.PaymentRecordReportRefundParams; import com.stripe.param.PaymentRecordRetrieveParams; public final class PaymentRecordService extends ApiService { @@ -180,6 +181,26 @@ public PaymentRecord reportPaymentAttemptInformational( options); return this.request(request, PaymentRecord.class); } + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund(String id, PaymentRecordReportRefundParams params) + throws StripeException { + return reportRefund(id, params, (RequestOptions) null); + } + /** Report that the most recent payment attempt on the specified Payment Record was refunded. */ + public PaymentRecord reportRefund( + String id, PaymentRecordReportRefundParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v1/payment_records/%s/report_refund", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, PaymentRecord.class); + } /** * Report a new Payment Record. You may report a Payment Record as it is initialized and later * report updates through the other report_* methods, or report Payment Records in a terminal diff --git a/src/main/java/com/stripe/service/financialconnections/AccountService.java b/src/main/java/com/stripe/service/financialconnections/AccountService.java index 282f1611af4..c0e2fce27f6 100644 --- a/src/main/java/com/stripe/service/financialconnections/AccountService.java +++ b/src/main/java/com/stripe/service/financialconnections/AccountService.java @@ -135,14 +135,14 @@ public Account refresh(String account, AccountRefreshParams params, RequestOptio } /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public Account subscribe(String account, AccountSubscribeParams params) throws StripeException { return subscribe(account, params, (RequestOptions) null); } /** * Subscribes to periodic refreshes of data associated with a Financial Connections {@code - * Account}. + * Account}. When the account status is active, data is typically refreshed once a day. */ public Account subscribe(String account, AccountSubscribeParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/terminal/ReaderService.java b/src/main/java/com/stripe/service/terminal/ReaderService.java index 6bd247bddbc..b96fc85fd5b 100644 --- a/src/main/java/com/stripe/service/terminal/ReaderService.java +++ b/src/main/java/com/stripe/service/terminal/ReaderService.java @@ -144,20 +144,36 @@ public Reader create(ReaderCreateParams params, RequestOptions options) throws S options); return this.request(request, Reader.class); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, ReaderCancelActionParams params) throws StripeException { return cancelAction(reader, params, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, RequestOptions options) throws StripeException { return cancelAction(reader, (ReaderCancelActionParams) null, options); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader) throws StripeException { return cancelAction(reader, (ReaderCancelActionParams) null, (RequestOptions) null); } - /** Cancels the current reader action. */ + /** + * Cancels the current reader action. See Programmatic + * Cancellation for more details. + */ public Reader cancelAction(String reader, ReaderCancelActionParams params, RequestOptions options) throws StripeException { String path = @@ -171,12 +187,20 @@ public Reader cancelAction(String reader, ReaderCancelActionParams params, Reque options); return this.request(request, Reader.class); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs(String reader, ReaderCollectInputsParams params) throws StripeException { return collectInputs(reader, params, (RequestOptions) null); } - /** Initiates an input collection flow on a Reader. */ + /** + * Initiates an input + * collection flow on a Reader to display input forms and collect information from your + * customers. + */ public Reader collectInputs( String reader, ReaderCollectInputsParams params, RequestOptions options) throws StripeException { @@ -193,7 +217,9 @@ public Reader collectInputs( } /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodParams params) throws StripeException { @@ -201,7 +227,9 @@ public Reader collectPaymentMethod(String reader, ReaderCollectPaymentMethodPara } /** * Initiates a payment flow on a Reader and updates the PaymentIntent with card details before - * manual confirmation. + * manual confirmation. See Collecting + * a Payment method for more details. */ public Reader collectPaymentMethod( String reader, ReaderCollectPaymentMethodParams params, RequestOptions options) @@ -218,12 +246,20 @@ public Reader collectPaymentMethod( options); return this.request(request, Reader.class); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent(String reader, ReaderConfirmPaymentIntentParams params) throws StripeException { return confirmPaymentIntent(reader, params, (RequestOptions) null); } - /** Finalizes a payment on a Reader. */ + /** + * Finalizes a payment on a Reader. See Confirming + * a Payment for more details. + */ public Reader confirmPaymentIntent( String reader, ReaderConfirmPaymentIntentParams params, RequestOptions options) throws StripeException { @@ -239,12 +275,20 @@ public Reader confirmPaymentIntent( options); return this.request(request, Reader.class); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent(String reader, ReaderProcessPaymentIntentParams params) throws StripeException { return processPaymentIntent(reader, params, (RequestOptions) null); } - /** Initiates a payment flow on a Reader. */ + /** + * Initiates a payment flow on a Reader. See process + * the payment for more details. + */ public Reader processPaymentIntent( String reader, ReaderProcessPaymentIntentParams params, RequestOptions options) throws StripeException { @@ -260,12 +304,20 @@ public Reader processPaymentIntent( options); return this.request(request, Reader.class); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent(String reader, ReaderProcessSetupIntentParams params) throws StripeException { return processSetupIntent(reader, params, (RequestOptions) null); } - /** Initiates a setup intent flow on a Reader. */ + /** + * Initiates a SetupIntent flow on a Reader. See Save + * directly without charging for more details. + */ public Reader processSetupIntent( String reader, ReaderProcessSetupIntentParams params, RequestOptions options) throws StripeException { @@ -281,20 +333,36 @@ public Reader processSetupIntent( options); return this.request(request, Reader.class); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader, ReaderRefundPaymentParams params) throws StripeException { return refundPayment(reader, params, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader, RequestOptions options) throws StripeException { return refundPayment(reader, (ReaderRefundPaymentParams) null, options); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment(String reader) throws StripeException { return refundPayment(reader, (ReaderRefundPaymentParams) null, (RequestOptions) null); } - /** Initiates a refund on a Reader. */ + /** + * Initiates an in-person refund on a Reader. See Refund + * an Interac Payment for more details. + */ public Reader refundPayment( String reader, ReaderRefundPaymentParams params, RequestOptions options) throws StripeException { @@ -309,12 +377,18 @@ public Reader refundPayment( options); return this.request(request, Reader.class); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay(String reader, ReaderSetReaderDisplayParams params) throws StripeException { return setReaderDisplay(reader, params, (RequestOptions) null); } - /** Sets reader display to show cart details. */ + /** + * Sets the reader display to show cart details. + */ public Reader setReaderDisplay( String reader, ReaderSetReaderDisplayParams params, RequestOptions options) throws StripeException { diff --git a/src/main/java/com/stripe/service/v2/core/AccountService.java b/src/main/java/com/stripe/service/v2/core/AccountService.java index a0d19e3ac01..3e503c30cb3 100644 --- a/src/main/java/com/stripe/service/v2/core/AccountService.java +++ b/src/main/java/com/stripe/service/v2/core/AccountService.java @@ -147,19 +147,35 @@ public Account update(String id, AccountUpdateParams params, RequestOptions opti options); return this.request(request, Account.class); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, AccountCloseParams params) throws StripeException { return close(id, params, (RequestOptions) null); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, RequestOptions options) throws StripeException { return close(id, (AccountCloseParams) null, options); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id) throws StripeException { return close(id, (AccountCloseParams) null, (RequestOptions) null); } - /** Removes access to the Account and its associated resources. */ + /** + * Removes access to the Account and its associated resources. Closed Accounts can no longer be + * operated on, but limited information can still be retrieved through the API in order to be able + * to track their history. + */ public Account close(String id, AccountCloseParams params, RequestOptions options) throws StripeException { String path = String.format("/v2/core/accounts/%s/close", ApiResource.urlEncodeId(id)); diff --git a/src/main/java/com/stripe/service/v2/core/EventService.java b/src/main/java/com/stripe/service/v2/core/EventService.java index 6a2cae51bbf..c461aa97db6 100644 --- a/src/main/java/com/stripe/service/v2/core/EventService.java +++ b/src/main/java/com/stripe/service/v2/core/EventService.java @@ -24,6 +24,14 @@ public StripeCollection list(EventListParams params) throws StripeExcepti return list(params, (RequestOptions) null); } /** List events, going back up to 30 days. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((EventListParams) null, options); + } + /** List events, going back up to 30 days. */ + public StripeCollection list() throws StripeException { + return list((EventListParams) null, (RequestOptions) null); + } + /** List events, going back up to 30 days. */ public StripeCollection list(EventListParams params, RequestOptions options) throws StripeException { String path = "/v2/core/events"; diff --git a/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java b/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java index 76965eb88e1..47a0d415ef9 100644 --- a/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java +++ b/src/main/java/com/stripe/service/v2/core/vault/GbBankAccountService.java @@ -1,7 +1,9 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.vault; +import com.google.gson.reflect.TypeToken; import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.vault.GbBankAccount; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; @@ -12,12 +14,47 @@ import com.stripe.net.StripeResponseGetter; import com.stripe.param.v2.core.vault.GbBankAccountCreateParams; import com.stripe.param.v2.core.vault.GbBankAccountInitiateConfirmationOfPayeeParams; +import com.stripe.param.v2.core.vault.GbBankAccountListParams; public final class GbBankAccountService extends ApiService { public GbBankAccountService(StripeResponseGetter responseGetter) { super(responseGetter); } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list(GbBankAccountListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((GbBankAccountListParams) null, options); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list() throws StripeException { + return list((GbBankAccountListParams) null, (RequestOptions) null); + } + /** + * List objects that can be used as destinations for outbound money movement via OutboundPayment. + */ + public StripeCollection list( + GbBankAccountListParams params, RequestOptions options) throws StripeException { + String path = "/v2/core/vault/gb_bank_accounts"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } /** Create a GB bank account. */ public GbBankAccount create(GbBankAccountCreateParams params) throws StripeException { return create(params, (RequestOptions) null); diff --git a/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java b/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java index 177838d0420..18d7da5a09b 100644 --- a/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java +++ b/src/main/java/com/stripe/service/v2/core/vault/UsBankAccountService.java @@ -1,11 +1,13 @@ // File generated from our OpenAPI spec package com.stripe.service.v2.core.vault; +import com.google.gson.reflect.TypeToken; import com.stripe.exception.BlockedByStripeException; import com.stripe.exception.ControlledByDashboardException; import com.stripe.exception.InvalidPaymentMethodException; import com.stripe.exception.QuotaExceededException; import com.stripe.exception.StripeException; +import com.stripe.model.v2.StripeCollection; import com.stripe.model.v2.core.vault.UsBankAccount; import com.stripe.net.ApiRequest; import com.stripe.net.ApiRequestParams; @@ -14,7 +16,9 @@ import com.stripe.net.BaseAddress; import com.stripe.net.RequestOptions; import com.stripe.net.StripeResponseGetter; +import com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams; import com.stripe.param.v2.core.vault.UsBankAccountCreateParams; +import com.stripe.param.v2.core.vault.UsBankAccountListParams; import com.stripe.param.v2.core.vault.UsBankAccountUpdateParams; public final class UsBankAccountService extends ApiService { @@ -22,6 +26,32 @@ public UsBankAccountService(StripeResponseGetter responseGetter) { super(responseGetter); } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list(UsBankAccountListParams params) + throws StripeException { + return list(params, (RequestOptions) null); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list(RequestOptions options) throws StripeException { + return list((UsBankAccountListParams) null, options); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list() throws StripeException { + return list((UsBankAccountListParams) null, (RequestOptions) null); + } + /** List USBankAccount objects. Optionally filter by verification status. */ + public StripeCollection list( + UsBankAccountListParams params, RequestOptions options) throws StripeException { + String path = "/v2/core/vault/us_bank_accounts"; + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, new TypeToken>() {}.getType()); + } /** Create a USBankAccount object. */ public UsBankAccount create(UsBankAccountCreateParams params) throws StripeException, BlockedByStripeException, InvalidPaymentMethodException, @@ -118,4 +148,73 @@ public UsBankAccount archive(String id, RequestOptions options) new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); return this.request(request, UsBankAccount.class); } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits( + String id, UsBankAccountConfirmMicrodepositsParams params) throws StripeException { + return confirmMicrodeposits(id, params, (RequestOptions) null); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits(String id, RequestOptions options) + throws StripeException { + return confirmMicrodeposits(id, (UsBankAccountConfirmMicrodepositsParams) null, options); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits(String id) throws StripeException { + return confirmMicrodeposits( + id, (UsBankAccountConfirmMicrodepositsParams) null, (RequestOptions) null); + } + /** + * Confirm microdeposits amounts or descriptor code that you have received from the Send + * Microdeposits request. Once you correctly confirm this, this US Bank Account will be verified + * and eligible to transfer funds with. + */ + public UsBankAccount confirmMicrodeposits( + String id, UsBankAccountConfirmMicrodepositsParams params, RequestOptions options) + throws StripeException { + String path = + String.format( + "/v2/core/vault/us_bank_accounts/%s/confirm_microdeposits", + ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, UsBankAccount.class); + } + /** + * Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. + * This will start the verification process and you must Confirm Microdeposits to successfully + * verify your US Bank Account. + */ + public UsBankAccount sendMicrodeposits(String id) throws StripeException { + return sendMicrodeposits(id, (RequestOptions) null); + } + /** + * Send microdeposits in order to verify your US Bank Account so it is eligible to transfer funds. + * This will start the verification process and you must Confirm Microdeposits to successfully + * verify your US Bank Account. + */ + public UsBankAccount sendMicrodeposits(String id, RequestOptions options) throws StripeException { + String path = + String.format( + "/v2/core/vault/us_bank_accounts/%s/send_microdeposits", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.POST, path, null, options); + return this.request(request, UsBankAccount.class); + } } diff --git a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java index c2ac9e692b4..c5a8104c4d8 100644 --- a/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java +++ b/src/main/java/com/stripe/service/v2/moneymanagement/FinancialAccountService.java @@ -18,6 +18,7 @@ import com.stripe.param.v2.moneymanagement.FinancialAccountCloseParams; import com.stripe.param.v2.moneymanagement.FinancialAccountCreateParams; import com.stripe.param.v2.moneymanagement.FinancialAccountListParams; +import com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams; public final class FinancialAccountService extends ApiService { public FinancialAccountService(StripeResponseGetter responseGetter) { @@ -80,6 +81,34 @@ public FinancialAccount retrieve(String id, RequestOptions options) throws Strip new ApiRequest(BaseAddress.API, ApiResource.RequestMethod.GET, path, null, options); return this.request(request, FinancialAccount.class); } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id, FinancialAccountUpdateParams params) + throws StripeException { + return update(id, params, (RequestOptions) null); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id, RequestOptions options) throws StripeException { + return update(id, (FinancialAccountUpdateParams) null, options); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update(String id) throws StripeException { + return update(id, (FinancialAccountUpdateParams) null, (RequestOptions) null); + } + /** Updates an existing FinancialAccount. */ + public FinancialAccount update( + String id, FinancialAccountUpdateParams params, RequestOptions options) + throws StripeException { + String path = + String.format("/v2/money_management/financial_accounts/%s", ApiResource.urlEncodeId(id)); + ApiRequest request = + new ApiRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + path, + ApiRequestParams.paramsToMap(params), + options); + return this.request(request, FinancialAccount.class); + } /** Closes a FinancialAccount with or without forwarding settings. */ public FinancialAccount close(String id, FinancialAccountCloseParams params) throws StripeException, NonZeroBalanceException { diff --git a/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java b/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java index 6cbc880a6d5..67068134be1 100644 --- a/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java +++ b/src/main/java/com/stripe/service/v2/moneymanagement/OutboundPaymentService.java @@ -54,14 +54,14 @@ public StripeCollection list( } /** Creates an OutboundPayment. */ public OutboundPayment create(OutboundPaymentCreateParams params) - throws StripeException, InsufficientFundsException, QuotaExceededException, - RecipientNotNotifiableException, FeatureNotEnabledException { + throws StripeException, InsufficientFundsException, FeatureNotEnabledException, + QuotaExceededException, RecipientNotNotifiableException { return create(params, (RequestOptions) null); } /** Creates an OutboundPayment. */ public OutboundPayment create(OutboundPaymentCreateParams params, RequestOptions options) - throws StripeException, InsufficientFundsException, QuotaExceededException, - RecipientNotNotifiableException, FeatureNotEnabledException { + throws StripeException, InsufficientFundsException, FeatureNotEnabledException, + QuotaExceededException, RecipientNotNotifiableException { String path = "/v2/money_management/outbound_payments"; ApiRequest request = new ApiRequest( diff --git a/src/test/java/com/stripe/functional/GeneratedExamples.java b/src/test/java/com/stripe/functional/GeneratedExamples.java index e4a6603fa77..982f06c6b3e 100644 --- a/src/test/java/com/stripe/functional/GeneratedExamples.java +++ b/src/test/java/com/stripe/functional/GeneratedExamples.java @@ -25477,7 +25477,7 @@ public void testV2CoreEventGetServices() throws StripeException { StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.EventListParams params = - com.stripe.param.v2.core.EventListParams.builder().setObjectId("object_id").build(); + com.stripe.param.v2.core.EventListParams.builder().build(); com.stripe.model.v2.StripeCollection stripeCollection = client.v2().core().events().list(params); @@ -25707,6 +25707,34 @@ public void testV2CoreEventDestinationPost5Services() throws StripeException { null); } + @Test + public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/gb_bank_accounts", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.core.vault.GbBankAccount>>() {}.getType(), + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"confirmation_of_payee\":{\"result\":{\"created\":\"1970-01-12T21:42:34.472Z\",\"match_result\":\"unavailable\",\"matched\":{},\"message\":\"message\",\"provided\":{\"business_type\":\"personal\",\"name\":\"name\"}},\"status\":\"awaiting_acknowledgement\"},\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.gb_bank_account\",\"sort_code\":\"sort_code\",\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.GbBankAccountListParams params = + com.stripe.param.v2.core.vault.GbBankAccountListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = client.v2().core().vault().gbBankAccounts().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/gb_bank_accounts", + params.toMap(), + null); + } + @Test public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { stubRequest( @@ -25737,7 +25765,7 @@ public void testV2CoreVaultGbBankAccountPostServices() throws StripeException { } @Test - public void testV2CoreVaultGbBankAccountGetServices() throws StripeException { + public void testV2CoreVaultGbBankAccountGet2Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.GET, @@ -25832,6 +25860,34 @@ public void testV2CoreVaultGbBankAccountPost4Services() throws StripeException { null); } + @Test + public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/us_bank_accounts", + null, + null, + new TypeToken< + com.stripe.model.v2.StripeCollection< + com.stripe.model.v2.core.vault.UsBankAccount>>() {}.getType(), + "{\"data\":[{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}],\"next_page_url\":null,\"previous_page_url\":null}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.UsBankAccountListParams params = + com.stripe.param.v2.core.vault.UsBankAccountListParams.builder().build(); + + com.stripe.model.v2.StripeCollection + stripeCollection = client.v2().core().vault().usBankAccounts().list(params); + assertNotNull(stripeCollection); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.GET, + "/v2/core/vault/us_bank_accounts", + params.toMap(), + null); + } + @Test public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { stubRequest( @@ -25841,7 +25897,7 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountCreateParams params = @@ -25861,7 +25917,7 @@ public void testV2CoreVaultUsBankAccountPostServices() throws StripeException { } @Test - public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { + public void testV2CoreVaultUsBankAccountGet2Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.GET, @@ -25869,7 +25925,7 @@ public void testV2CoreVaultUsBankAccountGetServices() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -25892,7 +25948,7 @@ public void testV2CoreVaultUsBankAccountPost2Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.param.v2.core.vault.UsBankAccountUpdateParams params = @@ -25918,7 +25974,7 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null, null, com.stripe.model.v2.core.vault.UsBankAccount.class, - "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"livemode\":true}"); + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); StripeClient client = new StripeClient(networkSpy); com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = @@ -25932,6 +25988,55 @@ public void testV2CoreVaultUsBankAccountPost3Services() throws StripeException { null); } + @Test + public void testV2CoreVaultUsBankAccountPost4Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + null, + null, + com.stripe.model.v2.core.vault.UsBankAccount.class, + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams params = + com.stripe.param.v2.core.vault.UsBankAccountConfirmMicrodepositsParams.builder().build(); + + com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = + client.v2().core().vault().usBankAccounts().confirmMicrodeposits("id_123", params); + assertNotNull(usBankAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/confirm_microdeposits", + params.toMap(), + null); + } + + @Test + public void testV2CoreVaultUsBankAccountPost5Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + null, + null, + com.stripe.model.v2.core.vault.UsBankAccount.class, + "{\"archived\":true,\"bank_account_type\":\"savings\",\"bank_name\":\"bank_name\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"last4\":\"last4\",\"object\":\"v2.core.vault.us_bank_account\",\"verification\":{\"status\":\"verification_failed\"},\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.model.v2.core.vault.UsBankAccount usBankAccount = + client.v2().core().vault().usBankAccounts().sendMicrodeposits("id_123"); + assertNotNull(usBankAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/core/vault/us_bank_accounts/id_123/send_microdeposits", + null, + null); + } + @Test public void testV2MoneyManagementAdjustmentGetServices() throws StripeException { stubRequest( @@ -26064,6 +26169,32 @@ public void testV2MoneyManagementFinancialAccountGet2Services() throws StripeExc @Test public void testV2MoneyManagementFinancialAccountPost2Services() throws StripeException { + stubRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/money_management/financial_accounts/id_123", + null, + null, + com.stripe.model.v2.moneymanagement.FinancialAccount.class, + "{\"balance\":{\"available\":{\"key\":{\"currency\":\"USD\",\"value\":35}},\"inbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":11}},\"outbound_pending\":{\"key\":{\"currency\":\"USD\",\"value\":60}}},\"country\":\"country\",\"created\":\"1970-01-12T21:42:34.472Z\",\"id\":\"obj_123\",\"object\":\"v2.money_management.financial_account\",\"status\":\"closed\",\"type\":\"other\",\"livemode\":true}"); + StripeClient client = new StripeClient(networkSpy); + + com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams params = + com.stripe.param.v2.moneymanagement.FinancialAccountUpdateParams.builder().build(); + + com.stripe.model.v2.moneymanagement.FinancialAccount financialAccount = + client.v2().moneyManagement().financialAccounts().update("id_123", params); + assertNotNull(financialAccount); + verifyRequest( + BaseAddress.API, + ApiResource.RequestMethod.POST, + "/v2/money_management/financial_accounts/id_123", + params.toMap(), + null); + } + + @Test + public void testV2MoneyManagementFinancialAccountPost3Services() throws StripeException { stubRequest( BaseAddress.API, ApiResource.RequestMethod.POST, @@ -27315,7 +27446,7 @@ public void testFeatureNotEnabledErrorServices() throws StripeException { "/v2/money_management/financial_accounts", null, null, - "{\"error\":{\"type\":\"feature_not_enabled\",\"code\":\"recipient_feature_not_active\"}}", + "{\"error\":{\"type\":\"feature_not_enabled\",\"code\":\"outbound_flow_from_closed_financial_account_unsupported\"}}", 400); StripeClient client = new StripeClient(networkSpy);