From c6724ab2a6a8509ee7df39680562045a495f8f27 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:29:12 +0000 Subject: [PATCH 1/2] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 1974 +++++++++++------ .../realtimedecisions/RealTimeDecision.kt | 1942 ++++++++++------ .../CardPaymentListPageResponseTest.kt | 592 +++-- .../models/cardpayments/CardPaymentTest.kt | 536 +++-- .../realtimedecisions/RealTimeDecisionTest.kt | 107 +- 6 files changed, 3414 insertions(+), 1741 deletions(-) diff --git a/.stats.yml b/.stats.yml index aa5bad044..40873533c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 234 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-d73ee438cf15ca739d3ac64cc009b613f9e17ed76a31f8cc95f1a9968196bde1.yml -openapi_spec_hash: 933ce5facdc1d8a41ed063d925846de3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-b42ffa447aa14da70d972676b1d5ad0c2720ff4e33a483037b2b1bb51190a69f.yml +openapi_spec_hash: f2a5c5e804880a8e8d13f5f32ca264a1 config_hash: b7ec7f54fa76c1f8bde7a548710a1d38 diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 3a534e5f3..8c483e517 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -1766,7 +1766,6 @@ private constructor( private val cardPaymentId: JsonField, private val cardholderEmail: JsonField, private val cardholderName: JsonField, - private val category: JsonField, private val challenge: JsonField, private val createdAt: JsonField, private val denyReason: JsonField, @@ -1776,10 +1775,8 @@ private constructor( private val merchantCategoryCode: JsonField, private val merchantCountry: JsonField, private val merchantName: JsonField, + private val messageCategory: JsonField, private val priorAuthenticatedCardPaymentId: JsonField, - private val purchaseAmount: JsonField, - private val purchaseAmountCardholderEstimated: JsonField, - private val purchaseCurrency: JsonField, private val realTimeDecisionId: JsonField, private val requestorAuthenticationIndicator: JsonField, @@ -1795,7 +1792,6 @@ private constructor( private val shippingAddressState: JsonField, private val status: JsonField, private val threeDSecureServerTransactionId: JsonField, - private val transactionType: JsonField, private val type: JsonField, private val additionalProperties: MutableMap, ) { @@ -1839,9 +1835,6 @@ private constructor( @JsonProperty("cardholder_name") @ExcludeMissing cardholderName: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), @JsonProperty("challenge") @ExcludeMissing challenge: JsonField = JsonMissing.of(), @@ -1869,18 +1862,12 @@ private constructor( @JsonProperty("merchant_name") @ExcludeMissing merchantName: JsonField = JsonMissing.of(), + @JsonProperty("message_category") + @ExcludeMissing + messageCategory: JsonField = JsonMissing.of(), @JsonProperty("prior_authenticated_card_payment_id") @ExcludeMissing priorAuthenticatedCardPaymentId: JsonField = JsonMissing.of(), - @JsonProperty("purchase_amount") - @ExcludeMissing - purchaseAmount: JsonField = JsonMissing.of(), - @JsonProperty("purchase_amount_cardholder_estimated") - @ExcludeMissing - purchaseAmountCardholderEstimated: JsonField = JsonMissing.of(), - @JsonProperty("purchase_currency") - @ExcludeMissing - purchaseCurrency: JsonField = JsonMissing.of(), @JsonProperty("real_time_decision_id") @ExcludeMissing realTimeDecisionId: JsonField = JsonMissing.of(), @@ -1925,9 +1912,6 @@ private constructor( @JsonProperty("three_d_secure_server_transaction_id") @ExcludeMissing threeDSecureServerTransactionId: JsonField = JsonMissing.of(), - @JsonProperty("transaction_type") - @ExcludeMissing - transactionType: JsonField = JsonMissing.of(), @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), ) : this( id, @@ -1943,7 +1927,6 @@ private constructor( cardPaymentId, cardholderEmail, cardholderName, - category, challenge, createdAt, denyReason, @@ -1953,10 +1936,8 @@ private constructor( merchantCategoryCode, merchantCountry, merchantName, + messageCategory, priorAuthenticatedCardPaymentId, - purchaseAmount, - purchaseAmountCardholderEstimated, - purchaseCurrency, realTimeDecisionId, requestorAuthenticationIndicator, requestorChallengeIndicator, @@ -1971,7 +1952,6 @@ private constructor( shippingAddressState, status, threeDSecureServerTransactionId, - transactionType, type, mutableMapOf(), ) @@ -2100,14 +2080,6 @@ private constructor( */ fun cardholderName(): Optional = cardholderName.getOptional("cardholder_name") - /** - * The category of the card authentication attempt. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun category(): Optional = category.getOptional("category") - /** * Details about the challenge, if one was requested. * @@ -2192,44 +2164,23 @@ private constructor( fun merchantName(): Optional = merchantName.getOptional("merchant_name") /** - * The ID of a prior Card Authentication that the requestor used to authenticate this - * cardholder for a previous transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun priorAuthenticatedCardPaymentId(): Optional = - priorAuthenticatedCardPaymentId.getOptional("prior_authenticated_card_payment_id") - - /** - * The purchase amount in minor units. + * The message category of the card authentication attempt. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun purchaseAmount(): Optional = purchaseAmount.getOptional("purchase_amount") - - /** - * The purchase amount in the cardholder's currency (i.e., USD) estimated using daily - * conversion rates from the card network. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - fun purchaseAmountCardholderEstimated(): Optional = - purchaseAmountCardholderEstimated.getOptional( - "purchase_amount_cardholder_estimated" - ) + fun messageCategory(): MessageCategory = messageCategory.getRequired("message_category") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the authentication - * attempt's purchase currency. + * The ID of a prior Card Authentication that the requestor used to authenticate this + * cardholder for a previous transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun purchaseCurrency(): Optional = - purchaseCurrency.getOptional("purchase_currency") + fun priorAuthenticatedCardPaymentId(): Optional = + priorAuthenticatedCardPaymentId.getOptional("prior_authenticated_card_payment_id") /** * The identifier of the Real-Time Decision sent to approve or decline this @@ -2361,15 +2312,6 @@ private constructor( fun threeDSecureServerTransactionId(): String = threeDSecureServerTransactionId.getRequired("three_d_secure_server_transaction_id") - /** - * The type of transaction being authenticated. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun transactionType(): Optional = - transactionType.getOptional("transaction_type") - /** * A constant representing the object's type. For this resource it will always be * `card_authentication`. @@ -2505,16 +2447,6 @@ private constructor( @ExcludeMissing fun _cardholderName(): JsonField = cardholderName - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("category") - @ExcludeMissing - fun _category(): JsonField = category - /** * Returns the raw JSON value of [challenge]. * @@ -2606,46 +2538,25 @@ private constructor( fun _merchantName(): JsonField = merchantName /** - * Returns the raw JSON value of [priorAuthenticatedCardPaymentId]. - * - * Unlike [priorAuthenticatedCardPaymentId], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("prior_authenticated_card_payment_id") - @ExcludeMissing - fun _priorAuthenticatedCardPaymentId(): JsonField = - priorAuthenticatedCardPaymentId - - /** - * Returns the raw JSON value of [purchaseAmount]. + * Returns the raw JSON value of [messageCategory]. * - * Unlike [purchaseAmount], this method doesn't throw if the JSON field has an + * Unlike [messageCategory], this method doesn't throw if the JSON field has an * unexpected type. */ - @JsonProperty("purchase_amount") + @JsonProperty("message_category") @ExcludeMissing - fun _purchaseAmount(): JsonField = purchaseAmount + fun _messageCategory(): JsonField = messageCategory /** - * Returns the raw JSON value of [purchaseAmountCardholderEstimated]. - * - * Unlike [purchaseAmountCardholderEstimated], this method doesn't throw if the JSON - * field has an unexpected type. - */ - @JsonProperty("purchase_amount_cardholder_estimated") - @ExcludeMissing - fun _purchaseAmountCardholderEstimated(): JsonField = - purchaseAmountCardholderEstimated - - /** - * Returns the raw JSON value of [purchaseCurrency]. + * Returns the raw JSON value of [priorAuthenticatedCardPaymentId]. * - * Unlike [purchaseCurrency], this method doesn't throw if the JSON field has an - * unexpected type. + * Unlike [priorAuthenticatedCardPaymentId], this method doesn't throw if the JSON field + * has an unexpected type. */ - @JsonProperty("purchase_currency") + @JsonProperty("prior_authenticated_card_payment_id") @ExcludeMissing - fun _purchaseCurrency(): JsonField = purchaseCurrency + fun _priorAuthenticatedCardPaymentId(): JsonField = + priorAuthenticatedCardPaymentId /** * Returns the raw JSON value of [realTimeDecisionId]. @@ -2787,16 +2698,6 @@ private constructor( fun _threeDSecureServerTransactionId(): JsonField = threeDSecureServerTransactionId - /** - * Returns the raw JSON value of [transactionType]. - * - * Unlike [transactionType], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("transaction_type") - @ExcludeMissing - fun _transactionType(): JsonField = transactionType - /** * Returns the raw JSON value of [type]. * @@ -2836,7 +2737,6 @@ private constructor( * .cardPaymentId() * .cardholderEmail() * .cardholderName() - * .category() * .challenge() * .createdAt() * .denyReason() @@ -2846,10 +2746,8 @@ private constructor( * .merchantCategoryCode() * .merchantCountry() * .merchantName() + * .messageCategory() * .priorAuthenticatedCardPaymentId() - * .purchaseAmount() - * .purchaseAmountCardholderEstimated() - * .purchaseCurrency() * .realTimeDecisionId() * .requestorAuthenticationIndicator() * .requestorChallengeIndicator() @@ -2864,7 +2762,6 @@ private constructor( * .shippingAddressState() * .status() * .threeDSecureServerTransactionId() - * .transactionType() * .type() * ``` */ @@ -2887,7 +2784,6 @@ private constructor( private var cardPaymentId: JsonField? = null private var cardholderEmail: JsonField? = null private var cardholderName: JsonField? = null - private var category: JsonField? = null private var challenge: JsonField? = null private var createdAt: JsonField? = null private var denyReason: JsonField? = null @@ -2897,10 +2793,8 @@ private constructor( private var merchantCategoryCode: JsonField? = null private var merchantCountry: JsonField? = null private var merchantName: JsonField? = null + private var messageCategory: JsonField? = null private var priorAuthenticatedCardPaymentId: JsonField? = null - private var purchaseAmount: JsonField? = null - private var purchaseAmountCardholderEstimated: JsonField? = null - private var purchaseCurrency: JsonField? = null private var realTimeDecisionId: JsonField? = null private var requestorAuthenticationIndicator: JsonField? = @@ -2918,7 +2812,6 @@ private constructor( private var shippingAddressState: JsonField? = null private var status: JsonField? = null private var threeDSecureServerTransactionId: JsonField? = null - private var transactionType: JsonField? = null private var type: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -2938,7 +2831,6 @@ private constructor( cardPaymentId = cardAuthentication.cardPaymentId cardholderEmail = cardAuthentication.cardholderEmail cardholderName = cardAuthentication.cardholderName - category = cardAuthentication.category challenge = cardAuthentication.challenge createdAt = cardAuthentication.createdAt denyReason = cardAuthentication.denyReason @@ -2948,12 +2840,9 @@ private constructor( merchantCategoryCode = cardAuthentication.merchantCategoryCode merchantCountry = cardAuthentication.merchantCountry merchantName = cardAuthentication.merchantName + messageCategory = cardAuthentication.messageCategory priorAuthenticatedCardPaymentId = cardAuthentication.priorAuthenticatedCardPaymentId - purchaseAmount = cardAuthentication.purchaseAmount - purchaseAmountCardholderEstimated = - cardAuthentication.purchaseAmountCardholderEstimated - purchaseCurrency = cardAuthentication.purchaseCurrency realTimeDecisionId = cardAuthentication.realTimeDecisionId requestorAuthenticationIndicator = cardAuthentication.requestorAuthenticationIndicator @@ -2970,7 +2859,6 @@ private constructor( status = cardAuthentication.status threeDSecureServerTransactionId = cardAuthentication.threeDSecureServerTransactionId - transactionType = cardAuthentication.transactionType type = cardAuthentication.type additionalProperties = cardAuthentication.additionalProperties.toMutableMap() } @@ -3251,21 +3139,6 @@ private constructor( this.cardholderName = cardholderName } - /** The category of the card authentication attempt. */ - fun category(category: Category?) = category(JsonField.ofNullable(category)) - - /** Alias for calling [Builder.category] with `category.orElse(null)`. */ - fun category(category: Optional) = category(category.getOrNull()) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** Details about the challenge, if one was requested. */ fun challenge(challenge: Challenge?) = challenge(JsonField.ofNullable(challenge)) @@ -3443,6 +3316,21 @@ private constructor( this.merchantName = merchantName } + /** The message category of the card authentication attempt. */ + fun messageCategory(messageCategory: MessageCategory) = + messageCategory(JsonField.of(messageCategory)) + + /** + * Sets [Builder.messageCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.messageCategory] with a well-typed + * [MessageCategory] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun messageCategory(messageCategory: JsonField) = apply { + this.messageCategory = messageCategory + } + /** * The ID of a prior Card Authentication that the requestor used to authenticate * this cardholder for a previous transaction. @@ -3471,97 +3359,6 @@ private constructor( priorAuthenticatedCardPaymentId: JsonField ) = apply { this.priorAuthenticatedCardPaymentId = priorAuthenticatedCardPaymentId } - /** The purchase amount in minor units. */ - fun purchaseAmount(purchaseAmount: Long?) = - purchaseAmount(JsonField.ofNullable(purchaseAmount)) - - /** - * Alias for [Builder.purchaseAmount]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun purchaseAmount(purchaseAmount: Long) = purchaseAmount(purchaseAmount as Long?) - - /** - * Alias for calling [Builder.purchaseAmount] with `purchaseAmount.orElse(null)`. - */ - fun purchaseAmount(purchaseAmount: Optional) = - purchaseAmount(purchaseAmount.getOrNull()) - - /** - * Sets [Builder.purchaseAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseAmount] with a well-typed [Long] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun purchaseAmount(purchaseAmount: JsonField) = apply { - this.purchaseAmount = purchaseAmount - } - - /** - * The purchase amount in the cardholder's currency (i.e., USD) estimated using - * daily conversion rates from the card network. - */ - fun purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated: Long?) = - purchaseAmountCardholderEstimated( - JsonField.ofNullable(purchaseAmountCardholderEstimated) - ) - - /** - * Alias for [Builder.purchaseAmountCardholderEstimated]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated: Long) = - purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated as Long?) - - /** - * Alias for calling [Builder.purchaseAmountCardholderEstimated] with - * `purchaseAmountCardholderEstimated.orElse(null)`. - */ - fun purchaseAmountCardholderEstimated( - purchaseAmountCardholderEstimated: Optional - ) = purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated.getOrNull()) - - /** - * Sets [Builder.purchaseAmountCardholderEstimated] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseAmountCardholderEstimated] with a - * well-typed [Long] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun purchaseAmountCardholderEstimated( - purchaseAmountCardholderEstimated: JsonField - ) = apply { - this.purchaseAmountCardholderEstimated = purchaseAmountCardholderEstimated - } - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the - * authentication attempt's purchase currency. - */ - fun purchaseCurrency(purchaseCurrency: String?) = - purchaseCurrency(JsonField.ofNullable(purchaseCurrency)) - - /** - * Alias for calling [Builder.purchaseCurrency] with - * `purchaseCurrency.orElse(null)`. - */ - fun purchaseCurrency(purchaseCurrency: Optional) = - purchaseCurrency(purchaseCurrency.getOrNull()) - - /** - * Sets [Builder.purchaseCurrency] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseCurrency] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun purchaseCurrency(purchaseCurrency: JsonField) = apply { - this.purchaseCurrency = purchaseCurrency - } - /** * The identifier of the Real-Time Decision sent to approve or decline this * authentication attempt. @@ -3857,27 +3654,6 @@ private constructor( threeDSecureServerTransactionId: JsonField ) = apply { this.threeDSecureServerTransactionId = threeDSecureServerTransactionId } - /** The type of transaction being authenticated. */ - fun transactionType(transactionType: TransactionType?) = - transactionType(JsonField.ofNullable(transactionType)) - - /** - * Alias for calling [Builder.transactionType] with `transactionType.orElse(null)`. - */ - fun transactionType(transactionType: Optional) = - transactionType(transactionType.getOrNull()) - - /** - * Sets [Builder.transactionType] to an arbitrary JSON value. - * - * You should usually call [Builder.transactionType] with a well-typed - * [TransactionType] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun transactionType(transactionType: JsonField) = apply { - this.transactionType = transactionType - } - /** * A constant representing the object's type. For this resource it will always be * `card_authentication`. @@ -3935,7 +3711,6 @@ private constructor( * .cardPaymentId() * .cardholderEmail() * .cardholderName() - * .category() * .challenge() * .createdAt() * .denyReason() @@ -3945,10 +3720,8 @@ private constructor( * .merchantCategoryCode() * .merchantCountry() * .merchantName() + * .messageCategory() * .priorAuthenticatedCardPaymentId() - * .purchaseAmount() - * .purchaseAmountCardholderEstimated() - * .purchaseCurrency() * .realTimeDecisionId() * .requestorAuthenticationIndicator() * .requestorChallengeIndicator() @@ -3963,7 +3736,6 @@ private constructor( * .shippingAddressState() * .status() * .threeDSecureServerTransactionId() - * .transactionType() * .type() * ``` * @@ -3987,7 +3759,6 @@ private constructor( checkRequired("cardPaymentId", cardPaymentId), checkRequired("cardholderEmail", cardholderEmail), checkRequired("cardholderName", cardholderName), - checkRequired("category", category), checkRequired("challenge", challenge), checkRequired("createdAt", createdAt), checkRequired("denyReason", denyReason), @@ -3997,16 +3768,11 @@ private constructor( checkRequired("merchantCategoryCode", merchantCategoryCode), checkRequired("merchantCountry", merchantCountry), checkRequired("merchantName", merchantName), + checkRequired("messageCategory", messageCategory), checkRequired( "priorAuthenticatedCardPaymentId", priorAuthenticatedCardPaymentId, ), - checkRequired("purchaseAmount", purchaseAmount), - checkRequired( - "purchaseAmountCardholderEstimated", - purchaseAmountCardholderEstimated, - ), - checkRequired("purchaseCurrency", purchaseCurrency), checkRequired("realTimeDecisionId", realTimeDecisionId), checkRequired( "requestorAuthenticationIndicator", @@ -4027,7 +3793,6 @@ private constructor( "threeDSecureServerTransactionId", threeDSecureServerTransactionId, ), - checkRequired("transactionType", transactionType), checkRequired("type", type), additionalProperties.toMutableMap(), ) @@ -4053,7 +3818,6 @@ private constructor( cardPaymentId() cardholderEmail() cardholderName() - category().ifPresent { it.validate() } challenge().ifPresent { it.validate() } createdAt() denyReason().ifPresent { it.validate() } @@ -4063,10 +3827,8 @@ private constructor( merchantCategoryCode() merchantCountry() merchantName() + messageCategory().validate() priorAuthenticatedCardPaymentId() - purchaseAmount() - purchaseAmountCardholderEstimated() - purchaseCurrency() realTimeDecisionId() requestorAuthenticationIndicator().ifPresent { it.validate() } requestorChallengeIndicator().ifPresent { it.validate() } @@ -4081,7 +3843,6 @@ private constructor( shippingAddressState() status().validate() threeDSecureServerTransactionId() - transactionType().ifPresent { it.validate() } type().validate() validated = true } @@ -4115,7 +3876,6 @@ private constructor( (if (cardPaymentId.asKnown().isPresent) 1 else 0) + (if (cardholderEmail.asKnown().isPresent) 1 else 0) + (if (cardholderName.asKnown().isPresent) 1 else 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + (challenge.asKnown().getOrNull()?.validity() ?: 0) + (if (createdAt.asKnown().isPresent) 1 else 0) + (denyReason.asKnown().getOrNull()?.validity() ?: 0) + @@ -4125,10 +3885,8 @@ private constructor( (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + (if (merchantCountry.asKnown().isPresent) 1 else 0) + (if (merchantName.asKnown().isPresent) 1 else 0) + + (messageCategory.asKnown().getOrNull()?.validity() ?: 0) + (if (priorAuthenticatedCardPaymentId.asKnown().isPresent) 1 else 0) + - (if (purchaseAmount.asKnown().isPresent) 1 else 0) + - (if (purchaseAmountCardholderEstimated.asKnown().isPresent) 1 else 0) + - (if (purchaseCurrency.asKnown().isPresent) 1 else 0) + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + (requestorAuthenticationIndicator.asKnown().getOrNull()?.validity() ?: 0) + (requestorChallengeIndicator.asKnown().getOrNull()?.validity() ?: 0) + @@ -4143,215 +3901,76 @@ private constructor( (if (shippingAddressState.asKnown().isPresent) 1 else 0) + (status.asKnown().getOrNull()?.validity() ?: 0) + (if (threeDSecureServerTransactionId.asKnown().isPresent) 1 else 0) + - (transactionType.asKnown().getOrNull()?.validity() ?: 0) + (type.asKnown().getOrNull()?.validity() ?: 0) - /** The category of the card authentication attempt. */ - class Category @JsonCreator private constructor(private val value: JsonField) : - Enum { + /** Details about the challenge, if one was requested. */ + class Challenge + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val attempts: JsonField>, + private val createdAt: JsonField, + private val oneTimeCode: JsonField, + private val verificationMethod: JsonField, + private val verificationValue: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("attempts") + @ExcludeMissing + attempts: JsonField> = JsonMissing.of(), + @JsonProperty("created_at") + @ExcludeMissing + createdAt: JsonField = JsonMissing.of(), + @JsonProperty("one_time_code") + @ExcludeMissing + oneTimeCode: JsonField = JsonMissing.of(), + @JsonProperty("verification_method") + @ExcludeMissing + verificationMethod: JsonField = JsonMissing.of(), + @JsonProperty("verification_value") + @ExcludeMissing + verificationValue: JsonField = JsonMissing.of(), + ) : this( + attempts, + createdAt, + oneTimeCode, + verificationMethod, + verificationValue, + mutableMapOf(), + ) /** - * Returns this class instance's raw value. + * Details about the challenge verification attempts, if any happened. * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** The authentication attempt is for a payment. */ - @JvmField val PAYMENT_AUTHENTICATION = of("payment_authentication") - - /** The authentication attempt is not for a payment. */ - @JvmField val NON_PAYMENT_AUTHENTICATION = of("non_payment_authentication") - - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) - } - - /** An enum containing [Category]'s known values. */ - enum class Known { - /** The authentication attempt is for a payment. */ - PAYMENT_AUTHENTICATION, - /** The authentication attempt is not for a payment. */ - NON_PAYMENT_AUTHENTICATION, - } + fun attempts(): List = attempts.getRequired("attempts") /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card + * Authentication Challenge was started. * - * An instance of [Category] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - enum class Value { - /** The authentication attempt is for a payment. */ - PAYMENT_AUTHENTICATION, - /** The authentication attempt is not for a payment. */ - NON_PAYMENT_AUTHENTICATION, - /** - * An enum member indicating that [Category] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } + fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * The one-time code used for the Card Authentication Challenge. * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - fun value(): Value = - when (this) { - PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION - NON_PAYMENT_AUTHENTICATION -> Value.NON_PAYMENT_AUTHENTICATION - else -> Value._UNKNOWN - } + fun oneTimeCode(): String = oneTimeCode.getRequired("one_time_code") /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION - NON_PAYMENT_AUTHENTICATION -> Known.NON_PAYMENT_AUTHENTICATION - else -> throw IncreaseInvalidDataException("Unknown Category: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Category = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Category && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** Details about the challenge, if one was requested. */ - class Challenge - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val attempts: JsonField>, - private val createdAt: JsonField, - private val oneTimeCode: JsonField, - private val verificationMethod: JsonField, - private val verificationValue: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("attempts") - @ExcludeMissing - attempts: JsonField> = JsonMissing.of(), - @JsonProperty("created_at") - @ExcludeMissing - createdAt: JsonField = JsonMissing.of(), - @JsonProperty("one_time_code") - @ExcludeMissing - oneTimeCode: JsonField = JsonMissing.of(), - @JsonProperty("verification_method") - @ExcludeMissing - verificationMethod: JsonField = JsonMissing.of(), - @JsonProperty("verification_value") - @ExcludeMissing - verificationValue: JsonField = JsonMissing.of(), - ) : this( - attempts, - createdAt, - oneTimeCode, - verificationMethod, - verificationValue, - mutableMapOf(), - ) - - /** - * Details about the challenge verification attempts, if any happened. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or - * is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun attempts(): List = attempts.getRequired("attempts") - - /** - * The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card - * Authentication Challenge was started. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or - * is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at") - - /** - * The one-time code used for the Card Authentication Challenge. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or - * is unexpectedly missing or null (e.g. if the server responded with an - * unexpected value). - */ - fun oneTimeCode(): String = oneTimeCode.getRequired("one_time_code") - - /** - * The method used to verify the Card Authentication Challenge. + * The method used to verify the Card Authentication Challenge. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or * is unexpectedly missing or null (e.g. if the server responded with an @@ -6833,88 +6452,1166 @@ private constructor( "DeviceChannel{browser=$browser, category=$category, merchantInitiated=$merchantInitiated, additionalProperties=$additionalProperties}" } - /** - * The 3DS requestor authentication indicator describes why the authentication attempt - * is performed, such as for a recurring transaction. - */ - class RequestorAuthenticationIndicator - @JsonCreator - private constructor(private val value: JsonField) : Enum { + /** The message category of the card authentication attempt. */ + class MessageCategory + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val nonPayment: JsonField, + private val payment: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("non_payment") + @ExcludeMissing + nonPayment: JsonField = JsonMissing.of(), + @JsonProperty("payment") + @ExcludeMissing + payment: JsonField = JsonMissing.of(), + ) : this(category, nonPayment, payment, mutableMapOf()) /** - * Returns this class instance's raw value. + * The category of the card authentication attempt. * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun category(): Category = category.getRequired("category") - companion object { + /** + * Fields specific to non-payment authentication attempts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun nonPayment(): Optional = nonPayment.getOptional("non_payment") - /** The authentication is for a payment transaction. */ - @JvmField val PAYMENT_TRANSACTION = of("payment_transaction") + /** + * Fields specific to payment authentication attempts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun payment(): Optional = payment.getOptional("payment") - /** The authentication is for a recurring transaction. */ - @JvmField val RECURRING_TRANSACTION = of("recurring_transaction") + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("category") + @ExcludeMissing + fun _category(): JsonField = category - /** The authentication is for an installment transaction. */ - @JvmField val INSTALLMENT_TRANSACTION = of("installment_transaction") + /** + * Returns the raw JSON value of [nonPayment]. + * + * Unlike [nonPayment], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("non_payment") + @ExcludeMissing + fun _nonPayment(): JsonField = nonPayment - /** The authentication is for adding a card. */ - @JvmField val ADD_CARD = of("add_card") + /** + * Returns the raw JSON value of [payment]. + * + * Unlike [payment], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("payment") + @ExcludeMissing + fun _payment(): JsonField = payment - /** The authentication is for maintaining a card. */ - @JvmField val MAINTAIN_CARD = of("maintain_card") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** The authentication is for EMV token cardholder verification. */ - @JvmField - val EMV_TOKEN_CARDHOLDER_VERIFICATION = of("emv_token_cardholder_verification") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** The authentication is for a billing agreement. */ - @JvmField val BILLING_AGREEMENT = of("billing_agreement") + fun toBuilder() = Builder().from(this) - @JvmStatic - fun of(value: String) = RequestorAuthenticationIndicator(JsonField.of(value)) - } + companion object { - /** An enum containing [RequestorAuthenticationIndicator]'s known values. */ - enum class Known { - /** The authentication is for a payment transaction. */ - PAYMENT_TRANSACTION, - /** The authentication is for a recurring transaction. */ - RECURRING_TRANSACTION, - /** The authentication is for an installment transaction. */ - INSTALLMENT_TRANSACTION, - /** The authentication is for adding a card. */ - ADD_CARD, - /** The authentication is for maintaining a card. */ - MAINTAIN_CARD, - /** The authentication is for EMV token cardholder verification. */ - EMV_TOKEN_CARDHOLDER_VERIFICATION, - /** The authentication is for a billing agreement. */ - BILLING_AGREEMENT, + /** + * Returns a mutable builder for constructing an instance of [MessageCategory]. + * + * The following fields are required: + * ```java + * .category() + * .nonPayment() + * .payment() + * ``` + */ + @JvmStatic fun builder() = Builder() } - /** - * An enum containing [RequestorAuthenticationIndicator]'s known values, as well as - * an [_UNKNOWN] member. - * - * An instance of [RequestorAuthenticationIndicator] can contain an unknown value in - * a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** The authentication is for a payment transaction. */ - PAYMENT_TRANSACTION, - /** The authentication is for a recurring transaction. */ - RECURRING_TRANSACTION, - /** The authentication is for an installment transaction. */ - INSTALLMENT_TRANSACTION, + /** A builder for [MessageCategory]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var nonPayment: JsonField? = null + private var payment: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(messageCategory: MessageCategory) = apply { + category = messageCategory.category + nonPayment = messageCategory.nonPayment + payment = messageCategory.payment + additionalProperties = messageCategory.additionalProperties.toMutableMap() + } + + /** The category of the card authentication attempt. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** Fields specific to non-payment authentication attempts. */ + fun nonPayment(nonPayment: NonPayment?) = + nonPayment(JsonField.ofNullable(nonPayment)) + + /** Alias for calling [Builder.nonPayment] with `nonPayment.orElse(null)`. */ + fun nonPayment(nonPayment: Optional) = + nonPayment(nonPayment.getOrNull()) + + /** + * Sets [Builder.nonPayment] to an arbitrary JSON value. + * + * You should usually call [Builder.nonPayment] with a well-typed [NonPayment] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun nonPayment(nonPayment: JsonField) = apply { + this.nonPayment = nonPayment + } + + /** Fields specific to payment authentication attempts. */ + fun payment(payment: Payment?) = payment(JsonField.ofNullable(payment)) + + /** Alias for calling [Builder.payment] with `payment.orElse(null)`. */ + fun payment(payment: Optional) = payment(payment.getOrNull()) + + /** + * Sets [Builder.payment] to an arbitrary JSON value. + * + * You should usually call [Builder.payment] with a well-typed [Payment] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun payment(payment: JsonField) = apply { this.payment = payment } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [MessageCategory]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .nonPayment() + * .payment() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): MessageCategory = + MessageCategory( + checkRequired("category", category), + checkRequired("nonPayment", nonPayment), + checkRequired("payment", payment), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): MessageCategory = apply { + if (validated) { + return@apply + } + + category().validate() + nonPayment().ifPresent { it.validate() } + payment().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (nonPayment.asKnown().getOrNull()?.validity() ?: 0) + + (payment.asKnown().getOrNull()?.validity() ?: 0) + + /** The category of the card authentication attempt. */ + class Category + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** The authentication attempt is for a payment. */ + @JvmField val PAYMENT_AUTHENTICATION = of("payment_authentication") + + /** The authentication attempt is not for a payment. */ + @JvmField val NON_PAYMENT_AUTHENTICATION = of("non_payment_authentication") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** The authentication attempt is for a payment. */ + PAYMENT_AUTHENTICATION, + /** The authentication attempt is not for a payment. */ + NON_PAYMENT_AUTHENTICATION, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The authentication attempt is for a payment. */ + PAYMENT_AUTHENTICATION, + /** The authentication attempt is not for a payment. */ + NON_PAYMENT_AUTHENTICATION, + /** + * An enum member indicating that [Category] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION + NON_PAYMENT_AUTHENTICATION -> Value.NON_PAYMENT_AUTHENTICATION + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION + NON_PAYMENT_AUTHENTICATION -> Known.NON_PAYMENT_AUTHENTICATION + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to non-payment authentication attempts. */ + class NonPayment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val additionalProperties: MutableMap + ) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [NonPayment]. + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonPayment]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(nonPayment: NonPayment) = apply { + additionalProperties = nonPayment.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NonPayment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NonPayment = NonPayment(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NonPayment = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NonPayment && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NonPayment{additionalProperties=$additionalProperties}" + } + + /** Fields specific to payment authentication attempts. */ + class Payment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val purchaseAmount: JsonField, + private val purchaseAmountCardholderEstimated: JsonField, + private val purchaseCurrency: JsonField, + private val transactionType: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("purchase_amount") + @ExcludeMissing + purchaseAmount: JsonField = JsonMissing.of(), + @JsonProperty("purchase_amount_cardholder_estimated") + @ExcludeMissing + purchaseAmountCardholderEstimated: JsonField = JsonMissing.of(), + @JsonProperty("purchase_currency") + @ExcludeMissing + purchaseCurrency: JsonField = JsonMissing.of(), + @JsonProperty("transaction_type") + @ExcludeMissing + transactionType: JsonField = JsonMissing.of(), + ) : this( + purchaseAmount, + purchaseAmountCardholderEstimated, + purchaseCurrency, + transactionType, + mutableMapOf(), + ) + + /** + * The purchase amount in minor units. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun purchaseAmount(): Long = purchaseAmount.getRequired("purchase_amount") + + /** + * The purchase amount in the cardholder's currency (i.e., USD) estimated using + * daily conversion rates from the card network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun purchaseAmountCardholderEstimated(): Optional = + purchaseAmountCardholderEstimated.getOptional( + "purchase_amount_cardholder_estimated" + ) + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * authentication attempt's purchase currency. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * or is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun purchaseCurrency(): String = + purchaseCurrency.getRequired("purchase_currency") + + /** + * The type of transaction being authenticated. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transactionType(): Optional = + transactionType.getOptional("transaction_type") + + /** + * Returns the raw JSON value of [purchaseAmount]. + * + * Unlike [purchaseAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("purchase_amount") + @ExcludeMissing + fun _purchaseAmount(): JsonField = purchaseAmount + + /** + * Returns the raw JSON value of [purchaseAmountCardholderEstimated]. + * + * Unlike [purchaseAmountCardholderEstimated], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("purchase_amount_cardholder_estimated") + @ExcludeMissing + fun _purchaseAmountCardholderEstimated(): JsonField = + purchaseAmountCardholderEstimated + + /** + * Returns the raw JSON value of [purchaseCurrency]. + * + * Unlike [purchaseCurrency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("purchase_currency") + @ExcludeMissing + fun _purchaseCurrency(): JsonField = purchaseCurrency + + /** + * Returns the raw JSON value of [transactionType]. + * + * Unlike [transactionType], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_type") + @ExcludeMissing + fun _transactionType(): JsonField = transactionType + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Payment]. + * + * The following fields are required: + * ```java + * .purchaseAmount() + * .purchaseAmountCardholderEstimated() + * .purchaseCurrency() + * .transactionType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Payment]. */ + class Builder internal constructor() { + + private var purchaseAmount: JsonField? = null + private var purchaseAmountCardholderEstimated: JsonField? = null + private var purchaseCurrency: JsonField? = null + private var transactionType: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(payment: Payment) = apply { + purchaseAmount = payment.purchaseAmount + purchaseAmountCardholderEstimated = + payment.purchaseAmountCardholderEstimated + purchaseCurrency = payment.purchaseCurrency + transactionType = payment.transactionType + additionalProperties = payment.additionalProperties.toMutableMap() + } + + /** The purchase amount in minor units. */ + fun purchaseAmount(purchaseAmount: Long) = + purchaseAmount(JsonField.of(purchaseAmount)) + + /** + * Sets [Builder.purchaseAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.purchaseAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun purchaseAmount(purchaseAmount: JsonField) = apply { + this.purchaseAmount = purchaseAmount + } + + /** + * The purchase amount in the cardholder's currency (i.e., USD) estimated + * using daily conversion rates from the card network. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: Long? + ) = + purchaseAmountCardholderEstimated( + JsonField.ofNullable(purchaseAmountCardholderEstimated) + ) + + /** + * Alias for [Builder.purchaseAmountCardholderEstimated]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: Long + ) = + purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated as Long? + ) + + /** + * Alias for calling [Builder.purchaseAmountCardholderEstimated] with + * `purchaseAmountCardholderEstimated.orElse(null)`. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: Optional + ) = + purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated.getOrNull() + ) + + /** + * Sets [Builder.purchaseAmountCardholderEstimated] to an arbitrary JSON + * value. + * + * You should usually call [Builder.purchaseAmountCardholderEstimated] with + * a well-typed [Long] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: JsonField + ) = apply { + this.purchaseAmountCardholderEstimated = + purchaseAmountCardholderEstimated + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * authentication attempt's purchase currency. + */ + fun purchaseCurrency(purchaseCurrency: String) = + purchaseCurrency(JsonField.of(purchaseCurrency)) + + /** + * Sets [Builder.purchaseCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.purchaseCurrency] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun purchaseCurrency(purchaseCurrency: JsonField) = apply { + this.purchaseCurrency = purchaseCurrency + } + + /** The type of transaction being authenticated. */ + fun transactionType(transactionType: TransactionType?) = + transactionType(JsonField.ofNullable(transactionType)) + + /** + * Alias for calling [Builder.transactionType] with + * `transactionType.orElse(null)`. + */ + fun transactionType(transactionType: Optional) = + transactionType(transactionType.getOrNull()) + + /** + * Sets [Builder.transactionType] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionType] with a well-typed + * [TransactionType] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun transactionType(transactionType: JsonField) = apply { + this.transactionType = transactionType + } + + fun additionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties( + additionalProperties: Map + ) = apply { this.additionalProperties.putAll(additionalProperties) } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Payment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .purchaseAmount() + * .purchaseAmountCardholderEstimated() + * .purchaseCurrency() + * .transactionType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Payment = + Payment( + checkRequired("purchaseAmount", purchaseAmount), + checkRequired( + "purchaseAmountCardholderEstimated", + purchaseAmountCardholderEstimated, + ), + checkRequired("purchaseCurrency", purchaseCurrency), + checkRequired("transactionType", transactionType), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Payment = apply { + if (validated) { + return@apply + } + + purchaseAmount() + purchaseAmountCardholderEstimated() + purchaseCurrency() + transactionType().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (purchaseAmount.asKnown().isPresent) 1 else 0) + + (if (purchaseAmountCardholderEstimated.asKnown().isPresent) 1 else 0) + + (if (purchaseCurrency.asKnown().isPresent) 1 else 0) + + (transactionType.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of transaction being authenticated. */ + class TransactionType + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data + * that doesn't match any known member, and you want to know that value. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** Purchase of goods or services. */ + @JvmField val GOODS_SERVICE_PURCHASE = of("goods_service_purchase") + + /** Check acceptance. */ + @JvmField val CHECK_ACCEPTANCE = of("check_acceptance") + + /** Account funding. */ + @JvmField val ACCOUNT_FUNDING = of("account_funding") + + /** Quasi-cash transaction. */ + @JvmField val QUASI_CASH_TRANSACTION = of("quasi_cash_transaction") + + /** Prepaid activation and load. */ + @JvmField + val PREPAID_ACTIVATION_AND_LOAD = of("prepaid_activation_and_load") + + @JvmStatic fun of(value: String) = TransactionType(JsonField.of(value)) + } + + /** An enum containing [TransactionType]'s known values. */ + enum class Known { + /** Purchase of goods or services. */ + GOODS_SERVICE_PURCHASE, + /** Check acceptance. */ + CHECK_ACCEPTANCE, + /** Account funding. */ + ACCOUNT_FUNDING, + /** Quasi-cash transaction. */ + QUASI_CASH_TRANSACTION, + /** Prepaid activation and load. */ + PREPAID_ACTIVATION_AND_LOAD, + } + + /** + * An enum containing [TransactionType]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [TransactionType] can contain an unknown value in a couple + * of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API + * may respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** Purchase of goods or services. */ + GOODS_SERVICE_PURCHASE, + /** Check acceptance. */ + CHECK_ACCEPTANCE, + /** Account funding. */ + ACCOUNT_FUNDING, + /** Quasi-cash transaction. */ + QUASI_CASH_TRANSACTION, + /** Prepaid activation and load. */ + PREPAID_ACTIVATION_AND_LOAD, + /** + * An enum member indicating that [TransactionType] was instantiated + * with an unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always + * known or if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE + CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE + ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING + QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION + PREPAID_ACTIVATION_AND_LOAD -> Value.PREPAID_ACTIVATION_AND_LOAD + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always + * known and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a + * not a known member. + */ + fun known(): Known = + when (this) { + GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE + CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE + ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING + QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION + PREPAID_ACTIVATION_AND_LOAD -> Known.PREPAID_ACTIVATION_AND_LOAD + else -> + throw IncreaseInvalidDataException( + "Unknown TransactionType: $value" + ) + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily + * for debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does + * not have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): TransactionType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this + * object recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransactionType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Payment && + purchaseAmount == other.purchaseAmount && + purchaseAmountCardholderEstimated == + other.purchaseAmountCardholderEstimated && + purchaseCurrency == other.purchaseCurrency && + transactionType == other.transactionType && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + purchaseAmount, + purchaseAmountCardholderEstimated, + purchaseCurrency, + transactionType, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Payment{purchaseAmount=$purchaseAmount, purchaseAmountCardholderEstimated=$purchaseAmountCardholderEstimated, purchaseCurrency=$purchaseCurrency, transactionType=$transactionType, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MessageCategory && + category == other.category && + nonPayment == other.nonPayment && + payment == other.payment && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, nonPayment, payment, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MessageCategory{category=$category, nonPayment=$nonPayment, payment=$payment, additionalProperties=$additionalProperties}" + } + + /** + * The 3DS requestor authentication indicator describes why the authentication attempt + * is performed, such as for a recurring transaction. + */ + class RequestorAuthenticationIndicator + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** The authentication is for a payment transaction. */ + @JvmField val PAYMENT_TRANSACTION = of("payment_transaction") + + /** The authentication is for a recurring transaction. */ + @JvmField val RECURRING_TRANSACTION = of("recurring_transaction") + + /** The authentication is for an installment transaction. */ + @JvmField val INSTALLMENT_TRANSACTION = of("installment_transaction") + + /** The authentication is for adding a card. */ + @JvmField val ADD_CARD = of("add_card") + + /** The authentication is for maintaining a card. */ + @JvmField val MAINTAIN_CARD = of("maintain_card") + + /** The authentication is for EMV token cardholder verification. */ + @JvmField + val EMV_TOKEN_CARDHOLDER_VERIFICATION = of("emv_token_cardholder_verification") + + /** The authentication is for a billing agreement. */ + @JvmField val BILLING_AGREEMENT = of("billing_agreement") + + @JvmStatic + fun of(value: String) = RequestorAuthenticationIndicator(JsonField.of(value)) + } + + /** An enum containing [RequestorAuthenticationIndicator]'s known values. */ + enum class Known { + /** The authentication is for a payment transaction. */ + PAYMENT_TRANSACTION, + /** The authentication is for a recurring transaction. */ + RECURRING_TRANSACTION, + /** The authentication is for an installment transaction. */ + INSTALLMENT_TRANSACTION, + /** The authentication is for adding a card. */ + ADD_CARD, + /** The authentication is for maintaining a card. */ + MAINTAIN_CARD, + /** The authentication is for EMV token cardholder verification. */ + EMV_TOKEN_CARDHOLDER_VERIFICATION, + /** The authentication is for a billing agreement. */ + BILLING_AGREEMENT, + } + + /** + * An enum containing [RequestorAuthenticationIndicator]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [RequestorAuthenticationIndicator] can contain an unknown value in + * a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The authentication is for a payment transaction. */ + PAYMENT_TRANSACTION, + /** The authentication is for a recurring transaction. */ + RECURRING_TRANSACTION, + /** The authentication is for an installment transaction. */ + INSTALLMENT_TRANSACTION, /** The authentication is for adding a card. */ ADD_CARD, /** The authentication is for maintaining a card. */ @@ -7479,175 +8176,6 @@ private constructor( override fun toString() = value.toString() } - /** The type of transaction being authenticated. */ - class TransactionType - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that - * doesn't match any known member, and you want to know that value. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** Purchase of goods or services. */ - @JvmField val GOODS_SERVICE_PURCHASE = of("goods_service_purchase") - - /** Check acceptance. */ - @JvmField val CHECK_ACCEPTANCE = of("check_acceptance") - - /** Account funding. */ - @JvmField val ACCOUNT_FUNDING = of("account_funding") - - /** Quasi-cash transaction. */ - @JvmField val QUASI_CASH_TRANSACTION = of("quasi_cash_transaction") - - /** Prepaid activation and load. */ - @JvmField val PREPAID_ACTIVATION_AND_LOAD = of("prepaid_activation_and_load") - - @JvmStatic fun of(value: String) = TransactionType(JsonField.of(value)) - } - - /** An enum containing [TransactionType]'s known values. */ - enum class Known { - /** Purchase of goods or services. */ - GOODS_SERVICE_PURCHASE, - /** Check acceptance. */ - CHECK_ACCEPTANCE, - /** Account funding. */ - ACCOUNT_FUNDING, - /** Quasi-cash transaction. */ - QUASI_CASH_TRANSACTION, - /** Prepaid activation and load. */ - PREPAID_ACTIVATION_AND_LOAD, - } - - /** - * An enum containing [TransactionType]'s known values, as well as an [_UNKNOWN] - * member. - * - * An instance of [TransactionType] can contain an unknown value in a couple of - * cases: - * - It was deserialized from data that doesn't match any known member. For example, - * if the SDK is on an older version than the API, then the API may respond with - * new members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** Purchase of goods or services. */ - GOODS_SERVICE_PURCHASE, - /** Check acceptance. */ - CHECK_ACCEPTANCE, - /** Account funding. */ - ACCOUNT_FUNDING, - /** Quasi-cash transaction. */ - QUASI_CASH_TRANSACTION, - /** Prepaid activation and load. */ - PREPAID_ACTIVATION_AND_LOAD, - /** - * An enum member indicating that [TransactionType] was instantiated with an - * unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if - * you want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE - ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION - PREPAID_ACTIVATION_AND_LOAD -> Value.PREPAID_ACTIVATION_AND_LOAD - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a - * known member. - */ - fun known(): Known = - when (this) { - GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE - ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION - PREPAID_ACTIVATION_AND_LOAD -> Known.PREPAID_ACTIVATION_AND_LOAD - else -> - throw IncreaseInvalidDataException("Unknown TransactionType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have - * the expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): TransactionType = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is TransactionType && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * A constant representing the object's type. For this resource it will always be * `card_authentication`. @@ -7795,7 +8323,6 @@ private constructor( cardPaymentId == other.cardPaymentId && cardholderEmail == other.cardholderEmail && cardholderName == other.cardholderName && - category == other.category && challenge == other.challenge && createdAt == other.createdAt && denyReason == other.denyReason && @@ -7805,10 +8332,8 @@ private constructor( merchantCategoryCode == other.merchantCategoryCode && merchantCountry == other.merchantCountry && merchantName == other.merchantName && + messageCategory == other.messageCategory && priorAuthenticatedCardPaymentId == other.priorAuthenticatedCardPaymentId && - purchaseAmount == other.purchaseAmount && - purchaseAmountCardholderEstimated == other.purchaseAmountCardholderEstimated && - purchaseCurrency == other.purchaseCurrency && realTimeDecisionId == other.realTimeDecisionId && requestorAuthenticationIndicator == other.requestorAuthenticationIndicator && requestorChallengeIndicator == other.requestorChallengeIndicator && @@ -7823,7 +8348,6 @@ private constructor( shippingAddressState == other.shippingAddressState && status == other.status && threeDSecureServerTransactionId == other.threeDSecureServerTransactionId && - transactionType == other.transactionType && type == other.type && additionalProperties == other.additionalProperties } @@ -7843,7 +8367,6 @@ private constructor( cardPaymentId, cardholderEmail, cardholderName, - category, challenge, createdAt, denyReason, @@ -7853,10 +8376,8 @@ private constructor( merchantCategoryCode, merchantCountry, merchantName, + messageCategory, priorAuthenticatedCardPaymentId, - purchaseAmount, - purchaseAmountCardholderEstimated, - purchaseCurrency, realTimeDecisionId, requestorAuthenticationIndicator, requestorChallengeIndicator, @@ -7871,7 +8392,6 @@ private constructor( shippingAddressState, status, threeDSecureServerTransactionId, - transactionType, type, additionalProperties, ) @@ -7880,7 +8400,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthentication{id=$id, accessControlServerTransactionId=$accessControlServerTransactionId, billingAddressCity=$billingAddressCity, billingAddressCountry=$billingAddressCountry, billingAddressLine1=$billingAddressLine1, billingAddressLine2=$billingAddressLine2, billingAddressLine3=$billingAddressLine3, billingAddressPostalCode=$billingAddressPostalCode, billingAddressState=$billingAddressState, cardId=$cardId, cardPaymentId=$cardPaymentId, cardholderEmail=$cardholderEmail, cardholderName=$cardholderName, category=$category, challenge=$challenge, createdAt=$createdAt, denyReason=$denyReason, deviceChannel=$deviceChannel, directoryServerTransactionId=$directoryServerTransactionId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCountry=$merchantCountry, merchantName=$merchantName, priorAuthenticatedCardPaymentId=$priorAuthenticatedCardPaymentId, purchaseAmount=$purchaseAmount, purchaseAmountCardholderEstimated=$purchaseAmountCardholderEstimated, purchaseCurrency=$purchaseCurrency, realTimeDecisionId=$realTimeDecisionId, requestorAuthenticationIndicator=$requestorAuthenticationIndicator, requestorChallengeIndicator=$requestorChallengeIndicator, requestorName=$requestorName, requestorUrl=$requestorUrl, shippingAddressCity=$shippingAddressCity, shippingAddressCountry=$shippingAddressCountry, shippingAddressLine1=$shippingAddressLine1, shippingAddressLine2=$shippingAddressLine2, shippingAddressLine3=$shippingAddressLine3, shippingAddressPostalCode=$shippingAddressPostalCode, shippingAddressState=$shippingAddressState, status=$status, threeDSecureServerTransactionId=$threeDSecureServerTransactionId, transactionType=$transactionType, type=$type, additionalProperties=$additionalProperties}" + "CardAuthentication{id=$id, accessControlServerTransactionId=$accessControlServerTransactionId, billingAddressCity=$billingAddressCity, billingAddressCountry=$billingAddressCountry, billingAddressLine1=$billingAddressLine1, billingAddressLine2=$billingAddressLine2, billingAddressLine3=$billingAddressLine3, billingAddressPostalCode=$billingAddressPostalCode, billingAddressState=$billingAddressState, cardId=$cardId, cardPaymentId=$cardPaymentId, cardholderEmail=$cardholderEmail, cardholderName=$cardholderName, challenge=$challenge, createdAt=$createdAt, denyReason=$denyReason, deviceChannel=$deviceChannel, directoryServerTransactionId=$directoryServerTransactionId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCountry=$merchantCountry, merchantName=$merchantName, messageCategory=$messageCategory, priorAuthenticatedCardPaymentId=$priorAuthenticatedCardPaymentId, realTimeDecisionId=$realTimeDecisionId, requestorAuthenticationIndicator=$requestorAuthenticationIndicator, requestorChallengeIndicator=$requestorChallengeIndicator, requestorName=$requestorName, requestorUrl=$requestorUrl, shippingAddressCity=$shippingAddressCity, shippingAddressCountry=$shippingAddressCountry, shippingAddressLine1=$shippingAddressLine1, shippingAddressLine2=$shippingAddressLine2, shippingAddressLine3=$shippingAddressLine3, shippingAddressPostalCode=$shippingAddressPostalCode, shippingAddressState=$shippingAddressState, status=$status, threeDSecureServerTransactionId=$threeDSecureServerTransactionId, type=$type, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index 35a5f5ad0..7caa90d90 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -703,7 +703,6 @@ private constructor( private val cardId: JsonField, private val cardholderEmail: JsonField, private val cardholderName: JsonField, - private val category: JsonField, private val decision: JsonField, private val deviceChannel: JsonField, private val directoryServerTransactionId: JsonField, @@ -711,10 +710,8 @@ private constructor( private val merchantCategoryCode: JsonField, private val merchantCountry: JsonField, private val merchantName: JsonField, + private val messageCategory: JsonField, private val priorAuthenticatedCardPaymentId: JsonField, - private val purchaseAmount: JsonField, - private val purchaseAmountCardholderEstimated: JsonField, - private val purchaseCurrency: JsonField, private val requestorAuthenticationIndicator: JsonField, private val requestorChallengeIndicator: JsonField, private val requestorName: JsonField, @@ -727,7 +724,6 @@ private constructor( private val shippingAddressPostalCode: JsonField, private val shippingAddressState: JsonField, private val threeDSecureServerTransactionId: JsonField, - private val transactionType: JsonField, private val upcomingCardPaymentId: JsonField, private val additionalProperties: MutableMap, ) { @@ -768,9 +764,6 @@ private constructor( @JsonProperty("cardholder_name") @ExcludeMissing cardholderName: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), @@ -792,18 +785,12 @@ private constructor( @JsonProperty("merchant_name") @ExcludeMissing merchantName: JsonField = JsonMissing.of(), + @JsonProperty("message_category") + @ExcludeMissing + messageCategory: JsonField = JsonMissing.of(), @JsonProperty("prior_authenticated_card_payment_id") @ExcludeMissing priorAuthenticatedCardPaymentId: JsonField = JsonMissing.of(), - @JsonProperty("purchase_amount") - @ExcludeMissing - purchaseAmount: JsonField = JsonMissing.of(), - @JsonProperty("purchase_amount_cardholder_estimated") - @ExcludeMissing - purchaseAmountCardholderEstimated: JsonField = JsonMissing.of(), - @JsonProperty("purchase_currency") - @ExcludeMissing - purchaseCurrency: JsonField = JsonMissing.of(), @JsonProperty("requestor_authentication_indicator") @ExcludeMissing requestorAuthenticationIndicator: JsonField = @@ -841,9 +828,6 @@ private constructor( @JsonProperty("three_d_secure_server_transaction_id") @ExcludeMissing threeDSecureServerTransactionId: JsonField = JsonMissing.of(), - @JsonProperty("transaction_type") - @ExcludeMissing - transactionType: JsonField = JsonMissing.of(), @JsonProperty("upcoming_card_payment_id") @ExcludeMissing upcomingCardPaymentId: JsonField = JsonMissing.of(), @@ -860,7 +844,6 @@ private constructor( cardId, cardholderEmail, cardholderName, - category, decision, deviceChannel, directoryServerTransactionId, @@ -868,10 +851,8 @@ private constructor( merchantCategoryCode, merchantCountry, merchantName, + messageCategory, priorAuthenticatedCardPaymentId, - purchaseAmount, - purchaseAmountCardholderEstimated, - purchaseCurrency, requestorAuthenticationIndicator, requestorChallengeIndicator, requestorName, @@ -884,7 +865,6 @@ private constructor( shippingAddressPostalCode, shippingAddressState, threeDSecureServerTransactionId, - transactionType, upcomingCardPaymentId, mutableMapOf(), ) @@ -1000,14 +980,6 @@ private constructor( */ fun cardholderName(): Optional = cardholderName.getOptional("cardholder_name") - /** - * The category of the card authentication attempt. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun category(): Optional = category.getOptional("category") - /** * Whether or not the authentication attempt was approved. * @@ -1071,41 +1043,22 @@ private constructor( fun merchantName(): Optional = merchantName.getOptional("merchant_name") /** - * The ID of a prior Card Authentication that the requestor used to authenticate this - * cardholder for a previous transaction. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun priorAuthenticatedCardPaymentId(): Optional = - priorAuthenticatedCardPaymentId.getOptional("prior_authenticated_card_payment_id") - - /** - * The purchase amount in minor units. + * The message category of the card authentication attempt. * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun purchaseAmount(): Optional = purchaseAmount.getOptional("purchase_amount") - - /** - * The purchase amount in the cardholder's currency (i.e., USD) estimated using daily - * conversion rates from the card network. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected value). */ - fun purchaseAmountCardholderEstimated(): Optional = - purchaseAmountCardholderEstimated.getOptional("purchase_amount_cardholder_estimated") + fun messageCategory(): MessageCategory = messageCategory.getRequired("message_category") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the authentication - * attempt's purchase currency. + * The ID of a prior Card Authentication that the requestor used to authenticate this + * cardholder for a previous transaction. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ - fun purchaseCurrency(): Optional = purchaseCurrency.getOptional("purchase_currency") + fun priorAuthenticatedCardPaymentId(): Optional = + priorAuthenticatedCardPaymentId.getOptional("prior_authenticated_card_payment_id") /** * The 3DS requestor authentication indicator describes why the authentication attempt is @@ -1215,15 +1168,6 @@ private constructor( fun threeDSecureServerTransactionId(): String = threeDSecureServerTransactionId.getRequired("three_d_secure_server_transaction_id") - /** - * The type of transaction being authenticated. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun transactionType(): Optional = - transactionType.getOptional("transaction_type") - /** * The identifier of the Card Payment this authentication attempt will belong to. Available * in the API once the card authentication has completed. @@ -1349,13 +1293,6 @@ private constructor( @ExcludeMissing fun _cardholderName(): JsonField = cardholderName - /** - * Returns the raw JSON value of [category]. - * - * Unlike [category], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("category") @ExcludeMissing fun _category(): JsonField = category - /** * Returns the raw JSON value of [decision]. * @@ -1424,45 +1361,24 @@ private constructor( fun _merchantName(): JsonField = merchantName /** - * Returns the raw JSON value of [priorAuthenticatedCardPaymentId]. - * - * Unlike [priorAuthenticatedCardPaymentId], this method doesn't throw if the JSON field has - * an unexpected type. - */ - @JsonProperty("prior_authenticated_card_payment_id") - @ExcludeMissing - fun _priorAuthenticatedCardPaymentId(): JsonField = priorAuthenticatedCardPaymentId - - /** - * Returns the raw JSON value of [purchaseAmount]. + * Returns the raw JSON value of [messageCategory]. * - * Unlike [purchaseAmount], this method doesn't throw if the JSON field has an unexpected + * Unlike [messageCategory], this method doesn't throw if the JSON field has an unexpected * type. */ - @JsonProperty("purchase_amount") - @ExcludeMissing - fun _purchaseAmount(): JsonField = purchaseAmount - - /** - * Returns the raw JSON value of [purchaseAmountCardholderEstimated]. - * - * Unlike [purchaseAmountCardholderEstimated], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("purchase_amount_cardholder_estimated") + @JsonProperty("message_category") @ExcludeMissing - fun _purchaseAmountCardholderEstimated(): JsonField = - purchaseAmountCardholderEstimated + fun _messageCategory(): JsonField = messageCategory /** - * Returns the raw JSON value of [purchaseCurrency]. + * Returns the raw JSON value of [priorAuthenticatedCardPaymentId]. * - * Unlike [purchaseCurrency], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [priorAuthenticatedCardPaymentId], this method doesn't throw if the JSON field has + * an unexpected type. */ - @JsonProperty("purchase_currency") + @JsonProperty("prior_authenticated_card_payment_id") @ExcludeMissing - fun _purchaseCurrency(): JsonField = purchaseCurrency + fun _priorAuthenticatedCardPaymentId(): JsonField = priorAuthenticatedCardPaymentId /** * Returns the raw JSON value of [requestorAuthenticationIndicator]. @@ -1586,16 +1502,6 @@ private constructor( @ExcludeMissing fun _threeDSecureServerTransactionId(): JsonField = threeDSecureServerTransactionId - /** - * Returns the raw JSON value of [transactionType]. - * - * Unlike [transactionType], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("transaction_type") - @ExcludeMissing - fun _transactionType(): JsonField = transactionType - /** * Returns the raw JSON value of [upcomingCardPaymentId]. * @@ -1637,7 +1543,6 @@ private constructor( * .cardId() * .cardholderEmail() * .cardholderName() - * .category() * .decision() * .deviceChannel() * .directoryServerTransactionId() @@ -1645,10 +1550,8 @@ private constructor( * .merchantCategoryCode() * .merchantCountry() * .merchantName() + * .messageCategory() * .priorAuthenticatedCardPaymentId() - * .purchaseAmount() - * .purchaseAmountCardholderEstimated() - * .purchaseCurrency() * .requestorAuthenticationIndicator() * .requestorChallengeIndicator() * .requestorName() @@ -1661,7 +1564,6 @@ private constructor( * .shippingAddressPostalCode() * .shippingAddressState() * .threeDSecureServerTransactionId() - * .transactionType() * .upcomingCardPaymentId() * ``` */ @@ -1683,7 +1585,6 @@ private constructor( private var cardId: JsonField? = null private var cardholderEmail: JsonField? = null private var cardholderName: JsonField? = null - private var category: JsonField? = null private var decision: JsonField? = null private var deviceChannel: JsonField? = null private var directoryServerTransactionId: JsonField? = null @@ -1691,10 +1592,8 @@ private constructor( private var merchantCategoryCode: JsonField? = null private var merchantCountry: JsonField? = null private var merchantName: JsonField? = null + private var messageCategory: JsonField? = null private var priorAuthenticatedCardPaymentId: JsonField? = null - private var purchaseAmount: JsonField? = null - private var purchaseAmountCardholderEstimated: JsonField? = null - private var purchaseCurrency: JsonField? = null private var requestorAuthenticationIndicator: JsonField? = null @@ -1709,7 +1608,6 @@ private constructor( private var shippingAddressPostalCode: JsonField? = null private var shippingAddressState: JsonField? = null private var threeDSecureServerTransactionId: JsonField? = null - private var transactionType: JsonField? = null private var upcomingCardPaymentId: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @@ -1728,7 +1626,6 @@ private constructor( cardId = cardAuthentication.cardId cardholderEmail = cardAuthentication.cardholderEmail cardholderName = cardAuthentication.cardholderName - category = cardAuthentication.category decision = cardAuthentication.decision deviceChannel = cardAuthentication.deviceChannel directoryServerTransactionId = cardAuthentication.directoryServerTransactionId @@ -1736,11 +1633,8 @@ private constructor( merchantCategoryCode = cardAuthentication.merchantCategoryCode merchantCountry = cardAuthentication.merchantCountry merchantName = cardAuthentication.merchantName + messageCategory = cardAuthentication.messageCategory priorAuthenticatedCardPaymentId = cardAuthentication.priorAuthenticatedCardPaymentId - purchaseAmount = cardAuthentication.purchaseAmount - purchaseAmountCardholderEstimated = - cardAuthentication.purchaseAmountCardholderEstimated - purchaseCurrency = cardAuthentication.purchaseCurrency requestorAuthenticationIndicator = cardAuthentication.requestorAuthenticationIndicator requestorChallengeIndicator = cardAuthentication.requestorChallengeIndicator @@ -1754,7 +1648,6 @@ private constructor( shippingAddressPostalCode = cardAuthentication.shippingAddressPostalCode shippingAddressState = cardAuthentication.shippingAddressState threeDSecureServerTransactionId = cardAuthentication.threeDSecureServerTransactionId - transactionType = cardAuthentication.transactionType upcomingCardPaymentId = cardAuthentication.upcomingCardPaymentId additionalProperties = cardAuthentication.additionalProperties.toMutableMap() } @@ -2013,21 +1906,6 @@ private constructor( this.cardholderName = cardholderName } - /** The category of the card authentication attempt. */ - fun category(category: Category?) = category(JsonField.ofNullable(category)) - - /** Alias for calling [Builder.category] with `category.orElse(null)`. */ - fun category(category: Optional) = category(category.getOrNull()) - - /** - * Sets [Builder.category] to an arbitrary JSON value. - * - * You should usually call [Builder.category] with a well-typed [Category] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun category(category: JsonField) = apply { this.category = category } - /** Whether or not the authentication attempt was approved. */ fun decision(decision: Decision?) = decision(JsonField.ofNullable(decision)) @@ -2165,6 +2043,21 @@ private constructor( this.merchantName = merchantName } + /** The message category of the card authentication attempt. */ + fun messageCategory(messageCategory: MessageCategory) = + messageCategory(JsonField.of(messageCategory)) + + /** + * Sets [Builder.messageCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.messageCategory] with a well-typed [MessageCategory] + * value instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun messageCategory(messageCategory: JsonField) = apply { + this.messageCategory = messageCategory + } + /** * The ID of a prior Card Authentication that the requestor used to authenticate this * cardholder for a previous transaction. @@ -2192,92 +2085,6 @@ private constructor( priorAuthenticatedCardPaymentId: JsonField ) = apply { this.priorAuthenticatedCardPaymentId = priorAuthenticatedCardPaymentId } - /** The purchase amount in minor units. */ - fun purchaseAmount(purchaseAmount: Long?) = - purchaseAmount(JsonField.ofNullable(purchaseAmount)) - - /** - * Alias for [Builder.purchaseAmount]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun purchaseAmount(purchaseAmount: Long) = purchaseAmount(purchaseAmount as Long?) - - /** Alias for calling [Builder.purchaseAmount] with `purchaseAmount.orElse(null)`. */ - fun purchaseAmount(purchaseAmount: Optional) = - purchaseAmount(purchaseAmount.getOrNull()) - - /** - * Sets [Builder.purchaseAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseAmount] with a well-typed [Long] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun purchaseAmount(purchaseAmount: JsonField) = apply { - this.purchaseAmount = purchaseAmount - } - - /** - * The purchase amount in the cardholder's currency (i.e., USD) estimated using daily - * conversion rates from the card network. - */ - fun purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated: Long?) = - purchaseAmountCardholderEstimated( - JsonField.ofNullable(purchaseAmountCardholderEstimated) - ) - - /** - * Alias for [Builder.purchaseAmountCardholderEstimated]. - * - * This unboxed primitive overload exists for backwards compatibility. - */ - fun purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated: Long) = - purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated as Long?) - - /** - * Alias for calling [Builder.purchaseAmountCardholderEstimated] with - * `purchaseAmountCardholderEstimated.orElse(null)`. - */ - fun purchaseAmountCardholderEstimated( - purchaseAmountCardholderEstimated: Optional - ) = purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated.getOrNull()) - - /** - * Sets [Builder.purchaseAmountCardholderEstimated] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseAmountCardholderEstimated] with a well-typed - * [Long] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun purchaseAmountCardholderEstimated( - purchaseAmountCardholderEstimated: JsonField - ) = apply { this.purchaseAmountCardholderEstimated = purchaseAmountCardholderEstimated } - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the authentication - * attempt's purchase currency. - */ - fun purchaseCurrency(purchaseCurrency: String?) = - purchaseCurrency(JsonField.ofNullable(purchaseCurrency)) - - /** - * Alias for calling [Builder.purchaseCurrency] with `purchaseCurrency.orElse(null)`. - */ - fun purchaseCurrency(purchaseCurrency: Optional) = - purchaseCurrency(purchaseCurrency.getOrNull()) - - /** - * Sets [Builder.purchaseCurrency] to an arbitrary JSON value. - * - * You should usually call [Builder.purchaseCurrency] with a well-typed [String] value - * instead. This method is primarily for setting the field to an undocumented or not yet - * supported value. - */ - fun purchaseCurrency(purchaseCurrency: JsonField) = apply { - this.purchaseCurrency = purchaseCurrency - } - /** * The 3DS requestor authentication indicator describes why the authentication attempt * is performed, such as for a recurring transaction. @@ -2532,25 +2339,6 @@ private constructor( threeDSecureServerTransactionId: JsonField ) = apply { this.threeDSecureServerTransactionId = threeDSecureServerTransactionId } - /** The type of transaction being authenticated. */ - fun transactionType(transactionType: TransactionType?) = - transactionType(JsonField.ofNullable(transactionType)) - - /** Alias for calling [Builder.transactionType] with `transactionType.orElse(null)`. */ - fun transactionType(transactionType: Optional) = - transactionType(transactionType.getOrNull()) - - /** - * Sets [Builder.transactionType] to an arbitrary JSON value. - * - * You should usually call [Builder.transactionType] with a well-typed [TransactionType] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun transactionType(transactionType: JsonField) = apply { - this.transactionType = transactionType - } - /** * The identifier of the Card Payment this authentication attempt will belong to. * Available in the API once the card authentication has completed. @@ -2607,7 +2395,6 @@ private constructor( * .cardId() * .cardholderEmail() * .cardholderName() - * .category() * .decision() * .deviceChannel() * .directoryServerTransactionId() @@ -2615,10 +2402,8 @@ private constructor( * .merchantCategoryCode() * .merchantCountry() * .merchantName() + * .messageCategory() * .priorAuthenticatedCardPaymentId() - * .purchaseAmount() - * .purchaseAmountCardholderEstimated() - * .purchaseCurrency() * .requestorAuthenticationIndicator() * .requestorChallengeIndicator() * .requestorName() @@ -2631,7 +2416,6 @@ private constructor( * .shippingAddressPostalCode() * .shippingAddressState() * .threeDSecureServerTransactionId() - * .transactionType() * .upcomingCardPaymentId() * ``` * @@ -2654,7 +2438,6 @@ private constructor( checkRequired("cardId", cardId), checkRequired("cardholderEmail", cardholderEmail), checkRequired("cardholderName", cardholderName), - checkRequired("category", category), checkRequired("decision", decision), checkRequired("deviceChannel", deviceChannel), checkRequired("directoryServerTransactionId", directoryServerTransactionId), @@ -2662,16 +2445,11 @@ private constructor( checkRequired("merchantCategoryCode", merchantCategoryCode), checkRequired("merchantCountry", merchantCountry), checkRequired("merchantName", merchantName), + checkRequired("messageCategory", messageCategory), checkRequired( "priorAuthenticatedCardPaymentId", priorAuthenticatedCardPaymentId, ), - checkRequired("purchaseAmount", purchaseAmount), - checkRequired( - "purchaseAmountCardholderEstimated", - purchaseAmountCardholderEstimated, - ), - checkRequired("purchaseCurrency", purchaseCurrency), checkRequired( "requestorAuthenticationIndicator", requestorAuthenticationIndicator, @@ -2690,7 +2468,6 @@ private constructor( "threeDSecureServerTransactionId", threeDSecureServerTransactionId, ), - checkRequired("transactionType", transactionType), checkRequired("upcomingCardPaymentId", upcomingCardPaymentId), additionalProperties.toMutableMap(), ) @@ -2715,7 +2492,6 @@ private constructor( cardId() cardholderEmail() cardholderName() - category().ifPresent { it.validate() } decision().ifPresent { it.validate() } deviceChannel().validate() directoryServerTransactionId() @@ -2723,10 +2499,8 @@ private constructor( merchantCategoryCode() merchantCountry() merchantName() + messageCategory().validate() priorAuthenticatedCardPaymentId() - purchaseAmount() - purchaseAmountCardholderEstimated() - purchaseCurrency() requestorAuthenticationIndicator().ifPresent { it.validate() } requestorChallengeIndicator().ifPresent { it.validate() } requestorName() @@ -2739,7 +2513,6 @@ private constructor( shippingAddressPostalCode() shippingAddressState() threeDSecureServerTransactionId() - transactionType().ifPresent { it.validate() } upcomingCardPaymentId() validated = true } @@ -2772,7 +2545,6 @@ private constructor( (if (cardId.asKnown().isPresent) 1 else 0) + (if (cardholderEmail.asKnown().isPresent) 1 else 0) + (if (cardholderName.asKnown().isPresent) 1 else 0) + - (category.asKnown().getOrNull()?.validity() ?: 0) + (decision.asKnown().getOrNull()?.validity() ?: 0) + (deviceChannel.asKnown().getOrNull()?.validity() ?: 0) + (if (directoryServerTransactionId.asKnown().isPresent) 1 else 0) + @@ -2780,10 +2552,8 @@ private constructor( (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + (if (merchantCountry.asKnown().isPresent) 1 else 0) + (if (merchantName.asKnown().isPresent) 1 else 0) + + (messageCategory.asKnown().getOrNull()?.validity() ?: 0) + (if (priorAuthenticatedCardPaymentId.asKnown().isPresent) 1 else 0) + - (if (purchaseAmount.asKnown().isPresent) 1 else 0) + - (if (purchaseAmountCardholderEstimated.asKnown().isPresent) 1 else 0) + - (if (purchaseCurrency.asKnown().isPresent) 1 else 0) + (requestorAuthenticationIndicator.asKnown().getOrNull()?.validity() ?: 0) + (requestorChallengeIndicator.asKnown().getOrNull()?.validity() ?: 0) + (if (requestorName.asKnown().isPresent) 1 else 0) + @@ -2796,11 +2566,10 @@ private constructor( (if (shippingAddressPostalCode.asKnown().isPresent) 1 else 0) + (if (shippingAddressState.asKnown().isPresent) 1 else 0) + (if (threeDSecureServerTransactionId.asKnown().isPresent) 1 else 0) + - (transactionType.asKnown().getOrNull()?.validity() ?: 0) + (if (upcomingCardPaymentId.asKnown().isPresent) 1 else 0) - /** The category of the card authentication attempt. */ - class Category @JsonCreator private constructor(private val value: JsonField) : + /** Whether or not the authentication attempt was approved. */ + class Decision @JsonCreator private constructor(private val value: JsonField) : Enum { /** @@ -2815,39 +2584,46 @@ private constructor( companion object { - /** The authentication attempt is for a payment. */ - @JvmField val PAYMENT_AUTHENTICATION = of("payment_authentication") + /** Approve the authentication attempt without triggering a challenge. */ + @JvmField val APPROVE = of("approve") + + /** Request further validation before approving the authentication attempt. */ + @JvmField val CHALLENGE = of("challenge") - /** The authentication attempt is not for a payment. */ - @JvmField val NON_PAYMENT_AUTHENTICATION = of("non_payment_authentication") + /** Deny the authentication attempt. */ + @JvmField val DENY = of("deny") - @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + @JvmStatic fun of(value: String) = Decision(JsonField.of(value)) } - /** An enum containing [Category]'s known values. */ + /** An enum containing [Decision]'s known values. */ enum class Known { - /** The authentication attempt is for a payment. */ - PAYMENT_AUTHENTICATION, - /** The authentication attempt is not for a payment. */ - NON_PAYMENT_AUTHENTICATION, + /** Approve the authentication attempt without triggering a challenge. */ + APPROVE, + /** Request further validation before approving the authentication attempt. */ + CHALLENGE, + /** Deny the authentication attempt. */ + DENY, } /** - * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * An enum containing [Decision]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [Category] can contain an unknown value in a couple of cases: + * An instance of [Decision] can contain an unknown value in a couple of cases: * - It was deserialized from data that doesn't match any known member. For example, if * the SDK is on an older version than the API, then the API may respond with new * members that the SDK is unaware of. * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** The authentication attempt is for a payment. */ - PAYMENT_AUTHENTICATION, - /** The authentication attempt is not for a payment. */ - NON_PAYMENT_AUTHENTICATION, + /** Approve the authentication attempt without triggering a challenge. */ + APPROVE, + /** Request further validation before approving the authentication attempt. */ + CHALLENGE, + /** Deny the authentication attempt. */ + DENY, /** - * An enum member indicating that [Category] was instantiated with an unknown value. + * An enum member indicating that [Decision] was instantiated with an unknown value. */ _UNKNOWN, } @@ -2861,8 +2637,9 @@ private constructor( */ fun value(): Value = when (this) { - PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION - NON_PAYMENT_AUTHENTICATION -> Value.NON_PAYMENT_AUTHENTICATION + APPROVE -> Value.APPROVE + CHALLENGE -> Value.CHALLENGE + DENY -> Value.DENY else -> Value._UNKNOWN } @@ -2877,9 +2654,10 @@ private constructor( */ fun known(): Known = when (this) { - PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION - NON_PAYMENT_AUTHENTICATION -> Known.NON_PAYMENT_AUTHENTICATION - else -> throw IncreaseInvalidDataException("Unknown Category: $value") + APPROVE -> Known.APPROVE + CHALLENGE -> Known.CHALLENGE + DENY -> Known.DENY + else -> throw IncreaseInvalidDataException("Unknown Decision: $value") } /** @@ -2898,7 +2676,7 @@ private constructor( private var validated: Boolean = false - fun validate(): Category = apply { + fun validate(): Decision = apply { if (validated) { return@apply } @@ -2928,7 +2706,7 @@ private constructor( return true } - return other is Category && value == other.value + return other is Decision && value == other.value } override fun hashCode() = value.hashCode() @@ -2936,189 +2714,43 @@ private constructor( override fun toString() = value.toString() } - /** Whether or not the authentication attempt was approved. */ - class Decision @JsonCreator private constructor(private val value: JsonField) : - Enum { + /** The device channel of the card authentication attempt. */ + class DeviceChannel + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val browser: JsonField, + private val category: JsonField, + private val merchantInitiated: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("browser") + @ExcludeMissing + browser: JsonField = JsonMissing.of(), + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("merchant_initiated") + @ExcludeMissing + merchantInitiated: JsonField = JsonMissing.of(), + ) : this(browser, category, merchantInitiated, mutableMapOf()) /** - * Returns this class instance's raw value. + * Fields specific to the browser device channel. * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** Approve the authentication attempt without triggering a challenge. */ - @JvmField val APPROVE = of("approve") - - /** Request further validation before approving the authentication attempt. */ - @JvmField val CHALLENGE = of("challenge") - - /** Deny the authentication attempt. */ - @JvmField val DENY = of("deny") - - @JvmStatic fun of(value: String) = Decision(JsonField.of(value)) - } - - /** An enum containing [Decision]'s known values. */ - enum class Known { - /** Approve the authentication attempt without triggering a challenge. */ - APPROVE, - /** Request further validation before approving the authentication attempt. */ - CHALLENGE, - /** Deny the authentication attempt. */ - DENY, - } + fun browser(): Optional = browser.getOptional("browser") /** - * An enum containing [Decision]'s known values, as well as an [_UNKNOWN] member. + * The category of the device channel. * - * An instance of [Decision] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** Approve the authentication attempt without triggering a challenge. */ - APPROVE, - /** Request further validation before approving the authentication attempt. */ - CHALLENGE, - /** Deny the authentication attempt. */ - DENY, - /** - * An enum member indicating that [Decision] was instantiated with an unknown value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - APPROVE -> Value.APPROVE - CHALLENGE -> Value.CHALLENGE - DENY -> Value.DENY - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - APPROVE -> Known.APPROVE - CHALLENGE -> Known.CHALLENGE - DENY -> Known.DENY - else -> throw IncreaseInvalidDataException("Unknown Decision: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): Decision = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is Decision && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - - /** The device channel of the card authentication attempt. */ - class DeviceChannel - @JsonCreator(mode = JsonCreator.Mode.DISABLED) - private constructor( - private val browser: JsonField, - private val category: JsonField, - private val merchantInitiated: JsonField, - private val additionalProperties: MutableMap, - ) { - - @JsonCreator - private constructor( - @JsonProperty("browser") - @ExcludeMissing - browser: JsonField = JsonMissing.of(), - @JsonProperty("category") - @ExcludeMissing - category: JsonField = JsonMissing.of(), - @JsonProperty("merchant_initiated") - @ExcludeMissing - merchantInitiated: JsonField = JsonMissing.of(), - ) : this(browser, category, merchantInitiated, mutableMapOf()) - - /** - * Fields specific to the browser device channel. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun browser(): Optional = browser.getOptional("browser") - - /** - * The category of the device channel. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is - * unexpectedly missing or null (e.g. if the server responded with an unexpected - * value). + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ fun category(): Category = category.getRequired("category") @@ -4505,81 +4137,1139 @@ private constructor( "DeviceChannel{browser=$browser, category=$category, merchantInitiated=$merchantInitiated, additionalProperties=$additionalProperties}" } - /** - * The 3DS requestor authentication indicator describes why the authentication attempt is - * performed, such as for a recurring transaction. - */ - class RequestorAuthenticationIndicator - @JsonCreator - private constructor(private val value: JsonField) : Enum { + /** The message category of the card authentication attempt. */ + class MessageCategory + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val nonPayment: JsonField, + private val payment: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("non_payment") + @ExcludeMissing + nonPayment: JsonField = JsonMissing.of(), + @JsonProperty("payment") + @ExcludeMissing + payment: JsonField = JsonMissing.of(), + ) : this(category, nonPayment, payment, mutableMapOf()) /** - * Returns this class instance's raw value. + * The category of the card authentication attempt. * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + fun category(): Category = category.getRequired("category") - companion object { + /** + * Fields specific to non-payment authentication attempts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun nonPayment(): Optional = nonPayment.getOptional("non_payment") - /** The authentication is for a payment transaction. */ - @JvmField val PAYMENT_TRANSACTION = of("payment_transaction") + /** + * Fields specific to payment authentication attempts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun payment(): Optional = payment.getOptional("payment") - /** The authentication is for a recurring transaction. */ - @JvmField val RECURRING_TRANSACTION = of("recurring_transaction") + /** + * Returns the raw JSON value of [category]. + * + * Unlike [category], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("category") + @ExcludeMissing + fun _category(): JsonField = category - /** The authentication is for an installment transaction. */ - @JvmField val INSTALLMENT_TRANSACTION = of("installment_transaction") + /** + * Returns the raw JSON value of [nonPayment]. + * + * Unlike [nonPayment], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("non_payment") + @ExcludeMissing + fun _nonPayment(): JsonField = nonPayment - /** The authentication is for adding a card. */ - @JvmField val ADD_CARD = of("add_card") + /** + * Returns the raw JSON value of [payment]. + * + * Unlike [payment], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("payment") @ExcludeMissing fun _payment(): JsonField = payment - /** The authentication is for maintaining a card. */ - @JvmField val MAINTAIN_CARD = of("maintain_card") + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } - /** The authentication is for EMV token cardholder verification. */ - @JvmField - val EMV_TOKEN_CARDHOLDER_VERIFICATION = of("emv_token_cardholder_verification") + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) - /** The authentication is for a billing agreement. */ - @JvmField val BILLING_AGREEMENT = of("billing_agreement") + fun toBuilder() = Builder().from(this) - @JvmStatic - fun of(value: String) = RequestorAuthenticationIndicator(JsonField.of(value)) - } + companion object { - /** An enum containing [RequestorAuthenticationIndicator]'s known values. */ - enum class Known { - /** The authentication is for a payment transaction. */ - PAYMENT_TRANSACTION, - /** The authentication is for a recurring transaction. */ - RECURRING_TRANSACTION, - /** The authentication is for an installment transaction. */ - INSTALLMENT_TRANSACTION, - /** The authentication is for adding a card. */ - ADD_CARD, - /** The authentication is for maintaining a card. */ - MAINTAIN_CARD, - /** The authentication is for EMV token cardholder verification. */ - EMV_TOKEN_CARDHOLDER_VERIFICATION, - /** The authentication is for a billing agreement. */ - BILLING_AGREEMENT, + /** + * Returns a mutable builder for constructing an instance of [MessageCategory]. + * + * The following fields are required: + * ```java + * .category() + * .nonPayment() + * .payment() + * ``` + */ + @JvmStatic fun builder() = Builder() } - /** - * An enum containing [RequestorAuthenticationIndicator]'s known values, as well as an - * [_UNKNOWN] member. - * - * An instance of [RequestorAuthenticationIndicator] can contain an unknown value in a - * couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ + /** A builder for [MessageCategory]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var nonPayment: JsonField? = null + private var payment: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(messageCategory: MessageCategory) = apply { + category = messageCategory.category + nonPayment = messageCategory.nonPayment + payment = messageCategory.payment + additionalProperties = messageCategory.additionalProperties.toMutableMap() + } + + /** The category of the card authentication attempt. */ + fun category(category: Category) = category(JsonField.of(category)) + + /** + * Sets [Builder.category] to an arbitrary JSON value. + * + * You should usually call [Builder.category] with a well-typed [Category] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun category(category: JsonField) = apply { this.category = category } + + /** Fields specific to non-payment authentication attempts. */ + fun nonPayment(nonPayment: NonPayment?) = + nonPayment(JsonField.ofNullable(nonPayment)) + + /** Alias for calling [Builder.nonPayment] with `nonPayment.orElse(null)`. */ + fun nonPayment(nonPayment: Optional) = + nonPayment(nonPayment.getOrNull()) + + /** + * Sets [Builder.nonPayment] to an arbitrary JSON value. + * + * You should usually call [Builder.nonPayment] with a well-typed [NonPayment] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun nonPayment(nonPayment: JsonField) = apply { + this.nonPayment = nonPayment + } + + /** Fields specific to payment authentication attempts. */ + fun payment(payment: Payment?) = payment(JsonField.ofNullable(payment)) + + /** Alias for calling [Builder.payment] with `payment.orElse(null)`. */ + fun payment(payment: Optional) = payment(payment.getOrNull()) + + /** + * Sets [Builder.payment] to an arbitrary JSON value. + * + * You should usually call [Builder.payment] with a well-typed [Payment] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun payment(payment: JsonField) = apply { this.payment = payment } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [MessageCategory]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .nonPayment() + * .payment() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): MessageCategory = + MessageCategory( + checkRequired("category", category), + checkRequired("nonPayment", nonPayment), + checkRequired("payment", payment), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): MessageCategory = apply { + if (validated) { + return@apply + } + + category().validate() + nonPayment().ifPresent { it.validate() } + payment().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (category.asKnown().getOrNull()?.validity() ?: 0) + + (nonPayment.asKnown().getOrNull()?.validity() ?: 0) + + (payment.asKnown().getOrNull()?.validity() ?: 0) + + /** The category of the card authentication attempt. */ + class Category @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** The authentication attempt is for a payment. */ + @JvmField val PAYMENT_AUTHENTICATION = of("payment_authentication") + + /** The authentication attempt is not for a payment. */ + @JvmField val NON_PAYMENT_AUTHENTICATION = of("non_payment_authentication") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** The authentication attempt is for a payment. */ + PAYMENT_AUTHENTICATION, + /** The authentication attempt is not for a payment. */ + NON_PAYMENT_AUTHENTICATION, + } + + /** + * An enum containing [Category]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Category] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** The authentication attempt is for a payment. */ + PAYMENT_AUTHENTICATION, + /** The authentication attempt is not for a payment. */ + NON_PAYMENT_AUTHENTICATION, + /** + * An enum member indicating that [Category] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + PAYMENT_AUTHENTICATION -> Value.PAYMENT_AUTHENTICATION + NON_PAYMENT_AUTHENTICATION -> Value.NON_PAYMENT_AUTHENTICATION + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + PAYMENT_AUTHENTICATION -> Known.PAYMENT_AUTHENTICATION + NON_PAYMENT_AUTHENTICATION -> Known.NON_PAYMENT_AUTHENTICATION + else -> throw IncreaseInvalidDataException("Unknown Category: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Category = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Category && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to non-payment authentication attempts. */ + class NonPayment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor(private val additionalProperties: MutableMap) { + + @JsonCreator private constructor() : this(mutableMapOf()) + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [NonPayment]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NonPayment]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(nonPayment: NonPayment) = apply { + additionalProperties = nonPayment.additionalProperties.toMutableMap() + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [NonPayment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): NonPayment = NonPayment(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): NonPayment = apply { + if (validated) { + return@apply + } + + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = 0 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NonPayment && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "NonPayment{additionalProperties=$additionalProperties}" + } + + /** Fields specific to payment authentication attempts. */ + class Payment + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val purchaseAmount: JsonField, + private val purchaseAmountCardholderEstimated: JsonField, + private val purchaseCurrency: JsonField, + private val transactionType: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("purchase_amount") + @ExcludeMissing + purchaseAmount: JsonField = JsonMissing.of(), + @JsonProperty("purchase_amount_cardholder_estimated") + @ExcludeMissing + purchaseAmountCardholderEstimated: JsonField = JsonMissing.of(), + @JsonProperty("purchase_currency") + @ExcludeMissing + purchaseCurrency: JsonField = JsonMissing.of(), + @JsonProperty("transaction_type") + @ExcludeMissing + transactionType: JsonField = JsonMissing.of(), + ) : this( + purchaseAmount, + purchaseAmountCardholderEstimated, + purchaseCurrency, + transactionType, + mutableMapOf(), + ) + + /** + * The purchase amount in minor units. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun purchaseAmount(): Long = purchaseAmount.getRequired("purchase_amount") + + /** + * The purchase amount in the cardholder's currency (i.e., USD) estimated using + * daily conversion rates from the card network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun purchaseAmountCardholderEstimated(): Optional = + purchaseAmountCardholderEstimated.getOptional( + "purchase_amount_cardholder_estimated" + ) + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * authentication attempt's purchase currency. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun purchaseCurrency(): String = purchaseCurrency.getRequired("purchase_currency") + + /** + * The type of transaction being authenticated. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transactionType(): Optional = + transactionType.getOptional("transaction_type") + + /** + * Returns the raw JSON value of [purchaseAmount]. + * + * Unlike [purchaseAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("purchase_amount") + @ExcludeMissing + fun _purchaseAmount(): JsonField = purchaseAmount + + /** + * Returns the raw JSON value of [purchaseAmountCardholderEstimated]. + * + * Unlike [purchaseAmountCardholderEstimated], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("purchase_amount_cardholder_estimated") + @ExcludeMissing + fun _purchaseAmountCardholderEstimated(): JsonField = + purchaseAmountCardholderEstimated + + /** + * Returns the raw JSON value of [purchaseCurrency]. + * + * Unlike [purchaseCurrency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("purchase_currency") + @ExcludeMissing + fun _purchaseCurrency(): JsonField = purchaseCurrency + + /** + * Returns the raw JSON value of [transactionType]. + * + * Unlike [transactionType], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_type") + @ExcludeMissing + fun _transactionType(): JsonField = transactionType + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Payment]. + * + * The following fields are required: + * ```java + * .purchaseAmount() + * .purchaseAmountCardholderEstimated() + * .purchaseCurrency() + * .transactionType() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Payment]. */ + class Builder internal constructor() { + + private var purchaseAmount: JsonField? = null + private var purchaseAmountCardholderEstimated: JsonField? = null + private var purchaseCurrency: JsonField? = null + private var transactionType: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(payment: Payment) = apply { + purchaseAmount = payment.purchaseAmount + purchaseAmountCardholderEstimated = + payment.purchaseAmountCardholderEstimated + purchaseCurrency = payment.purchaseCurrency + transactionType = payment.transactionType + additionalProperties = payment.additionalProperties.toMutableMap() + } + + /** The purchase amount in minor units. */ + fun purchaseAmount(purchaseAmount: Long) = + purchaseAmount(JsonField.of(purchaseAmount)) + + /** + * Sets [Builder.purchaseAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.purchaseAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun purchaseAmount(purchaseAmount: JsonField) = apply { + this.purchaseAmount = purchaseAmount + } + + /** + * The purchase amount in the cardholder's currency (i.e., USD) estimated using + * daily conversion rates from the card network. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: Long? + ) = + purchaseAmountCardholderEstimated( + JsonField.ofNullable(purchaseAmountCardholderEstimated) + ) + + /** + * Alias for [Builder.purchaseAmountCardholderEstimated]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun purchaseAmountCardholderEstimated(purchaseAmountCardholderEstimated: Long) = + purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated as Long? + ) + + /** + * Alias for calling [Builder.purchaseAmountCardholderEstimated] with + * `purchaseAmountCardholderEstimated.orElse(null)`. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: Optional + ) = + purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated.getOrNull() + ) + + /** + * Sets [Builder.purchaseAmountCardholderEstimated] to an arbitrary JSON value. + * + * You should usually call [Builder.purchaseAmountCardholderEstimated] with a + * well-typed [Long] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun purchaseAmountCardholderEstimated( + purchaseAmountCardholderEstimated: JsonField + ) = apply { + this.purchaseAmountCardholderEstimated = purchaseAmountCardholderEstimated + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * authentication attempt's purchase currency. + */ + fun purchaseCurrency(purchaseCurrency: String) = + purchaseCurrency(JsonField.of(purchaseCurrency)) + + /** + * Sets [Builder.purchaseCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.purchaseCurrency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun purchaseCurrency(purchaseCurrency: JsonField) = apply { + this.purchaseCurrency = purchaseCurrency + } + + /** The type of transaction being authenticated. */ + fun transactionType(transactionType: TransactionType?) = + transactionType(JsonField.ofNullable(transactionType)) + + /** + * Alias for calling [Builder.transactionType] with + * `transactionType.orElse(null)`. + */ + fun transactionType(transactionType: Optional) = + transactionType(transactionType.getOrNull()) + + /** + * Sets [Builder.transactionType] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionType] with a well-typed + * [TransactionType] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun transactionType(transactionType: JsonField) = apply { + this.transactionType = transactionType + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Payment]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .purchaseAmount() + * .purchaseAmountCardholderEstimated() + * .purchaseCurrency() + * .transactionType() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Payment = + Payment( + checkRequired("purchaseAmount", purchaseAmount), + checkRequired( + "purchaseAmountCardholderEstimated", + purchaseAmountCardholderEstimated, + ), + checkRequired("purchaseCurrency", purchaseCurrency), + checkRequired("transactionType", transactionType), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Payment = apply { + if (validated) { + return@apply + } + + purchaseAmount() + purchaseAmountCardholderEstimated() + purchaseCurrency() + transactionType().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (if (purchaseAmount.asKnown().isPresent) 1 else 0) + + (if (purchaseAmountCardholderEstimated.asKnown().isPresent) 1 else 0) + + (if (purchaseCurrency.asKnown().isPresent) 1 else 0) + + (transactionType.asKnown().getOrNull()?.validity() ?: 0) + + /** The type of transaction being authenticated. */ + class TransactionType + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** Purchase of goods or services. */ + @JvmField val GOODS_SERVICE_PURCHASE = of("goods_service_purchase") + + /** Check acceptance. */ + @JvmField val CHECK_ACCEPTANCE = of("check_acceptance") + + /** Account funding. */ + @JvmField val ACCOUNT_FUNDING = of("account_funding") + + /** Quasi-cash transaction. */ + @JvmField val QUASI_CASH_TRANSACTION = of("quasi_cash_transaction") + + /** Prepaid activation and load. */ + @JvmField + val PREPAID_ACTIVATION_AND_LOAD = of("prepaid_activation_and_load") + + @JvmStatic fun of(value: String) = TransactionType(JsonField.of(value)) + } + + /** An enum containing [TransactionType]'s known values. */ + enum class Known { + /** Purchase of goods or services. */ + GOODS_SERVICE_PURCHASE, + /** Check acceptance. */ + CHECK_ACCEPTANCE, + /** Account funding. */ + ACCOUNT_FUNDING, + /** Quasi-cash transaction. */ + QUASI_CASH_TRANSACTION, + /** Prepaid activation and load. */ + PREPAID_ACTIVATION_AND_LOAD, + } + + /** + * An enum containing [TransactionType]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [TransactionType] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** Purchase of goods or services. */ + GOODS_SERVICE_PURCHASE, + /** Check acceptance. */ + CHECK_ACCEPTANCE, + /** Account funding. */ + ACCOUNT_FUNDING, + /** Quasi-cash transaction. */ + QUASI_CASH_TRANSACTION, + /** Prepaid activation and load. */ + PREPAID_ACTIVATION_AND_LOAD, + /** + * An enum member indicating that [TransactionType] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE + CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE + ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING + QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION + PREPAID_ACTIVATION_AND_LOAD -> Value.PREPAID_ACTIVATION_AND_LOAD + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE + CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE + ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING + QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION + PREPAID_ACTIVATION_AND_LOAD -> Known.PREPAID_ACTIVATION_AND_LOAD + else -> + throw IncreaseInvalidDataException( + "Unknown TransactionType: $value" + ) + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): TransactionType = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TransactionType && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Payment && + purchaseAmount == other.purchaseAmount && + purchaseAmountCardholderEstimated == + other.purchaseAmountCardholderEstimated && + purchaseCurrency == other.purchaseCurrency && + transactionType == other.transactionType && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + purchaseAmount, + purchaseAmountCardholderEstimated, + purchaseCurrency, + transactionType, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Payment{purchaseAmount=$purchaseAmount, purchaseAmountCardholderEstimated=$purchaseAmountCardholderEstimated, purchaseCurrency=$purchaseCurrency, transactionType=$transactionType, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is MessageCategory && + category == other.category && + nonPayment == other.nonPayment && + payment == other.payment && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, nonPayment, payment, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "MessageCategory{category=$category, nonPayment=$nonPayment, payment=$payment, additionalProperties=$additionalProperties}" + } + + /** + * The 3DS requestor authentication indicator describes why the authentication attempt is + * performed, such as for a recurring transaction. + */ + class RequestorAuthenticationIndicator + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that doesn't + * match any known member, and you want to know that value. For example, if the SDK is + * on an older version than the API, then the API may respond with new members that the + * SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** The authentication is for a payment transaction. */ + @JvmField val PAYMENT_TRANSACTION = of("payment_transaction") + + /** The authentication is for a recurring transaction. */ + @JvmField val RECURRING_TRANSACTION = of("recurring_transaction") + + /** The authentication is for an installment transaction. */ + @JvmField val INSTALLMENT_TRANSACTION = of("installment_transaction") + + /** The authentication is for adding a card. */ + @JvmField val ADD_CARD = of("add_card") + + /** The authentication is for maintaining a card. */ + @JvmField val MAINTAIN_CARD = of("maintain_card") + + /** The authentication is for EMV token cardholder verification. */ + @JvmField + val EMV_TOKEN_CARDHOLDER_VERIFICATION = of("emv_token_cardholder_verification") + + /** The authentication is for a billing agreement. */ + @JvmField val BILLING_AGREEMENT = of("billing_agreement") + + @JvmStatic + fun of(value: String) = RequestorAuthenticationIndicator(JsonField.of(value)) + } + + /** An enum containing [RequestorAuthenticationIndicator]'s known values. */ + enum class Known { + /** The authentication is for a payment transaction. */ + PAYMENT_TRANSACTION, + /** The authentication is for a recurring transaction. */ + RECURRING_TRANSACTION, + /** The authentication is for an installment transaction. */ + INSTALLMENT_TRANSACTION, + /** The authentication is for adding a card. */ + ADD_CARD, + /** The authentication is for maintaining a card. */ + MAINTAIN_CARD, + /** The authentication is for EMV token cardholder verification. */ + EMV_TOKEN_CARDHOLDER_VERIFICATION, + /** The authentication is for a billing agreement. */ + BILLING_AGREEMENT, + } + + /** + * An enum containing [RequestorAuthenticationIndicator]'s known values, as well as an + * [_UNKNOWN] member. + * + * An instance of [RequestorAuthenticationIndicator] can contain an unknown value in a + * couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ enum class Value { /** The authentication is for a payment transaction. */ PAYMENT_TRANSACTION, @@ -4936,172 +5626,6 @@ private constructor( override fun toString() = value.toString() } - /** The type of transaction being authenticated. */ - class TransactionType - @JsonCreator - private constructor(private val value: JsonField) : Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** Purchase of goods or services. */ - @JvmField val GOODS_SERVICE_PURCHASE = of("goods_service_purchase") - - /** Check acceptance. */ - @JvmField val CHECK_ACCEPTANCE = of("check_acceptance") - - /** Account funding. */ - @JvmField val ACCOUNT_FUNDING = of("account_funding") - - /** Quasi-cash transaction. */ - @JvmField val QUASI_CASH_TRANSACTION = of("quasi_cash_transaction") - - /** Prepaid activation and load. */ - @JvmField val PREPAID_ACTIVATION_AND_LOAD = of("prepaid_activation_and_load") - - @JvmStatic fun of(value: String) = TransactionType(JsonField.of(value)) - } - - /** An enum containing [TransactionType]'s known values. */ - enum class Known { - /** Purchase of goods or services. */ - GOODS_SERVICE_PURCHASE, - /** Check acceptance. */ - CHECK_ACCEPTANCE, - /** Account funding. */ - ACCOUNT_FUNDING, - /** Quasi-cash transaction. */ - QUASI_CASH_TRANSACTION, - /** Prepaid activation and load. */ - PREPAID_ACTIVATION_AND_LOAD, - } - - /** - * An enum containing [TransactionType]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [TransactionType] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** Purchase of goods or services. */ - GOODS_SERVICE_PURCHASE, - /** Check acceptance. */ - CHECK_ACCEPTANCE, - /** Account funding. */ - ACCOUNT_FUNDING, - /** Quasi-cash transaction. */ - QUASI_CASH_TRANSACTION, - /** Prepaid activation and load. */ - PREPAID_ACTIVATION_AND_LOAD, - /** - * An enum member indicating that [TransactionType] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - GOODS_SERVICE_PURCHASE -> Value.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Value.CHECK_ACCEPTANCE - ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Value.QUASI_CASH_TRANSACTION - PREPAID_ACTIVATION_AND_LOAD -> Value.PREPAID_ACTIVATION_AND_LOAD - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - GOODS_SERVICE_PURCHASE -> Known.GOODS_SERVICE_PURCHASE - CHECK_ACCEPTANCE -> Known.CHECK_ACCEPTANCE - ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING - QUASI_CASH_TRANSACTION -> Known.QUASI_CASH_TRANSACTION - PREPAID_ACTIVATION_AND_LOAD -> Known.PREPAID_ACTIVATION_AND_LOAD - else -> throw IncreaseInvalidDataException("Unknown TransactionType: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): TransactionType = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is TransactionType && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -5120,7 +5644,6 @@ private constructor( cardId == other.cardId && cardholderEmail == other.cardholderEmail && cardholderName == other.cardholderName && - category == other.category && decision == other.decision && deviceChannel == other.deviceChannel && directoryServerTransactionId == other.directoryServerTransactionId && @@ -5128,10 +5651,8 @@ private constructor( merchantCategoryCode == other.merchantCategoryCode && merchantCountry == other.merchantCountry && merchantName == other.merchantName && + messageCategory == other.messageCategory && priorAuthenticatedCardPaymentId == other.priorAuthenticatedCardPaymentId && - purchaseAmount == other.purchaseAmount && - purchaseAmountCardholderEstimated == other.purchaseAmountCardholderEstimated && - purchaseCurrency == other.purchaseCurrency && requestorAuthenticationIndicator == other.requestorAuthenticationIndicator && requestorChallengeIndicator == other.requestorChallengeIndicator && requestorName == other.requestorName && @@ -5144,7 +5665,6 @@ private constructor( shippingAddressPostalCode == other.shippingAddressPostalCode && shippingAddressState == other.shippingAddressState && threeDSecureServerTransactionId == other.threeDSecureServerTransactionId && - transactionType == other.transactionType && upcomingCardPaymentId == other.upcomingCardPaymentId && additionalProperties == other.additionalProperties } @@ -5163,7 +5683,6 @@ private constructor( cardId, cardholderEmail, cardholderName, - category, decision, deviceChannel, directoryServerTransactionId, @@ -5171,10 +5690,8 @@ private constructor( merchantCategoryCode, merchantCountry, merchantName, + messageCategory, priorAuthenticatedCardPaymentId, - purchaseAmount, - purchaseAmountCardholderEstimated, - purchaseCurrency, requestorAuthenticationIndicator, requestorChallengeIndicator, requestorName, @@ -5187,7 +5704,6 @@ private constructor( shippingAddressPostalCode, shippingAddressState, threeDSecureServerTransactionId, - transactionType, upcomingCardPaymentId, additionalProperties, ) @@ -5196,7 +5712,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthentication{accessControlServerTransactionId=$accessControlServerTransactionId, accountId=$accountId, billingAddressCity=$billingAddressCity, billingAddressCountry=$billingAddressCountry, billingAddressLine1=$billingAddressLine1, billingAddressLine2=$billingAddressLine2, billingAddressLine3=$billingAddressLine3, billingAddressPostalCode=$billingAddressPostalCode, billingAddressState=$billingAddressState, cardId=$cardId, cardholderEmail=$cardholderEmail, cardholderName=$cardholderName, category=$category, decision=$decision, deviceChannel=$deviceChannel, directoryServerTransactionId=$directoryServerTransactionId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCountry=$merchantCountry, merchantName=$merchantName, priorAuthenticatedCardPaymentId=$priorAuthenticatedCardPaymentId, purchaseAmount=$purchaseAmount, purchaseAmountCardholderEstimated=$purchaseAmountCardholderEstimated, purchaseCurrency=$purchaseCurrency, requestorAuthenticationIndicator=$requestorAuthenticationIndicator, requestorChallengeIndicator=$requestorChallengeIndicator, requestorName=$requestorName, requestorUrl=$requestorUrl, shippingAddressCity=$shippingAddressCity, shippingAddressCountry=$shippingAddressCountry, shippingAddressLine1=$shippingAddressLine1, shippingAddressLine2=$shippingAddressLine2, shippingAddressLine3=$shippingAddressLine3, shippingAddressPostalCode=$shippingAddressPostalCode, shippingAddressState=$shippingAddressState, threeDSecureServerTransactionId=$threeDSecureServerTransactionId, transactionType=$transactionType, upcomingCardPaymentId=$upcomingCardPaymentId, additionalProperties=$additionalProperties}" + "CardAuthentication{accessControlServerTransactionId=$accessControlServerTransactionId, accountId=$accountId, billingAddressCity=$billingAddressCity, billingAddressCountry=$billingAddressCountry, billingAddressLine1=$billingAddressLine1, billingAddressLine2=$billingAddressLine2, billingAddressLine3=$billingAddressLine3, billingAddressPostalCode=$billingAddressPostalCode, billingAddressState=$billingAddressState, cardId=$cardId, cardholderEmail=$cardholderEmail, cardholderName=$cardholderName, decision=$decision, deviceChannel=$deviceChannel, directoryServerTransactionId=$directoryServerTransactionId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCountry=$merchantCountry, merchantName=$merchantName, messageCategory=$messageCategory, priorAuthenticatedCardPaymentId=$priorAuthenticatedCardPaymentId, requestorAuthenticationIndicator=$requestorAuthenticationIndicator, requestorChallengeIndicator=$requestorChallengeIndicator, requestorName=$requestorName, requestorUrl=$requestorUrl, shippingAddressCity=$shippingAddressCity, shippingAddressCountry=$shippingAddressCountry, shippingAddressLine1=$shippingAddressLine1, shippingAddressLine2=$shippingAddressLine2, shippingAddressLine3=$shippingAddressLine3, shippingAddressPostalCode=$shippingAddressPostalCode, shippingAddressState=$shippingAddressState, threeDSecureServerTransactionId=$threeDSecureServerTransactionId, upcomingCardPaymentId=$upcomingCardPaymentId, additionalProperties=$additionalProperties}" } /** Fields related to a 3DS authentication attempt. */ diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt index 04f0366d4..81d56d850 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentListPageResponseTest.kt @@ -44,10 +44,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -138,10 +134,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -169,11 +201,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -2193,10 +2220,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -2287,10 +2310,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -2318,11 +2377,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -4342,10 +4396,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -4436,10 +4486,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -4467,11 +4553,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -6491,10 +6572,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -6585,10 +6662,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -6616,11 +6729,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -8682,10 +8790,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -8771,10 +8875,42 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -8802,10 +8938,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -10711,10 +10843,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -10800,10 +10928,42 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -10831,10 +10991,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -12740,10 +12896,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -12829,10 +12981,42 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -12860,10 +13044,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -14769,10 +14949,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -14858,10 +15034,42 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -14889,10 +15097,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -16842,10 +17046,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -16936,10 +17136,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -16967,11 +17203,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -18991,10 +19222,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -19085,10 +19312,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -19116,11 +19379,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -21140,10 +21398,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -21234,10 +21488,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -21265,11 +21555,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -23289,10 +23574,6 @@ internal class CardPaymentListPageResponseTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge .builder() @@ -23383,10 +23664,46 @@ internal class CardPaymentListPageResponseTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication + .MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated( + 1000L + ) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element + .CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -23414,11 +23731,6 @@ internal class CardPaymentListPageResponseTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication - .TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt index 2faabe732..8ea97f929 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/cardpayments/CardPaymentTest.kt @@ -42,10 +42,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -123,10 +119,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -154,10 +182,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -1948,10 +1972,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -2029,10 +2049,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -2060,10 +2112,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -3854,10 +3902,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -3935,10 +3979,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -3966,10 +4042,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -5760,10 +5832,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -5841,10 +5909,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -5872,10 +5972,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -7700,10 +7796,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -7771,10 +7863,38 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory.builder() + .category( + CardPayment.Element.CardAuthentication.MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication.MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication.MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -7798,10 +7918,6 @@ internal class CardPaymentTest { CardPayment.Element.CardAuthentication.Status.VALIDATING_CHALLENGE ) .threeDSecureServerTransactionId("6839e1b0-dcae-482d-8166-40e44dd0d8cd") - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type(CardPayment.Element.CardAuthentication.Type.CARD_AUTHENTICATION) .build() ) @@ -9410,10 +9526,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -9481,10 +9593,38 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory.builder() + .category( + CardPayment.Element.CardAuthentication.MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication.MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication.MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -9508,10 +9648,6 @@ internal class CardPaymentTest { CardPayment.Element.CardAuthentication.Status.VALIDATING_CHALLENGE ) .threeDSecureServerTransactionId("6839e1b0-dcae-482d-8166-40e44dd0d8cd") - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type(CardPayment.Element.CardAuthentication.Type.CARD_AUTHENTICATION) .build() ) @@ -11120,10 +11256,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -11191,10 +11323,38 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory.builder() + .category( + CardPayment.Element.CardAuthentication.MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication.MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication.MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -11218,10 +11378,6 @@ internal class CardPaymentTest { CardPayment.Element.CardAuthentication.Status.VALIDATING_CHALLENGE ) .threeDSecureServerTransactionId("6839e1b0-dcae-482d-8166-40e44dd0d8cd") - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type(CardPayment.Element.CardAuthentication.Type.CARD_AUTHENTICATION) .build() ) @@ -12830,10 +12986,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -12901,10 +13053,38 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory.builder() + .category( + CardPayment.Element.CardAuthentication.MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication.MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication.MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -12928,10 +13108,6 @@ internal class CardPaymentTest { CardPayment.Element.CardAuthentication.Status.VALIDATING_CHALLENGE ) .threeDSecureServerTransactionId("6839e1b0-dcae-482d-8166-40e44dd0d8cd") - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type(CardPayment.Element.CardAuthentication.Type.CARD_AUTHENTICATION) .build() ) @@ -14580,10 +14756,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -14661,10 +14833,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -14692,10 +14896,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -16486,10 +16686,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -16567,10 +16763,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -16598,10 +16826,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -18392,10 +18616,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -18473,10 +18693,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -18504,10 +18756,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION @@ -20298,10 +20546,6 @@ internal class CardPaymentTest { .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .cardholderEmail("user@example.com") .cardholderName("Ian Crease") - .category( - CardPayment.Element.CardAuthentication.Category - .PAYMENT_AUTHENTICATION - ) .challenge( CardPayment.Element.CardAuthentication.Challenge.builder() .addAttempt( @@ -20379,10 +20623,42 @@ internal class CardPaymentTest { .merchantCategoryCode("5734") .merchantCountry("US") .merchantName("AMAZON.COM") + .messageCategory( + CardPayment.Element.CardAuthentication.MessageCategory + .builder() + .category( + CardPayment.Element.CardAuthentication + .MessageCategory + .Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + CardPayment.Element.CardAuthentication + .MessageCategory + .NonPayment + .builder() + .build() + ) + .payment( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .builder() + .purchaseAmount(861L) + .purchaseAmountCardholderEstimated(1000L) + .purchaseCurrency("EUR") + .transactionType( + CardPayment.Element.CardAuthentication + .MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId(null) - .purchaseAmount(861L) - .purchaseAmountCardholderEstimated(1000L) - .purchaseCurrency("EUR") .realTimeDecisionId(null) .requestorAuthenticationIndicator( CardPayment.Element.CardAuthentication @@ -20410,10 +20686,6 @@ internal class CardPaymentTest { .threeDSecureServerTransactionId( "6839e1b0-dcae-482d-8166-40e44dd0d8cd" ) - .transactionType( - CardPayment.Element.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .type( CardPayment.Element.CardAuthentication.Type .CARD_AUTHENTICATION diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index cc2b2e43e..1dec0e36f 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -29,9 +29,6 @@ internal class RealTimeDecisionTest { .cardId("card_id") .cardholderEmail("cardholder_email") .cardholderName("cardholder_name") - .category( - RealTimeDecision.CardAuthentication.Category.PAYMENT_AUTHENTICATION - ) .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE) .deviceChannel( RealTimeDecision.CardAuthentication.DeviceChannel.builder() @@ -72,10 +69,34 @@ internal class RealTimeDecisionTest { .merchantCategoryCode("merchant_category_code") .merchantCountry("merchant_country") .merchantName("merchant_name") + .messageCategory( + RealTimeDecision.CardAuthentication.MessageCategory.builder() + .category( + RealTimeDecision.CardAuthentication.MessageCategory.Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + RealTimeDecision.CardAuthentication.MessageCategory.NonPayment + .builder() + .build() + ) + .payment( + RealTimeDecision.CardAuthentication.MessageCategory.Payment + .builder() + .purchaseAmount(0L) + .purchaseAmountCardholderEstimated(0L) + .purchaseCurrency("purchase_currency") + .transactionType( + RealTimeDecision.CardAuthentication.MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id") - .purchaseAmount(0L) - .purchaseAmountCardholderEstimated(0L) - .purchaseCurrency("purchase_currency") .requestorAuthenticationIndicator( RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator .PAYMENT_TRANSACTION @@ -94,10 +115,6 @@ internal class RealTimeDecisionTest { .shippingAddressPostalCode("shipping_address_postal_code") .shippingAddressState("shipping_address_state") .threeDSecureServerTransactionId("three_d_secure_server_transaction_id") - .transactionType( - RealTimeDecision.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .upcomingCardPaymentId("upcoming_card_payment_id") .build() ) @@ -569,7 +586,6 @@ internal class RealTimeDecisionTest { .cardId("card_id") .cardholderEmail("cardholder_email") .cardholderName("cardholder_name") - .category(RealTimeDecision.CardAuthentication.Category.PAYMENT_AUTHENTICATION) .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE) .deviceChannel( RealTimeDecision.CardAuthentication.DeviceChannel.builder() @@ -607,10 +623,33 @@ internal class RealTimeDecisionTest { .merchantCategoryCode("merchant_category_code") .merchantCountry("merchant_country") .merchantName("merchant_name") + .messageCategory( + RealTimeDecision.CardAuthentication.MessageCategory.builder() + .category( + RealTimeDecision.CardAuthentication.MessageCategory.Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + RealTimeDecision.CardAuthentication.MessageCategory.NonPayment + .builder() + .build() + ) + .payment( + RealTimeDecision.CardAuthentication.MessageCategory.Payment + .builder() + .purchaseAmount(0L) + .purchaseAmountCardholderEstimated(0L) + .purchaseCurrency("purchase_currency") + .transactionType( + RealTimeDecision.CardAuthentication.MessageCategory.Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id") - .purchaseAmount(0L) - .purchaseAmountCardholderEstimated(0L) - .purchaseCurrency("purchase_currency") .requestorAuthenticationIndicator( RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator .PAYMENT_TRANSACTION @@ -629,9 +668,6 @@ internal class RealTimeDecisionTest { .shippingAddressPostalCode("shipping_address_postal_code") .shippingAddressState("shipping_address_state") .threeDSecureServerTransactionId("three_d_secure_server_transaction_id") - .transactionType( - RealTimeDecision.CardAuthentication.TransactionType.GOODS_SERVICE_PURCHASE - ) .upcomingCardPaymentId("upcoming_card_payment_id") .build() ) @@ -1099,9 +1135,6 @@ internal class RealTimeDecisionTest { .cardId("card_id") .cardholderEmail("cardholder_email") .cardholderName("cardholder_name") - .category( - RealTimeDecision.CardAuthentication.Category.PAYMENT_AUTHENTICATION - ) .decision(RealTimeDecision.CardAuthentication.Decision.APPROVE) .deviceChannel( RealTimeDecision.CardAuthentication.DeviceChannel.builder() @@ -1142,10 +1175,34 @@ internal class RealTimeDecisionTest { .merchantCategoryCode("merchant_category_code") .merchantCountry("merchant_country") .merchantName("merchant_name") + .messageCategory( + RealTimeDecision.CardAuthentication.MessageCategory.builder() + .category( + RealTimeDecision.CardAuthentication.MessageCategory.Category + .PAYMENT_AUTHENTICATION + ) + .nonPayment( + RealTimeDecision.CardAuthentication.MessageCategory.NonPayment + .builder() + .build() + ) + .payment( + RealTimeDecision.CardAuthentication.MessageCategory.Payment + .builder() + .purchaseAmount(0L) + .purchaseAmountCardholderEstimated(0L) + .purchaseCurrency("purchase_currency") + .transactionType( + RealTimeDecision.CardAuthentication.MessageCategory + .Payment + .TransactionType + .GOODS_SERVICE_PURCHASE + ) + .build() + ) + .build() + ) .priorAuthenticatedCardPaymentId("prior_authenticated_card_payment_id") - .purchaseAmount(0L) - .purchaseAmountCardholderEstimated(0L) - .purchaseCurrency("purchase_currency") .requestorAuthenticationIndicator( RealTimeDecision.CardAuthentication.RequestorAuthenticationIndicator .PAYMENT_TRANSACTION @@ -1164,10 +1221,6 @@ internal class RealTimeDecisionTest { .shippingAddressPostalCode("shipping_address_postal_code") .shippingAddressState("shipping_address_state") .threeDSecureServerTransactionId("three_d_secure_server_transaction_id") - .transactionType( - RealTimeDecision.CardAuthentication.TransactionType - .GOODS_SERVICE_PURCHASE - ) .upcomingCardPaymentId("upcoming_card_payment_id") .build() ) From 0ed56edba92368135e879ccd31d05d6a5b7cf5ac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 9 Mar 2026 22:29:38 +0000 Subject: [PATCH 2/2] release: 0.459.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index d2127382b..6c3521308 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.458.0" + ".": "0.459.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 51dc93b7c..395eefe51 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.459.0 (2026-03-09) + +Full Changelog: [v0.458.0...v0.459.0](https://github.com/Increase/increase-java/compare/v0.458.0...v0.459.0) + +### Features + +* **api:** api update ([c6724ab](https://github.com/Increase/increase-java/commit/c6724ab2a6a8509ee7df39680562045a495f8f27)) + ## 0.458.0 (2026-03-09) Full Changelog: [v0.457.0...v0.458.0](https://github.com/Increase/increase-java/compare/v0.457.0...v0.458.0) diff --git a/README.md b/README.md index c04b9e163..6852e3cf6 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.458.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.458.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.458.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.459.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.459.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.459.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.458.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.459.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.458.0") +implementation("com.increase.api:increase-java:0.459.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.458.0") com.increase.api increase-java - 0.458.0 + 0.459.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 26682b2f2..06d9d83c9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.458.0" // x-release-please-version + version = "0.459.0" // x-release-please-version } subprojects {