diff --git a/.release-please-manifest.json b/.release-please-manifest.json index c1ebe3f9a..0243314d8 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.376.0" + ".": "0.377.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 537cdff67..f5d26caa7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 229 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-942f7494ee0f14c1634ede0989985359cea633e5eece3d761910e7ffd6ac0fd8.yml -openapi_spec_hash: d87134899fb29e27832158facf9d67eb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-79f55910f087930ab5447372ef856ab63fe18f08d2151c59b8aebcccd6f41700.yml +openapi_spec_hash: 5b6d915106e3361863168d9b084a570c config_hash: b6f365add90e618b2174634df140826e diff --git a/CHANGELOG.md b/CHANGELOG.md index 39b949425..59ca49b4a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,13 @@ # Changelog +## 0.377.0 (2025-12-08) + +Full Changelog: [v0.376.0...v0.377.0](https://github.com/Increase/increase-java/compare/v0.376.0...v0.377.0) + +### Features + +* **api:** api update ([5875a12](https://github.com/Increase/increase-java/commit/5875a125f07087e38563e9d65810b96586eb4b64)) + ## 0.376.0 (2025-12-08) Full Changelog: [v0.375.0...v0.376.0](https://github.com/Increase/increase-java/compare/v0.375.0...v0.376.0) diff --git a/README.md b/README.md index 9c803eea3..03587477e 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.376.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.376.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.376.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.377.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.377.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.377.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.376.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.377.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.376.0") +implementation("com.increase.api:increase-java:0.377.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.376.0") com.increase.api increase-java - 0.376.0 + 0.377.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index 8e7f18546..a0d9f6782 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.376.0" // x-release-please-version + version = "0.377.0" // x-release-please-version } subprojects { 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 19aa8825f..1b7f4a7b9 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 @@ -524,6 +524,7 @@ private constructor( private val cardAuthentication: JsonField, private val cardAuthorization: JsonField, private val cardAuthorizationExpiration: JsonField, + private val cardBalanceInquiry: JsonField, private val cardDecline: JsonField, private val cardFinancial: JsonField, private val cardFuelConfirmation: JsonField, @@ -549,6 +550,9 @@ private constructor( @JsonProperty("card_authorization_expiration") @ExcludeMissing cardAuthorizationExpiration: JsonField = JsonMissing.of(), + @JsonProperty("card_balance_inquiry") + @ExcludeMissing + cardBalanceInquiry: JsonField = JsonMissing.of(), @JsonProperty("card_decline") @ExcludeMissing cardDecline: JsonField = JsonMissing.of(), @@ -584,6 +588,7 @@ private constructor( cardAuthentication, cardAuthorization, cardAuthorizationExpiration, + cardBalanceInquiry, cardDecline, cardFinancial, cardFuelConfirmation, @@ -631,6 +636,18 @@ private constructor( fun cardAuthorizationExpiration(): Optional = cardAuthorizationExpiration.getOptional("card_authorization_expiration") + /** + * A Card Balance Inquiry object. This field will be present in the JSON response if and + * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are + * transactions that allow merchants to check the available balance on a card without + * placing a hold on funds, commonly used when a customer requests their balance at an ATM. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun cardBalanceInquiry(): Optional = + cardBalanceInquiry.getOptional("card_balance_inquiry") + /** * A Card Decline object. This field will be present in the JSON response if and only if * `category` is equal to `card_decline`. @@ -774,6 +791,16 @@ private constructor( fun _cardAuthorizationExpiration(): JsonField = cardAuthorizationExpiration + /** + * Returns the raw JSON value of [cardBalanceInquiry]. + * + * Unlike [cardBalanceInquiry], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("card_balance_inquiry") + @ExcludeMissing + fun _cardBalanceInquiry(): JsonField = cardBalanceInquiry + /** * Returns the raw JSON value of [cardDecline]. * @@ -897,6 +924,7 @@ private constructor( * .cardAuthentication() * .cardAuthorization() * .cardAuthorizationExpiration() + * .cardBalanceInquiry() * .cardDecline() * .cardFinancial() * .cardFuelConfirmation() @@ -919,6 +947,7 @@ private constructor( private var cardAuthentication: JsonField? = null private var cardAuthorization: JsonField? = null private var cardAuthorizationExpiration: JsonField? = null + private var cardBalanceInquiry: JsonField? = null private var cardDecline: JsonField? = null private var cardFinancial: JsonField? = null private var cardFuelConfirmation: JsonField? = null @@ -937,6 +966,7 @@ private constructor( cardAuthentication = element.cardAuthentication cardAuthorization = element.cardAuthorization cardAuthorizationExpiration = element.cardAuthorizationExpiration + cardBalanceInquiry = element.cardBalanceInquiry cardDecline = element.cardDecline cardFinancial = element.cardFinancial cardFuelConfirmation = element.cardFuelConfirmation @@ -1032,6 +1062,34 @@ private constructor( cardAuthorizationExpiration: JsonField ) = apply { this.cardAuthorizationExpiration = cardAuthorizationExpiration } + /** + * A Card Balance Inquiry object. This field will be present in the JSON response if and + * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are + * transactions that allow merchants to check the available balance on a card without + * placing a hold on funds, commonly used when a customer requests their balance at an + * ATM. + */ + fun cardBalanceInquiry(cardBalanceInquiry: CardBalanceInquiry?) = + cardBalanceInquiry(JsonField.ofNullable(cardBalanceInquiry)) + + /** + * Alias for calling [Builder.cardBalanceInquiry] with + * `cardBalanceInquiry.orElse(null)`. + */ + fun cardBalanceInquiry(cardBalanceInquiry: Optional) = + cardBalanceInquiry(cardBalanceInquiry.getOrNull()) + + /** + * Sets [Builder.cardBalanceInquiry] to an arbitrary JSON value. + * + * You should usually call [Builder.cardBalanceInquiry] with a well-typed + * [CardBalanceInquiry] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun cardBalanceInquiry(cardBalanceInquiry: JsonField) = apply { + this.cardBalanceInquiry = cardBalanceInquiry + } + /** * A Card Decline object. This field will be present in the JSON response if and only if * `category` is equal to `card_decline`. @@ -1300,6 +1358,7 @@ private constructor( * .cardAuthentication() * .cardAuthorization() * .cardAuthorizationExpiration() + * .cardBalanceInquiry() * .cardDecline() * .cardFinancial() * .cardFuelConfirmation() @@ -1320,6 +1379,7 @@ private constructor( checkRequired("cardAuthentication", cardAuthentication), checkRequired("cardAuthorization", cardAuthorization), checkRequired("cardAuthorizationExpiration", cardAuthorizationExpiration), + checkRequired("cardBalanceInquiry", cardBalanceInquiry), checkRequired("cardDecline", cardDecline), checkRequired("cardFinancial", cardFinancial), checkRequired("cardFuelConfirmation", cardFuelConfirmation), @@ -1345,6 +1405,7 @@ private constructor( cardAuthentication().ifPresent { it.validate() } cardAuthorization().ifPresent { it.validate() } cardAuthorizationExpiration().ifPresent { it.validate() } + cardBalanceInquiry().ifPresent { it.validate() } cardDecline().ifPresent { it.validate() } cardFinancial().ifPresent { it.validate() } cardFuelConfirmation().ifPresent { it.validate() } @@ -1378,6 +1439,7 @@ private constructor( (cardAuthentication.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorization.asKnown().getOrNull()?.validity() ?: 0) + (cardAuthorizationExpiration.asKnown().getOrNull()?.validity() ?: 0) + + (cardBalanceInquiry.asKnown().getOrNull()?.validity() ?: 0) + (cardDecline.asKnown().getOrNull()?.validity() ?: 0) + (cardFinancial.asKnown().getOrNull()?.validity() ?: 0) + (cardFuelConfirmation.asKnown().getOrNull()?.validity() ?: 0) + @@ -13477,22 +13539,20 @@ private constructor( } /** - * A Card Decline object. This field will be present in the JSON response if and only if - * `category` is equal to `card_decline`. + * A Card Balance Inquiry object. This field will be present in the JSON response if and + * only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries are + * transactions that allow merchants to check the available balance on a card without + * placing a hold on funds, commonly used when a customer requests their balance at an ATM. */ - class CardDecline + class CardBalanceInquiry @JsonCreator(mode = JsonCreator.Mode.DISABLED) private constructor( private val id: JsonField, - private val actioner: JsonField, private val additionalAmounts: JsonField, - private val amount: JsonField, + private val balance: JsonField, private val cardPaymentId: JsonField, private val currency: JsonField, - private val declinedTransactionId: JsonField, private val digitalWalletTokenId: JsonField, - private val direction: JsonField, - private val incrementedCardAuthorizationId: JsonField, private val merchantAcceptorId: JsonField, private val merchantCategoryCode: JsonField, private val merchantCity: JsonField, @@ -13504,13 +13564,9 @@ private constructor( private val networkIdentifiers: JsonField, private val networkRiskScore: JsonField, private val physicalCardId: JsonField, - private val presentmentAmount: JsonField, - private val presentmentCurrency: JsonField, - private val processingCategory: JsonField, private val realTimeDecisionId: JsonField, - private val realTimeDecisionReason: JsonField, - private val reason: JsonField, private val terminalId: JsonField, + private val type: JsonField, private val verification: JsonField, private val additionalProperties: MutableMap, ) { @@ -13518,31 +13574,21 @@ private constructor( @JsonCreator private constructor( @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), - @JsonProperty("actioner") - @ExcludeMissing - actioner: JsonField = JsonMissing.of(), @JsonProperty("additional_amounts") @ExcludeMissing additionalAmounts: JsonField = JsonMissing.of(), - @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("balance") + @ExcludeMissing + balance: JsonField = JsonMissing.of(), @JsonProperty("card_payment_id") @ExcludeMissing cardPaymentId: JsonField = JsonMissing.of(), @JsonProperty("currency") @ExcludeMissing currency: JsonField = JsonMissing.of(), - @JsonProperty("declined_transaction_id") - @ExcludeMissing - declinedTransactionId: JsonField = JsonMissing.of(), @JsonProperty("digital_wallet_token_id") @ExcludeMissing digitalWalletTokenId: JsonField = JsonMissing.of(), - @JsonProperty("direction") - @ExcludeMissing - direction: JsonField = JsonMissing.of(), - @JsonProperty("incremented_card_authorization_id") - @ExcludeMissing - incrementedCardAuthorizationId: JsonField = JsonMissing.of(), @JsonProperty("merchant_acceptor_id") @ExcludeMissing merchantAcceptorId: JsonField = JsonMissing.of(), @@ -13576,41 +13622,23 @@ private constructor( @JsonProperty("physical_card_id") @ExcludeMissing physicalCardId: JsonField = JsonMissing.of(), - @JsonProperty("presentment_amount") - @ExcludeMissing - presentmentAmount: JsonField = JsonMissing.of(), - @JsonProperty("presentment_currency") - @ExcludeMissing - presentmentCurrency: JsonField = JsonMissing.of(), - @JsonProperty("processing_category") - @ExcludeMissing - processingCategory: JsonField = JsonMissing.of(), @JsonProperty("real_time_decision_id") @ExcludeMissing realTimeDecisionId: JsonField = JsonMissing.of(), - @JsonProperty("real_time_decision_reason") - @ExcludeMissing - realTimeDecisionReason: JsonField = JsonMissing.of(), - @JsonProperty("reason") - @ExcludeMissing - reason: JsonField = JsonMissing.of(), @JsonProperty("terminal_id") @ExcludeMissing terminalId: JsonField = JsonMissing.of(), + @JsonProperty("type") @ExcludeMissing type: JsonField = JsonMissing.of(), @JsonProperty("verification") @ExcludeMissing verification: JsonField = JsonMissing.of(), ) : this( id, - actioner, additionalAmounts, - amount, + balance, cardPaymentId, currency, - declinedTransactionId, digitalWalletTokenId, - direction, - incrementedCardAuthorizationId, merchantAcceptorId, merchantCategoryCode, merchantCity, @@ -13622,19 +13650,15 @@ private constructor( networkIdentifiers, networkRiskScore, physicalCardId, - presentmentAmount, - presentmentCurrency, - processingCategory, realTimeDecisionId, - realTimeDecisionReason, - reason, terminalId, + type, verification, mutableMapOf(), ) /** - * The Card Decline identifier. + * The Card Balance Inquiry identifier. * * @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 @@ -13642,16 +13666,6 @@ private constructor( */ fun id(): String = id.getRequired("id") - /** - * Whether this authorization was approved by Increase, the card network through - * stand-in processing, or the user through a real-time decision. - * - * @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 actioner(): Actioner = actioner.getRequired("actioner") - /** * Additional amounts associated with the card authorization, such as ATM surcharges * fees. These are usually a subset of the `amount` field and are used to provide more @@ -13665,14 +13679,14 @@ private constructor( additionalAmounts.getRequired("additional_amounts") /** - * The declined amount in the minor unit of the destination account currency. For - * dollars, for example, this is cents. + * The balance amount in the minor unit of the account's currency. For dollars, for + * example, this is cents. * * @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 amount(): Long = amount.getRequired("amount") + fun balance(): Long = balance.getRequired("balance") /** * The ID of the Card Payment this transaction belongs to. @@ -13684,8 +13698,8 @@ private constructor( fun cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id") /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the account's + * 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 @@ -13693,16 +13707,6 @@ private constructor( */ fun currency(): Currency = currency.getRequired("currency") - /** - * The identifier of the declined transaction created for this Card Decline. - * - * @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 declinedTransactionId(): String = - declinedTransactionId.getRequired("declined_transaction_id") - /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay * purchase), the identifier of the token that was used. @@ -13713,26 +13717,6 @@ private constructor( fun digitalWalletTokenId(): Optional = digitalWalletTokenId.getOptional("digital_wallet_token_id") - /** - * The direction describes the direction the funds will move, either from the cardholder - * to the merchant or from the merchant to the cardholder. - * - * @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 direction(): Direction = direction.getRequired("direction") - - /** - * The identifier of the card authorization this request attempted to incrementally - * authorize. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun incrementedCardAuthorizationId(): Optional = - incrementedCardAuthorizationId.getOptional("incremented_card_authorization_id") - /** * The merchant identifier (commonly abbreviated as MID) of the merchant the card is * transacting with. @@ -13838,37 +13822,6 @@ private constructor( */ fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id") - /** - * The declined amount in the minor unit of the transaction's presentment 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 presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount") - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - * presentment 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 presentmentCurrency(): String = - presentmentCurrency.getRequired("presentment_currency") - - /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. - * - * @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 processingCategory(): ProcessingCategory = - processingCategory.getRequired("processing_category") - /** * The identifier of the Real-Time Decision sent to approve or decline this transaction. * @@ -13879,31 +13832,23 @@ private constructor( realTimeDecisionId.getOptional("real_time_decision_id") /** - * This is present if a specific decline reason was given in the real-time decision. + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. * if the server responded with an unexpected value). */ - fun realTimeDecisionReason(): Optional = - realTimeDecisionReason.getOptional("real_time_decision_reason") + fun terminalId(): Optional = terminalId.getOptional("terminal_id") /** - * Why the transaction was declined. + * A constant representing the object's type. For this resource it will always be + * `card_balance_inquiry`. * * @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 reason(): Reason = reason.getRequired("reason") - - /** - * The terminal identifier (commonly abbreviated as TID) of the terminal the card is - * transacting with. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. - * if the server responded with an unexpected value). - */ - fun terminalId(): Optional = terminalId.getOptional("terminal_id") + fun type(): Type = type.getRequired("type") /** * Fields related to verification of cardholder-provided values. @@ -13921,16 +13866,6 @@ private constructor( */ @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id - /** - * Returns the raw JSON value of [actioner]. - * - * Unlike [actioner], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("actioner") - @ExcludeMissing - fun _actioner(): JsonField = actioner - /** * Returns the raw JSON value of [additionalAmounts]. * @@ -13942,11 +13877,11 @@ private constructor( fun _additionalAmounts(): JsonField = additionalAmounts /** - * Returns the raw JSON value of [amount]. + * Returns the raw JSON value of [balance]. * - * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + * Unlike [balance], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + @JsonProperty("balance") @ExcludeMissing fun _balance(): JsonField = balance /** * Returns the raw JSON value of [cardPaymentId]. @@ -13968,16 +13903,6 @@ private constructor( @ExcludeMissing fun _currency(): JsonField = currency - /** - * Returns the raw JSON value of [declinedTransactionId]. - * - * Unlike [declinedTransactionId], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("declined_transaction_id") - @ExcludeMissing - fun _declinedTransactionId(): JsonField = declinedTransactionId - /** * Returns the raw JSON value of [digitalWalletTokenId]. * @@ -13988,27 +13913,6 @@ private constructor( @ExcludeMissing fun _digitalWalletTokenId(): JsonField = digitalWalletTokenId - /** - * Returns the raw JSON value of [direction]. - * - * Unlike [direction], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("direction") - @ExcludeMissing - fun _direction(): JsonField = direction - - /** - * Returns the raw JSON value of [incrementedCardAuthorizationId]. - * - * Unlike [incrementedCardAuthorizationId], this method doesn't throw if the JSON field - * has an unexpected type. - */ - @JsonProperty("incremented_card_authorization_id") - @ExcludeMissing - fun _incrementedCardAuthorizationId(): JsonField = - incrementedCardAuthorizationId - /** * Returns the raw JSON value of [merchantAcceptorId]. * @@ -14119,36 +14023,6 @@ private constructor( @ExcludeMissing fun _physicalCardId(): JsonField = physicalCardId - /** - * Returns the raw JSON value of [presentmentAmount]. - * - * Unlike [presentmentAmount], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("presentment_amount") - @ExcludeMissing - fun _presentmentAmount(): JsonField = presentmentAmount - - /** - * Returns the raw JSON value of [presentmentCurrency]. - * - * Unlike [presentmentCurrency], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("presentment_currency") - @ExcludeMissing - fun _presentmentCurrency(): JsonField = presentmentCurrency - - /** - * Returns the raw JSON value of [processingCategory]. - * - * Unlike [processingCategory], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("processing_category") - @ExcludeMissing - fun _processingCategory(): JsonField = processingCategory - /** * Returns the raw JSON value of [realTimeDecisionId]. * @@ -14159,24 +14033,6 @@ private constructor( @ExcludeMissing fun _realTimeDecisionId(): JsonField = realTimeDecisionId - /** - * Returns the raw JSON value of [realTimeDecisionReason]. - * - * Unlike [realTimeDecisionReason], this method doesn't throw if the JSON field has an - * unexpected type. - */ - @JsonProperty("real_time_decision_reason") - @ExcludeMissing - fun _realTimeDecisionReason(): JsonField = - realTimeDecisionReason - - /** - * Returns the raw JSON value of [reason]. - * - * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. - */ - @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason - /** * Returns the raw JSON value of [terminalId]. * @@ -14187,6 +14043,13 @@ private constructor( @ExcludeMissing fun _terminalId(): JsonField = terminalId + /** + * Returns the raw JSON value of [type]. + * + * Unlike [type], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("type") @ExcludeMissing fun _type(): JsonField = type + /** * Returns the raw JSON value of [verification]. * @@ -14212,20 +14075,16 @@ private constructor( companion object { /** - * Returns a mutable builder for constructing an instance of [CardDecline]. + * Returns a mutable builder for constructing an instance of [CardBalanceInquiry]. * * The following fields are required: * ```java * .id() - * .actioner() * .additionalAmounts() - * .amount() + * .balance() * .cardPaymentId() * .currency() - * .declinedTransactionId() * .digitalWalletTokenId() - * .direction() - * .incrementedCardAuthorizationId() * .merchantAcceptorId() * .merchantCategoryCode() * .merchantCity() @@ -14237,32 +14096,24 @@ private constructor( * .networkIdentifiers() * .networkRiskScore() * .physicalCardId() - * .presentmentAmount() - * .presentmentCurrency() - * .processingCategory() * .realTimeDecisionId() - * .realTimeDecisionReason() - * .reason() * .terminalId() + * .type() * .verification() * ``` */ @JvmStatic fun builder() = Builder() } - /** A builder for [CardDecline]. */ + /** A builder for [CardBalanceInquiry]. */ class Builder internal constructor() { private var id: JsonField? = null - private var actioner: JsonField? = null private var additionalAmounts: JsonField? = null - private var amount: JsonField? = null + private var balance: JsonField? = null private var cardPaymentId: JsonField? = null private var currency: JsonField? = null - private var declinedTransactionId: JsonField? = null private var digitalWalletTokenId: JsonField? = null - private var direction: JsonField? = null - private var incrementedCardAuthorizationId: JsonField? = null private var merchantAcceptorId: JsonField? = null private var merchantCategoryCode: JsonField? = null private var merchantCity: JsonField? = null @@ -14274,51 +14125,39 @@ private constructor( private var networkIdentifiers: JsonField? = null private var networkRiskScore: JsonField? = null private var physicalCardId: JsonField? = null - private var presentmentAmount: JsonField? = null - private var presentmentCurrency: JsonField? = null - private var processingCategory: JsonField? = null private var realTimeDecisionId: JsonField? = null - private var realTimeDecisionReason: JsonField? = null - private var reason: JsonField? = null private var terminalId: JsonField? = null + private var type: JsonField? = null private var verification: JsonField? = null private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic - internal fun from(cardDecline: CardDecline) = apply { - id = cardDecline.id - actioner = cardDecline.actioner - additionalAmounts = cardDecline.additionalAmounts - amount = cardDecline.amount - cardPaymentId = cardDecline.cardPaymentId - currency = cardDecline.currency - declinedTransactionId = cardDecline.declinedTransactionId - digitalWalletTokenId = cardDecline.digitalWalletTokenId - direction = cardDecline.direction - incrementedCardAuthorizationId = cardDecline.incrementedCardAuthorizationId - merchantAcceptorId = cardDecline.merchantAcceptorId - merchantCategoryCode = cardDecline.merchantCategoryCode - merchantCity = cardDecline.merchantCity - merchantCountry = cardDecline.merchantCountry - merchantDescriptor = cardDecline.merchantDescriptor - merchantPostalCode = cardDecline.merchantPostalCode - merchantState = cardDecline.merchantState - networkDetails = cardDecline.networkDetails - networkIdentifiers = cardDecline.networkIdentifiers - networkRiskScore = cardDecline.networkRiskScore - physicalCardId = cardDecline.physicalCardId - presentmentAmount = cardDecline.presentmentAmount - presentmentCurrency = cardDecline.presentmentCurrency - processingCategory = cardDecline.processingCategory - realTimeDecisionId = cardDecline.realTimeDecisionId - realTimeDecisionReason = cardDecline.realTimeDecisionReason - reason = cardDecline.reason - terminalId = cardDecline.terminalId - verification = cardDecline.verification - additionalProperties = cardDecline.additionalProperties.toMutableMap() - } - - /** The Card Decline identifier. */ + internal fun from(cardBalanceInquiry: CardBalanceInquiry) = apply { + id = cardBalanceInquiry.id + additionalAmounts = cardBalanceInquiry.additionalAmounts + balance = cardBalanceInquiry.balance + cardPaymentId = cardBalanceInquiry.cardPaymentId + currency = cardBalanceInquiry.currency + digitalWalletTokenId = cardBalanceInquiry.digitalWalletTokenId + merchantAcceptorId = cardBalanceInquiry.merchantAcceptorId + merchantCategoryCode = cardBalanceInquiry.merchantCategoryCode + merchantCity = cardBalanceInquiry.merchantCity + merchantCountry = cardBalanceInquiry.merchantCountry + merchantDescriptor = cardBalanceInquiry.merchantDescriptor + merchantPostalCode = cardBalanceInquiry.merchantPostalCode + merchantState = cardBalanceInquiry.merchantState + networkDetails = cardBalanceInquiry.networkDetails + networkIdentifiers = cardBalanceInquiry.networkIdentifiers + networkRiskScore = cardBalanceInquiry.networkRiskScore + physicalCardId = cardBalanceInquiry.physicalCardId + realTimeDecisionId = cardBalanceInquiry.realTimeDecisionId + terminalId = cardBalanceInquiry.terminalId + type = cardBalanceInquiry.type + verification = cardBalanceInquiry.verification + additionalProperties = cardBalanceInquiry.additionalProperties.toMutableMap() + } + + /** The Card Balance Inquiry identifier. */ fun id(id: String) = id(JsonField.of(id)) /** @@ -14330,21 +14169,6 @@ private constructor( */ fun id(id: JsonField) = apply { this.id = id } - /** - * Whether this authorization was approved by Increase, the card network through - * stand-in processing, or the user through a real-time decision. - */ - fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner)) - - /** - * Sets [Builder.actioner] to an arbitrary JSON value. - * - * You should usually call [Builder.actioner] with a well-typed [Actioner] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun actioner(actioner: JsonField) = apply { this.actioner = actioner } - /** * Additional amounts associated with the card authorization, such as ATM surcharges * fees. These are usually a subset of the `amount` field and are used to provide @@ -14365,19 +14189,19 @@ private constructor( } /** - * The declined amount in the minor unit of the destination account currency. For - * dollars, for example, this is cents. + * The balance amount in the minor unit of the account's currency. For dollars, for + * example, this is cents. */ - fun amount(amount: Long) = amount(JsonField.of(amount)) + fun balance(balance: Long) = balance(JsonField.of(balance)) /** - * Sets [Builder.amount] to an arbitrary JSON value. + * Sets [Builder.balance] to an arbitrary JSON value. * - * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * You should usually call [Builder.balance] with a well-typed [Long] value instead. * This method is primarily for setting the field to an undocumented or not yet * supported value. */ - fun amount(amount: JsonField) = apply { this.amount = amount } + fun balance(balance: JsonField) = apply { this.balance = balance } /** The ID of the Card Payment this transaction belongs to. */ fun cardPaymentId(cardPaymentId: String) = @@ -14395,8 +14219,8 @@ private constructor( } /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the account's + * currency. */ fun currency(currency: Currency) = currency(JsonField.of(currency)) @@ -14409,21 +14233,6 @@ private constructor( */ fun currency(currency: JsonField) = apply { this.currency = currency } - /** The identifier of the declined transaction created for this Card Decline. */ - fun declinedTransactionId(declinedTransactionId: String) = - declinedTransactionId(JsonField.of(declinedTransactionId)) - - /** - * Sets [Builder.declinedTransactionId] to an arbitrary JSON value. - * - * You should usually call [Builder.declinedTransactionId] with a well-typed - * [String] value instead. This method is primarily for setting the field to an - * undocumented or not yet supported value. - */ - fun declinedTransactionId(declinedTransactionId: JsonField) = apply { - this.declinedTransactionId = declinedTransactionId - } - /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay * purchase), the identifier of the token that was used. @@ -14449,51 +14258,6 @@ private constructor( this.digitalWalletTokenId = digitalWalletTokenId } - /** - * The direction describes the direction the funds will move, either from the - * cardholder to the merchant or from the merchant to the cardholder. - */ - fun direction(direction: Direction) = direction(JsonField.of(direction)) - - /** - * Sets [Builder.direction] to an arbitrary JSON value. - * - * You should usually call [Builder.direction] with a well-typed [Direction] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun direction(direction: JsonField) = apply { - this.direction = direction - } - - /** - * The identifier of the card authorization this request attempted to incrementally - * authorize. - */ - fun incrementedCardAuthorizationId(incrementedCardAuthorizationId: String?) = - incrementedCardAuthorizationId( - JsonField.ofNullable(incrementedCardAuthorizationId) - ) - - /** - * Alias for calling [Builder.incrementedCardAuthorizationId] with - * `incrementedCardAuthorizationId.orElse(null)`. - */ - fun incrementedCardAuthorizationId( - incrementedCardAuthorizationId: Optional - ) = incrementedCardAuthorizationId(incrementedCardAuthorizationId.getOrNull()) - - /** - * Sets [Builder.incrementedCardAuthorizationId] to an arbitrary JSON value. - * - * You should usually call [Builder.incrementedCardAuthorizationId] with a - * well-typed [String] value instead. This method is primarily for setting the field - * to an undocumented or not yet supported value. - */ - fun incrementedCardAuthorizationId( - incrementedCardAuthorizationId: JsonField - ) = apply { this.incrementedCardAuthorizationId = incrementedCardAuthorizationId } - /** * The merchant identifier (commonly abbreviated as MID) of the merchant the card is * transacting with. @@ -14711,59 +14475,6 @@ private constructor( this.physicalCardId = physicalCardId } - /** - * The declined amount in the minor unit of the transaction's presentment currency. - */ - fun presentmentAmount(presentmentAmount: Long) = - presentmentAmount(JsonField.of(presentmentAmount)) - - /** - * Sets [Builder.presentmentAmount] to an arbitrary JSON value. - * - * You should usually call [Builder.presentmentAmount] with a well-typed [Long] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun presentmentAmount(presentmentAmount: JsonField) = apply { - this.presentmentAmount = presentmentAmount - } - - /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - * presentment currency. - */ - fun presentmentCurrency(presentmentCurrency: String) = - presentmentCurrency(JsonField.of(presentmentCurrency)) - - /** - * Sets [Builder.presentmentCurrency] to an arbitrary JSON value. - * - * You should usually call [Builder.presentmentCurrency] with a well-typed [String] - * value instead. This method is primarily for setting the field to an undocumented - * or not yet supported value. - */ - fun presentmentCurrency(presentmentCurrency: JsonField) = apply { - this.presentmentCurrency = presentmentCurrency - } - - /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. - */ - fun processingCategory(processingCategory: ProcessingCategory) = - processingCategory(JsonField.of(processingCategory)) - - /** - * Sets [Builder.processingCategory] to an arbitrary JSON value. - * - * You should usually call [Builder.processingCategory] with a well-typed - * [ProcessingCategory] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun processingCategory(processingCategory: JsonField) = apply { - this.processingCategory = processingCategory - } - /** * The identifier of the Real-Time Decision sent to approve or decline this * transaction. @@ -14789,43 +14500,6 @@ private constructor( this.realTimeDecisionId = realTimeDecisionId } - /** - * This is present if a specific decline reason was given in the real-time decision. - */ - fun realTimeDecisionReason(realTimeDecisionReason: RealTimeDecisionReason?) = - realTimeDecisionReason(JsonField.ofNullable(realTimeDecisionReason)) - - /** - * Alias for calling [Builder.realTimeDecisionReason] with - * `realTimeDecisionReason.orElse(null)`. - */ - fun realTimeDecisionReason( - realTimeDecisionReason: Optional - ) = realTimeDecisionReason(realTimeDecisionReason.getOrNull()) - - /** - * Sets [Builder.realTimeDecisionReason] to an arbitrary JSON value. - * - * You should usually call [Builder.realTimeDecisionReason] with a well-typed - * [RealTimeDecisionReason] value instead. This method is primarily for setting the - * field to an undocumented or not yet supported value. - */ - fun realTimeDecisionReason( - realTimeDecisionReason: JsonField - ) = apply { this.realTimeDecisionReason = realTimeDecisionReason } - - /** Why the transaction was declined. */ - fun reason(reason: Reason) = reason(JsonField.of(reason)) - - /** - * Sets [Builder.reason] to an arbitrary JSON value. - * - * You should usually call [Builder.reason] with a well-typed [Reason] value - * instead. This method is primarily for setting the field to an undocumented or not - * yet supported value. - */ - fun reason(reason: JsonField) = apply { this.reason = reason } - /** * The terminal identifier (commonly abbreviated as TID) of the terminal the card is * transacting with. @@ -14846,6 +14520,21 @@ private constructor( this.terminalId = terminalId } + /** + * A constant representing the object's type. For this resource it will always be + * `card_balance_inquiry`. + */ + fun type(type: Type) = type(JsonField.of(type)) + + /** + * Sets [Builder.type] to an arbitrary JSON value. + * + * You should usually call [Builder.type] with a well-typed [Type] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun type(type: JsonField) = apply { this.type = type } + /** Fields related to verification of cardholder-provided values. */ fun verification(verification: Verification) = verification(JsonField.of(verification)) @@ -14884,22 +14573,18 @@ private constructor( } /** - * Returns an immutable instance of [CardDecline]. + * Returns an immutable instance of [CardBalanceInquiry]. * * Further updates to this [Builder] will not mutate the returned instance. * * The following fields are required: * ```java * .id() - * .actioner() * .additionalAmounts() - * .amount() + * .balance() * .cardPaymentId() * .currency() - * .declinedTransactionId() * .digitalWalletTokenId() - * .direction() - * .incrementedCardAuthorizationId() * .merchantAcceptorId() * .merchantCategoryCode() * .merchantCity() @@ -14911,33 +14596,22 @@ private constructor( * .networkIdentifiers() * .networkRiskScore() * .physicalCardId() - * .presentmentAmount() - * .presentmentCurrency() - * .processingCategory() * .realTimeDecisionId() - * .realTimeDecisionReason() - * .reason() * .terminalId() + * .type() * .verification() * ``` * * @throws IllegalStateException if any required field is unset. */ - fun build(): CardDecline = - CardDecline( + fun build(): CardBalanceInquiry = + CardBalanceInquiry( checkRequired("id", id), - checkRequired("actioner", actioner), checkRequired("additionalAmounts", additionalAmounts), - checkRequired("amount", amount), + checkRequired("balance", balance), checkRequired("cardPaymentId", cardPaymentId), checkRequired("currency", currency), - checkRequired("declinedTransactionId", declinedTransactionId), checkRequired("digitalWalletTokenId", digitalWalletTokenId), - checkRequired("direction", direction), - checkRequired( - "incrementedCardAuthorizationId", - incrementedCardAuthorizationId, - ), checkRequired("merchantAcceptorId", merchantAcceptorId), checkRequired("merchantCategoryCode", merchantCategoryCode), checkRequired("merchantCity", merchantCity), @@ -14949,13 +14623,9 @@ private constructor( checkRequired("networkIdentifiers", networkIdentifiers), checkRequired("networkRiskScore", networkRiskScore), checkRequired("physicalCardId", physicalCardId), - checkRequired("presentmentAmount", presentmentAmount), - checkRequired("presentmentCurrency", presentmentCurrency), - checkRequired("processingCategory", processingCategory), checkRequired("realTimeDecisionId", realTimeDecisionId), - checkRequired("realTimeDecisionReason", realTimeDecisionReason), - checkRequired("reason", reason), checkRequired("terminalId", terminalId), + checkRequired("type", type), checkRequired("verification", verification), additionalProperties.toMutableMap(), ) @@ -14963,21 +14633,17 @@ private constructor( private var validated: Boolean = false - fun validate(): CardDecline = apply { + fun validate(): CardBalanceInquiry = apply { if (validated) { return@apply } id() - actioner().validate() additionalAmounts().validate() - amount() + balance() cardPaymentId() currency().validate() - declinedTransactionId() digitalWalletTokenId() - direction().validate() - incrementedCardAuthorizationId() merchantAcceptorId() merchantCategoryCode() merchantCity() @@ -14989,13 +14655,9 @@ private constructor( networkIdentifiers().validate() networkRiskScore() physicalCardId() - presentmentAmount() - presentmentCurrency() - processingCategory().validate() realTimeDecisionId() - realTimeDecisionReason().ifPresent { it.validate() } - reason().validate() terminalId() + type().validate() verification().validate() validated = true } @@ -15017,15 +14679,11 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (if (id.asKnown().isPresent) 1 else 0) + - (actioner.asKnown().getOrNull()?.validity() ?: 0) + (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) + - (if (amount.asKnown().isPresent) 1 else 0) + + (if (balance.asKnown().isPresent) 1 else 0) + (if (cardPaymentId.asKnown().isPresent) 1 else 0) + (currency.asKnown().getOrNull()?.validity() ?: 0) + - (if (declinedTransactionId.asKnown().isPresent) 1 else 0) + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + - (direction.asKnown().getOrNull()?.validity() ?: 0) + - (if (incrementedCardAuthorizationId.asKnown().isPresent) 1 else 0) + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + (if (merchantCity.asKnown().isPresent) 1 else 0) + @@ -15037,165 +14695,11 @@ private constructor( (networkIdentifiers.asKnown().getOrNull()?.validity() ?: 0) + (if (networkRiskScore.asKnown().isPresent) 1 else 0) + (if (physicalCardId.asKnown().isPresent) 1 else 0) + - (if (presentmentAmount.asKnown().isPresent) 1 else 0) + - (if (presentmentCurrency.asKnown().isPresent) 1 else 0) + - (processingCategory.asKnown().getOrNull()?.validity() ?: 0) + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + - (realTimeDecisionReason.asKnown().getOrNull()?.validity() ?: 0) + - (reason.asKnown().getOrNull()?.validity() ?: 0) + (if (terminalId.asKnown().isPresent) 1 else 0) + + (type.asKnown().getOrNull()?.validity() ?: 0) + (verification.asKnown().getOrNull()?.validity() ?: 0) - /** - * Whether this authorization was approved by Increase, the card network through - * stand-in processing, or the user through a real-time decision. - */ - class Actioner @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 { - - /** This object was actioned by the user through a real-time decision. */ - @JvmField val USER = of("user") - - /** This object was actioned by Increase without user intervention. */ - @JvmField val INCREASE = of("increase") - - /** This object was actioned by the network, through stand-in processing. */ - @JvmField val NETWORK = of("network") - - @JvmStatic fun of(value: String) = Actioner(JsonField.of(value)) - } - - /** An enum containing [Actioner]'s known values. */ - enum class Known { - /** This object was actioned by the user through a real-time decision. */ - USER, - /** This object was actioned by Increase without user intervention. */ - INCREASE, - /** This object was actioned by the network, through stand-in processing. */ - NETWORK, - } - - /** - * An enum containing [Actioner]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Actioner] 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 { - /** This object was actioned by the user through a real-time decision. */ - USER, - /** This object was actioned by Increase without user intervention. */ - INCREASE, - /** This object was actioned by the network, through stand-in processing. */ - NETWORK, - /** - * An enum member indicating that [Actioner] 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) { - USER -> Value.USER - INCREASE -> Value.INCREASE - NETWORK -> Value.NETWORK - 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) { - USER -> Known.USER - INCREASE -> Known.INCREASE - NETWORK -> Known.NETWORK - else -> throw IncreaseInvalidDataException("Unknown Actioner: $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(): Actioner = 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 Actioner && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** * Additional amounts associated with the card authorization, such as ATM surcharges * fees. These are usually a subset of the `amount` field and are used to provide more @@ -18109,8 +17613,8 @@ private constructor( } /** - * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - * account currency. + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the account's + * currency. */ class Currency @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -18240,156 +17744,6 @@ private constructor( override fun toString() = value.toString() } - /** - * The direction describes the direction the funds will move, either from the cardholder - * to the merchant or from the merchant to the cardholder. - */ - class Direction @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 { - - /** A regular card authorization where funds are debited from the cardholder. */ - @JvmField val SETTLEMENT = of("settlement") - - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - @JvmField val REFUND = of("refund") - - @JvmStatic fun of(value: String) = Direction(JsonField.of(value)) - } - - /** An enum containing [Direction]'s known values. */ - enum class Known { - /** A regular card authorization where funds are debited from the cardholder. */ - SETTLEMENT, - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - REFUND, - } - - /** - * An enum containing [Direction]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [Direction] 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 { - /** A regular card authorization where funds are debited from the cardholder. */ - SETTLEMENT, - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - REFUND, - /** - * An enum member indicating that [Direction] 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) { - SETTLEMENT -> Value.SETTLEMENT - REFUND -> Value.REFUND - 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) { - SETTLEMENT -> Known.SETTLEMENT - REFUND -> Known.REFUND - else -> throw IncreaseInvalidDataException("Unknown Direction: $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(): Direction = 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 Direction && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - /** Fields specific to the `network`. */ class NetworkDetails @JsonCreator(mode = JsonCreator.Mode.DISABLED) @@ -20442,12 +19796,11 @@ private constructor( } /** - * The processing category describes the intent behind the authorization, such as - * whether it was used for bill payments or an automatic fuel dispenser. + * A constant representing the object's type. For this resource it will always be + * `card_balance_inquiry`. */ - class ProcessingCategory - @JsonCreator - private constructor(private val value: JsonField) : Enum { + class Type @JsonCreator private constructor(private val value: JsonField) : + Enum { /** * Returns this class instance's raw value. @@ -20461,155 +19814,29 @@ private constructor( companion object { - /** - * Account funding transactions are transactions used to e.g., fund an account - * or transfer funds between accounts. - */ - @JvmField val ACCOUNT_FUNDING = of("account_funding") + @JvmField val CARD_BALANCE_INQUIRY = of("card_balance_inquiry") - /** - * Automatic fuel dispenser authorizations occur when a card is used at a gas - * pump, prior to the actual transaction amount being known. They are followed - * by an advice message that updates the amount of the pending transaction. - */ - @JvmField val AUTOMATIC_FUEL_DISPENSER = of("automatic_fuel_dispenser") - - /** A transaction used to pay a bill. */ - @JvmField val BILL_PAYMENT = of("bill_payment") - - /** Original credit transactions are used to send money to a cardholder. */ - @JvmField val ORIGINAL_CREDIT = of("original_credit") - - /** A regular purchase. */ - @JvmField val PURCHASE = of("purchase") - - /** - * Quasi-cash transactions represent purchases of items which may be convertible - * to cash. - */ - @JvmField val QUASI_CASH = of("quasi_cash") - - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - @JvmField val REFUND = of("refund") - - /** - * Cash disbursement transactions are used to withdraw cash from an ATM or a - * point of sale. - */ - @JvmField val CASH_DISBURSEMENT = of("cash_disbursement") - - /** - * A balance inquiry transaction is used to check the balance of an account - * associated with a card. - */ - @JvmField val BALANCE_INQUIRY = of("balance_inquiry") - - /** The processing category is unknown. */ - @JvmField val UNKNOWN = of("unknown") - - @JvmStatic fun of(value: String) = ProcessingCategory(JsonField.of(value)) + @JvmStatic fun of(value: String) = Type(JsonField.of(value)) } - /** An enum containing [ProcessingCategory]'s known values. */ + /** An enum containing [Type]'s known values. */ enum class Known { - /** - * Account funding transactions are transactions used to e.g., fund an account - * or transfer funds between accounts. - */ - ACCOUNT_FUNDING, - /** - * Automatic fuel dispenser authorizations occur when a card is used at a gas - * pump, prior to the actual transaction amount being known. They are followed - * by an advice message that updates the amount of the pending transaction. - */ - AUTOMATIC_FUEL_DISPENSER, - /** A transaction used to pay a bill. */ - BILL_PAYMENT, - /** Original credit transactions are used to send money to a cardholder. */ - ORIGINAL_CREDIT, - /** A regular purchase. */ - PURCHASE, - /** - * Quasi-cash transactions represent purchases of items which may be convertible - * to cash. - */ - QUASI_CASH, - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - REFUND, - /** - * Cash disbursement transactions are used to withdraw cash from an ATM or a - * point of sale. - */ - CASH_DISBURSEMENT, - /** - * A balance inquiry transaction is used to check the balance of an account - * associated with a card. - */ - BALANCE_INQUIRY, - /** The processing category is unknown. */ - UNKNOWN, + CARD_BALANCE_INQUIRY } /** - * An enum containing [ProcessingCategory]'s known values, as well as an [_UNKNOWN] - * member. + * An enum containing [Type]'s known values, as well as an [_UNKNOWN] member. * - * An instance of [ProcessingCategory] can contain an unknown value in a couple of - * cases: + * An instance of [Type] 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 { + CARD_BALANCE_INQUIRY, /** - * Account funding transactions are transactions used to e.g., fund an account - * or transfer funds between accounts. - */ - ACCOUNT_FUNDING, - /** - * Automatic fuel dispenser authorizations occur when a card is used at a gas - * pump, prior to the actual transaction amount being known. They are followed - * by an advice message that updates the amount of the pending transaction. - */ - AUTOMATIC_FUEL_DISPENSER, - /** A transaction used to pay a bill. */ - BILL_PAYMENT, - /** Original credit transactions are used to send money to a cardholder. */ - ORIGINAL_CREDIT, - /** A regular purchase. */ - PURCHASE, - /** - * Quasi-cash transactions represent purchases of items which may be convertible - * to cash. - */ - QUASI_CASH, - /** - * A refund card authorization, sometimes referred to as a credit voucher - * authorization, where funds are credited to the cardholder. - */ - REFUND, - /** - * Cash disbursement transactions are used to withdraw cash from an ATM or a - * point of sale. - */ - CASH_DISBURSEMENT, - /** - * A balance inquiry transaction is used to check the balance of an account - * associated with a card. - */ - BALANCE_INQUIRY, - /** The processing category is unknown. */ - UNKNOWN, - /** - * An enum member indicating that [ProcessingCategory] was instantiated with an - * unknown value. + * An enum member indicating that [Type] was instantiated with an unknown value. */ _UNKNOWN, } @@ -20623,16 +19850,7 @@ private constructor( */ fun value(): Value = when (this) { - ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING - AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER - BILL_PAYMENT -> Value.BILL_PAYMENT - ORIGINAL_CREDIT -> Value.ORIGINAL_CREDIT - PURCHASE -> Value.PURCHASE - QUASI_CASH -> Value.QUASI_CASH - REFUND -> Value.REFUND - CASH_DISBURSEMENT -> Value.CASH_DISBURSEMENT - BALANCE_INQUIRY -> Value.BALANCE_INQUIRY - UNKNOWN -> Value.UNKNOWN + CARD_BALANCE_INQUIRY -> Value.CARD_BALANCE_INQUIRY else -> Value._UNKNOWN } @@ -20647,18 +19865,8 @@ private constructor( */ fun known(): Known = when (this) { - ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING - AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER - BILL_PAYMENT -> Known.BILL_PAYMENT - ORIGINAL_CREDIT -> Known.ORIGINAL_CREDIT - PURCHASE -> Known.PURCHASE - QUASI_CASH -> Known.QUASI_CASH - REFUND -> Known.REFUND - CASH_DISBURSEMENT -> Known.CASH_DISBURSEMENT - BALANCE_INQUIRY -> Known.BALANCE_INQUIRY - UNKNOWN -> Known.UNKNOWN - else -> - throw IncreaseInvalidDataException("Unknown ProcessingCategory: $value") + CARD_BALANCE_INQUIRY -> Known.CARD_BALANCE_INQUIRY + else -> throw IncreaseInvalidDataException("Unknown Type: $value") } /** @@ -20677,7 +19885,8502 @@ private constructor( private var validated: Boolean = false - fun validate(): ProcessingCategory = apply { + fun validate(): Type = 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 Type && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields related to verification of cardholder-provided values. */ + class Verification + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val cardVerificationCode: JsonField, + private val cardholderAddress: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("card_verification_code") + @ExcludeMissing + cardVerificationCode: JsonField = JsonMissing.of(), + @JsonProperty("cardholder_address") + @ExcludeMissing + cardholderAddress: JsonField = JsonMissing.of(), + ) : this(cardVerificationCode, cardholderAddress, mutableMapOf()) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + * + * @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 cardVerificationCode(): CardVerificationCode = + cardVerificationCode.getRequired("card_verification_code") + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + * + * @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 cardholderAddress(): CardholderAddress = + cardholderAddress.getRequired("cardholder_address") + + /** + * Returns the raw JSON value of [cardVerificationCode]. + * + * Unlike [cardVerificationCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("card_verification_code") + @ExcludeMissing + fun _cardVerificationCode(): JsonField = cardVerificationCode + + /** + * Returns the raw JSON value of [cardholderAddress]. + * + * Unlike [cardholderAddress], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("cardholder_address") + @ExcludeMissing + fun _cardholderAddress(): JsonField = cardholderAddress + + @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 [Verification]. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Verification]. */ + class Builder internal constructor() { + + private var cardVerificationCode: JsonField? = null + private var cardholderAddress: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(verification: Verification) = apply { + cardVerificationCode = verification.cardVerificationCode + cardholderAddress = verification.cardholderAddress + additionalProperties = verification.additionalProperties.toMutableMap() + } + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code + * on the back of the card. + */ + fun cardVerificationCode(cardVerificationCode: CardVerificationCode) = + cardVerificationCode(JsonField.of(cardVerificationCode)) + + /** + * Sets [Builder.cardVerificationCode] to an arbitrary JSON value. + * + * You should usually call [Builder.cardVerificationCode] with a well-typed + * [CardVerificationCode] value instead. This method is primarily for setting + * the field to an undocumented or not yet supported value. + */ + fun cardVerificationCode( + cardVerificationCode: JsonField + ) = apply { this.cardVerificationCode = cardVerificationCode } + + /** + * Cardholder address provided in the authorization request and the address on + * file we verified it against. + */ + fun cardholderAddress(cardholderAddress: CardholderAddress) = + cardholderAddress(JsonField.of(cardholderAddress)) + + /** + * Sets [Builder.cardholderAddress] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderAddress] with a well-typed + * [CardholderAddress] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun cardholderAddress(cardholderAddress: JsonField) = apply { + this.cardholderAddress = cardholderAddress + } + + 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 [Verification]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .cardVerificationCode() + * .cardholderAddress() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Verification = + Verification( + checkRequired("cardVerificationCode", cardVerificationCode), + checkRequired("cardholderAddress", cardholderAddress), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Verification = apply { + if (validated) { + return@apply + } + + cardVerificationCode().validate() + cardholderAddress().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 = + (cardVerificationCode.asKnown().getOrNull()?.validity() ?: 0) + + (cardholderAddress.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Fields related to verification of the Card Verification Code, a 3-digit code on + * the back of the card. + */ + class CardVerificationCode + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of() + ) : this(result, mutableMapOf()) + + /** + * The result of verifying the Card Verification Code. + * + * @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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardVerificationCode]. + * + * The following fields are required: + * ```java + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardVerificationCode]. */ + class Builder internal constructor() { + + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardVerificationCode: CardVerificationCode) = apply { + result = cardVerificationCode.result + additionalProperties = + cardVerificationCode.additionalProperties.toMutableMap() + } + + /** The result of verifying the Card Verification Code. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + 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 [CardVerificationCode]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardVerificationCode = + CardVerificationCode( + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardVerificationCode = apply { + if (validated) { + return@apply + } + + result().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 = (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The result of verifying the Card Verification Code. */ + class Result + @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 { + + /** + * No card verification code was provided in the authorization request. + */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** The card verification code matched the one on file. */ + @JvmField val MATCH = of("match") + + /** The card verification code did not match the one on file. */ + @JvmField val NO_MATCH = of("no_match") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] 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 { + /** + * No card verification code was provided in the authorization request. + */ + NOT_CHECKED, + /** The card verification code matched the one on file. */ + MATCH, + /** The card verification code did not match the one on file. */ + NO_MATCH, + /** + * An enum member indicating that [Result] 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) { + NOT_CHECKED -> Value.NOT_CHECKED + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + 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) { + NOT_CHECKED -> Known.NOT_CHECKED + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + else -> throw IncreaseInvalidDataException("Unknown Result: $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(): Result = 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 Result && 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 CardVerificationCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(result, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardVerificationCode{result=$result, additionalProperties=$additionalProperties}" + } + + /** + * Cardholder address provided in the authorization request and the address on file + * we verified it against. + */ + class CardholderAddress + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val actualLine1: JsonField, + private val actualPostalCode: JsonField, + private val providedLine1: JsonField, + private val providedPostalCode: JsonField, + private val result: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("actual_line1") + @ExcludeMissing + actualLine1: JsonField = JsonMissing.of(), + @JsonProperty("actual_postal_code") + @ExcludeMissing + actualPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("provided_line1") + @ExcludeMissing + providedLine1: JsonField = JsonMissing.of(), + @JsonProperty("provided_postal_code") + @ExcludeMissing + providedPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("result") + @ExcludeMissing + result: JsonField = JsonMissing.of(), + ) : this( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + mutableMapOf(), + ) + + /** + * Line 1 of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualLine1(): Optional = actualLine1.getOptional("actual_line1") + + /** + * The postal code of the address on file for the cardholder. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun actualPostalCode(): Optional = + actualPostalCode.getOptional("actual_postal_code") + + /** + * The cardholder address line 1 provided for verification in the authorization + * request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedLine1(): Optional = + providedLine1.getOptional("provided_line1") + + /** + * The postal code provided for verification in the authorization request. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun providedPostalCode(): Optional = + providedPostalCode.getOptional("provided_postal_code") + + /** + * The address verification result returned to the card network. + * + * @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 result(): Result = result.getRequired("result") + + /** + * Returns the raw JSON value of [actualLine1]. + * + * Unlike [actualLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_line1") + @ExcludeMissing + fun _actualLine1(): JsonField = actualLine1 + + /** + * Returns the raw JSON value of [actualPostalCode]. + * + * Unlike [actualPostalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("actual_postal_code") + @ExcludeMissing + fun _actualPostalCode(): JsonField = actualPostalCode + + /** + * Returns the raw JSON value of [providedLine1]. + * + * Unlike [providedLine1], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("provided_line1") + @ExcludeMissing + fun _providedLine1(): JsonField = providedLine1 + + /** + * Returns the raw JSON value of [providedPostalCode]. + * + * Unlike [providedPostalCode], this method doesn't throw if the JSON field has + * an unexpected type. + */ + @JsonProperty("provided_postal_code") + @ExcludeMissing + fun _providedPostalCode(): JsonField = providedPostalCode + + /** + * Returns the raw JSON value of [result]. + * + * Unlike [result], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("result") + @ExcludeMissing + fun _result(): JsonField = result + + @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 + * [CardholderAddress]. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderAddress]. */ + class Builder internal constructor() { + + private var actualLine1: JsonField? = null + private var actualPostalCode: JsonField? = null + private var providedLine1: JsonField? = null + private var providedPostalCode: JsonField? = null + private var result: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(cardholderAddress: CardholderAddress) = apply { + actualLine1 = cardholderAddress.actualLine1 + actualPostalCode = cardholderAddress.actualPostalCode + providedLine1 = cardholderAddress.providedLine1 + providedPostalCode = cardholderAddress.providedPostalCode + result = cardholderAddress.result + additionalProperties = + cardholderAddress.additionalProperties.toMutableMap() + } + + /** Line 1 of the address on file for the cardholder. */ + fun actualLine1(actualLine1: String?) = + actualLine1(JsonField.ofNullable(actualLine1)) + + /** + * Alias for calling [Builder.actualLine1] with `actualLine1.orElse(null)`. + */ + fun actualLine1(actualLine1: Optional) = + actualLine1(actualLine1.getOrNull()) + + /** + * Sets [Builder.actualLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.actualLine1] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun actualLine1(actualLine1: JsonField) = apply { + this.actualLine1 = actualLine1 + } + + /** The postal code of the address on file for the cardholder. */ + fun actualPostalCode(actualPostalCode: String?) = + actualPostalCode(JsonField.ofNullable(actualPostalCode)) + + /** + * Alias for calling [Builder.actualPostalCode] with + * `actualPostalCode.orElse(null)`. + */ + fun actualPostalCode(actualPostalCode: Optional) = + actualPostalCode(actualPostalCode.getOrNull()) + + /** + * Sets [Builder.actualPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.actualPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun actualPostalCode(actualPostalCode: JsonField) = apply { + this.actualPostalCode = actualPostalCode + } + + /** + * The cardholder address line 1 provided for verification in the + * authorization request. + */ + fun providedLine1(providedLine1: String?) = + providedLine1(JsonField.ofNullable(providedLine1)) + + /** + * Alias for calling [Builder.providedLine1] with + * `providedLine1.orElse(null)`. + */ + fun providedLine1(providedLine1: Optional) = + providedLine1(providedLine1.getOrNull()) + + /** + * Sets [Builder.providedLine1] to an arbitrary JSON value. + * + * You should usually call [Builder.providedLine1] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedLine1(providedLine1: JsonField) = apply { + this.providedLine1 = providedLine1 + } + + /** + * The postal code provided for verification in the authorization request. + */ + fun providedPostalCode(providedPostalCode: String?) = + providedPostalCode(JsonField.ofNullable(providedPostalCode)) + + /** + * Alias for calling [Builder.providedPostalCode] with + * `providedPostalCode.orElse(null)`. + */ + fun providedPostalCode(providedPostalCode: Optional) = + providedPostalCode(providedPostalCode.getOrNull()) + + /** + * Sets [Builder.providedPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.providedPostalCode] with a well-typed + * [String] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun providedPostalCode(providedPostalCode: JsonField) = apply { + this.providedPostalCode = providedPostalCode + } + + /** The address verification result returned to the card network. */ + fun result(result: Result) = result(JsonField.of(result)) + + /** + * Sets [Builder.result] to an arbitrary JSON value. + * + * You should usually call [Builder.result] with a well-typed [Result] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun result(result: JsonField) = apply { this.result = result } + + 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 [CardholderAddress]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .actualLine1() + * .actualPostalCode() + * .providedLine1() + * .providedPostalCode() + * .result() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardholderAddress = + CardholderAddress( + checkRequired("actualLine1", actualLine1), + checkRequired("actualPostalCode", actualPostalCode), + checkRequired("providedLine1", providedLine1), + checkRequired("providedPostalCode", providedPostalCode), + checkRequired("result", result), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardholderAddress = apply { + if (validated) { + return@apply + } + + actualLine1() + actualPostalCode() + providedLine1() + providedPostalCode() + result().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 (actualLine1.asKnown().isPresent) 1 else 0) + + (if (actualPostalCode.asKnown().isPresent) 1 else 0) + + (if (providedLine1.asKnown().isPresent) 1 else 0) + + (if (providedPostalCode.asKnown().isPresent) 1 else 0) + + (result.asKnown().getOrNull()?.validity() ?: 0) + + /** The address verification result returned to the card network. */ + class Result + @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 { + + /** No address information was provided in the authorization request. */ + @JvmField val NOT_CHECKED = of("not_checked") + + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = + of("postal_code_match_address_no_match") + + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + @JvmField + val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = + of("postal_code_no_match_address_match") + + /** Postal code and street address match. */ + @JvmField val MATCH = of("match") + + /** Postal code and street address do not match. */ + @JvmField val NO_MATCH = of("no_match") + + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) + } + + /** An enum containing [Result]'s known values. */ + enum class Known { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + } + + /** + * An enum containing [Result]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [Result] 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 { + /** No address information was provided in the authorization request. */ + NOT_CHECKED, + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, + /** Postal code and street address match. */ + MATCH, + /** Postal code and street address do not match. */ + NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, + /** + * An enum member indicating that [Result] 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) { + NOT_CHECKED -> Value.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + 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) { + NOT_CHECKED -> Known.NOT_CHECKED + POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> + Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH + POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> + Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED + else -> throw IncreaseInvalidDataException("Unknown Result: $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(): Result = 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 Result && 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 CardholderAddress && + actualLine1 == other.actualLine1 && + actualPostalCode == other.actualPostalCode && + providedLine1 == other.providedLine1 && + providedPostalCode == other.providedPostalCode && + result == other.result && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + actualLine1, + actualPostalCode, + providedLine1, + providedPostalCode, + result, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardholderAddress{actualLine1=$actualLine1, actualPostalCode=$actualPostalCode, providedLine1=$providedLine1, providedPostalCode=$providedPostalCode, result=$result, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Verification && + cardVerificationCode == other.cardVerificationCode && + cardholderAddress == other.cardholderAddress && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(cardVerificationCode, cardholderAddress, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Verification{cardVerificationCode=$cardVerificationCode, cardholderAddress=$cardholderAddress, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardBalanceInquiry && + id == other.id && + additionalAmounts == other.additionalAmounts && + balance == other.balance && + cardPaymentId == other.cardPaymentId && + currency == other.currency && + digitalWalletTokenId == other.digitalWalletTokenId && + merchantAcceptorId == other.merchantAcceptorId && + merchantCategoryCode == other.merchantCategoryCode && + merchantCity == other.merchantCity && + merchantCountry == other.merchantCountry && + merchantDescriptor == other.merchantDescriptor && + merchantPostalCode == other.merchantPostalCode && + merchantState == other.merchantState && + networkDetails == other.networkDetails && + networkIdentifiers == other.networkIdentifiers && + networkRiskScore == other.networkRiskScore && + physicalCardId == other.physicalCardId && + realTimeDecisionId == other.realTimeDecisionId && + terminalId == other.terminalId && + type == other.type && + verification == other.verification && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + id, + additionalAmounts, + balance, + cardPaymentId, + currency, + digitalWalletTokenId, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + realTimeDecisionId, + terminalId, + type, + verification, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardBalanceInquiry{id=$id, additionalAmounts=$additionalAmounts, balance=$balance, cardPaymentId=$cardPaymentId, currency=$currency, digitalWalletTokenId=$digitalWalletTokenId, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, realTimeDecisionId=$realTimeDecisionId, terminalId=$terminalId, type=$type, verification=$verification, additionalProperties=$additionalProperties}" + } + + /** + * A Card Decline object. This field will be present in the JSON response if and only if + * `category` is equal to `card_decline`. + */ + class CardDecline + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val id: JsonField, + private val actioner: JsonField, + private val additionalAmounts: JsonField, + private val amount: JsonField, + private val cardPaymentId: JsonField, + private val currency: JsonField, + private val declinedTransactionId: JsonField, + private val digitalWalletTokenId: JsonField, + private val direction: JsonField, + private val incrementedCardAuthorizationId: JsonField, + private val merchantAcceptorId: JsonField, + private val merchantCategoryCode: JsonField, + private val merchantCity: JsonField, + private val merchantCountry: JsonField, + private val merchantDescriptor: JsonField, + private val merchantPostalCode: JsonField, + private val merchantState: JsonField, + private val networkDetails: JsonField, + private val networkIdentifiers: JsonField, + private val networkRiskScore: JsonField, + private val physicalCardId: JsonField, + private val presentmentAmount: JsonField, + private val presentmentCurrency: JsonField, + private val processingCategory: JsonField, + private val realTimeDecisionId: JsonField, + private val realTimeDecisionReason: JsonField, + private val reason: JsonField, + private val terminalId: JsonField, + private val verification: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("id") @ExcludeMissing id: JsonField = JsonMissing.of(), + @JsonProperty("actioner") + @ExcludeMissing + actioner: JsonField = JsonMissing.of(), + @JsonProperty("additional_amounts") + @ExcludeMissing + additionalAmounts: JsonField = JsonMissing.of(), + @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(), + @JsonProperty("card_payment_id") + @ExcludeMissing + cardPaymentId: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + @JsonProperty("declined_transaction_id") + @ExcludeMissing + declinedTransactionId: JsonField = JsonMissing.of(), + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + digitalWalletTokenId: JsonField = JsonMissing.of(), + @JsonProperty("direction") + @ExcludeMissing + direction: JsonField = JsonMissing.of(), + @JsonProperty("incremented_card_authorization_id") + @ExcludeMissing + incrementedCardAuthorizationId: JsonField = JsonMissing.of(), + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + merchantAcceptorId: JsonField = JsonMissing.of(), + @JsonProperty("merchant_category_code") + @ExcludeMissing + merchantCategoryCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_city") + @ExcludeMissing + merchantCity: JsonField = JsonMissing.of(), + @JsonProperty("merchant_country") + @ExcludeMissing + merchantCountry: JsonField = JsonMissing.of(), + @JsonProperty("merchant_descriptor") + @ExcludeMissing + merchantDescriptor: JsonField = JsonMissing.of(), + @JsonProperty("merchant_postal_code") + @ExcludeMissing + merchantPostalCode: JsonField = JsonMissing.of(), + @JsonProperty("merchant_state") + @ExcludeMissing + merchantState: JsonField = JsonMissing.of(), + @JsonProperty("network_details") + @ExcludeMissing + networkDetails: JsonField = JsonMissing.of(), + @JsonProperty("network_identifiers") + @ExcludeMissing + networkIdentifiers: JsonField = JsonMissing.of(), + @JsonProperty("network_risk_score") + @ExcludeMissing + networkRiskScore: JsonField = JsonMissing.of(), + @JsonProperty("physical_card_id") + @ExcludeMissing + physicalCardId: JsonField = JsonMissing.of(), + @JsonProperty("presentment_amount") + @ExcludeMissing + presentmentAmount: JsonField = JsonMissing.of(), + @JsonProperty("presentment_currency") + @ExcludeMissing + presentmentCurrency: JsonField = JsonMissing.of(), + @JsonProperty("processing_category") + @ExcludeMissing + processingCategory: JsonField = JsonMissing.of(), + @JsonProperty("real_time_decision_id") + @ExcludeMissing + realTimeDecisionId: JsonField = JsonMissing.of(), + @JsonProperty("real_time_decision_reason") + @ExcludeMissing + realTimeDecisionReason: JsonField = JsonMissing.of(), + @JsonProperty("reason") + @ExcludeMissing + reason: JsonField = JsonMissing.of(), + @JsonProperty("terminal_id") + @ExcludeMissing + terminalId: JsonField = JsonMissing.of(), + @JsonProperty("verification") + @ExcludeMissing + verification: JsonField = JsonMissing.of(), + ) : this( + id, + actioner, + additionalAmounts, + amount, + cardPaymentId, + currency, + declinedTransactionId, + digitalWalletTokenId, + direction, + incrementedCardAuthorizationId, + merchantAcceptorId, + merchantCategoryCode, + merchantCity, + merchantCountry, + merchantDescriptor, + merchantPostalCode, + merchantState, + networkDetails, + networkIdentifiers, + networkRiskScore, + physicalCardId, + presentmentAmount, + presentmentCurrency, + processingCategory, + realTimeDecisionId, + realTimeDecisionReason, + reason, + terminalId, + verification, + mutableMapOf(), + ) + + /** + * The Card Decline identifier. + * + * @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 id(): String = id.getRequired("id") + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + * + * @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 actioner(): Actioner = actioner.getRequired("actioner") + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + * + * @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 additionalAmounts(): AdditionalAmounts = + additionalAmounts.getRequired("additional_amounts") + + /** + * The declined amount in the minor unit of the destination account currency. For + * dollars, for example, this is cents. + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The ID of the Card Payment this transaction belongs to. + * + * @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 cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account 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 currency(): Currency = currency.getRequired("currency") + + /** + * The identifier of the declined transaction created for this Card Decline. + * + * @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 declinedTransactionId(): String = + declinedTransactionId.getRequired("declined_transaction_id") + + /** + * If the authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun digitalWalletTokenId(): Optional = + digitalWalletTokenId.getOptional("digital_wallet_token_id") + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + * + * @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 direction(): Direction = direction.getRequired("direction") + + /** + * The identifier of the card authorization this request attempted to incrementally + * authorize. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun incrementedCardAuthorizationId(): Optional = + incrementedCardAuthorizationId.getOptional("incremented_card_authorization_id") + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + * + * @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 merchantAcceptorId(): String = + merchantAcceptorId.getRequired("merchant_acceptor_id") + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is + * transacting with. + * + * @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 merchantCategoryCode(): String = + merchantCategoryCode.getRequired("merchant_category_code") + + /** + * The city the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantCity(): Optional = merchantCity.getOptional("merchant_city") + + /** + * The country the merchant resides in. + * + * @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 merchantCountry(): String = merchantCountry.getRequired("merchant_country") + + /** + * The merchant descriptor of the merchant the card is transacting with. + * + * @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 merchantDescriptor(): String = merchantDescriptor.getRequired("merchant_descriptor") + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit ZIP + * code, where the first 5 and last 4 are separated by a dash. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantPostalCode(): Optional = + merchantPostalCode.getOptional("merchant_postal_code") + + /** + * The state the merchant resides in. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun merchantState(): Optional = merchantState.getOptional("merchant_state") + + /** + * Fields specific to the `network`. + * + * @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 networkDetails(): NetworkDetails = networkDetails.getRequired("network_details") + + /** + * Network-specific identifiers for a specific request or transaction. + * + * @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 networkIdentifiers(): NetworkIdentifiers = + networkIdentifiers.getRequired("network_identifiers") + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the score + * is from 0 to 999, where 999 is the riskiest. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun networkRiskScore(): Optional = + networkRiskScore.getOptional("network_risk_score") + + /** + * If the authorization was made in-person with a physical card, the Physical Card that + * was used. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun physicalCardId(): Optional = physicalCardId.getOptional("physical_card_id") + + /** + * The declined amount in the minor unit of the transaction's presentment 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 presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment 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 presentmentCurrency(): String = + presentmentCurrency.getRequired("presentment_currency") + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + * + * @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 processingCategory(): ProcessingCategory = + processingCategory.getRequired("processing_category") + + /** + * The identifier of the Real-Time Decision sent to approve or decline this transaction. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun realTimeDecisionId(): Optional = + realTimeDecisionId.getOptional("real_time_decision_id") + + /** + * This is present if a specific decline reason was given in the real-time decision. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun realTimeDecisionReason(): Optional = + realTimeDecisionReason.getOptional("real_time_decision_reason") + + /** + * Why the transaction was declined. + * + * @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 reason(): Reason = reason.getRequired("reason") + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun terminalId(): Optional = terminalId.getOptional("terminal_id") + + /** + * Fields related to verification of cardholder-provided values. + * + * @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 verification(): Verification = verification.getRequired("verification") + + /** + * Returns the raw JSON value of [id]. + * + * Unlike [id], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("id") @ExcludeMissing fun _id(): JsonField = id + + /** + * Returns the raw JSON value of [actioner]. + * + * Unlike [actioner], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("actioner") + @ExcludeMissing + fun _actioner(): JsonField = actioner + + /** + * Returns the raw JSON value of [additionalAmounts]. + * + * Unlike [additionalAmounts], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("additional_amounts") + @ExcludeMissing + fun _additionalAmounts(): JsonField = additionalAmounts + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [cardPaymentId]. + * + * Unlike [cardPaymentId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("card_payment_id") + @ExcludeMissing + fun _cardPaymentId(): JsonField = cardPaymentId + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + /** + * Returns the raw JSON value of [declinedTransactionId]. + * + * Unlike [declinedTransactionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("declined_transaction_id") + @ExcludeMissing + fun _declinedTransactionId(): JsonField = declinedTransactionId + + /** + * Returns the raw JSON value of [digitalWalletTokenId]. + * + * Unlike [digitalWalletTokenId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("digital_wallet_token_id") + @ExcludeMissing + fun _digitalWalletTokenId(): JsonField = digitalWalletTokenId + + /** + * Returns the raw JSON value of [direction]. + * + * Unlike [direction], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("direction") + @ExcludeMissing + fun _direction(): JsonField = direction + + /** + * Returns the raw JSON value of [incrementedCardAuthorizationId]. + * + * Unlike [incrementedCardAuthorizationId], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("incremented_card_authorization_id") + @ExcludeMissing + fun _incrementedCardAuthorizationId(): JsonField = + incrementedCardAuthorizationId + + /** + * Returns the raw JSON value of [merchantAcceptorId]. + * + * Unlike [merchantAcceptorId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_acceptor_id") + @ExcludeMissing + fun _merchantAcceptorId(): JsonField = merchantAcceptorId + + /** + * Returns the raw JSON value of [merchantCategoryCode]. + * + * Unlike [merchantCategoryCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_category_code") + @ExcludeMissing + fun _merchantCategoryCode(): JsonField = merchantCategoryCode + + /** + * Returns the raw JSON value of [merchantCity]. + * + * Unlike [merchantCity], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("merchant_city") + @ExcludeMissing + fun _merchantCity(): JsonField = merchantCity + + /** + * Returns the raw JSON value of [merchantCountry]. + * + * Unlike [merchantCountry], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_country") + @ExcludeMissing + fun _merchantCountry(): JsonField = merchantCountry + + /** + * Returns the raw JSON value of [merchantDescriptor]. + * + * Unlike [merchantDescriptor], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_descriptor") + @ExcludeMissing + fun _merchantDescriptor(): JsonField = merchantDescriptor + + /** + * Returns the raw JSON value of [merchantPostalCode]. + * + * Unlike [merchantPostalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("merchant_postal_code") + @ExcludeMissing + fun _merchantPostalCode(): JsonField = merchantPostalCode + + /** + * Returns the raw JSON value of [merchantState]. + * + * Unlike [merchantState], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("merchant_state") + @ExcludeMissing + fun _merchantState(): JsonField = merchantState + + /** + * Returns the raw JSON value of [networkDetails]. + * + * Unlike [networkDetails], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_details") + @ExcludeMissing + fun _networkDetails(): JsonField = networkDetails + + /** + * Returns the raw JSON value of [networkIdentifiers]. + * + * Unlike [networkIdentifiers], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_identifiers") + @ExcludeMissing + fun _networkIdentifiers(): JsonField = networkIdentifiers + + /** + * Returns the raw JSON value of [networkRiskScore]. + * + * Unlike [networkRiskScore], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("network_risk_score") + @ExcludeMissing + fun _networkRiskScore(): JsonField = networkRiskScore + + /** + * Returns the raw JSON value of [physicalCardId]. + * + * Unlike [physicalCardId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("physical_card_id") + @ExcludeMissing + fun _physicalCardId(): JsonField = physicalCardId + + /** + * Returns the raw JSON value of [presentmentAmount]. + * + * Unlike [presentmentAmount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_amount") + @ExcludeMissing + fun _presentmentAmount(): JsonField = presentmentAmount + + /** + * Returns the raw JSON value of [presentmentCurrency]. + * + * Unlike [presentmentCurrency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("presentment_currency") + @ExcludeMissing + fun _presentmentCurrency(): JsonField = presentmentCurrency + + /** + * Returns the raw JSON value of [processingCategory]. + * + * Unlike [processingCategory], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("processing_category") + @ExcludeMissing + fun _processingCategory(): JsonField = processingCategory + + /** + * Returns the raw JSON value of [realTimeDecisionId]. + * + * Unlike [realTimeDecisionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_decision_id") + @ExcludeMissing + fun _realTimeDecisionId(): JsonField = realTimeDecisionId + + /** + * Returns the raw JSON value of [realTimeDecisionReason]. + * + * Unlike [realTimeDecisionReason], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("real_time_decision_reason") + @ExcludeMissing + fun _realTimeDecisionReason(): JsonField = + realTimeDecisionReason + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + /** + * Returns the raw JSON value of [terminalId]. + * + * Unlike [terminalId], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("terminal_id") + @ExcludeMissing + fun _terminalId(): JsonField = terminalId + + /** + * Returns the raw JSON value of [verification]. + * + * Unlike [verification], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("verification") + @ExcludeMissing + fun _verification(): JsonField = verification + + @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 [CardDecline]. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .declinedTransactionId() + * .digitalWalletTokenId() + * .direction() + * .incrementedCardAuthorizationId() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .realTimeDecisionReason() + * .reason() + * .terminalId() + * .verification() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardDecline]. */ + class Builder internal constructor() { + + private var id: JsonField? = null + private var actioner: JsonField? = null + private var additionalAmounts: JsonField? = null + private var amount: JsonField? = null + private var cardPaymentId: JsonField? = null + private var currency: JsonField? = null + private var declinedTransactionId: JsonField? = null + private var digitalWalletTokenId: JsonField? = null + private var direction: JsonField? = null + private var incrementedCardAuthorizationId: JsonField? = null + private var merchantAcceptorId: JsonField? = null + private var merchantCategoryCode: JsonField? = null + private var merchantCity: JsonField? = null + private var merchantCountry: JsonField? = null + private var merchantDescriptor: JsonField? = null + private var merchantPostalCode: JsonField? = null + private var merchantState: JsonField? = null + private var networkDetails: JsonField? = null + private var networkIdentifiers: JsonField? = null + private var networkRiskScore: JsonField? = null + private var physicalCardId: JsonField? = null + private var presentmentAmount: JsonField? = null + private var presentmentCurrency: JsonField? = null + private var processingCategory: JsonField? = null + private var realTimeDecisionId: JsonField? = null + private var realTimeDecisionReason: JsonField? = null + private var reason: JsonField? = null + private var terminalId: JsonField? = null + private var verification: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(cardDecline: CardDecline) = apply { + id = cardDecline.id + actioner = cardDecline.actioner + additionalAmounts = cardDecline.additionalAmounts + amount = cardDecline.amount + cardPaymentId = cardDecline.cardPaymentId + currency = cardDecline.currency + declinedTransactionId = cardDecline.declinedTransactionId + digitalWalletTokenId = cardDecline.digitalWalletTokenId + direction = cardDecline.direction + incrementedCardAuthorizationId = cardDecline.incrementedCardAuthorizationId + merchantAcceptorId = cardDecline.merchantAcceptorId + merchantCategoryCode = cardDecline.merchantCategoryCode + merchantCity = cardDecline.merchantCity + merchantCountry = cardDecline.merchantCountry + merchantDescriptor = cardDecline.merchantDescriptor + merchantPostalCode = cardDecline.merchantPostalCode + merchantState = cardDecline.merchantState + networkDetails = cardDecline.networkDetails + networkIdentifiers = cardDecline.networkIdentifiers + networkRiskScore = cardDecline.networkRiskScore + physicalCardId = cardDecline.physicalCardId + presentmentAmount = cardDecline.presentmentAmount + presentmentCurrency = cardDecline.presentmentCurrency + processingCategory = cardDecline.processingCategory + realTimeDecisionId = cardDecline.realTimeDecisionId + realTimeDecisionReason = cardDecline.realTimeDecisionReason + reason = cardDecline.reason + terminalId = cardDecline.terminalId + verification = cardDecline.verification + additionalProperties = cardDecline.additionalProperties.toMutableMap() + } + + /** The Card Decline identifier. */ + fun id(id: String) = id(JsonField.of(id)) + + /** + * Sets [Builder.id] to an arbitrary JSON value. + * + * You should usually call [Builder.id] with a well-typed [String] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun id(id: JsonField) = apply { this.id = id } + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + */ + fun actioner(actioner: Actioner) = actioner(JsonField.of(actioner)) + + /** + * Sets [Builder.actioner] to an arbitrary JSON value. + * + * You should usually call [Builder.actioner] with a well-typed [Actioner] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun actioner(actioner: JsonField) = apply { this.actioner = actioner } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide + * more detailed information about the transaction. + */ + fun additionalAmounts(additionalAmounts: AdditionalAmounts) = + additionalAmounts(JsonField.of(additionalAmounts)) + + /** + * Sets [Builder.additionalAmounts] to an arbitrary JSON value. + * + * You should usually call [Builder.additionalAmounts] with a well-typed + * [AdditionalAmounts] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun additionalAmounts(additionalAmounts: JsonField) = apply { + this.additionalAmounts = additionalAmounts + } + + /** + * The declined amount in the minor unit of the destination account currency. For + * dollars, for example, this is cents. + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** The ID of the Card Payment this transaction belongs to. */ + fun cardPaymentId(cardPaymentId: String) = + cardPaymentId(JsonField.of(cardPaymentId)) + + /** + * Sets [Builder.cardPaymentId] to an arbitrary JSON value. + * + * You should usually call [Builder.cardPaymentId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun cardPaymentId(cardPaymentId: JsonField) = apply { + this.cardPaymentId = cardPaymentId + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + fun currency(currency: Currency) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [Currency] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun currency(currency: JsonField) = apply { this.currency = currency } + + /** The identifier of the declined transaction created for this Card Decline. */ + fun declinedTransactionId(declinedTransactionId: String) = + declinedTransactionId(JsonField.of(declinedTransactionId)) + + /** + * Sets [Builder.declinedTransactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.declinedTransactionId] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun declinedTransactionId(declinedTransactionId: JsonField) = apply { + this.declinedTransactionId = declinedTransactionId + } + + /** + * If the authorization was made via a Digital Wallet Token (such as an Apple Pay + * purchase), the identifier of the token that was used. + */ + fun digitalWalletTokenId(digitalWalletTokenId: String?) = + digitalWalletTokenId(JsonField.ofNullable(digitalWalletTokenId)) + + /** + * Alias for calling [Builder.digitalWalletTokenId] with + * `digitalWalletTokenId.orElse(null)`. + */ + fun digitalWalletTokenId(digitalWalletTokenId: Optional) = + digitalWalletTokenId(digitalWalletTokenId.getOrNull()) + + /** + * Sets [Builder.digitalWalletTokenId] to an arbitrary JSON value. + * + * You should usually call [Builder.digitalWalletTokenId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply { + this.digitalWalletTokenId = digitalWalletTokenId + } + + /** + * The direction describes the direction the funds will move, either from the + * cardholder to the merchant or from the merchant to the cardholder. + */ + fun direction(direction: Direction) = direction(JsonField.of(direction)) + + /** + * Sets [Builder.direction] to an arbitrary JSON value. + * + * You should usually call [Builder.direction] with a well-typed [Direction] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun direction(direction: JsonField) = apply { + this.direction = direction + } + + /** + * The identifier of the card authorization this request attempted to incrementally + * authorize. + */ + fun incrementedCardAuthorizationId(incrementedCardAuthorizationId: String?) = + incrementedCardAuthorizationId( + JsonField.ofNullable(incrementedCardAuthorizationId) + ) + + /** + * Alias for calling [Builder.incrementedCardAuthorizationId] with + * `incrementedCardAuthorizationId.orElse(null)`. + */ + fun incrementedCardAuthorizationId( + incrementedCardAuthorizationId: Optional + ) = incrementedCardAuthorizationId(incrementedCardAuthorizationId.getOrNull()) + + /** + * Sets [Builder.incrementedCardAuthorizationId] to an arbitrary JSON value. + * + * You should usually call [Builder.incrementedCardAuthorizationId] with a + * well-typed [String] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun incrementedCardAuthorizationId( + incrementedCardAuthorizationId: JsonField + ) = apply { this.incrementedCardAuthorizationId = incrementedCardAuthorizationId } + + /** + * The merchant identifier (commonly abbreviated as MID) of the merchant the card is + * transacting with. + */ + fun merchantAcceptorId(merchantAcceptorId: String) = + merchantAcceptorId(JsonField.of(merchantAcceptorId)) + + /** + * Sets [Builder.merchantAcceptorId] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantAcceptorId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantAcceptorId(merchantAcceptorId: JsonField) = apply { + this.merchantAcceptorId = merchantAcceptorId + } + + /** + * The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card + * is transacting with. + */ + fun merchantCategoryCode(merchantCategoryCode: String) = + merchantCategoryCode(JsonField.of(merchantCategoryCode)) + + /** + * Sets [Builder.merchantCategoryCode] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCategoryCode] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply { + this.merchantCategoryCode = merchantCategoryCode + } + + /** The city the merchant resides in. */ + fun merchantCity(merchantCity: String?) = + merchantCity(JsonField.ofNullable(merchantCity)) + + /** Alias for calling [Builder.merchantCity] with `merchantCity.orElse(null)`. */ + fun merchantCity(merchantCity: Optional) = + merchantCity(merchantCity.getOrNull()) + + /** + * Sets [Builder.merchantCity] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCity] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun merchantCity(merchantCity: JsonField) = apply { + this.merchantCity = merchantCity + } + + /** The country the merchant resides in. */ + fun merchantCountry(merchantCountry: String) = + merchantCountry(JsonField.of(merchantCountry)) + + /** + * Sets [Builder.merchantCountry] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantCountry] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantCountry(merchantCountry: JsonField) = apply { + this.merchantCountry = merchantCountry + } + + /** The merchant descriptor of the merchant the card is transacting with. */ + fun merchantDescriptor(merchantDescriptor: String) = + merchantDescriptor(JsonField.of(merchantDescriptor)) + + /** + * Sets [Builder.merchantDescriptor] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantDescriptor] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantDescriptor(merchantDescriptor: JsonField) = apply { + this.merchantDescriptor = merchantDescriptor + } + + /** + * The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + * ZIP code, where the first 5 and last 4 are separated by a dash. + */ + fun merchantPostalCode(merchantPostalCode: String?) = + merchantPostalCode(JsonField.ofNullable(merchantPostalCode)) + + /** + * Alias for calling [Builder.merchantPostalCode] with + * `merchantPostalCode.orElse(null)`. + */ + fun merchantPostalCode(merchantPostalCode: Optional) = + merchantPostalCode(merchantPostalCode.getOrNull()) + + /** + * Sets [Builder.merchantPostalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantPostalCode] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun merchantPostalCode(merchantPostalCode: JsonField) = apply { + this.merchantPostalCode = merchantPostalCode + } + + /** The state the merchant resides in. */ + fun merchantState(merchantState: String?) = + merchantState(JsonField.ofNullable(merchantState)) + + /** Alias for calling [Builder.merchantState] with `merchantState.orElse(null)`. */ + fun merchantState(merchantState: Optional) = + merchantState(merchantState.getOrNull()) + + /** + * Sets [Builder.merchantState] to an arbitrary JSON value. + * + * You should usually call [Builder.merchantState] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun merchantState(merchantState: JsonField) = apply { + this.merchantState = merchantState + } + + /** Fields specific to the `network`. */ + fun networkDetails(networkDetails: NetworkDetails) = + networkDetails(JsonField.of(networkDetails)) + + /** + * Sets [Builder.networkDetails] to an arbitrary JSON value. + * + * You should usually call [Builder.networkDetails] with a well-typed + * [NetworkDetails] value instead. This method is primarily for setting the field to + * an undocumented or not yet supported value. + */ + fun networkDetails(networkDetails: JsonField) = apply { + this.networkDetails = networkDetails + } + + /** Network-specific identifiers for a specific request or transaction. */ + fun networkIdentifiers(networkIdentifiers: NetworkIdentifiers) = + networkIdentifiers(JsonField.of(networkIdentifiers)) + + /** + * Sets [Builder.networkIdentifiers] to an arbitrary JSON value. + * + * You should usually call [Builder.networkIdentifiers] with a well-typed + * [NetworkIdentifiers] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun networkIdentifiers(networkIdentifiers: JsonField) = apply { + this.networkIdentifiers = networkIdentifiers + } + + /** + * The risk score generated by the card network. For Visa this is the Visa Advanced + * Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse the + * score is from 0 to 999, where 999 is the riskiest. + */ + fun networkRiskScore(networkRiskScore: Long?) = + networkRiskScore(JsonField.ofNullable(networkRiskScore)) + + /** + * Alias for [Builder.networkRiskScore]. + * + * This unboxed primitive overload exists for backwards compatibility. + */ + fun networkRiskScore(networkRiskScore: Long) = + networkRiskScore(networkRiskScore as Long?) + + /** + * Alias for calling [Builder.networkRiskScore] with + * `networkRiskScore.orElse(null)`. + */ + fun networkRiskScore(networkRiskScore: Optional) = + networkRiskScore(networkRiskScore.getOrNull()) + + /** + * Sets [Builder.networkRiskScore] to an arbitrary JSON value. + * + * You should usually call [Builder.networkRiskScore] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun networkRiskScore(networkRiskScore: JsonField) = apply { + this.networkRiskScore = networkRiskScore + } + + /** + * If the authorization was made in-person with a physical card, the Physical Card + * that was used. + */ + fun physicalCardId(physicalCardId: String?) = + physicalCardId(JsonField.ofNullable(physicalCardId)) + + /** + * Alias for calling [Builder.physicalCardId] with `physicalCardId.orElse(null)`. + */ + fun physicalCardId(physicalCardId: Optional) = + physicalCardId(physicalCardId.getOrNull()) + + /** + * Sets [Builder.physicalCardId] to an arbitrary JSON value. + * + * You should usually call [Builder.physicalCardId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun physicalCardId(physicalCardId: JsonField) = apply { + this.physicalCardId = physicalCardId + } + + /** + * The declined amount in the minor unit of the transaction's presentment currency. + */ + fun presentmentAmount(presentmentAmount: Long) = + presentmentAmount(JsonField.of(presentmentAmount)) + + /** + * Sets [Builder.presentmentAmount] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentAmount] with a well-typed [Long] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentAmount(presentmentAmount: JsonField) = apply { + this.presentmentAmount = presentmentAmount + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + * presentment currency. + */ + fun presentmentCurrency(presentmentCurrency: String) = + presentmentCurrency(JsonField.of(presentmentCurrency)) + + /** + * Sets [Builder.presentmentCurrency] to an arbitrary JSON value. + * + * You should usually call [Builder.presentmentCurrency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun presentmentCurrency(presentmentCurrency: JsonField) = apply { + this.presentmentCurrency = presentmentCurrency + } + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + fun processingCategory(processingCategory: ProcessingCategory) = + processingCategory(JsonField.of(processingCategory)) + + /** + * Sets [Builder.processingCategory] to an arbitrary JSON value. + * + * You should usually call [Builder.processingCategory] with a well-typed + * [ProcessingCategory] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun processingCategory(processingCategory: JsonField) = apply { + this.processingCategory = processingCategory + } + + /** + * The identifier of the Real-Time Decision sent to approve or decline this + * transaction. + */ + fun realTimeDecisionId(realTimeDecisionId: String?) = + realTimeDecisionId(JsonField.ofNullable(realTimeDecisionId)) + + /** + * Alias for calling [Builder.realTimeDecisionId] with + * `realTimeDecisionId.orElse(null)`. + */ + fun realTimeDecisionId(realTimeDecisionId: Optional) = + realTimeDecisionId(realTimeDecisionId.getOrNull()) + + /** + * Sets [Builder.realTimeDecisionId] to an arbitrary JSON value. + * + * You should usually call [Builder.realTimeDecisionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun realTimeDecisionId(realTimeDecisionId: JsonField) = apply { + this.realTimeDecisionId = realTimeDecisionId + } + + /** + * This is present if a specific decline reason was given in the real-time decision. + */ + fun realTimeDecisionReason(realTimeDecisionReason: RealTimeDecisionReason?) = + realTimeDecisionReason(JsonField.ofNullable(realTimeDecisionReason)) + + /** + * Alias for calling [Builder.realTimeDecisionReason] with + * `realTimeDecisionReason.orElse(null)`. + */ + fun realTimeDecisionReason( + realTimeDecisionReason: Optional + ) = realTimeDecisionReason(realTimeDecisionReason.getOrNull()) + + /** + * Sets [Builder.realTimeDecisionReason] to an arbitrary JSON value. + * + * You should usually call [Builder.realTimeDecisionReason] with a well-typed + * [RealTimeDecisionReason] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun realTimeDecisionReason( + realTimeDecisionReason: JsonField + ) = apply { this.realTimeDecisionReason = realTimeDecisionReason } + + /** Why the transaction was declined. */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [Reason] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + /** + * The terminal identifier (commonly abbreviated as TID) of the terminal the card is + * transacting with. + */ + fun terminalId(terminalId: String?) = terminalId(JsonField.ofNullable(terminalId)) + + /** Alias for calling [Builder.terminalId] with `terminalId.orElse(null)`. */ + fun terminalId(terminalId: Optional) = terminalId(terminalId.getOrNull()) + + /** + * Sets [Builder.terminalId] to an arbitrary JSON value. + * + * You should usually call [Builder.terminalId] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun terminalId(terminalId: JsonField) = apply { + this.terminalId = terminalId + } + + /** Fields related to verification of cardholder-provided values. */ + fun verification(verification: Verification) = + verification(JsonField.of(verification)) + + /** + * Sets [Builder.verification] to an arbitrary JSON value. + * + * You should usually call [Builder.verification] with a well-typed [Verification] + * value instead. This method is primarily for setting the field to an undocumented + * or not yet supported value. + */ + fun verification(verification: JsonField) = apply { + this.verification = verification + } + + 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 [CardDecline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .id() + * .actioner() + * .additionalAmounts() + * .amount() + * .cardPaymentId() + * .currency() + * .declinedTransactionId() + * .digitalWalletTokenId() + * .direction() + * .incrementedCardAuthorizationId() + * .merchantAcceptorId() + * .merchantCategoryCode() + * .merchantCity() + * .merchantCountry() + * .merchantDescriptor() + * .merchantPostalCode() + * .merchantState() + * .networkDetails() + * .networkIdentifiers() + * .networkRiskScore() + * .physicalCardId() + * .presentmentAmount() + * .presentmentCurrency() + * .processingCategory() + * .realTimeDecisionId() + * .realTimeDecisionReason() + * .reason() + * .terminalId() + * .verification() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardDecline = + CardDecline( + checkRequired("id", id), + checkRequired("actioner", actioner), + checkRequired("additionalAmounts", additionalAmounts), + checkRequired("amount", amount), + checkRequired("cardPaymentId", cardPaymentId), + checkRequired("currency", currency), + checkRequired("declinedTransactionId", declinedTransactionId), + checkRequired("digitalWalletTokenId", digitalWalletTokenId), + checkRequired("direction", direction), + checkRequired( + "incrementedCardAuthorizationId", + incrementedCardAuthorizationId, + ), + checkRequired("merchantAcceptorId", merchantAcceptorId), + checkRequired("merchantCategoryCode", merchantCategoryCode), + checkRequired("merchantCity", merchantCity), + checkRequired("merchantCountry", merchantCountry), + checkRequired("merchantDescriptor", merchantDescriptor), + checkRequired("merchantPostalCode", merchantPostalCode), + checkRequired("merchantState", merchantState), + checkRequired("networkDetails", networkDetails), + checkRequired("networkIdentifiers", networkIdentifiers), + checkRequired("networkRiskScore", networkRiskScore), + checkRequired("physicalCardId", physicalCardId), + checkRequired("presentmentAmount", presentmentAmount), + checkRequired("presentmentCurrency", presentmentCurrency), + checkRequired("processingCategory", processingCategory), + checkRequired("realTimeDecisionId", realTimeDecisionId), + checkRequired("realTimeDecisionReason", realTimeDecisionReason), + checkRequired("reason", reason), + checkRequired("terminalId", terminalId), + checkRequired("verification", verification), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardDecline = apply { + if (validated) { + return@apply + } + + id() + actioner().validate() + additionalAmounts().validate() + amount() + cardPaymentId() + currency().validate() + declinedTransactionId() + digitalWalletTokenId() + direction().validate() + incrementedCardAuthorizationId() + merchantAcceptorId() + merchantCategoryCode() + merchantCity() + merchantCountry() + merchantDescriptor() + merchantPostalCode() + merchantState() + networkDetails().validate() + networkIdentifiers().validate() + networkRiskScore() + physicalCardId() + presentmentAmount() + presentmentCurrency() + processingCategory().validate() + realTimeDecisionId() + realTimeDecisionReason().ifPresent { it.validate() } + reason().validate() + terminalId() + verification().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 (id.asKnown().isPresent) 1 else 0) + + (actioner.asKnown().getOrNull()?.validity() ?: 0) + + (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) + + (if (amount.asKnown().isPresent) 1 else 0) + + (if (cardPaymentId.asKnown().isPresent) 1 else 0) + + (currency.asKnown().getOrNull()?.validity() ?: 0) + + (if (declinedTransactionId.asKnown().isPresent) 1 else 0) + + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + + (direction.asKnown().getOrNull()?.validity() ?: 0) + + (if (incrementedCardAuthorizationId.asKnown().isPresent) 1 else 0) + + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + + (if (merchantCategoryCode.asKnown().isPresent) 1 else 0) + + (if (merchantCity.asKnown().isPresent) 1 else 0) + + (if (merchantCountry.asKnown().isPresent) 1 else 0) + + (if (merchantDescriptor.asKnown().isPresent) 1 else 0) + + (if (merchantPostalCode.asKnown().isPresent) 1 else 0) + + (if (merchantState.asKnown().isPresent) 1 else 0) + + (networkDetails.asKnown().getOrNull()?.validity() ?: 0) + + (networkIdentifiers.asKnown().getOrNull()?.validity() ?: 0) + + (if (networkRiskScore.asKnown().isPresent) 1 else 0) + + (if (physicalCardId.asKnown().isPresent) 1 else 0) + + (if (presentmentAmount.asKnown().isPresent) 1 else 0) + + (if (presentmentCurrency.asKnown().isPresent) 1 else 0) + + (processingCategory.asKnown().getOrNull()?.validity() ?: 0) + + (if (realTimeDecisionId.asKnown().isPresent) 1 else 0) + + (realTimeDecisionReason.asKnown().getOrNull()?.validity() ?: 0) + + (reason.asKnown().getOrNull()?.validity() ?: 0) + + (if (terminalId.asKnown().isPresent) 1 else 0) + + (verification.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Whether this authorization was approved by Increase, the card network through + * stand-in processing, or the user through a real-time decision. + */ + class Actioner @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 { + + /** This object was actioned by the user through a real-time decision. */ + @JvmField val USER = of("user") + + /** This object was actioned by Increase without user intervention. */ + @JvmField val INCREASE = of("increase") + + /** This object was actioned by the network, through stand-in processing. */ + @JvmField val NETWORK = of("network") + + @JvmStatic fun of(value: String) = Actioner(JsonField.of(value)) + } + + /** An enum containing [Actioner]'s known values. */ + enum class Known { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + } + + /** + * An enum containing [Actioner]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Actioner] 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 { + /** This object was actioned by the user through a real-time decision. */ + USER, + /** This object was actioned by Increase without user intervention. */ + INCREASE, + /** This object was actioned by the network, through stand-in processing. */ + NETWORK, + /** + * An enum member indicating that [Actioner] 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) { + USER -> Value.USER + INCREASE -> Value.INCREASE + NETWORK -> Value.NETWORK + 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) { + USER -> Known.USER + INCREASE -> Known.INCREASE + NETWORK -> Known.NETWORK + else -> throw IncreaseInvalidDataException("Unknown Actioner: $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(): Actioner = 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 Actioner && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Additional amounts associated with the card authorization, such as ATM surcharges + * fees. These are usually a subset of the `amount` field and are used to provide more + * detailed information about the transaction. + */ + class AdditionalAmounts + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val clinic: JsonField, + private val dental: JsonField, + private val original: JsonField, + private val prescription: JsonField, + private val surcharge: JsonField, + private val totalCumulative: JsonField, + private val totalHealthcare: JsonField, + private val transit: JsonField, + private val unknown: JsonField, + private val vision: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("clinic") + @ExcludeMissing + clinic: JsonField = JsonMissing.of(), + @JsonProperty("dental") + @ExcludeMissing + dental: JsonField = JsonMissing.of(), + @JsonProperty("original") + @ExcludeMissing + original: JsonField = JsonMissing.of(), + @JsonProperty("prescription") + @ExcludeMissing + prescription: JsonField = JsonMissing.of(), + @JsonProperty("surcharge") + @ExcludeMissing + surcharge: JsonField = JsonMissing.of(), + @JsonProperty("total_cumulative") + @ExcludeMissing + totalCumulative: JsonField = JsonMissing.of(), + @JsonProperty("total_healthcare") + @ExcludeMissing + totalHealthcare: JsonField = JsonMissing.of(), + @JsonProperty("transit") + @ExcludeMissing + transit: JsonField = JsonMissing.of(), + @JsonProperty("unknown") + @ExcludeMissing + unknown: JsonField = JsonMissing.of(), + @JsonProperty("vision") + @ExcludeMissing + vision: JsonField = JsonMissing.of(), + ) : this( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + mutableMapOf(), + ) + + /** + * The part of this transaction amount that was for clinic-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun clinic(): Optional = clinic.getOptional("clinic") + + /** + * The part of this transaction amount that was for dental-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun dental(): Optional = dental.getOptional("dental") + + /** + * The original pre-authorized amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun original(): Optional = original.getOptional("original") + + /** + * The part of this transaction amount that was for healthcare prescriptions. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun prescription(): Optional = + prescription.getOptional("prescription") + + /** + * The surcharge amount charged for this transaction by the merchant. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun surcharge(): Optional = surcharge.getOptional("surcharge") + + /** + * The total amount of a series of incremental authorizations, optionally provided. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalCumulative(): Optional = + totalCumulative.getOptional("total_cumulative") + + /** + * The total amount of healthcare-related additional amounts. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun totalHealthcare(): Optional = + totalHealthcare.getOptional("total_healthcare") + + /** + * The part of this transaction amount that was for transit-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transit(): Optional = transit.getOptional("transit") + + /** + * An unknown additional amount. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun unknown(): Optional = unknown.getOptional("unknown") + + /** + * The part of this transaction amount that was for vision-related services. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun vision(): Optional = vision.getOptional("vision") + + /** + * Returns the raw JSON value of [clinic]. + * + * Unlike [clinic], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("clinic") @ExcludeMissing fun _clinic(): JsonField = clinic + + /** + * Returns the raw JSON value of [dental]. + * + * Unlike [dental], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("dental") @ExcludeMissing fun _dental(): JsonField = dental + + /** + * Returns the raw JSON value of [original]. + * + * Unlike [original], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("original") + @ExcludeMissing + fun _original(): JsonField = original + + /** + * Returns the raw JSON value of [prescription]. + * + * Unlike [prescription], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("prescription") + @ExcludeMissing + fun _prescription(): JsonField = prescription + + /** + * Returns the raw JSON value of [surcharge]. + * + * Unlike [surcharge], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("surcharge") + @ExcludeMissing + fun _surcharge(): JsonField = surcharge + + /** + * Returns the raw JSON value of [totalCumulative]. + * + * Unlike [totalCumulative], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_cumulative") + @ExcludeMissing + fun _totalCumulative(): JsonField = totalCumulative + + /** + * Returns the raw JSON value of [totalHealthcare]. + * + * Unlike [totalHealthcare], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("total_healthcare") + @ExcludeMissing + fun _totalHealthcare(): JsonField = totalHealthcare + + /** + * Returns the raw JSON value of [transit]. + * + * Unlike [transit], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("transit") + @ExcludeMissing + fun _transit(): JsonField = transit + + /** + * Returns the raw JSON value of [unknown]. + * + * Unlike [unknown], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("unknown") + @ExcludeMissing + fun _unknown(): JsonField = unknown + + /** + * Returns the raw JSON value of [vision]. + * + * Unlike [vision], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("vision") @ExcludeMissing fun _vision(): JsonField = vision + + @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 + * [AdditionalAmounts]. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [AdditionalAmounts]. */ + class Builder internal constructor() { + + private var clinic: JsonField? = null + private var dental: JsonField? = null + private var original: JsonField? = null + private var prescription: JsonField? = null + private var surcharge: JsonField? = null + private var totalCumulative: JsonField? = null + private var totalHealthcare: JsonField? = null + private var transit: JsonField? = null + private var unknown: JsonField? = null + private var vision: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(additionalAmounts: AdditionalAmounts) = apply { + clinic = additionalAmounts.clinic + dental = additionalAmounts.dental + original = additionalAmounts.original + prescription = additionalAmounts.prescription + surcharge = additionalAmounts.surcharge + totalCumulative = additionalAmounts.totalCumulative + totalHealthcare = additionalAmounts.totalHealthcare + transit = additionalAmounts.transit + unknown = additionalAmounts.unknown + vision = additionalAmounts.vision + additionalProperties = additionalAmounts.additionalProperties.toMutableMap() + } + + /** The part of this transaction amount that was for clinic-related services. */ + fun clinic(clinic: Clinic?) = clinic(JsonField.ofNullable(clinic)) + + /** Alias for calling [Builder.clinic] with `clinic.orElse(null)`. */ + fun clinic(clinic: Optional) = clinic(clinic.getOrNull()) + + /** + * Sets [Builder.clinic] to an arbitrary JSON value. + * + * You should usually call [Builder.clinic] with a well-typed [Clinic] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun clinic(clinic: JsonField) = apply { this.clinic = clinic } + + /** The part of this transaction amount that was for dental-related services. */ + fun dental(dental: Dental?) = dental(JsonField.ofNullable(dental)) + + /** Alias for calling [Builder.dental] with `dental.orElse(null)`. */ + fun dental(dental: Optional) = dental(dental.getOrNull()) + + /** + * Sets [Builder.dental] to an arbitrary JSON value. + * + * You should usually call [Builder.dental] with a well-typed [Dental] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun dental(dental: JsonField) = apply { this.dental = dental } + + /** The original pre-authorized amount. */ + fun original(original: Original?) = original(JsonField.ofNullable(original)) + + /** Alias for calling [Builder.original] with `original.orElse(null)`. */ + fun original(original: Optional) = original(original.getOrNull()) + + /** + * Sets [Builder.original] to an arbitrary JSON value. + * + * You should usually call [Builder.original] with a well-typed [Original] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun original(original: JsonField) = apply { this.original = original } + + /** + * The part of this transaction amount that was for healthcare prescriptions. + */ + fun prescription(prescription: Prescription?) = + prescription(JsonField.ofNullable(prescription)) + + /** + * Alias for calling [Builder.prescription] with `prescription.orElse(null)`. + */ + fun prescription(prescription: Optional) = + prescription(prescription.getOrNull()) + + /** + * Sets [Builder.prescription] to an arbitrary JSON value. + * + * You should usually call [Builder.prescription] with a well-typed + * [Prescription] value instead. This method is primarily for setting the field + * to an undocumented or not yet supported value. + */ + fun prescription(prescription: JsonField) = apply { + this.prescription = prescription + } + + /** The surcharge amount charged for this transaction by the merchant. */ + fun surcharge(surcharge: Surcharge?) = + surcharge(JsonField.ofNullable(surcharge)) + + /** Alias for calling [Builder.surcharge] with `surcharge.orElse(null)`. */ + fun surcharge(surcharge: Optional) = surcharge(surcharge.getOrNull()) + + /** + * Sets [Builder.surcharge] to an arbitrary JSON value. + * + * You should usually call [Builder.surcharge] with a well-typed [Surcharge] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun surcharge(surcharge: JsonField) = apply { + this.surcharge = surcharge + } + + /** + * The total amount of a series of incremental authorizations, optionally + * provided. + */ + fun totalCumulative(totalCumulative: TotalCumulative?) = + totalCumulative(JsonField.ofNullable(totalCumulative)) + + /** + * Alias for calling [Builder.totalCumulative] with + * `totalCumulative.orElse(null)`. + */ + fun totalCumulative(totalCumulative: Optional) = + totalCumulative(totalCumulative.getOrNull()) + + /** + * Sets [Builder.totalCumulative] to an arbitrary JSON value. + * + * You should usually call [Builder.totalCumulative] with a well-typed + * [TotalCumulative] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalCumulative(totalCumulative: JsonField) = apply { + this.totalCumulative = totalCumulative + } + + /** The total amount of healthcare-related additional amounts. */ + fun totalHealthcare(totalHealthcare: TotalHealthcare?) = + totalHealthcare(JsonField.ofNullable(totalHealthcare)) + + /** + * Alias for calling [Builder.totalHealthcare] with + * `totalHealthcare.orElse(null)`. + */ + fun totalHealthcare(totalHealthcare: Optional) = + totalHealthcare(totalHealthcare.getOrNull()) + + /** + * Sets [Builder.totalHealthcare] to an arbitrary JSON value. + * + * You should usually call [Builder.totalHealthcare] with a well-typed + * [TotalHealthcare] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun totalHealthcare(totalHealthcare: JsonField) = apply { + this.totalHealthcare = totalHealthcare + } + + /** + * The part of this transaction amount that was for transit-related services. + */ + fun transit(transit: Transit?) = transit(JsonField.ofNullable(transit)) + + /** Alias for calling [Builder.transit] with `transit.orElse(null)`. */ + fun transit(transit: Optional) = transit(transit.getOrNull()) + + /** + * Sets [Builder.transit] to an arbitrary JSON value. + * + * You should usually call [Builder.transit] with a well-typed [Transit] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun transit(transit: JsonField) = apply { this.transit = transit } + + /** An unknown additional amount. */ + fun unknown(unknown: Unknown?) = unknown(JsonField.ofNullable(unknown)) + + /** Alias for calling [Builder.unknown] with `unknown.orElse(null)`. */ + fun unknown(unknown: Optional) = unknown(unknown.getOrNull()) + + /** + * Sets [Builder.unknown] to an arbitrary JSON value. + * + * You should usually call [Builder.unknown] with a well-typed [Unknown] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun unknown(unknown: JsonField) = apply { this.unknown = unknown } + + /** The part of this transaction amount that was for vision-related services. */ + fun vision(vision: Vision?) = vision(JsonField.ofNullable(vision)) + + /** Alias for calling [Builder.vision] with `vision.orElse(null)`. */ + fun vision(vision: Optional) = vision(vision.getOrNull()) + + /** + * Sets [Builder.vision] to an arbitrary JSON value. + * + * You should usually call [Builder.vision] with a well-typed [Vision] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun vision(vision: JsonField) = apply { this.vision = vision } + + 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 [AdditionalAmounts]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .clinic() + * .dental() + * .original() + * .prescription() + * .surcharge() + * .totalCumulative() + * .totalHealthcare() + * .transit() + * .unknown() + * .vision() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): AdditionalAmounts = + AdditionalAmounts( + checkRequired("clinic", clinic), + checkRequired("dental", dental), + checkRequired("original", original), + checkRequired("prescription", prescription), + checkRequired("surcharge", surcharge), + checkRequired("totalCumulative", totalCumulative), + checkRequired("totalHealthcare", totalHealthcare), + checkRequired("transit", transit), + checkRequired("unknown", unknown), + checkRequired("vision", vision), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): AdditionalAmounts = apply { + if (validated) { + return@apply + } + + clinic().ifPresent { it.validate() } + dental().ifPresent { it.validate() } + original().ifPresent { it.validate() } + prescription().ifPresent { it.validate() } + surcharge().ifPresent { it.validate() } + totalCumulative().ifPresent { it.validate() } + totalHealthcare().ifPresent { it.validate() } + transit().ifPresent { it.validate() } + unknown().ifPresent { it.validate() } + vision().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 = + (clinic.asKnown().getOrNull()?.validity() ?: 0) + + (dental.asKnown().getOrNull()?.validity() ?: 0) + + (original.asKnown().getOrNull()?.validity() ?: 0) + + (prescription.asKnown().getOrNull()?.validity() ?: 0) + + (surcharge.asKnown().getOrNull()?.validity() ?: 0) + + (totalCumulative.asKnown().getOrNull()?.validity() ?: 0) + + (totalHealthcare.asKnown().getOrNull()?.validity() ?: 0) + + (transit.asKnown().getOrNull()?.validity() ?: 0) + + (unknown.asKnown().getOrNull()?.validity() ?: 0) + + (vision.asKnown().getOrNull()?.validity() ?: 0) + + /** The part of this transaction amount that was for clinic-related services. */ + class Clinic + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Clinic]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Clinic]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(clinic: Clinic) = apply { + amount = clinic.amount + currency = clinic.currency + additionalProperties = clinic.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Clinic]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Clinic = + Clinic( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Clinic = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Clinic && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Clinic{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for dental-related services. */ + class Dental + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Dental]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Dental]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(dental: Dental) = apply { + amount = dental.amount + currency = dental.currency + additionalProperties = dental.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Dental]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Dental = + Dental( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Dental = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Dental && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Dental{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The original pre-authorized amount. */ + class Original + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Original]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Original]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(original: Original) = apply { + amount = original.amount + currency = original.currency + additionalProperties = original.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Original]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Original = + Original( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Original = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Original && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Original{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for healthcare prescriptions. */ + class Prescription + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Prescription]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Prescription]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(prescription: Prescription) = apply { + amount = prescription.amount + currency = prescription.currency + additionalProperties = prescription.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Prescription]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Prescription = + Prescription( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Prescription = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Prescription && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Prescription{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The surcharge amount charged for this transaction by the merchant. */ + class Surcharge + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Surcharge]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Surcharge]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(surcharge: Surcharge) = apply { + amount = surcharge.amount + currency = surcharge.currency + additionalProperties = surcharge.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Surcharge]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Surcharge = + Surcharge( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Surcharge = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Surcharge && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Surcharge{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** + * The total amount of a series of incremental authorizations, optionally provided. + */ + class TotalCumulative + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalCumulative]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalCumulative]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalCumulative: TotalCumulative) = apply { + amount = totalCumulative.amount + currency = totalCumulative.currency + additionalProperties = + totalCumulative.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [TotalCumulative]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalCumulative = + TotalCumulative( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalCumulative = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalCumulative && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalCumulative{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The total amount of healthcare-related additional amounts. */ + class TotalHealthcare + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 + * [TotalHealthcare]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [TotalHealthcare]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(totalHealthcare: TotalHealthcare) = apply { + amount = totalHealthcare.amount + currency = totalHealthcare.currency + additionalProperties = + totalHealthcare.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [TotalHealthcare]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): TotalHealthcare = + TotalHealthcare( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): TotalHealthcare = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is TotalHealthcare && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "TotalHealthcare{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for transit-related services. */ + class Transit + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Transit]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Transit]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(transit: Transit) = apply { + amount = transit.amount + currency = transit.currency + additionalProperties = transit.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Transit]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Transit = + Transit( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Transit = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Transit && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Transit{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** An unknown additional amount. */ + class Unknown + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Unknown]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Unknown]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(unknown: Unknown) = apply { + amount = unknown.amount + currency = unknown.currency + additionalProperties = unknown.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Unknown]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Unknown = + Unknown( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Unknown = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Unknown && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Unknown{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + /** The part of this transaction amount that was for vision-related services. */ + class Vision + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val amount: JsonField, + private val currency: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("amount") + @ExcludeMissing + amount: JsonField = JsonMissing.of(), + @JsonProperty("currency") + @ExcludeMissing + currency: JsonField = JsonMissing.of(), + ) : this(amount, currency, mutableMapOf()) + + /** + * The amount in minor units of the `currency` field. The amount is positive if + * it is added to the amount (such as an ATM surcharge fee) and negative if it + * is subtracted from the amount (such as a discount). + * + * @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 amount(): Long = amount.getRequired("amount") + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's 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 currency(): String = currency.getRequired("currency") + + /** + * Returns the raw JSON value of [amount]. + * + * Unlike [amount], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("amount") @ExcludeMissing fun _amount(): JsonField = amount + + /** + * Returns the raw JSON value of [currency]. + * + * Unlike [currency], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("currency") + @ExcludeMissing + fun _currency(): JsonField = currency + + @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 [Vision]. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Vision]. */ + class Builder internal constructor() { + + private var amount: JsonField? = null + private var currency: JsonField? = null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(vision: Vision) = apply { + amount = vision.amount + currency = vision.currency + additionalProperties = vision.additionalProperties.toMutableMap() + } + + /** + * The amount in minor units of the `currency` field. The amount is positive + * if it is added to the amount (such as an ATM surcharge fee) and negative + * if it is subtracted from the amount (such as a discount). + */ + fun amount(amount: Long) = amount(JsonField.of(amount)) + + /** + * Sets [Builder.amount] to an arbitrary JSON value. + * + * You should usually call [Builder.amount] with a well-typed [Long] value + * instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun amount(amount: JsonField) = apply { this.amount = amount } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the + * additional amount's currency. + */ + fun currency(currency: String) = currency(JsonField.of(currency)) + + /** + * Sets [Builder.currency] to an arbitrary JSON value. + * + * You should usually call [Builder.currency] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun currency(currency: JsonField) = apply { + this.currency = currency + } + + 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 [Vision]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .amount() + * .currency() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Vision = + Vision( + checkRequired("amount", amount), + checkRequired("currency", currency), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Vision = apply { + if (validated) { + return@apply + } + + amount() + currency() + 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 (amount.asKnown().isPresent) 1 else 0) + + (if (currency.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Vision && + amount == other.amount && + currency == other.currency && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(amount, currency, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Vision{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is AdditionalAmounts && + clinic == other.clinic && + dental == other.dental && + original == other.original && + prescription == other.prescription && + surcharge == other.surcharge && + totalCumulative == other.totalCumulative && + totalHealthcare == other.totalHealthcare && + transit == other.transit && + unknown == other.unknown && + vision == other.vision && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + clinic, + dental, + original, + prescription, + surcharge, + totalCumulative, + totalHealthcare, + transit, + unknown, + vision, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "AdditionalAmounts{clinic=$clinic, dental=$dental, original=$original, prescription=$prescription, surcharge=$surcharge, totalCumulative=$totalCumulative, totalHealthcare=$totalHealthcare, transit=$transit, unknown=$unknown, vision=$vision, additionalProperties=$additionalProperties}" + } + + /** + * The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + * account currency. + */ + class Currency @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 { + + /** US Dollar (USD) */ + @JvmField val USD = of("USD") + + @JvmStatic fun of(value: String) = Currency(JsonField.of(value)) + } + + /** An enum containing [Currency]'s known values. */ + enum class Known { + /** US Dollar (USD) */ + USD + } + + /** + * An enum containing [Currency]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Currency] 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 { + /** US Dollar (USD) */ + USD, + /** + * An enum member indicating that [Currency] 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) { + USD -> Value.USD + 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) { + USD -> Known.USD + else -> throw IncreaseInvalidDataException("Unknown Currency: $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(): Currency = 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 Currency && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The direction describes the direction the funds will move, either from the cardholder + * to the merchant or from the merchant to the cardholder. + */ + class Direction @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 { + + /** A regular card authorization where funds are debited from the cardholder. */ + @JvmField val SETTLEMENT = of("settlement") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + @JvmStatic fun of(value: String) = Direction(JsonField.of(value)) + } + + /** An enum containing [Direction]'s known values. */ + enum class Known { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + } + + /** + * An enum containing [Direction]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Direction] 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 { + /** A regular card authorization where funds are debited from the cardholder. */ + SETTLEMENT, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * An enum member indicating that [Direction] 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) { + SETTLEMENT -> Value.SETTLEMENT + REFUND -> Value.REFUND + 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) { + SETTLEMENT -> Known.SETTLEMENT + REFUND -> Known.REFUND + else -> throw IncreaseInvalidDataException("Unknown Direction: $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(): Direction = 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 Direction && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Fields specific to the `network`. */ + class NetworkDetails + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val category: JsonField, + private val pulse: JsonField, + private val visa: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("category") + @ExcludeMissing + category: JsonField = JsonMissing.of(), + @JsonProperty("pulse") + @ExcludeMissing + pulse: JsonField = JsonMissing.of(), + @JsonProperty("visa") @ExcludeMissing visa: JsonField = JsonMissing.of(), + ) : this(category, pulse, visa, mutableMapOf()) + + /** + * The payment network used to process this card authorization. + * + * @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") + + /** + * Fields specific to the `pulse` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pulse(): Optional = pulse.getOptional("pulse") + + /** + * Fields specific to the `visa` network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun visa(): Optional = visa.getOptional("visa") + + /** + * 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 [pulse]. + * + * Unlike [pulse], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("pulse") @ExcludeMissing fun _pulse(): JsonField = pulse + + /** + * Returns the raw JSON value of [visa]. + * + * Unlike [visa], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("visa") @ExcludeMissing fun _visa(): JsonField = visa + + @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 [NetworkDetails]. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkDetails]. */ + class Builder internal constructor() { + + private var category: JsonField? = null + private var pulse: JsonField? = null + private var visa: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkDetails: NetworkDetails) = apply { + category = networkDetails.category + pulse = networkDetails.pulse + visa = networkDetails.visa + additionalProperties = networkDetails.additionalProperties.toMutableMap() + } + + /** The payment network used to process this card authorization. */ + 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 the `pulse` network. */ + fun pulse(pulse: Pulse?) = pulse(JsonField.ofNullable(pulse)) + + /** Alias for calling [Builder.pulse] with `pulse.orElse(null)`. */ + fun pulse(pulse: Optional) = pulse(pulse.getOrNull()) + + /** + * Sets [Builder.pulse] to an arbitrary JSON value. + * + * You should usually call [Builder.pulse] with a well-typed [Pulse] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun pulse(pulse: JsonField) = apply { this.pulse = pulse } + + /** Fields specific to the `visa` network. */ + fun visa(visa: Visa?) = visa(JsonField.ofNullable(visa)) + + /** Alias for calling [Builder.visa] with `visa.orElse(null)`. */ + fun visa(visa: Optional) = visa(visa.getOrNull()) + + /** + * Sets [Builder.visa] to an arbitrary JSON value. + * + * You should usually call [Builder.visa] with a well-typed [Visa] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun visa(visa: JsonField) = apply { this.visa = visa } + + 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 [NetworkDetails]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .category() + * .pulse() + * .visa() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkDetails = + NetworkDetails( + checkRequired("category", category), + checkRequired("pulse", pulse), + checkRequired("visa", visa), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkDetails = apply { + if (validated) { + return@apply + } + + category().validate() + pulse().ifPresent { it.validate() } + visa().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) + + (pulse.asKnown().getOrNull()?.validity() ?: 0) + + (visa.asKnown().getOrNull()?.validity() ?: 0) + + /** The payment network used to process this card authorization. */ + 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 { + + /** Visa */ + @JvmField val VISA = of("visa") + + /** Pulse */ + @JvmField val PULSE = of("pulse") + + @JvmStatic fun of(value: String) = Category(JsonField.of(value)) + } + + /** An enum containing [Category]'s known values. */ + enum class Known { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + } + + /** + * 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 { + /** Visa */ + VISA, + /** Pulse */ + PULSE, + /** + * 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) { + VISA -> Value.VISA + PULSE -> Value.PULSE + 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) { + VISA -> Known.VISA + PULSE -> Known.PULSE + 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 the `pulse` network. */ + class Pulse + @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 [Pulse]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Pulse]. */ + class Builder internal constructor() { + + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(pulse: Pulse) = apply { + additionalProperties = pulse.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 [Pulse]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Pulse = Pulse(additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Pulse = 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 Pulse && additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = "Pulse{additionalProperties=$additionalProperties}" + } + + /** Fields specific to the `visa` network. */ + class Visa + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val electronicCommerceIndicator: JsonField, + private val pointOfServiceEntryMode: JsonField, + private val standInProcessingReason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + electronicCommerceIndicator: JsonField = + JsonMissing.of(), + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + pointOfServiceEntryMode: JsonField = + JsonMissing.of(), + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + standInProcessingReason: JsonField = + JsonMissing.of(), + ) : this( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + mutableMapOf(), + ) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun electronicCommerceIndicator(): Optional = + electronicCommerceIndicator.getOptional("electronic_commerce_indicator") + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun pointOfServiceEntryMode(): Optional = + pointOfServiceEntryMode.getOptional("point_of_service_entry_mode") + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun standInProcessingReason(): Optional = + standInProcessingReason.getOptional("stand_in_processing_reason") + + /** + * Returns the raw JSON value of [electronicCommerceIndicator]. + * + * Unlike [electronicCommerceIndicator], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("electronic_commerce_indicator") + @ExcludeMissing + fun _electronicCommerceIndicator(): JsonField = + electronicCommerceIndicator + + /** + * Returns the raw JSON value of [pointOfServiceEntryMode]. + * + * Unlike [pointOfServiceEntryMode], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("point_of_service_entry_mode") + @ExcludeMissing + fun _pointOfServiceEntryMode(): JsonField = + pointOfServiceEntryMode + + /** + * Returns the raw JSON value of [standInProcessingReason]. + * + * Unlike [standInProcessingReason], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("stand_in_processing_reason") + @ExcludeMissing + fun _standInProcessingReason(): JsonField = + standInProcessingReason + + @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 [Visa]. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Visa]. */ + class Builder internal constructor() { + + private var electronicCommerceIndicator: + JsonField? = + null + private var pointOfServiceEntryMode: JsonField? = + null + private var standInProcessingReason: JsonField? = + null + private var additionalProperties: MutableMap = + mutableMapOf() + + @JvmSynthetic + internal fun from(visa: Visa) = apply { + electronicCommerceIndicator = visa.electronicCommerceIndicator + pointOfServiceEntryMode = visa.pointOfServiceEntryMode + standInProcessingReason = visa.standInProcessingReason + additionalProperties = visa.additionalProperties.toMutableMap() + } + + /** + * For electronic commerce transactions, this identifies the level of + * security used in obtaining the customer's payment credential. For mail or + * telephone order transactions, identifies the type of mail or telephone + * order. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: ElectronicCommerceIndicator? + ) = + electronicCommerceIndicator( + JsonField.ofNullable(electronicCommerceIndicator) + ) + + /** + * Alias for calling [Builder.electronicCommerceIndicator] with + * `electronicCommerceIndicator.orElse(null)`. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: Optional + ) = electronicCommerceIndicator(electronicCommerceIndicator.getOrNull()) + + /** + * Sets [Builder.electronicCommerceIndicator] to an arbitrary JSON value. + * + * You should usually call [Builder.electronicCommerceIndicator] with a + * well-typed [ElectronicCommerceIndicator] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun electronicCommerceIndicator( + electronicCommerceIndicator: JsonField + ) = apply { this.electronicCommerceIndicator = electronicCommerceIndicator } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: PointOfServiceEntryMode? + ) = pointOfServiceEntryMode(JsonField.ofNullable(pointOfServiceEntryMode)) + + /** + * Alias for calling [Builder.pointOfServiceEntryMode] with + * `pointOfServiceEntryMode.orElse(null)`. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: Optional + ) = pointOfServiceEntryMode(pointOfServiceEntryMode.getOrNull()) + + /** + * Sets [Builder.pointOfServiceEntryMode] to an arbitrary JSON value. + * + * You should usually call [Builder.pointOfServiceEntryMode] with a + * well-typed [PointOfServiceEntryMode] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun pointOfServiceEntryMode( + pointOfServiceEntryMode: JsonField + ) = apply { this.pointOfServiceEntryMode = pointOfServiceEntryMode } + + /** + * Only present when `actioner: network`. Describes why a card authorization + * was approved or declined by Visa through stand-in processing. + */ + fun standInProcessingReason( + standInProcessingReason: StandInProcessingReason? + ) = standInProcessingReason(JsonField.ofNullable(standInProcessingReason)) + + /** + * Alias for calling [Builder.standInProcessingReason] with + * `standInProcessingReason.orElse(null)`. + */ + fun standInProcessingReason( + standInProcessingReason: Optional + ) = standInProcessingReason(standInProcessingReason.getOrNull()) + + /** + * Sets [Builder.standInProcessingReason] to an arbitrary JSON value. + * + * You should usually call [Builder.standInProcessingReason] with a + * well-typed [StandInProcessingReason] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported + * value. + */ + fun standInProcessingReason( + standInProcessingReason: JsonField + ) = apply { this.standInProcessingReason = standInProcessingReason } + + 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 [Visa]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .electronicCommerceIndicator() + * .pointOfServiceEntryMode() + * .standInProcessingReason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Visa = + Visa( + checkRequired( + "electronicCommerceIndicator", + electronicCommerceIndicator, + ), + checkRequired("pointOfServiceEntryMode", pointOfServiceEntryMode), + checkRequired("standInProcessingReason", standInProcessingReason), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Visa = apply { + if (validated) { + return@apply + } + + electronicCommerceIndicator().ifPresent { it.validate() } + pointOfServiceEntryMode().ifPresent { it.validate() } + standInProcessingReason().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 = + (electronicCommerceIndicator.asKnown().getOrNull()?.validity() ?: 0) + + (pointOfServiceEntryMode.asKnown().getOrNull()?.validity() ?: 0) + + (standInProcessingReason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * For electronic commerce transactions, this identifies the level of security + * used in obtaining the customer's payment credential. For mail or telephone + * order transactions, identifies the type of mail or telephone order. + */ + class ElectronicCommerceIndicator + @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 { + + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + @JvmField val MAIL_PHONE_ORDER = of("mail_phone_order") + + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + @JvmField val RECURRING = of("recurring") + + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + @JvmField val INSTALLMENT = of("installment") + + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + @JvmField val UNKNOWN_MAIL_PHONE_ORDER = of("unknown_mail_phone_order") + + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + @JvmField + val SECURE_ELECTRONIC_COMMERCE = of("secure_electronic_commerce") + + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT = + of("non_authenticated_security_transaction_at_3ds_capable_merchant") + + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + @JvmField + val NON_AUTHENTICATED_SECURITY_TRANSACTION = + of("non_authenticated_security_transaction") + + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + @JvmField val NON_SECURE_TRANSACTION = of("non_secure_transaction") + + @JvmStatic + fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value)) + } + + /** An enum containing [ElectronicCommerceIndicator]'s known values. */ + enum class Known { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + } + + /** + * An enum containing [ElectronicCommerceIndicator]'s known values, as well + * as an [_UNKNOWN] member. + * + * An instance of [ElectronicCommerceIndicator] 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 { + /** + * Single transaction of a mail/phone order: Use to indicate that the + * transaction is a mail/phone order purchase, not a recurring + * transaction or installment payment. For domestic transactions in the + * US region, this value may also indicate one bill payment transaction + * in the card-present or card-absent environments. + */ + MAIL_PHONE_ORDER, + /** + * Recurring transaction: Payment indicator used to indicate a recurring + * transaction that originates from an acquirer in the US region. + */ + RECURRING, + /** + * Installment payment: Payment indicator used to indicate one purchase + * of goods or services that is billed to the account in multiple + * charges over a period of time agreed upon by the cardholder and + * merchant from transactions that originate from an acquirer in the US + * region. + */ + INSTALLMENT, + /** + * Unknown classification: other mail order: Use to indicate that the + * type of mail/telephone order is unknown. + */ + UNKNOWN_MAIL_PHONE_ORDER, + /** + * Secure electronic commerce transaction: Use to indicate that the + * electronic commerce transaction has been authenticated using e.g., + * 3-D Secure + */ + SECURE_ELECTRONIC_COMMERCE, + /** + * Non-authenticated security transaction at a 3-D Secure-capable + * merchant, and merchant attempted to authenticate the cardholder using + * 3-D Secure: Use to identify an electronic commerce transaction where + * the merchant attempted to authenticate the cardholder using 3-D + * Secure, but was unable to complete the authentication because the + * issuer or cardholder does not participate in the 3-D Secure program. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT, + /** + * Non-authenticated security transaction: Use to identify an electronic + * commerce transaction that uses data encryption for security however, + * cardholder authentication is not performed using 3-D Secure. + */ + NON_AUTHENTICATED_SECURITY_TRANSACTION, + /** + * Non-secure transaction: Use to identify an electronic commerce + * transaction that has no data protection. + */ + NON_SECURE_TRANSACTION, + /** + * An enum member indicating that [ElectronicCommerceIndicator] 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) { + MAIL_PHONE_ORDER -> Value.MAIL_PHONE_ORDER + RECURRING -> Value.RECURRING + INSTALLMENT -> Value.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Value.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Value.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Value + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Value.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Value.NON_SECURE_TRANSACTION + 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) { + MAIL_PHONE_ORDER -> Known.MAIL_PHONE_ORDER + RECURRING -> Known.RECURRING + INSTALLMENT -> Known.INSTALLMENT + UNKNOWN_MAIL_PHONE_ORDER -> Known.UNKNOWN_MAIL_PHONE_ORDER + SECURE_ELECTRONIC_COMMERCE -> Known.SECURE_ELECTRONIC_COMMERCE + NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT -> + Known + .NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT + NON_AUTHENTICATED_SECURITY_TRANSACTION -> + Known.NON_AUTHENTICATED_SECURITY_TRANSACTION + NON_SECURE_TRANSACTION -> Known.NON_SECURE_TRANSACTION + else -> + throw IncreaseInvalidDataException( + "Unknown ElectronicCommerceIndicator: $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(): ElectronicCommerceIndicator = 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 ElectronicCommerceIndicator && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * The method used to enter the cardholder's primary account number and card + * expiration date. + */ + class PointOfServiceEntryMode + @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 { + + /** Unknown */ + @JvmField val UNKNOWN = of("unknown") + + /** Manual key entry */ + @JvmField val MANUAL = of("manual") + + /** Magnetic stripe read, without card verification value */ + @JvmField val MAGNETIC_STRIPE_NO_CVV = of("magnetic_stripe_no_cvv") + + /** Optical code */ + @JvmField val OPTICAL_CODE = of("optical_code") + + /** Contact chip card */ + @JvmField val INTEGRATED_CIRCUIT_CARD = of("integrated_circuit_card") + + /** Contactless read of chip card */ + @JvmField val CONTACTLESS = of("contactless") + + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + @JvmField val CREDENTIAL_ON_FILE = of("credential_on_file") + + /** Magnetic stripe read */ + @JvmField val MAGNETIC_STRIPE = of("magnetic_stripe") + + /** Contactless read of magnetic stripe data */ + @JvmField + val CONTACTLESS_MAGNETIC_STRIPE = of("contactless_magnetic_stripe") + + /** Contact chip card, without card verification value */ + @JvmField + val INTEGRATED_CIRCUIT_CARD_NO_CVV = + of("integrated_circuit_card_no_cvv") + + @JvmStatic + fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value)) + } + + /** An enum containing [PointOfServiceEntryMode]'s known values. */ + enum class Known { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + } + + /** + * An enum containing [PointOfServiceEntryMode]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [PointOfServiceEntryMode] 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 { + /** Unknown */ + UNKNOWN, + /** Manual key entry */ + MANUAL, + /** Magnetic stripe read, without card verification value */ + MAGNETIC_STRIPE_NO_CVV, + /** Optical code */ + OPTICAL_CODE, + /** Contact chip card */ + INTEGRATED_CIRCUIT_CARD, + /** Contactless read of chip card */ + CONTACTLESS, + /** + * Transaction initiated using a credential that has previously been + * stored on file + */ + CREDENTIAL_ON_FILE, + /** Magnetic stripe read */ + MAGNETIC_STRIPE, + /** Contactless read of magnetic stripe data */ + CONTACTLESS_MAGNETIC_STRIPE, + /** Contact chip card, without card verification value */ + INTEGRATED_CIRCUIT_CARD_NO_CVV, + /** + * An enum member indicating that [PointOfServiceEntryMode] 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) { + UNKNOWN -> Value.UNKNOWN + MANUAL -> Value.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Value.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Value.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Value.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Value.CONTACTLESS + CREDENTIAL_ON_FILE -> Value.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Value.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Value.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Value.INTEGRATED_CIRCUIT_CARD_NO_CVV + 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) { + UNKNOWN -> Known.UNKNOWN + MANUAL -> Known.MANUAL + MAGNETIC_STRIPE_NO_CVV -> Known.MAGNETIC_STRIPE_NO_CVV + OPTICAL_CODE -> Known.OPTICAL_CODE + INTEGRATED_CIRCUIT_CARD -> Known.INTEGRATED_CIRCUIT_CARD + CONTACTLESS -> Known.CONTACTLESS + CREDENTIAL_ON_FILE -> Known.CREDENTIAL_ON_FILE + MAGNETIC_STRIPE -> Known.MAGNETIC_STRIPE + CONTACTLESS_MAGNETIC_STRIPE -> Known.CONTACTLESS_MAGNETIC_STRIPE + INTEGRATED_CIRCUIT_CARD_NO_CVV -> + Known.INTEGRATED_CIRCUIT_CARD_NO_CVV + else -> + throw IncreaseInvalidDataException( + "Unknown PointOfServiceEntryMode: $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(): PointOfServiceEntryMode = 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 PointOfServiceEntryMode && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** + * Only present when `actioner: network`. Describes why a card authorization was + * approved or declined by Visa through stand-in processing. + */ + class StandInProcessingReason + @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 { + + /** Increase failed to process the authorization in a timely manner. */ + @JvmField val ISSUER_ERROR = of("issuer_error") + + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + @JvmField val INVALID_PHYSICAL_CARD = of("invalid_physical_card") + + /** The 3DS cardholder authentication verification value was invalid. */ + @JvmField + val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE = + of("invalid_cardholder_authentication_verification_value") + + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + @JvmField val INTERNAL_VISA_ERROR = of("internal_visa_error") + + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + @JvmField + val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED = + of("merchant_transaction_advisory_service_authentication_required") + + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + @JvmField + val PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK = + of("payment_fraud_disruption_acquirer_block") + + /** An unspecific reason for stand-in processing. */ + @JvmField val OTHER = of("other") + + @JvmStatic + fun of(value: String) = StandInProcessingReason(JsonField.of(value)) + } + + /** An enum containing [StandInProcessingReason]'s known values. */ + enum class Known { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + } + + /** + * An enum containing [StandInProcessingReason]'s known values, as well as + * an [_UNKNOWN] member. + * + * An instance of [StandInProcessingReason] 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 { + /** Increase failed to process the authorization in a timely manner. */ + ISSUER_ERROR, + /** + * The physical card read had an invalid CVV, dCVV, or authorization + * request cryptogram. + */ + INVALID_PHYSICAL_CARD, + /** The 3DS cardholder authentication verification value was invalid. */ + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE, + /** + * An internal Visa error occurred. Visa uses this reason code for + * certain expected occurrences as well, such as Application Transaction + * Counter (ATC) replays. + */ + INTERNAL_VISA_ERROR, + /** + * The merchant has enabled Visa's Transaction Advisory Service and + * requires further authentication to perform the transaction. In + * practice this is often utilized at fuel pumps to tell the cardholder + * to see the cashier. + */ + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED, + /** + * The transaction was blocked by Visa's Payment Fraud Disruption + * service due to fraudulent Acquirer behavior, such as card testing. + */ + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK, + /** An unspecific reason for stand-in processing. */ + OTHER, + /** + * An enum member indicating that [StandInProcessingReason] 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) { + ISSUER_ERROR -> Value.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Value.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Value.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Value.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Value + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Value.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Value.OTHER + 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) { + ISSUER_ERROR -> Known.ISSUER_ERROR + INVALID_PHYSICAL_CARD -> Known.INVALID_PHYSICAL_CARD + INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE -> + Known.INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE + INTERNAL_VISA_ERROR -> Known.INTERNAL_VISA_ERROR + MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED -> + Known + .MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED + PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK -> + Known.PAYMENT_FRAUD_DISRUPTION_ACQUIRER_BLOCK + OTHER -> Known.OTHER + else -> + throw IncreaseInvalidDataException( + "Unknown StandInProcessingReason: $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(): StandInProcessingReason = 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 StandInProcessingReason && 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 Visa && + electronicCommerceIndicator == other.electronicCommerceIndicator && + pointOfServiceEntryMode == other.pointOfServiceEntryMode && + standInProcessingReason == other.standInProcessingReason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + electronicCommerceIndicator, + pointOfServiceEntryMode, + standInProcessingReason, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Visa{electronicCommerceIndicator=$electronicCommerceIndicator, pointOfServiceEntryMode=$pointOfServiceEntryMode, standInProcessingReason=$standInProcessingReason, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkDetails && + category == other.category && + pulse == other.pulse && + visa == other.visa && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(category, pulse, visa, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkDetails{category=$category, pulse=$pulse, visa=$visa, additionalProperties=$additionalProperties}" + } + + /** Network-specific identifiers for a specific request or transaction. */ + class NetworkIdentifiers + @JsonCreator(mode = JsonCreator.Mode.DISABLED) + private constructor( + private val authorizationIdentificationResponse: JsonField, + private val retrievalReferenceNumber: JsonField, + private val traceNumber: JsonField, + private val transactionId: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("authorization_identification_response") + @ExcludeMissing + authorizationIdentificationResponse: JsonField = JsonMissing.of(), + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + retrievalReferenceNumber: JsonField = JsonMissing.of(), + @JsonProperty("trace_number") + @ExcludeMissing + traceNumber: JsonField = JsonMissing.of(), + @JsonProperty("transaction_id") + @ExcludeMissing + transactionId: JsonField = JsonMissing.of(), + ) : this( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + mutableMapOf(), + ) + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun authorizationIdentificationResponse(): Optional = + authorizationIdentificationResponse.getOptional( + "authorization_identification_response" + ) + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun retrievalReferenceNumber(): Optional = + retrievalReferenceNumber.getOptional("retrieval_reference_number") + + /** + * A counter used to verify an individual authorization. Expected to be unique per + * acquirer within a window of time. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun traceNumber(): Optional = traceNumber.getOptional("trace_number") + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type + * (e.g. if the server responded with an unexpected value). + */ + fun transactionId(): Optional = transactionId.getOptional("transaction_id") + + /** + * Returns the raw JSON value of [authorizationIdentificationResponse]. + * + * Unlike [authorizationIdentificationResponse], this method doesn't throw if the + * JSON field has an unexpected type. + */ + @JsonProperty("authorization_identification_response") + @ExcludeMissing + fun _authorizationIdentificationResponse(): JsonField = + authorizationIdentificationResponse + + /** + * Returns the raw JSON value of [retrievalReferenceNumber]. + * + * Unlike [retrievalReferenceNumber], this method doesn't throw if the JSON field + * has an unexpected type. + */ + @JsonProperty("retrieval_reference_number") + @ExcludeMissing + fun _retrievalReferenceNumber(): JsonField = retrievalReferenceNumber + + /** + * Returns the raw JSON value of [traceNumber]. + * + * Unlike [traceNumber], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("trace_number") + @ExcludeMissing + fun _traceNumber(): JsonField = traceNumber + + /** + * Returns the raw JSON value of [transactionId]. + * + * Unlike [transactionId], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("transaction_id") + @ExcludeMissing + fun _transactionId(): JsonField = transactionId + + @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 + * [NetworkIdentifiers]. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [NetworkIdentifiers]. */ + class Builder internal constructor() { + + private var authorizationIdentificationResponse: JsonField? = null + private var retrievalReferenceNumber: JsonField? = null + private var traceNumber: JsonField? = null + private var transactionId: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(networkIdentifiers: NetworkIdentifiers) = apply { + authorizationIdentificationResponse = + networkIdentifiers.authorizationIdentificationResponse + retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber + traceNumber = networkIdentifiers.traceNumber + transactionId = networkIdentifiers.transactionId + additionalProperties = + networkIdentifiers.additionalProperties.toMutableMap() + } + + /** + * The randomly generated 6-character Authorization Identification Response code + * sent back to the acquirer in an approved response. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: String? + ) = + authorizationIdentificationResponse( + JsonField.ofNullable(authorizationIdentificationResponse) + ) + + /** + * Alias for calling [Builder.authorizationIdentificationResponse] with + * `authorizationIdentificationResponse.orElse(null)`. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: Optional + ) = + authorizationIdentificationResponse( + authorizationIdentificationResponse.getOrNull() + ) + + /** + * Sets [Builder.authorizationIdentificationResponse] to an arbitrary JSON + * value. + * + * You should usually call [Builder.authorizationIdentificationResponse] with a + * well-typed [String] value instead. This method is primarily for setting the + * field to an undocumented or not yet supported value. + */ + fun authorizationIdentificationResponse( + authorizationIdentificationResponse: JsonField + ) = apply { + this.authorizationIdentificationResponse = + authorizationIdentificationResponse + } + + /** + * A life-cycle identifier used across e.g., an authorization and a reversal. + * Expected to be unique per acquirer within a window of time. For some card + * networks the retrieval reference number includes the trace counter. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: String?) = + retrievalReferenceNumber(JsonField.ofNullable(retrievalReferenceNumber)) + + /** + * Alias for calling [Builder.retrievalReferenceNumber] with + * `retrievalReferenceNumber.orElse(null)`. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: Optional) = + retrievalReferenceNumber(retrievalReferenceNumber.getOrNull()) + + /** + * Sets [Builder.retrievalReferenceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.retrievalReferenceNumber] with a well-typed + * [String] value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun retrievalReferenceNumber(retrievalReferenceNumber: JsonField) = + apply { + this.retrievalReferenceNumber = retrievalReferenceNumber + } + + /** + * A counter used to verify an individual authorization. Expected to be unique + * per acquirer within a window of time. + */ + fun traceNumber(traceNumber: String?) = + traceNumber(JsonField.ofNullable(traceNumber)) + + /** Alias for calling [Builder.traceNumber] with `traceNumber.orElse(null)`. */ + fun traceNumber(traceNumber: Optional) = + traceNumber(traceNumber.getOrNull()) + + /** + * Sets [Builder.traceNumber] to an arbitrary JSON value. + * + * You should usually call [Builder.traceNumber] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun traceNumber(traceNumber: JsonField) = apply { + this.traceNumber = traceNumber + } + + /** + * A globally unique transaction identifier provided by the card network, used + * across multiple life-cycle requests. + */ + fun transactionId(transactionId: String?) = + transactionId(JsonField.ofNullable(transactionId)) + + /** + * Alias for calling [Builder.transactionId] with `transactionId.orElse(null)`. + */ + fun transactionId(transactionId: Optional) = + transactionId(transactionId.getOrNull()) + + /** + * Sets [Builder.transactionId] to an arbitrary JSON value. + * + * You should usually call [Builder.transactionId] with a well-typed [String] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun transactionId(transactionId: JsonField) = apply { + this.transactionId = transactionId + } + + 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 [NetworkIdentifiers]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .authorizationIdentificationResponse() + * .retrievalReferenceNumber() + * .traceNumber() + * .transactionId() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): NetworkIdentifiers = + NetworkIdentifiers( + checkRequired( + "authorizationIdentificationResponse", + authorizationIdentificationResponse, + ), + checkRequired("retrievalReferenceNumber", retrievalReferenceNumber), + checkRequired("traceNumber", traceNumber), + checkRequired("transactionId", transactionId), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): NetworkIdentifiers = apply { + if (validated) { + return@apply + } + + authorizationIdentificationResponse() + retrievalReferenceNumber() + traceNumber() + transactionId() + 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 (authorizationIdentificationResponse.asKnown().isPresent) 1 else 0) + + (if (retrievalReferenceNumber.asKnown().isPresent) 1 else 0) + + (if (traceNumber.asKnown().isPresent) 1 else 0) + + (if (transactionId.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is NetworkIdentifiers && + authorizationIdentificationResponse == + other.authorizationIdentificationResponse && + retrievalReferenceNumber == other.retrievalReferenceNumber && + traceNumber == other.traceNumber && + transactionId == other.transactionId && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash( + authorizationIdentificationResponse, + retrievalReferenceNumber, + traceNumber, + transactionId, + additionalProperties, + ) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "NetworkIdentifiers{authorizationIdentificationResponse=$authorizationIdentificationResponse, retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}" + } + + /** + * The processing category describes the intent behind the authorization, such as + * whether it was used for bill payments or an automatic fuel dispenser. + */ + class ProcessingCategory + @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 { + + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + @JvmField val ACCOUNT_FUNDING = of("account_funding") + + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + @JvmField val AUTOMATIC_FUEL_DISPENSER = of("automatic_fuel_dispenser") + + /** A transaction used to pay a bill. */ + @JvmField val BILL_PAYMENT = of("bill_payment") + + /** Original credit transactions are used to send money to a cardholder. */ + @JvmField val ORIGINAL_CREDIT = of("original_credit") + + /** A regular purchase. */ + @JvmField val PURCHASE = of("purchase") + + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + @JvmField val QUASI_CASH = of("quasi_cash") + + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + @JvmField val REFUND = of("refund") + + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + @JvmField val CASH_DISBURSEMENT = of("cash_disbursement") + + /** + * A balance inquiry transaction is used to check the balance of an account + * associated with a card. + */ + @JvmField val BALANCE_INQUIRY = of("balance_inquiry") + + /** The processing category is unknown. */ + @JvmField val UNKNOWN = of("unknown") + + @JvmStatic fun of(value: String) = ProcessingCategory(JsonField.of(value)) + } + + /** An enum containing [ProcessingCategory]'s known values. */ + enum class Known { + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** + * A balance inquiry transaction is used to check the balance of an account + * associated with a card. + */ + BALANCE_INQUIRY, + /** The processing category is unknown. */ + UNKNOWN, + } + + /** + * An enum containing [ProcessingCategory]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [ProcessingCategory] 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 { + /** + * Account funding transactions are transactions used to e.g., fund an account + * or transfer funds between accounts. + */ + ACCOUNT_FUNDING, + /** + * Automatic fuel dispenser authorizations occur when a card is used at a gas + * pump, prior to the actual transaction amount being known. They are followed + * by an advice message that updates the amount of the pending transaction. + */ + AUTOMATIC_FUEL_DISPENSER, + /** A transaction used to pay a bill. */ + BILL_PAYMENT, + /** Original credit transactions are used to send money to a cardholder. */ + ORIGINAL_CREDIT, + /** A regular purchase. */ + PURCHASE, + /** + * Quasi-cash transactions represent purchases of items which may be convertible + * to cash. + */ + QUASI_CASH, + /** + * A refund card authorization, sometimes referred to as a credit voucher + * authorization, where funds are credited to the cardholder. + */ + REFUND, + /** + * Cash disbursement transactions are used to withdraw cash from an ATM or a + * point of sale. + */ + CASH_DISBURSEMENT, + /** + * A balance inquiry transaction is used to check the balance of an account + * associated with a card. + */ + BALANCE_INQUIRY, + /** The processing category is unknown. */ + UNKNOWN, + /** + * An enum member indicating that [ProcessingCategory] 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) { + ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Value.BILL_PAYMENT + ORIGINAL_CREDIT -> Value.ORIGINAL_CREDIT + PURCHASE -> Value.PURCHASE + QUASI_CASH -> Value.QUASI_CASH + REFUND -> Value.REFUND + CASH_DISBURSEMENT -> Value.CASH_DISBURSEMENT + BALANCE_INQUIRY -> Value.BALANCE_INQUIRY + UNKNOWN -> Value.UNKNOWN + 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) { + ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING + AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER + BILL_PAYMENT -> Known.BILL_PAYMENT + ORIGINAL_CREDIT -> Known.ORIGINAL_CREDIT + PURCHASE -> Known.PURCHASE + QUASI_CASH -> Known.QUASI_CASH + REFUND -> Known.REFUND + CASH_DISBURSEMENT -> Known.CASH_DISBURSEMENT + BALANCE_INQUIRY -> Known.BALANCE_INQUIRY + UNKNOWN -> Known.UNKNOWN + else -> + throw IncreaseInvalidDataException("Unknown ProcessingCategory: $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(): ProcessingCategory = apply { if (validated) { return@apply } @@ -66647,6 +74350,11 @@ private constructor( /** Card Authentication: details will be under the `card_authentication` object. */ @JvmField val CARD_AUTHENTICATION = of("card_authentication") + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + @JvmField val CARD_BALANCE_INQUIRY = of("card_balance_inquiry") + /** Inbound Card Validation: details will be under the `card_validation` object. */ @JvmField val CARD_VALIDATION = of("card_validation") @@ -66692,6 +74400,10 @@ private constructor( CARD_AUTHORIZATION, /** Card Authentication: details will be under the `card_authentication` object. */ CARD_AUTHENTICATION, + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + CARD_BALANCE_INQUIRY, /** Inbound Card Validation: details will be under the `card_validation` object. */ CARD_VALIDATION, /** Card Decline: details will be under the `card_decline` object. */ @@ -66734,6 +74446,10 @@ private constructor( CARD_AUTHORIZATION, /** Card Authentication: details will be under the `card_authentication` object. */ CARD_AUTHENTICATION, + /** + * Card Balance Inquiry: details will be under the `card_balance_inquiry` object. + */ + CARD_BALANCE_INQUIRY, /** Inbound Card Validation: details will be under the `card_validation` object. */ CARD_VALIDATION, /** Card Decline: details will be under the `card_decline` object. */ @@ -66777,6 +74493,7 @@ private constructor( when (this) { CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION CARD_AUTHENTICATION -> Value.CARD_AUTHENTICATION + CARD_BALANCE_INQUIRY -> Value.CARD_BALANCE_INQUIRY CARD_VALIDATION -> Value.CARD_VALIDATION CARD_DECLINE -> Value.CARD_DECLINE CARD_REVERSAL -> Value.CARD_REVERSAL @@ -66803,6 +74520,7 @@ private constructor( when (this) { CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION CARD_AUTHENTICATION -> Known.CARD_AUTHENTICATION + CARD_BALANCE_INQUIRY -> Known.CARD_BALANCE_INQUIRY CARD_VALIDATION -> Known.CARD_VALIDATION CARD_DECLINE -> Known.CARD_DECLINE CARD_REVERSAL -> Known.CARD_REVERSAL @@ -66988,6 +74706,7 @@ private constructor( cardAuthentication == other.cardAuthentication && cardAuthorization == other.cardAuthorization && cardAuthorizationExpiration == other.cardAuthorizationExpiration && + cardBalanceInquiry == other.cardBalanceInquiry && cardDecline == other.cardDecline && cardFinancial == other.cardFinancial && cardFuelConfirmation == other.cardFuelConfirmation && @@ -67007,6 +74726,7 @@ private constructor( cardAuthentication, cardAuthorization, cardAuthorizationExpiration, + cardBalanceInquiry, cardDecline, cardFinancial, cardFuelConfirmation, @@ -67025,7 +74745,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" + "Element{cardAuthentication=$cardAuthentication, cardAuthorization=$cardAuthorization, cardAuthorizationExpiration=$cardAuthorizationExpiration, cardBalanceInquiry=$cardBalanceInquiry, cardDecline=$cardDecline, cardFinancial=$cardFinancial, cardFuelConfirmation=$cardFuelConfirmation, cardIncrement=$cardIncrement, cardRefund=$cardRefund, cardReversal=$cardReversal, cardSettlement=$cardSettlement, cardValidation=$cardValidation, category=$category, createdAt=$createdAt, other=$other, additionalProperties=$additionalProperties}" } /** The summarized state of this card payment. */ 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 669bb9398..c53730e1c 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 @@ -348,6 +348,220 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") + .additionalAmounts( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .balance(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD + ) + .digitalWalletTokenId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .builder() + .category( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element + .CardBalanceInquiry + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element + .CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -2092,17 +2306,15 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -2111,7 +2323,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -2120,7 +2332,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -2129,7 +2341,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -2138,7 +2350,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -2147,7 +2359,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -2156,7 +2368,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -2165,7 +2377,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -2174,7 +2386,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -2183,7 +2395,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -2193,54 +2405,52 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -2252,7 +2462,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -2262,28 +2473,23 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) .verification( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .Verification .CardVerificationCode .Result @@ -2292,7 +2498,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -2300,7 +2507,8 @@ internal class CardPaymentListPageResponseTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .Verification .CardholderAddress .Result @@ -2312,17 +2520,237 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") .actioner( - CardPayment.Element.CardFinancial.Actioner.INCREASE + CardPayment.Element.CardDecline.Actioner.INCREASE ) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardFinancial + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner( + CardPayment.Element.CardFinancial.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial .AdditionalAmounts .Clinic .builder() @@ -3836,17 +4264,15 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -3855,7 +4281,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -3864,7 +4290,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -3873,7 +4299,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -3882,7 +4308,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -3891,7 +4317,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -3900,7 +4326,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -3909,7 +4335,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -3918,7 +4344,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -3927,7 +4353,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -3937,54 +4363,270 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline .NetworkDetails .Visa .PointOfServiceEntryMode @@ -5580,17 +6222,15 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -5599,7 +6239,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -5608,7 +6248,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -5617,7 +6257,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -5626,7 +6266,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -5635,7 +6275,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -5644,7 +6284,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -5653,7 +6293,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -5662,7 +6302,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -5671,7 +6311,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -5681,54 +6321,52 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -5740,7 +6378,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -5750,12 +6389,229 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE - ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) .realTimeDecisionId(null) .realTimeDecisionReason(null) .reason( @@ -7339,15 +8195,14 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -7356,7 +8211,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -7365,7 +8220,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -7374,7 +8229,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -7383,7 +8238,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -7392,7 +8247,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -7401,7 +8256,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -7410,7 +8265,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -7419,7 +8274,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -7428,7 +8283,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -7438,50 +8293,49 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -7493,7 +8347,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -7503,8 +8358,217 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") .processingCategory( CardPayment.Element.CardDecline.ProcessingCategory .PURCHASE @@ -8996,15 +10060,14 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -9013,7 +10076,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -9022,7 +10085,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -9031,7 +10094,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -9040,7 +10103,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -9049,7 +10112,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -9058,7 +10121,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -9067,7 +10130,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -9076,7 +10139,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -9085,7 +10148,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -9095,50 +10158,49 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -9150,7 +10212,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -9160,21 +10223,230 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() .cardVerificationCode( CardPayment.Element.CardDecline.Verification .CardVerificationCode @@ -10653,15 +11925,14 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -10670,7 +11941,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -10679,7 +11950,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -10688,7 +11959,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -10697,7 +11968,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -10706,7 +11977,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -10715,7 +11986,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -10724,7 +11995,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -10733,7 +12004,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -10742,7 +12013,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -10752,50 +12023,49 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -10807,7 +12077,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -10817,12 +12088,221 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE - ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) .realTimeDecisionId(null) .realTimeDecisionReason(null) .reason( @@ -12310,15 +13790,14 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -12327,7 +13806,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -12336,7 +13815,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -12345,7 +13824,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -12354,7 +13833,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -12363,7 +13842,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -12372,7 +13851,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -12381,7 +13860,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -12390,7 +13869,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -12399,7 +13878,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -12409,50 +13888,49 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -12464,7 +13942,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -12474,17 +13953,226 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason - .INSUFFICIENT_FUNDS + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason + .INSUFFICIENT_FUNDS ) .terminalId("RCN5VNXS") .verification( @@ -14016,17 +15704,15 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -14035,7 +15721,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -14044,7 +15730,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -14053,7 +15739,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -14062,7 +15748,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -14071,7 +15757,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -14080,7 +15766,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -14089,7 +15775,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -14098,7 +15784,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -14107,7 +15793,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -14117,54 +15803,52 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -14176,7 +15860,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -14186,11 +15871,228 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory - .PURCHASE + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory + .PURCHASE ) .realTimeDecisionId(null) .realTimeDecisionReason(null) @@ -15760,17 +17662,15 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner( - CardPayment.Element.CardDecline.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -15779,7 +17679,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -15788,7 +17688,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -15797,7 +17697,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -15806,7 +17706,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -15815,7 +17715,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -15824,7 +17724,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -15833,7 +17733,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -15842,7 +17742,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -15851,7 +17751,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -15861,54 +17761,52 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardDecline.Direction.SETTLEMENT - ) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element + .CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -15920,7 +17818,8 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -15930,8 +17829,225 @@ internal class CardPaymentListPageResponseTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner( + CardPayment.Element.CardDecline.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardDecline.Direction.SETTLEMENT + ) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails + .builder() + .category( + CardPayment.Element.CardDecline + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") .processingCategory( CardPayment.Element.CardDecline.ProcessingCategory .PURCHASE @@ -17249,19 +19365,270 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardAuthorization( - CardPayment.Element.CardAuthorization.builder() - .id("card_authorization_6iqxap6ivd0fo5eu3i8x") - .actioner( - CardPayment.Element.CardAuthorization.Actioner - .INCREASE - ) + .cardAuthorization( + CardPayment.Element.CardAuthorization.builder() + .id("card_authorization_6iqxap6ivd0fo5eu3i8x") + .actioner( + CardPayment.Element.CardAuthorization.Actioner + .INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardAuthorization.Currency.USD + ) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardAuthorization.Direction + .SETTLEMENT + ) + .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardAuthorization.NetworkDetails + .builder() + .category( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element + .CardAuthorization + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element + .CardAuthorization + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardAuthorization + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId(null) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardAuthorization + .ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardAuthorization.Type + .CARD_AUTHORIZATION + ) + .verification( + CardPayment.Element.CardAuthorization.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardAuthorization + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardAuthorization + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id( + "card_authorization_expiration_9xxbjtmixs8sfluzux2e" + ) + .cardAuthorizationId( + "card_authorization_6iqxap6ivd0fo5eu3i8x" + ) + .currency( + CardPayment.Element.CardAuthorizationExpiration + .Currency + .USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration + .Network + .VISA + ) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -17270,7 +19637,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .dental( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -17279,7 +19646,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .original( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -17288,7 +19655,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .prescription( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -17297,7 +19664,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .surcharge( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -17306,7 +19673,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalCumulative( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -17315,7 +19682,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .totalHealthcare( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -17324,7 +19691,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .transit( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -17333,7 +19700,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .unknown( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -17342,7 +19709,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .vision( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -17352,17 +19719,12 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .amount(100L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") .currency( - CardPayment.Element.CardAuthorization.Currency.USD + CardPayment.Element.CardBalanceInquiry.Currency.USD ) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardAuthorization.Direction - .SETTLEMENT - ) - .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") @@ -17371,29 +19733,30 @@ internal class CardPaymentListPageResponseTest { .merchantPostalCode("10045") .merchantState("NY") .networkDetails( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .builder() .category( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .builder() .electronicCommerceIndicator( CardPayment.Element - .CardAuthorization + .CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator @@ -17401,7 +19764,7 @@ internal class CardPaymentListPageResponseTest { ) .pointOfServiceEntryMode( CardPayment.Element - .CardAuthorization + .CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -17413,7 +19776,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) @@ -17423,32 +19786,24 @@ internal class CardPaymentListPageResponseTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId(null) .physicalCardId(null) - .presentmentAmount(100L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardAuthorization - .ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) .terminalId("RCN5VNXS") .type( - CardPayment.Element.CardAuthorization.Type - .CARD_AUTHORIZATION + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY ) .verification( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardVerificationCode .builder() .result( CardPayment.Element - .CardAuthorization + .CardBalanceInquiry .Verification .CardVerificationCode .Result @@ -17457,7 +19812,7 @@ internal class CardPaymentListPageResponseTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardholderAddress .builder() @@ -17467,7 +19822,7 @@ internal class CardPaymentListPageResponseTest { .providedPostalCode("94132") .result( CardPayment.Element - .CardAuthorization + .CardBalanceInquiry .Verification .CardholderAddress .Result @@ -17479,31 +19834,6 @@ internal class CardPaymentListPageResponseTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id( - "card_authorization_expiration_9xxbjtmixs8sfluzux2e" - ) - .cardAuthorizationId( - "card_authorization_6iqxap6ivd0fo5eu3i8x" - ) - .currency( - CardPayment.Element.CardAuthorizationExpiration - .Currency - .USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration - .Network - .VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -19248,6 +21578,220 @@ internal class CardPaymentListPageResponseTest { ) .build() ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") + .additionalAmounts( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .balance(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency( + CardPayment.Element.CardBalanceInquiry.Currency.USD + ) + .digitalWalletTokenId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .builder() + .category( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element + .CardBalanceInquiry + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element + .CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry + .NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element + .CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") 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 6121a0077..cfdccb852 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 @@ -312,6 +312,209 @@ internal class CardPaymentTest { ) .build() ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") + .additionalAmounts( + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .balance(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) + .digitalWalletTokenId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() + .category( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -1855,14 +2058,15 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Clinic .builder() .amount(0L) @@ -1870,7 +2074,8 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Dental .builder() .amount(0L) @@ -1878,7 +2083,8 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Original .builder() .amount(0L) @@ -1886,7 +2092,8 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Prescription .builder() .amount(0L) @@ -1894,7 +2101,8 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -1902,7 +2110,8 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -1910,7 +2119,8 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -1918,7 +2128,8 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Transit .builder() .amount(0L) @@ -1926,7 +2137,8 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Unknown .builder() .amount(0L) @@ -1934,7 +2146,8 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Vision .builder() .amount(0L) @@ -1943,46 +2156,47 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -1994,7 +2208,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -2003,25 +2218,22 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification .CardVerificationCode .Result .MATCH @@ -2029,7 +2241,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -2037,7 +2249,8 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -2048,15 +2261,14 @@ internal class CardPaymentTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") - .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts - .builder() + CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Clinic .builder() .amount(0L) @@ -2064,7 +2276,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Dental .builder() .amount(0L) @@ -2072,7 +2284,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Original .builder() .amount(0L) @@ -2080,7 +2292,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -2088,7 +2300,201 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -3398,14 +3804,15 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Clinic .builder() .amount(0L) @@ -3413,7 +3820,8 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Dental .builder() .amount(0L) @@ -3421,7 +3829,8 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Original .builder() .amount(0L) @@ -3429,7 +3838,8 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Prescription .builder() .amount(0L) @@ -3437,7 +3847,8 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -3445,7 +3856,8 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -3453,7 +3865,8 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -3461,7 +3874,8 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Transit .builder() .amount(0L) @@ -3469,7 +3883,8 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Unknown .builder() .amount(0L) @@ -3477,7 +3892,8 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Vision .builder() .amount(0L) @@ -3486,46 +3902,47 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -3537,7 +3954,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -3546,25 +3964,216 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification .CardVerificationCode .Result .MATCH @@ -4941,14 +5550,15 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Clinic .builder() .amount(0L) @@ -4956,7 +5566,8 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Dental .builder() .amount(0L) @@ -4964,7 +5575,8 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Original .builder() .amount(0L) @@ -4972,7 +5584,8 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Prescription .builder() .amount(0L) @@ -4980,7 +5593,8 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Surcharge .builder() .amount(10L) @@ -4988,7 +5602,8 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -4996,7 +5611,8 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -5004,7 +5620,8 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Transit .builder() .amount(0L) @@ -5012,7 +5629,8 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Unknown .builder() .amount(0L) @@ -5020,7 +5638,8 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts .Vision .builder() .amount(0L) @@ -5029,46 +5648,47 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId( - "declined_transaction_17jbn0yyhvkt4v4ooym8" - ) + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() .category( - CardPayment.Element.CardDecline.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -5080,7 +5700,8 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -5089,25 +5710,22 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason( - CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS - ) .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification .CardVerificationCode .Result .MATCH @@ -5115,7 +5733,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -5123,7 +5741,201 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId( + "declined_transaction_17jbn0yyhvkt4v4ooym8" + ) + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason( + CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS + ) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -6469,35 +7281,37 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -6505,14 +7319,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -6520,7 +7335,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -6528,21 +7343,24 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Vision .builder() .amount(0L) .currency("currency") @@ -6550,40 +7368,43 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .Category + .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -6593,7 +7414,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -6602,23 +7423,17 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .type(CardPayment.Element.CardBalanceInquiry.Type.CARD_BALANCE_INQUIRY) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .Result .MATCH @@ -6626,7 +7441,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -6634,7 +7449,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -6645,12 +7460,188 @@ internal class CardPaymentTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") - .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + CardPayment.Element.CardDecline.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardDecline.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardDecline.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardDecline.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardDecline.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() .clinic( CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic .builder() @@ -7855,35 +8846,37 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -7891,14 +8884,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -7906,7 +8900,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -7914,21 +8908,24 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Vision .builder() .amount(0L) .currency("currency") @@ -7936,40 +8933,43 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .Category + .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -7979,7 +8979,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -7988,23 +8988,17 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .type(CardPayment.Element.CardBalanceInquiry.Type.CARD_BALANCE_INQUIRY) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .Result .MATCH @@ -8012,7 +9006,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -8020,7 +9014,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -8031,35 +9025,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") - .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + CardPayment.Element.CardDecline.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardFinancial.AdditionalAmounts.Original + CardPayment.Element.CardDecline.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -8067,15 +9061,14 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardFinancial.AdditionalAmounts - .Surcharge + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -8083,7 +9076,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -8091,14 +9084,191 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + CardPayment.Element.CardDecline.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardFinancial.AdditionalAmounts.Unknown .builder() .amount(0L) .currency("currency") @@ -9241,35 +10411,37 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -9277,14 +10449,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -9292,7 +10465,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -9300,21 +10473,24 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Vision .builder() .amount(0L) .currency("currency") @@ -9322,40 +10498,43 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .Category + .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -9365,7 +10544,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -9374,23 +10553,17 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .type(CardPayment.Element.CardBalanceInquiry.Type.CARD_BALANCE_INQUIRY) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .Result .MATCH @@ -9398,7 +10571,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -9406,7 +10579,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -9417,35 +10590,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") - .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + CardPayment.Element.CardDecline.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardFinancial.AdditionalAmounts.Original + CardPayment.Element.CardDecline.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -9453,15 +10626,14 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardFinancial.AdditionalAmounts - .Surcharge + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -9469,7 +10641,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -9477,7 +10649,184 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") @@ -10627,35 +11976,37 @@ internal class CardPaymentTest { ) .build() ) - .cardDecline( - CardPayment.Element.CardDecline.builder() - .id("card_decline_bx3o8zd7glq8yvtwg25v") - .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardDecline.AdditionalAmounts.builder() + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardDecline.AdditionalAmounts.Clinic + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardDecline.AdditionalAmounts.Dental + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardDecline.AdditionalAmounts.Original + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -10663,14 +12014,15 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -10678,7 +12030,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardDecline.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -10686,21 +12038,24 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardDecline.AdditionalAmounts.Transit + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Transit .builder() .amount(0L) .currency("currency") .build() ) .unknown( - CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Unknown .builder() .amount(0L) .currency("currency") .build() ) .vision( - CardPayment.Element.CardDecline.AdditionalAmounts.Vision + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .Vision .builder() .amount(0L) .currency("currency") @@ -10708,40 +12063,43 @@ internal class CardPaymentTest { ) .build() ) - .amount(-1000L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardDecline.Currency.USD) - .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) - .incrementedCardAuthorizationId(null) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") .merchantCountry("US") .merchantDescriptor("AMAZON.COM") .merchantPostalCode("10045") - .merchantState(null) + .merchantState("NY") .networkDetails( - CardPayment.Element.CardDecline.NetworkDetails.builder() + CardPayment.Element.CardBalanceInquiry.NetworkDetails.builder() .category( - CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .Category + .VISA ) .pulse( - CardPayment.Element.CardDecline.NetworkDetails.Pulse + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Pulse .builder() .build() ) .visa( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry.NetworkDetails.Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardDecline.NetworkDetails.Visa + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa .PointOfServiceEntryMode .MANUAL ) @@ -10751,7 +12109,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers.builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") .traceNumber("487941") @@ -10760,23 +12118,17 @@ internal class CardPaymentTest { ) .networkRiskScore(10L) .physicalCardId(null) - .presentmentAmount(-1000L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE - ) .realTimeDecisionId(null) - .realTimeDecisionReason(null) - .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) .terminalId("RCN5VNXS") + .type(CardPayment.Element.CardBalanceInquiry.Type.CARD_BALANCE_INQUIRY) .verification( - CardPayment.Element.CardDecline.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification.builder() .cardVerificationCode( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .Result .MATCH @@ -10784,7 +12136,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -10792,7 +12144,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardDecline.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .Result .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH @@ -10803,35 +12155,35 @@ internal class CardPaymentTest { ) .build() ) - .cardFinancial( - CardPayment.Element.CardFinancial.builder() - .id("card_financial_di5b98i72ppomo268zfk") - .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .cardDecline( + CardPayment.Element.CardDecline.builder() + .id("card_decline_bx3o8zd7glq8yvtwg25v") + .actioner(CardPayment.Element.CardDecline.Actioner.INCREASE) .additionalAmounts( - CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + CardPayment.Element.CardDecline.AdditionalAmounts.builder() .clinic( - CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + CardPayment.Element.CardDecline.AdditionalAmounts.Clinic .builder() .amount(0L) .currency("currency") .build() ) .dental( - CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + CardPayment.Element.CardDecline.AdditionalAmounts.Dental .builder() .amount(0L) .currency("currency") .build() ) .original( - CardPayment.Element.CardFinancial.AdditionalAmounts.Original + CardPayment.Element.CardDecline.AdditionalAmounts.Original .builder() .amount(0L) .currency("currency") .build() ) .prescription( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .Prescription .builder() .amount(0L) @@ -10839,15 +12191,14 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardFinancial.AdditionalAmounts - .Surcharge + CardPayment.Element.CardDecline.AdditionalAmounts.Surcharge .builder() .amount(10L) .currency("USD") .build() ) .totalCumulative( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalCumulative .builder() .amount(0L) @@ -10855,7 +12206,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardFinancial.AdditionalAmounts + CardPayment.Element.CardDecline.AdditionalAmounts .TotalHealthcare .builder() .amount(0L) @@ -10863,7 +12214,184 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardFinancial.AdditionalAmounts.Transit + CardPayment.Element.CardDecline.AdditionalAmounts.Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardDecline.AdditionalAmounts.Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardDecline.AdditionalAmounts.Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(-1000L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardDecline.Currency.USD) + .declinedTransactionId("declined_transaction_17jbn0yyhvkt4v4ooym8") + .digitalWalletTokenId(null) + .direction(CardPayment.Element.CardDecline.Direction.SETTLEMENT) + .incrementedCardAuthorizationId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState(null) + .networkDetails( + CardPayment.Element.CardDecline.NetworkDetails.builder() + .category( + CardPayment.Element.CardDecline.NetworkDetails.Category.VISA + ) + .pulse( + CardPayment.Element.CardDecline.NetworkDetails.Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardDecline.NetworkDetails.Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardDecline.NetworkIdentifiers.builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .presentmentAmount(-1000L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardDecline.ProcessingCategory.PURCHASE + ) + .realTimeDecisionId(null) + .realTimeDecisionReason(null) + .reason(CardPayment.Element.CardDecline.Reason.INSUFFICIENT_FUNDS) + .terminalId("RCN5VNXS") + .verification( + CardPayment.Element.CardDecline.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardDecline.Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardDecline.Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardFinancial( + CardPayment.Element.CardFinancial.builder() + .id("card_financial_di5b98i72ppomo268zfk") + .actioner(CardPayment.Element.CardFinancial.Actioner.INCREASE) + .additionalAmounts( + CardPayment.Element.CardFinancial.AdditionalAmounts.builder() + .clinic( + CardPayment.Element.CardFinancial.AdditionalAmounts.Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardFinancial.AdditionalAmounts.Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardFinancial.AdditionalAmounts.Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardFinancial.AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardFinancial.AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardFinancial.AdditionalAmounts.Transit .builder() .amount(0L) .currency("currency") @@ -11851,17 +13379,244 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorization( - CardPayment.Element.CardAuthorization.builder() - .id("card_authorization_6iqxap6ivd0fo5eu3i8x") - .actioner( - CardPayment.Element.CardAuthorization.Actioner.INCREASE - ) + .cardAuthorization( + CardPayment.Element.CardAuthorization.builder() + .id("card_authorization_6iqxap6ivd0fo5eu3i8x") + .actioner( + CardPayment.Element.CardAuthorization.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardAuthorization.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardAuthorization.Direction.SETTLEMENT + ) + .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardAuthorization.NetworkDetails + .builder() + .category( + CardPayment.Element.CardAuthorization.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardAuthorization.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardAuthorization.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId(null) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardAuthorization.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardAuthorization.Type + .CARD_AUTHORIZATION + ) + .verification( + CardPayment.Element.CardAuthorization.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency( + CardPayment.Element.CardAuthorizationExpiration.Currency.USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration.Network.VISA + ) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardAuthorization.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -11870,7 +13625,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -11879,7 +13634,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -11888,7 +13643,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -11897,7 +13652,7 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -11906,7 +13661,7 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -11915,7 +13670,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -11924,7 +13679,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -11933,7 +13688,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -11942,7 +13697,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -11952,14 +13707,10 @@ internal class CardPaymentTest { ) .build() ) - .amount(100L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardAuthorization.Currency.USD) + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardAuthorization.Direction.SETTLEMENT - ) - .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") @@ -11968,32 +13719,35 @@ internal class CardPaymentTest { .merchantPostalCode("10045") .merchantState("NY") .networkDetails( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry.NetworkDetails .builder() .category( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -12005,7 +13759,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardAuthorization.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -12014,28 +13768,22 @@ internal class CardPaymentTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId(null) .physicalCardId(null) - .presentmentAmount(100L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardAuthorization.ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) .terminalId("RCN5VNXS") .type( - CardPayment.Element.CardAuthorization.Type - .CARD_AUTHORIZATION + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY ) .verification( - CardPayment.Element.CardAuthorization.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardVerificationCode .Result @@ -12044,7 +13792,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -12052,7 +13800,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardholderAddress .Result @@ -12064,23 +13812,6 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency( - CardPayment.Element.CardAuthorizationExpiration.Currency.USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration.Network.VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -13568,17 +15299,237 @@ internal class CardPaymentTest { .realTimeDecisionId(null) .terminalId("RCN5VNXS") .type( - CardPayment.Element.CardAuthorization.Type - .CARD_AUTHORIZATION + CardPayment.Element.CardAuthorization.Type + .CARD_AUTHORIZATION + ) + .verification( + CardPayment.Element.CardAuthorization.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency( + CardPayment.Element.CardAuthorizationExpiration.Currency.USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration.Network.VISA + ) + .type( + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION + ) + .build() + ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") + .additionalAmounts( + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .balance(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) + .digitalWalletTokenId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() + .category( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY ) .verification( - CardPayment.Element.CardAuthorization.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardVerificationCode .Result @@ -13587,7 +15538,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -13595,7 +15546,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardholderAddress .Result @@ -13607,23 +15558,6 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency( - CardPayment.Element.CardAuthorizationExpiration.Currency.USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration.Network.VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -14920,34 +16854,261 @@ internal class CardPaymentTest { .deviceChannel( CardPayment.Element.CardAuthentication.DeviceChannel.BROWSER ) - .merchantAcceptorId("5665270011000168") - .merchantCategoryCode("5734") - .merchantCountry("US") - .merchantName("AMAZON.COM") - .purchaseAmount(1000L) - .purchaseCurrency("USD") - .realTimeDecisionId(null) - .status( - CardPayment.Element.CardAuthentication.Status - .VALIDATING_CHALLENGE + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCountry("US") + .merchantName("AMAZON.COM") + .purchaseAmount(1000L) + .purchaseCurrency("USD") + .realTimeDecisionId(null) + .status( + CardPayment.Element.CardAuthentication.Status + .VALIDATING_CHALLENGE + ) + .type( + CardPayment.Element.CardAuthentication.Type + .CARD_AUTHENTICATION + ) + .build() + ) + .cardAuthorization( + CardPayment.Element.CardAuthorization.builder() + .id("card_authorization_6iqxap6ivd0fo5eu3i8x") + .actioner( + CardPayment.Element.CardAuthorization.Actioner.INCREASE + ) + .additionalAmounts( + CardPayment.Element.CardAuthorization.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardAuthorization + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .amount(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardAuthorization.Currency.USD) + .digitalWalletTokenId(null) + .direction( + CardPayment.Element.CardAuthorization.Direction.SETTLEMENT + ) + .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardAuthorization.NetworkDetails + .builder() + .category( + CardPayment.Element.CardAuthorization.NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardAuthorization.NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardAuthorization.NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardAuthorization + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardAuthorization.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .pendingTransactionId(null) + .physicalCardId(null) + .presentmentAmount(100L) + .presentmentCurrency("USD") + .processingCategory( + CardPayment.Element.CardAuthorization.ProcessingCategory + .PURCHASE + ) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardAuthorization.Type + .CARD_AUTHORIZATION + ) + .verification( + CardPayment.Element.CardAuthorization.Verification.builder() + .cardVerificationCode( + CardPayment.Element.CardAuthorization.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardAuthorization.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardAuthorization + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) + .cardAuthorizationExpiration( + CardPayment.Element.CardAuthorizationExpiration.builder() + .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") + .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") + .currency( + CardPayment.Element.CardAuthorizationExpiration.Currency.USD + ) + .expiredAmount(20L) + .network( + CardPayment.Element.CardAuthorizationExpiration.Network.VISA ) .type( - CardPayment.Element.CardAuthentication.Type - .CARD_AUTHENTICATION + CardPayment.Element.CardAuthorizationExpiration.Type + .CARD_AUTHORIZATION_EXPIRATION ) .build() ) - .cardAuthorization( - CardPayment.Element.CardAuthorization.builder() - .id("card_authorization_6iqxap6ivd0fo5eu3i8x") - .actioner( - CardPayment.Element.CardAuthorization.Actioner.INCREASE - ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") .additionalAmounts( - CardPayment.Element.CardAuthorization.AdditionalAmounts + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts .builder() .clinic( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Clinic .builder() @@ -14956,7 +17117,7 @@ internal class CardPaymentTest { .build() ) .dental( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Dental .builder() @@ -14965,7 +17126,7 @@ internal class CardPaymentTest { .build() ) .original( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Original .builder() @@ -14974,7 +17135,7 @@ internal class CardPaymentTest { .build() ) .prescription( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Prescription .builder() @@ -14983,7 +17144,7 @@ internal class CardPaymentTest { .build() ) .surcharge( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Surcharge .builder() @@ -14992,7 +17153,7 @@ internal class CardPaymentTest { .build() ) .totalCumulative( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalCumulative .builder() @@ -15001,7 +17162,7 @@ internal class CardPaymentTest { .build() ) .totalHealthcare( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .TotalHealthcare .builder() @@ -15010,7 +17171,7 @@ internal class CardPaymentTest { .build() ) .transit( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Transit .builder() @@ -15019,7 +17180,7 @@ internal class CardPaymentTest { .build() ) .unknown( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Unknown .builder() @@ -15028,7 +17189,7 @@ internal class CardPaymentTest { .build() ) .vision( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .AdditionalAmounts .Vision .builder() @@ -15038,14 +17199,10 @@ internal class CardPaymentTest { ) .build() ) - .amount(100L) + .balance(100L) .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") - .currency(CardPayment.Element.CardAuthorization.Currency.USD) + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) .digitalWalletTokenId(null) - .direction( - CardPayment.Element.CardAuthorization.Direction.SETTLEMENT - ) - .expiresAt(OffsetDateTime.parse("2020-01-31T23:59:59Z")) .merchantAcceptorId("5665270011000168") .merchantCategoryCode("5734") .merchantCity("New York") @@ -15054,32 +17211,35 @@ internal class CardPaymentTest { .merchantPostalCode("10045") .merchantState("NY") .networkDetails( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry.NetworkDetails .builder() .category( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Category .VISA ) .pulse( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Pulse .builder() .build() ) .visa( - CardPayment.Element.CardAuthorization.NetworkDetails + CardPayment.Element.CardBalanceInquiry + .NetworkDetails .Visa .builder() .electronicCommerceIndicator( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .ElectronicCommerceIndicator .SECURE_ELECTRONIC_COMMERCE ) .pointOfServiceEntryMode( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .NetworkDetails .Visa .PointOfServiceEntryMode @@ -15091,7 +17251,7 @@ internal class CardPaymentTest { .build() ) .networkIdentifiers( - CardPayment.Element.CardAuthorization.NetworkIdentifiers + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers .builder() .authorizationIdentificationResponse(null) .retrievalReferenceNumber("785867080153") @@ -15100,28 +17260,22 @@ internal class CardPaymentTest { .build() ) .networkRiskScore(10L) - .pendingTransactionId(null) .physicalCardId(null) - .presentmentAmount(100L) - .presentmentCurrency("USD") - .processingCategory( - CardPayment.Element.CardAuthorization.ProcessingCategory - .PURCHASE - ) .realTimeDecisionId(null) .terminalId("RCN5VNXS") .type( - CardPayment.Element.CardAuthorization.Type - .CARD_AUTHORIZATION + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY ) .verification( - CardPayment.Element.CardAuthorization.Verification.builder() + CardPayment.Element.CardBalanceInquiry.Verification + .builder() .cardVerificationCode( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardVerificationCode .builder() .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardVerificationCode .Result @@ -15130,7 +17284,7 @@ internal class CardPaymentTest { .build() ) .cardholderAddress( - CardPayment.Element.CardAuthorization.Verification + CardPayment.Element.CardBalanceInquiry.Verification .CardholderAddress .builder() .actualLine1("33 Liberty Street") @@ -15138,7 +17292,7 @@ internal class CardPaymentTest { .providedLine1("33 Liberty Street") .providedPostalCode("94132") .result( - CardPayment.Element.CardAuthorization + CardPayment.Element.CardBalanceInquiry .Verification .CardholderAddress .Result @@ -15150,23 +17304,6 @@ internal class CardPaymentTest { ) .build() ) - .cardAuthorizationExpiration( - CardPayment.Element.CardAuthorizationExpiration.builder() - .id("card_authorization_expiration_9xxbjtmixs8sfluzux2e") - .cardAuthorizationId("card_authorization_6iqxap6ivd0fo5eu3i8x") - .currency( - CardPayment.Element.CardAuthorizationExpiration.Currency.USD - ) - .expiredAmount(20L) - .network( - CardPayment.Element.CardAuthorizationExpiration.Network.VISA - ) - .type( - CardPayment.Element.CardAuthorizationExpiration.Type - .CARD_AUTHORIZATION_EXPIRATION - ) - .build() - ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v") @@ -16710,6 +18847,209 @@ internal class CardPaymentTest { ) .build() ) + .cardBalanceInquiry( + CardPayment.Element.CardBalanceInquiry.builder() + .id("card_balance_inquiry_pt06vq4e7qzvv01je0yt") + .additionalAmounts( + CardPayment.Element.CardBalanceInquiry.AdditionalAmounts + .builder() + .clinic( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Clinic + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .dental( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Dental + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .original( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Original + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .prescription( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Prescription + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .surcharge( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Surcharge + .builder() + .amount(10L) + .currency("USD") + .build() + ) + .totalCumulative( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalCumulative + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .totalHealthcare( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .TotalHealthcare + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .transit( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Transit + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .unknown( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Unknown + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .vision( + CardPayment.Element.CardBalanceInquiry + .AdditionalAmounts + .Vision + .builder() + .amount(0L) + .currency("currency") + .build() + ) + .build() + ) + .balance(100L) + .cardPaymentId("card_payment_nd3k2kacrqjli8482ave") + .currency(CardPayment.Element.CardBalanceInquiry.Currency.USD) + .digitalWalletTokenId(null) + .merchantAcceptorId("5665270011000168") + .merchantCategoryCode("5734") + .merchantCity("New York") + .merchantCountry("US") + .merchantDescriptor("AMAZON.COM") + .merchantPostalCode("10045") + .merchantState("NY") + .networkDetails( + CardPayment.Element.CardBalanceInquiry.NetworkDetails + .builder() + .category( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Category + .VISA + ) + .pulse( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Pulse + .builder() + .build() + ) + .visa( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .builder() + .electronicCommerceIndicator( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .ElectronicCommerceIndicator + .SECURE_ELECTRONIC_COMMERCE + ) + .pointOfServiceEntryMode( + CardPayment.Element.CardBalanceInquiry + .NetworkDetails + .Visa + .PointOfServiceEntryMode + .MANUAL + ) + .standInProcessingReason(null) + .build() + ) + .build() + ) + .networkIdentifiers( + CardPayment.Element.CardBalanceInquiry.NetworkIdentifiers + .builder() + .authorizationIdentificationResponse(null) + .retrievalReferenceNumber("785867080153") + .traceNumber("487941") + .transactionId("627199945183184") + .build() + ) + .networkRiskScore(10L) + .physicalCardId(null) + .realTimeDecisionId(null) + .terminalId("RCN5VNXS") + .type( + CardPayment.Element.CardBalanceInquiry.Type + .CARD_BALANCE_INQUIRY + ) + .verification( + CardPayment.Element.CardBalanceInquiry.Verification + .builder() + .cardVerificationCode( + CardPayment.Element.CardBalanceInquiry.Verification + .CardVerificationCode + .builder() + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardVerificationCode + .Result + .MATCH + ) + .build() + ) + .cardholderAddress( + CardPayment.Element.CardBalanceInquiry.Verification + .CardholderAddress + .builder() + .actualLine1("33 Liberty Street") + .actualPostalCode("94131") + .providedLine1("33 Liberty Street") + .providedPostalCode("94132") + .result( + CardPayment.Element.CardBalanceInquiry + .Verification + .CardholderAddress + .Result + .POSTAL_CODE_NO_MATCH_ADDRESS_MATCH + ) + .build() + ) + .build() + ) + .build() + ) .cardDecline( CardPayment.Element.CardDecline.builder() .id("card_decline_bx3o8zd7glq8yvtwg25v")