Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
// File generated from our OpenAPI spec by Stainless.
package com.increase.api.models
import com.fasterxml.jackson.annotation.JsonAnyGetter
import com.fasterxml.jackson.annotation.JsonAnySetter
import com.fasterxml.jackson.annotation.JsonCreator
import com.fasterxml.jackson.annotation.JsonProperty
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
import com.increase.api.core.Enum
import com.increase.api.core.ExcludeMissing
import com.increase.api.core.JsonField
import com.increase.api.core.JsonMissing
import com.increase.api.core.JsonValue
import com.increase.api.core.NoAutoDetect
import com.increase.api.core.toImmutable
import com.increase.api.errors.IncreaseInvalidDataException
import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Objects
/**
* Card Payments group together interactions related to a single card payment, such as an
* authorization and its corresponding settlement.
*/
@JsonDeserialize(builder = CardPayment.Builder::class)
@NoAutoDetect
class CardPayment
private constructor(
private val accountId: JsonField,
private val cardId: JsonField,
private val createdAt: JsonField,
private val digitalWalletTokenId: JsonField,
private val elements: JsonField>,
private val id: JsonField,
private val physicalCardId: JsonField,
private val state: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The identifier for the Account the Transaction belongs to. */
fun accountId(): String = accountId.getRequired("account_id")
/** The Card identifier for this payment. */
fun cardId(): String = cardId.getRequired("card_id")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/** The Digital Wallet Token identifier for this payment. */
fun digitalWalletTokenId(): String? =
digitalWalletTokenId.getNullable("digital_wallet_token_id")
/** The interactions related to this card payment. */
fun elements(): List = elements.getRequired("elements")
/** The Card Payment identifier. */
fun id(): String = id.getRequired("id")
/** The Physical Card identifier for this payment. */
fun physicalCardId(): String? = physicalCardId.getNullable("physical_card_id")
/** The summarized state of this card payment. */
fun state(): State = state.getRequired("state")
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
fun type(): Type = type.getRequired("type")
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id") @ExcludeMissing fun _accountId() = accountId
/** The Card identifier for this payment. */
@JsonProperty("card_id") @ExcludeMissing fun _cardId() = cardId
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/** The Digital Wallet Token identifier for this payment. */
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun _digitalWalletTokenId() = digitalWalletTokenId
/** The interactions related to this card payment. */
@JsonProperty("elements") @ExcludeMissing fun _elements() = elements
/** The Card Payment identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/** The Physical Card identifier for this payment. */
@JsonProperty("physical_card_id") @ExcludeMissing fun _physicalCardId() = physicalCardId
/** The summarized state of this card payment. */
@JsonProperty("state") @ExcludeMissing fun _state() = state
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardPayment = apply {
if (!validated) {
accountId()
cardId()
createdAt()
digitalWalletTokenId()
elements().forEach { it.validate() }
id()
physicalCardId()
state().validate()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var accountId: JsonField = JsonMissing.of()
private var cardId: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var digitalWalletTokenId: JsonField = JsonMissing.of()
private var elements: JsonField> = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var physicalCardId: JsonField = JsonMissing.of()
private var state: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardPayment: CardPayment) = apply {
this.accountId = cardPayment.accountId
this.cardId = cardPayment.cardId
this.createdAt = cardPayment.createdAt
this.digitalWalletTokenId = cardPayment.digitalWalletTokenId
this.elements = cardPayment.elements
this.id = cardPayment.id
this.physicalCardId = cardPayment.physicalCardId
this.state = cardPayment.state
this.type = cardPayment.type
additionalProperties(cardPayment.additionalProperties)
}
/** The identifier for the Account the Transaction belongs to. */
fun accountId(accountId: String) = accountId(JsonField.of(accountId))
/** The identifier for the Account the Transaction belongs to. */
@JsonProperty("account_id")
@ExcludeMissing
fun accountId(accountId: JsonField) = apply { this.accountId = accountId }
/** The Card identifier for this payment. */
fun cardId(cardId: String) = cardId(JsonField.of(cardId))
/** The Card identifier for this payment. */
@JsonProperty("card_id")
@ExcludeMissing
fun cardId(cardId: JsonField) = apply { this.cardId = cardId }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Card Payment was
* created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply { this.createdAt = createdAt }
/** The Digital Wallet Token identifier for this payment. */
fun digitalWalletTokenId(digitalWalletTokenId: String) =
digitalWalletTokenId(JsonField.of(digitalWalletTokenId))
/** The Digital Wallet Token identifier for this payment. */
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun digitalWalletTokenId(digitalWalletTokenId: JsonField) = apply {
this.digitalWalletTokenId = digitalWalletTokenId
}
/** The interactions related to this card payment. */
fun elements(elements: List) = elements(JsonField.of(elements))
/** The interactions related to this card payment. */
@JsonProperty("elements")
@ExcludeMissing
fun elements(elements: JsonField>) = apply { this.elements = elements }
/** The Card Payment identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Card Payment identifier. */
@JsonProperty("id") @ExcludeMissing fun id(id: JsonField) = apply { this.id = id }
/** The Physical Card identifier for this payment. */
fun physicalCardId(physicalCardId: String) = physicalCardId(JsonField.of(physicalCardId))
/** The Physical Card identifier for this payment. */
@JsonProperty("physical_card_id")
@ExcludeMissing
fun physicalCardId(physicalCardId: JsonField) = apply {
this.physicalCardId = physicalCardId
}
/** The summarized state of this card payment. */
fun state(state: State) = state(JsonField.of(state))
/** The summarized state of this card payment. */
@JsonProperty("state")
@ExcludeMissing
fun state(state: JsonField) = apply { this.state = state }
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `card_payment`.
*/
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): CardPayment =
CardPayment(
accountId,
cardId,
createdAt,
digitalWalletTokenId,
elements.map { it.toImmutable() },
id,
physicalCardId,
state,
type,
additionalProperties.toImmutable(),
)
}
@JsonDeserialize(builder = Element.Builder::class)
@NoAutoDetect
class Element
private constructor(
private val cardAuthorization: JsonField,
private val cardAuthorizationExpiration: JsonField,
private val cardDecline: JsonField,
private val cardFuelConfirmation: JsonField,
private val cardIncrement: JsonField,
private val cardRefund: JsonField,
private val cardReversal: JsonField,
private val cardSettlement: JsonField,
private val cardValidation: JsonField,
private val category: JsonField,
private val createdAt: JsonField,
private val other: JsonValue,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
fun cardAuthorization(): CardAuthorization? =
cardAuthorization.getNullable("card_authorization")
/**
* A Card Authorization Expiration object. This field will be present in the JSON response
* if and only if `category` is equal to `card_authorization_expiration`.
*/
fun cardAuthorizationExpiration(): CardAuthorizationExpiration? =
cardAuthorizationExpiration.getNullable("card_authorization_expiration")
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
fun cardDecline(): CardDecline? = cardDecline.getNullable("card_decline")
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if and
* only if `category` is equal to `card_fuel_confirmation`.
*/
fun cardFuelConfirmation(): CardFuelConfirmation? =
cardFuelConfirmation.getNullable("card_fuel_confirmation")
/**
* A Card Increment object. This field will be present in the JSON response if and only if
* `category` is equal to `card_increment`.
*/
fun cardIncrement(): CardIncrement? = cardIncrement.getNullable("card_increment")
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(): CardRefund? = cardRefund.getNullable("card_refund")
/**
* A Card Reversal object. This field will be present in the JSON response if and only if
* `category` is equal to `card_reversal`.
*/
fun cardReversal(): CardReversal? = cardReversal.getNullable("card_reversal")
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
fun cardSettlement(): CardSettlement? = cardSettlement.getNullable("card_settlement")
/**
* A Card Validation object. This field will be present in the JSON response if and only if
* `category` is equal to `card_validation`.
*/
fun cardValidation(): CardValidation? = cardValidation.getNullable("card_validation")
/**
* The type of the resource. We may add additional possible values for this enum over time;
* your application should be able to handle such additions gracefully.
*/
fun category(): Category = category.getRequired("category")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card
* payment element was created.
*/
fun createdAt(): OffsetDateTime = createdAt.getRequired("created_at")
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
@JsonProperty("card_authorization")
@ExcludeMissing
fun _cardAuthorization() = cardAuthorization
/**
* A Card Authorization Expiration object. This field will be present in the JSON response
* if and only if `category` is equal to `card_authorization_expiration`.
*/
@JsonProperty("card_authorization_expiration")
@ExcludeMissing
fun _cardAuthorizationExpiration() = cardAuthorizationExpiration
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
@JsonProperty("card_decline") @ExcludeMissing fun _cardDecline() = cardDecline
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if and
* only if `category` is equal to `card_fuel_confirmation`.
*/
@JsonProperty("card_fuel_confirmation")
@ExcludeMissing
fun _cardFuelConfirmation() = cardFuelConfirmation
/**
* A Card Increment object. This field will be present in the JSON response if and only if
* `category` is equal to `card_increment`.
*/
@JsonProperty("card_increment") @ExcludeMissing fun _cardIncrement() = cardIncrement
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund") @ExcludeMissing fun _cardRefund() = cardRefund
/**
* A Card Reversal object. This field will be present in the JSON response if and only if
* `category` is equal to `card_reversal`.
*/
@JsonProperty("card_reversal") @ExcludeMissing fun _cardReversal() = cardReversal
/**
* A Card Settlement object. This field will be present in the JSON response if and only if
* `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement") @ExcludeMissing fun _cardSettlement() = cardSettlement
/**
* A Card Validation object. This field will be present in the JSON response if and only if
* `category` is equal to `card_validation`.
*/
@JsonProperty("card_validation") @ExcludeMissing fun _cardValidation() = cardValidation
/**
* The type of the resource. We may add additional possible values for this enum over time;
* your application should be able to handle such additions gracefully.
*/
@JsonProperty("category") @ExcludeMissing fun _category() = category
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the card
* payment element was created.
*/
@JsonProperty("created_at") @ExcludeMissing fun _createdAt() = createdAt
/**
* If the category of this Transaction source is equal to `other`, this field will contain
* an empty object, otherwise it will contain null.
*/
@JsonProperty("other") @ExcludeMissing fun _other() = other
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Element = apply {
if (!validated) {
cardAuthorization()?.validate()
cardAuthorizationExpiration()?.validate()
cardDecline()?.validate()
cardFuelConfirmation()?.validate()
cardIncrement()?.validate()
cardRefund()?.validate()
cardReversal()?.validate()
cardSettlement()?.validate()
cardValidation()?.validate()
category()
createdAt()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var cardAuthorization: JsonField = JsonMissing.of()
private var cardAuthorizationExpiration: JsonField =
JsonMissing.of()
private var cardDecline: JsonField = JsonMissing.of()
private var cardFuelConfirmation: JsonField = JsonMissing.of()
private var cardIncrement: JsonField = JsonMissing.of()
private var cardRefund: JsonField = JsonMissing.of()
private var cardReversal: JsonField = JsonMissing.of()
private var cardSettlement: JsonField = JsonMissing.of()
private var cardValidation: JsonField = JsonMissing.of()
private var category: JsonField = JsonMissing.of()
private var createdAt: JsonField = JsonMissing.of()
private var other: JsonValue = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(element: Element) = apply {
this.cardAuthorization = element.cardAuthorization
this.cardAuthorizationExpiration = element.cardAuthorizationExpiration
this.cardDecline = element.cardDecline
this.cardFuelConfirmation = element.cardFuelConfirmation
this.cardIncrement = element.cardIncrement
this.cardRefund = element.cardRefund
this.cardReversal = element.cardReversal
this.cardSettlement = element.cardSettlement
this.cardValidation = element.cardValidation
this.category = element.category
this.createdAt = element.createdAt
this.other = element.other
additionalProperties(element.additionalProperties)
}
/**
* A Card Authorization object. This field will be present in the JSON response if and
* only if `category` is equal to `card_authorization`.
*/
fun cardAuthorization(cardAuthorization: CardAuthorization) =
cardAuthorization(JsonField.of(cardAuthorization))
/**
* A Card Authorization object. This field will be present in the JSON response if and
* only if `category` is equal to `card_authorization`.
*/
@JsonProperty("card_authorization")
@ExcludeMissing
fun cardAuthorization(cardAuthorization: JsonField) = apply {
this.cardAuthorization = cardAuthorization
}
/**
* A Card Authorization Expiration object. This field will be present in the JSON
* response if and only if `category` is equal to `card_authorization_expiration`.
*/
fun cardAuthorizationExpiration(
cardAuthorizationExpiration: CardAuthorizationExpiration
) = cardAuthorizationExpiration(JsonField.of(cardAuthorizationExpiration))
/**
* A Card Authorization Expiration object. This field will be present in the JSON
* response if and only if `category` is equal to `card_authorization_expiration`.
*/
@JsonProperty("card_authorization_expiration")
@ExcludeMissing
fun cardAuthorizationExpiration(
cardAuthorizationExpiration: JsonField
) = apply { this.cardAuthorizationExpiration = cardAuthorizationExpiration }
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
fun cardDecline(cardDecline: CardDecline) = cardDecline(JsonField.of(cardDecline))
/**
* A Card Decline object. This field will be present in the JSON response if and only if
* `category` is equal to `card_decline`.
*/
@JsonProperty("card_decline")
@ExcludeMissing
fun cardDecline(cardDecline: JsonField) = apply {
this.cardDecline = cardDecline
}
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if
* and only if `category` is equal to `card_fuel_confirmation`.
*/
fun cardFuelConfirmation(cardFuelConfirmation: CardFuelConfirmation) =
cardFuelConfirmation(JsonField.of(cardFuelConfirmation))
/**
* A Card Fuel Confirmation object. This field will be present in the JSON response if
* and only if `category` is equal to `card_fuel_confirmation`.
*/
@JsonProperty("card_fuel_confirmation")
@ExcludeMissing
fun cardFuelConfirmation(cardFuelConfirmation: JsonField) =
apply {
this.cardFuelConfirmation = cardFuelConfirmation
}
/**
* A Card Increment object. This field will be present in the JSON response if and only
* if `category` is equal to `card_increment`.
*/
fun cardIncrement(cardIncrement: CardIncrement) =
cardIncrement(JsonField.of(cardIncrement))
/**
* A Card Increment object. This field will be present in the JSON response if and only
* if `category` is equal to `card_increment`.
*/
@JsonProperty("card_increment")
@ExcludeMissing
fun cardIncrement(cardIncrement: JsonField) = apply {
this.cardIncrement = cardIncrement
}
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
fun cardRefund(cardRefund: CardRefund) = cardRefund(JsonField.of(cardRefund))
/**
* A Card Refund object. This field will be present in the JSON response if and only if
* `category` is equal to `card_refund`.
*/
@JsonProperty("card_refund")
@ExcludeMissing
fun cardRefund(cardRefund: JsonField) = apply {
this.cardRefund = cardRefund
}
/**
* A Card Reversal object. This field will be present in the JSON response if and only
* if `category` is equal to `card_reversal`.
*/
fun cardReversal(cardReversal: CardReversal) = cardReversal(JsonField.of(cardReversal))
/**
* A Card Reversal object. This field will be present in the JSON response if and only
* if `category` is equal to `card_reversal`.
*/
@JsonProperty("card_reversal")
@ExcludeMissing
fun cardReversal(cardReversal: JsonField) = apply {
this.cardReversal = cardReversal
}
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
fun cardSettlement(cardSettlement: CardSettlement) =
cardSettlement(JsonField.of(cardSettlement))
/**
* A Card Settlement object. This field will be present in the JSON response if and only
* if `category` is equal to `card_settlement`.
*/
@JsonProperty("card_settlement")
@ExcludeMissing
fun cardSettlement(cardSettlement: JsonField) = apply {
this.cardSettlement = cardSettlement
}
/**
* A Card Validation object. This field will be present in the JSON response if and only
* if `category` is equal to `card_validation`.
*/
fun cardValidation(cardValidation: CardValidation) =
cardValidation(JsonField.of(cardValidation))
/**
* A Card Validation object. This field will be present in the JSON response if and only
* if `category` is equal to `card_validation`.
*/
@JsonProperty("card_validation")
@ExcludeMissing
fun cardValidation(cardValidation: JsonField) = apply {
this.cardValidation = cardValidation
}
/**
* The type of the resource. We may add additional possible values for this enum over
* time; your application should be able to handle such additions gracefully.
*/
fun category(category: Category) = category(JsonField.of(category))
/**
* The type of the resource. We may add additional possible values for this enum over
* time; your application should be able to handle such additions gracefully.
*/
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* card payment element was created.
*/
fun createdAt(createdAt: OffsetDateTime) = createdAt(JsonField.of(createdAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time at which the
* card payment element was created.
*/
@JsonProperty("created_at")
@ExcludeMissing
fun createdAt(createdAt: JsonField) = apply {
this.createdAt = createdAt
}
/**
* If the category of this Transaction source is equal to `other`, this field will
* contain an empty object, otherwise it will contain null.
*/
@JsonProperty("other")
@ExcludeMissing
fun other(other: JsonValue) = apply { this.other = other }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): Element =
Element(
cardAuthorization,
cardAuthorizationExpiration,
cardDecline,
cardFuelConfirmation,
cardIncrement,
cardRefund,
cardReversal,
cardSettlement,
cardValidation,
category,
createdAt,
other,
additionalProperties.toImmutable(),
)
}
/**
* A Card Authorization object. This field will be present in the JSON response if and only
* if `category` is equal to `card_authorization`.
*/
@JsonDeserialize(builder = CardAuthorization.Builder::class)
@NoAutoDetect
class CardAuthorization
private constructor(
private val actioner: JsonField,
private val amount: JsonField,
private val cardPaymentId: JsonField,
private val currency: JsonField,
private val digitalWalletTokenId: JsonField,
private val direction: JsonField,
private val expiresAt: JsonField,
private val id: 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 pendingTransactionId: JsonField,
private val physicalCardId: JsonField,
private val presentmentAmount: JsonField,
private val presentmentCurrency: JsonField,
private val processingCategory: JsonField,
private val realTimeDecisionId: JsonField,
private val terminalId: JsonField,
private val type: JsonField,
private val verification: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* 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.getRequired("actioner")
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
fun amount(): Long = amount.getRequired("amount")
/** The ID of the Card Payment this transaction belongs to. */
fun cardPaymentId(): String = cardPaymentId.getRequired("card_payment_id")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
fun currency(): Currency = currency.getRequired("currency")
/**
* 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(): String? =
digitalWalletTokenId.getNullable("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.
*/
fun direction(): Direction = direction.getRequired("direction")
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization will
* expire and the pending transaction will be released.
*/
fun expiresAt(): OffsetDateTime = expiresAt.getRequired("expires_at")
/** The Card Authorization identifier. */
fun id(): String = id.getRequired("id")
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
fun merchantAcceptorId(): String =
merchantAcceptorId.getRequired("merchant_acceptor_id")
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
* transacting with.
*/
fun merchantCategoryCode(): String =
merchantCategoryCode.getRequired("merchant_category_code")
/** The city the merchant resides in. */
fun merchantCity(): String? = merchantCity.getNullable("merchant_city")
/** The country the merchant resides in. */
fun merchantCountry(): String = merchantCountry.getRequired("merchant_country")
/** The merchant descriptor of the merchant the card is transacting with. */
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.
*/
fun merchantPostalCode(): String? =
merchantPostalCode.getNullable("merchant_postal_code")
/** The state the merchant resides in. */
fun merchantState(): String? = merchantState.getNullable("merchant_state")
/** Fields specific to the `network`. */
fun networkDetails(): NetworkDetails = networkDetails.getRequired("network_details")
/** Network-specific identifiers for a specific request or transaction. */
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.
*/
fun networkRiskScore(): Long? = networkRiskScore.getNullable("network_risk_score")
/** The identifier of the Pending Transaction associated with this Transaction. */
fun pendingTransactionId(): String? =
pendingTransactionId.getNullable("pending_transaction_id")
/**
* If the authorization was made in-person with a physical card, the Physical Card that
* was used.
*/
fun physicalCardId(): String? = physicalCardId.getNullable("physical_card_id")
/** The pending amount in the minor unit of the transaction's presentment currency. */
fun presentmentAmount(): Long = presentmentAmount.getRequired("presentment_amount")
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
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.
*/
fun processingCategory(): ProcessingCategory =
processingCategory.getRequired("processing_category")
/**
* The identifier of the Real-Time Decision sent to approve or decline this transaction.
*/
fun realTimeDecisionId(): String? =
realTimeDecisionId.getNullable("real_time_decision_id")
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
fun terminalId(): String? = terminalId.getNullable("terminal_id")
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
fun type(): Type = type.getRequired("type")
/** Fields related to verification of cardholder-provided values. */
fun verification(): Verification = verification.getRequired("verification")
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
@JsonProperty("actioner") @ExcludeMissing fun _actioner() = actioner
/**
* The pending amount in the minor unit of the transaction's currency. For dollars, for
* example, this is cents.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/** The ID of the Card Payment this transaction belongs to. */
@JsonProperty("card_payment_id") @ExcludeMissing fun _cardPaymentId() = cardPaymentId
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
fun _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.
*/
@JsonProperty("direction") @ExcludeMissing fun _direction() = direction
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization will
* expire and the pending transaction will be released.
*/
@JsonProperty("expires_at") @ExcludeMissing fun _expiresAt() = expiresAt
/** The Card Authorization identifier. */
@JsonProperty("id") @ExcludeMissing fun _id() = id
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
fun _merchantAcceptorId() = merchantAcceptorId
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_category_code")
@ExcludeMissing
fun _merchantCategoryCode() = merchantCategoryCode
/** The city the merchant resides in. */
@JsonProperty("merchant_city") @ExcludeMissing fun _merchantCity() = merchantCity
/** The country the merchant resides in. */
@JsonProperty("merchant_country")
@ExcludeMissing
fun _merchantCountry() = merchantCountry
/** The merchant descriptor of the merchant the card is transacting with. */
@JsonProperty("merchant_descriptor")
@ExcludeMissing
fun _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.
*/
@JsonProperty("merchant_postal_code")
@ExcludeMissing
fun _merchantPostalCode() = merchantPostalCode
/** The state the merchant resides in. */
@JsonProperty("merchant_state") @ExcludeMissing fun _merchantState() = merchantState
/** Fields specific to the `network`. */
@JsonProperty("network_details") @ExcludeMissing fun _networkDetails() = networkDetails
/** Network-specific identifiers for a specific request or transaction. */
@JsonProperty("network_identifiers")
@ExcludeMissing
fun _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.
*/
@JsonProperty("network_risk_score")
@ExcludeMissing
fun _networkRiskScore() = networkRiskScore
/** The identifier of the Pending Transaction associated with this Transaction. */
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun _pendingTransactionId() = pendingTransactionId
/**
* If the authorization was made in-person with a physical card, the Physical Card that
* was used.
*/
@JsonProperty("physical_card_id") @ExcludeMissing fun _physicalCardId() = physicalCardId
/** The pending amount in the minor unit of the transaction's presentment currency. */
@JsonProperty("presentment_amount")
@ExcludeMissing
fun _presentmentAmount() = presentmentAmount
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
@JsonProperty("presentment_currency")
@ExcludeMissing
fun _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.
*/
@JsonProperty("processing_category")
@ExcludeMissing
fun _processingCategory() = processingCategory
/**
* The identifier of the Real-Time Decision sent to approve or decline this transaction.
*/
@JsonProperty("real_time_decision_id")
@ExcludeMissing
fun _realTimeDecisionId() = realTimeDecisionId
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
@JsonProperty("terminal_id") @ExcludeMissing fun _terminalId() = terminalId
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
/** Fields related to verification of cardholder-provided values. */
@JsonProperty("verification") @ExcludeMissing fun _verification() = verification
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardAuthorization = apply {
if (!validated) {
actioner()
amount()
cardPaymentId()
currency()
digitalWalletTokenId()
direction()
expiresAt()
id()
merchantAcceptorId()
merchantCategoryCode()
merchantCity()
merchantCountry()
merchantDescriptor()
merchantPostalCode()
merchantState()
networkDetails().validate()
networkIdentifiers().validate()
networkRiskScore()
pendingTransactionId()
physicalCardId()
presentmentAmount()
presentmentCurrency()
processingCategory()
realTimeDecisionId()
terminalId()
type()
verification().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var actioner: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var cardPaymentId: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var digitalWalletTokenId: JsonField = JsonMissing.of()
private var direction: JsonField = JsonMissing.of()
private var expiresAt: JsonField = JsonMissing.of()
private var id: JsonField = JsonMissing.of()
private var merchantAcceptorId: JsonField = JsonMissing.of()
private var merchantCategoryCode: JsonField = JsonMissing.of()
private var merchantCity: JsonField = JsonMissing.of()
private var merchantCountry: JsonField = JsonMissing.of()
private var merchantDescriptor: JsonField = JsonMissing.of()
private var merchantPostalCode: JsonField = JsonMissing.of()
private var merchantState: JsonField = JsonMissing.of()
private var networkDetails: JsonField = JsonMissing.of()
private var networkIdentifiers: JsonField = JsonMissing.of()
private var networkRiskScore: JsonField = JsonMissing.of()
private var pendingTransactionId: JsonField = JsonMissing.of()
private var physicalCardId: JsonField = JsonMissing.of()
private var presentmentAmount: JsonField = JsonMissing.of()
private var presentmentCurrency: JsonField = JsonMissing.of()
private var processingCategory: JsonField = JsonMissing.of()
private var realTimeDecisionId: JsonField = JsonMissing.of()
private var terminalId: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var verification: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardAuthorization: CardAuthorization) = apply {
this.actioner = cardAuthorization.actioner
this.amount = cardAuthorization.amount
this.cardPaymentId = cardAuthorization.cardPaymentId
this.currency = cardAuthorization.currency
this.digitalWalletTokenId = cardAuthorization.digitalWalletTokenId
this.direction = cardAuthorization.direction
this.expiresAt = cardAuthorization.expiresAt
this.id = cardAuthorization.id
this.merchantAcceptorId = cardAuthorization.merchantAcceptorId
this.merchantCategoryCode = cardAuthorization.merchantCategoryCode
this.merchantCity = cardAuthorization.merchantCity
this.merchantCountry = cardAuthorization.merchantCountry
this.merchantDescriptor = cardAuthorization.merchantDescriptor
this.merchantPostalCode = cardAuthorization.merchantPostalCode
this.merchantState = cardAuthorization.merchantState
this.networkDetails = cardAuthorization.networkDetails
this.networkIdentifiers = cardAuthorization.networkIdentifiers
this.networkRiskScore = cardAuthorization.networkRiskScore
this.pendingTransactionId = cardAuthorization.pendingTransactionId
this.physicalCardId = cardAuthorization.physicalCardId
this.presentmentAmount = cardAuthorization.presentmentAmount
this.presentmentCurrency = cardAuthorization.presentmentCurrency
this.processingCategory = cardAuthorization.processingCategory
this.realTimeDecisionId = cardAuthorization.realTimeDecisionId
this.terminalId = cardAuthorization.terminalId
this.type = cardAuthorization.type
this.verification = cardAuthorization.verification
additionalProperties(cardAuthorization.additionalProperties)
}
/**
* 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))
/**
* Whether this authorization was approved by Increase, the card network through
* stand-in processing, or the user through a real-time decision.
*/
@JsonProperty("actioner")
@ExcludeMissing
fun actioner(actioner: JsonField) = apply { this.actioner = actioner }
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* The pending amount in the minor unit of the transaction's currency. For dollars,
* for example, this is cents.
*/
@JsonProperty("amount")
@ExcludeMissing
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))
/** The ID of the Card Payment this transaction belongs to. */
@JsonProperty("card_payment_id")
@ExcludeMissing
fun cardPaymentId(cardPaymentId: JsonField) = apply {
this.cardPaymentId = cardPaymentId
}
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* currency.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
/**
* 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.of(digitalWalletTokenId))
/**
* If the authorization was made via a Digital Wallet Token (such as an Apple Pay
* purchase), the identifier of the token that was used.
*/
@JsonProperty("digital_wallet_token_id")
@ExcludeMissing
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))
/**
* The direction describes the direction the funds will move, either from the
* cardholder to the merchant or from the merchant to the cardholder.
*/
@JsonProperty("direction")
@ExcludeMissing
fun direction(direction: JsonField) = apply {
this.direction = direction
}
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization
* will expire and the pending transaction will be released.
*/
fun expiresAt(expiresAt: OffsetDateTime) = expiresAt(JsonField.of(expiresAt))
/**
* The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) when this authorization
* will expire and the pending transaction will be released.
*/
@JsonProperty("expires_at")
@ExcludeMissing
fun expiresAt(expiresAt: JsonField) = apply {
this.expiresAt = expiresAt
}
/** The Card Authorization identifier. */
fun id(id: String) = id(JsonField.of(id))
/** The Card Authorization identifier. */
@JsonProperty("id")
@ExcludeMissing
fun id(id: JsonField) = apply { this.id = id }
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
fun merchantAcceptorId(merchantAcceptorId: String) =
merchantAcceptorId(JsonField.of(merchantAcceptorId))
/**
* The merchant identifier (commonly abbreviated as MID) of the merchant the card is
* transacting with.
*/
@JsonProperty("merchant_acceptor_id")
@ExcludeMissing
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))
/**
* The Merchant Category Code (commonly abbreviated as MCC) of the merchant the card
* is transacting with.
*/
@JsonProperty("merchant_category_code")
@ExcludeMissing
fun merchantCategoryCode(merchantCategoryCode: JsonField) = apply {
this.merchantCategoryCode = merchantCategoryCode
}
/** The city the merchant resides in. */
fun merchantCity(merchantCity: String) = merchantCity(JsonField.of(merchantCity))
/** The city the merchant resides in. */
@JsonProperty("merchant_city")
@ExcludeMissing
fun merchantCity(merchantCity: JsonField) = apply {
this.merchantCity = merchantCity
}
/** The country the merchant resides in. */
fun merchantCountry(merchantCountry: String) =
merchantCountry(JsonField.of(merchantCountry))
/** The country the merchant resides in. */
@JsonProperty("merchant_country")
@ExcludeMissing
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))
/** The merchant descriptor of the merchant the card is transacting with. */
@JsonProperty("merchant_descriptor")
@ExcludeMissing
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.of(merchantPostalCode))
/**
* 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.
*/
@JsonProperty("merchant_postal_code")
@ExcludeMissing
fun merchantPostalCode(merchantPostalCode: JsonField) = apply {
this.merchantPostalCode = merchantPostalCode
}
/** The state the merchant resides in. */
fun merchantState(merchantState: String) =
merchantState(JsonField.of(merchantState))
/** The state the merchant resides in. */
@JsonProperty("merchant_state")
@ExcludeMissing
fun merchantState(merchantState: JsonField) = apply {
this.merchantState = merchantState
}
/** Fields specific to the `network`. */
fun networkDetails(networkDetails: NetworkDetails) =
networkDetails(JsonField.of(networkDetails))
/** Fields specific to the `network`. */
@JsonProperty("network_details")
@ExcludeMissing
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))
/** Network-specific identifiers for a specific request or transaction. */
@JsonProperty("network_identifiers")
@ExcludeMissing
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.
*/
fun networkRiskScore(networkRiskScore: Long) =
networkRiskScore(JsonField.of(networkRiskScore))
/**
* 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.
*/
@JsonProperty("network_risk_score")
@ExcludeMissing
fun networkRiskScore(networkRiskScore: JsonField) = apply {
this.networkRiskScore = networkRiskScore
}
/** The identifier of the Pending Transaction associated with this Transaction. */
fun pendingTransactionId(pendingTransactionId: String) =
pendingTransactionId(JsonField.of(pendingTransactionId))
/** The identifier of the Pending Transaction associated with this Transaction. */
@JsonProperty("pending_transaction_id")
@ExcludeMissing
fun pendingTransactionId(pendingTransactionId: JsonField) = apply {
this.pendingTransactionId = pendingTransactionId
}
/**
* If the authorization was made in-person with a physical card, the Physical Card
* that was used.
*/
fun physicalCardId(physicalCardId: String) =
physicalCardId(JsonField.of(physicalCardId))
/**
* If the authorization was made in-person with a physical card, the Physical Card
* that was used.
*/
@JsonProperty("physical_card_id")
@ExcludeMissing
fun physicalCardId(physicalCardId: JsonField) = apply {
this.physicalCardId = physicalCardId
}
/**
* The pending amount in the minor unit of the transaction's presentment currency.
*/
fun presentmentAmount(presentmentAmount: Long) =
presentmentAmount(JsonField.of(presentmentAmount))
/**
* The pending amount in the minor unit of the transaction's presentment currency.
*/
@JsonProperty("presentment_amount")
@ExcludeMissing
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))
/**
* The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's
* presentment currency.
*/
@JsonProperty("presentment_currency")
@ExcludeMissing
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))
/**
* The processing category describes the intent behind the authorization, such as
* whether it was used for bill payments or an automatic fuel dispenser.
*/
@JsonProperty("processing_category")
@ExcludeMissing
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.of(realTimeDecisionId))
/**
* The identifier of the Real-Time Decision sent to approve or decline this
* transaction.
*/
@JsonProperty("real_time_decision_id")
@ExcludeMissing
fun realTimeDecisionId(realTimeDecisionId: JsonField) = apply {
this.realTimeDecisionId = realTimeDecisionId
}
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
fun terminalId(terminalId: String) = terminalId(JsonField.of(terminalId))
/**
* The terminal identifier (commonly abbreviated as TID) of the terminal the card is
* transacting with.
*/
@JsonProperty("terminal_id")
@ExcludeMissing
fun terminalId(terminalId: JsonField) = apply {
this.terminalId = terminalId
}
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* A constant representing the object's type. For this resource it will always be
* `card_authorization`.
*/
@JsonProperty("type")
@ExcludeMissing
fun type(type: JsonField) = apply { this.type = type }
/** Fields related to verification of cardholder-provided values. */
fun verification(verification: Verification) =
verification(JsonField.of(verification))
/** Fields related to verification of cardholder-provided values. */
@JsonProperty("verification")
@ExcludeMissing
fun verification(verification: JsonField) = apply {
this.verification = verification
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): CardAuthorization =
CardAuthorization(
actioner,
amount,
cardPaymentId,
currency,
digitalWalletTokenId,
direction,
expiresAt,
id,
merchantAcceptorId,
merchantCategoryCode,
merchantCity,
merchantCountry,
merchantDescriptor,
merchantPostalCode,
merchantState,
networkDetails,
networkIdentifiers,
networkRiskScore,
pendingTransactionId,
physicalCardId,
presentmentAmount,
presentmentCurrency,
processingCategory,
realTimeDecisionId,
terminalId,
type,
verification,
additionalProperties.toImmutable(),
)
}
class Actioner
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Actioner && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val USER = Actioner(JsonField.of("user"))
val INCREASE = Actioner(JsonField.of("increase"))
val NETWORK = Actioner(JsonField.of("network"))
fun of(value: String) = Actioner(JsonField.of(value))
}
enum class Known {
USER,
INCREASE,
NETWORK,
}
enum class Value {
USER,
INCREASE,
NETWORK,
_UNKNOWN,
}
fun value(): Value =
when (this) {
USER -> Value.USER
INCREASE -> Value.INCREASE
NETWORK -> Value.NETWORK
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
USER -> Known.USER
INCREASE -> Known.INCREASE
NETWORK -> Known.NETWORK
else -> throw IncreaseInvalidDataException("Unknown Actioner: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Currency
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Currency && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CAD = Currency(JsonField.of("CAD"))
val CHF = Currency(JsonField.of("CHF"))
val EUR = Currency(JsonField.of("EUR"))
val GBP = Currency(JsonField.of("GBP"))
val JPY = Currency(JsonField.of("JPY"))
val USD = Currency(JsonField.of("USD"))
fun of(value: String) = Currency(JsonField.of(value))
}
enum class Known {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
}
enum class Value {
CAD,
CHF,
EUR,
GBP,
JPY,
USD,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CAD -> Value.CAD
CHF -> Value.CHF
EUR -> Value.EUR
GBP -> Value.GBP
JPY -> Value.JPY
USD -> Value.USD
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CAD -> Known.CAD
CHF -> Known.CHF
EUR -> Known.EUR
GBP -> Known.GBP
JPY -> Known.JPY
USD -> Known.USD
else -> throw IncreaseInvalidDataException("Unknown Currency: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Direction
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Direction && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val SETTLEMENT = Direction(JsonField.of("settlement"))
val REFUND = Direction(JsonField.of("refund"))
fun of(value: String) = Direction(JsonField.of(value))
}
enum class Known {
SETTLEMENT,
REFUND,
}
enum class Value {
SETTLEMENT,
REFUND,
_UNKNOWN,
}
fun value(): Value =
when (this) {
SETTLEMENT -> Value.SETTLEMENT
REFUND -> Value.REFUND
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
SETTLEMENT -> Known.SETTLEMENT
REFUND -> Known.REFUND
else -> throw IncreaseInvalidDataException("Unknown Direction: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields specific to the `network`. */
@JsonDeserialize(builder = NetworkDetails.Builder::class)
@NoAutoDetect
class NetworkDetails
private constructor(
private val category: JsonField,
private val visa: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The payment network used to process this card authorization. */
fun category(): Category = category.getRequired("category")
/** Fields specific to the `visa` network. */
fun visa(): Visa? = visa.getNullable("visa")
/** The payment network used to process this card authorization. */
@JsonProperty("category") @ExcludeMissing fun _category() = category
/** Fields specific to the `visa` network. */
@JsonProperty("visa") @ExcludeMissing fun _visa() = visa
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): NetworkDetails = apply {
if (!validated) {
category()
visa()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var category: JsonField = JsonMissing.of()
private var visa: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(networkDetails: NetworkDetails) = apply {
this.category = networkDetails.category
this.visa = networkDetails.visa
additionalProperties(networkDetails.additionalProperties)
}
/** The payment network used to process this card authorization. */
fun category(category: Category) = category(JsonField.of(category))
/** The payment network used to process this card authorization. */
@JsonProperty("category")
@ExcludeMissing
fun category(category: JsonField) = apply { this.category = category }
/** Fields specific to the `visa` network. */
fun visa(visa: Visa) = visa(JsonField.of(visa))
/** Fields specific to the `visa` network. */
@JsonProperty("visa")
@ExcludeMissing
fun visa(visa: JsonField) = apply { this.visa = visa }
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): NetworkDetails =
NetworkDetails(
category,
visa,
additionalProperties.toImmutable(),
)
}
class Category
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Category && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val VISA = Category(JsonField.of("visa"))
fun of(value: String) = Category(JsonField.of(value))
}
enum class Known {
VISA,
}
enum class Value {
VISA,
_UNKNOWN,
}
fun value(): Value =
when (this) {
VISA -> Value.VISA
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
VISA -> Known.VISA
else -> throw IncreaseInvalidDataException("Unknown Category: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields specific to the `visa` network. */
@JsonDeserialize(builder = Visa.Builder::class)
@NoAutoDetect
class Visa
private constructor(
private val electronicCommerceIndicator: JsonField,
private val pointOfServiceEntryMode: JsonField,
private val standInProcessingReason: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* 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.getNullable("electronic_commerce_indicator")
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
fun pointOfServiceEntryMode(): PointOfServiceEntryMode? =
pointOfServiceEntryMode.getNullable("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.
*/
fun standInProcessingReason(): StandInProcessingReason? =
standInProcessingReason.getNullable("stand_in_processing_reason")
/**
* 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.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
fun _electronicCommerceIndicator() = electronicCommerceIndicator
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
fun _pointOfServiceEntryMode() = pointOfServiceEntryMode
/**
* Only present when `actioner: network`. Describes why a card authorization was
* approved or declined by Visa through stand-in processing.
*/
@JsonProperty("stand_in_processing_reason")
@ExcludeMissing
fun _standInProcessingReason() = standInProcessingReason
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Visa = apply {
if (!validated) {
electronicCommerceIndicator()
pointOfServiceEntryMode()
standInProcessingReason()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var electronicCommerceIndicator:
JsonField =
JsonMissing.of()
private var pointOfServiceEntryMode: JsonField =
JsonMissing.of()
private var standInProcessingReason: JsonField =
JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(visa: Visa) = apply {
this.electronicCommerceIndicator = visa.electronicCommerceIndicator
this.pointOfServiceEntryMode = visa.pointOfServiceEntryMode
this.standInProcessingReason = visa.standInProcessingReason
additionalProperties(visa.additionalProperties)
}
/**
* 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.of(electronicCommerceIndicator))
/**
* 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.
*/
@JsonProperty("electronic_commerce_indicator")
@ExcludeMissing
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.of(pointOfServiceEntryMode))
/**
* The method used to enter the cardholder's primary account number and card
* expiration date.
*/
@JsonProperty("point_of_service_entry_mode")
@ExcludeMissing
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.of(standInProcessingReason))
/**
* Only present when `actioner: network`. Describes why a card authorization
* was approved or declined by Visa through stand-in processing.
*/
@JsonProperty("stand_in_processing_reason")
@ExcludeMissing
fun standInProcessingReason(
standInProcessingReason: JsonField
) = apply { this.standInProcessingReason = standInProcessingReason }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): Visa =
Visa(
electronicCommerceIndicator,
pointOfServiceEntryMode,
standInProcessingReason,
additionalProperties.toImmutable(),
)
}
class ElectronicCommerceIndicator
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is ElectronicCommerceIndicator && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(JsonField.of("mail_phone_order"))
val RECURRING = ElectronicCommerceIndicator(JsonField.of("recurring"))
val INSTALLMENT =
ElectronicCommerceIndicator(JsonField.of("installment"))
val UNKNOWN_MAIL_PHONE_ORDER =
ElectronicCommerceIndicator(
JsonField.of("unknown_mail_phone_order")
)
val SECURE_ELECTRONIC_COMMERCE =
ElectronicCommerceIndicator(
JsonField.of("secure_electronic_commerce")
)
val NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT =
ElectronicCommerceIndicator(
JsonField.of(
"non_authenticated_security_transaction_at_3ds_capable_merchant"
)
)
val NON_AUTHENTICATED_SECURITY_TRANSACTION =
ElectronicCommerceIndicator(
JsonField.of("non_authenticated_security_transaction")
)
val NON_SECURE_TRANSACTION =
ElectronicCommerceIndicator(JsonField.of("non_secure_transaction"))
fun of(value: String) = ElectronicCommerceIndicator(JsonField.of(value))
}
enum class Known {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
}
enum class Value {
MAIL_PHONE_ORDER,
RECURRING,
INSTALLMENT,
UNKNOWN_MAIL_PHONE_ORDER,
SECURE_ELECTRONIC_COMMERCE,
NON_AUTHENTICATED_SECURITY_TRANSACTION_AT_3DS_CAPABLE_MERCHANT,
NON_AUTHENTICATED_SECURITY_TRANSACTION,
NON_SECURE_TRANSACTION,
_UNKNOWN,
}
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
}
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"
)
}
fun asString(): String = _value().asStringOrThrow()
}
class PointOfServiceEntryMode
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is PointOfServiceEntryMode && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val UNKNOWN = PointOfServiceEntryMode(JsonField.of("unknown"))
val MANUAL = PointOfServiceEntryMode(JsonField.of("manual"))
val MAGNETIC_STRIPE_NO_CVV =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe_no_cvv"))
val OPTICAL_CODE = PointOfServiceEntryMode(JsonField.of("optical_code"))
val INTEGRATED_CIRCUIT_CARD =
PointOfServiceEntryMode(JsonField.of("integrated_circuit_card"))
val CONTACTLESS = PointOfServiceEntryMode(JsonField.of("contactless"))
val CREDENTIAL_ON_FILE =
PointOfServiceEntryMode(JsonField.of("credential_on_file"))
val MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("magnetic_stripe"))
val CONTACTLESS_MAGNETIC_STRIPE =
PointOfServiceEntryMode(JsonField.of("contactless_magnetic_stripe"))
val INTEGRATED_CIRCUIT_CARD_NO_CVV =
PointOfServiceEntryMode(
JsonField.of("integrated_circuit_card_no_cvv")
)
fun of(value: String) = PointOfServiceEntryMode(JsonField.of(value))
}
enum class Known {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
}
enum class Value {
UNKNOWN,
MANUAL,
MAGNETIC_STRIPE_NO_CVV,
OPTICAL_CODE,
INTEGRATED_CIRCUIT_CARD,
CONTACTLESS,
CREDENTIAL_ON_FILE,
MAGNETIC_STRIPE,
CONTACTLESS_MAGNETIC_STRIPE,
INTEGRATED_CIRCUIT_CARD_NO_CVV,
_UNKNOWN,
}
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
}
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"
)
}
fun asString(): String = _value().asStringOrThrow()
}
class StandInProcessingReason
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is StandInProcessingReason && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ISSUER_ERROR = StandInProcessingReason(JsonField.of("issuer_error"))
val INVALID_PHYSICAL_CARD =
StandInProcessingReason(JsonField.of("invalid_physical_card"))
val INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE =
StandInProcessingReason(
JsonField.of(
"invalid_cardholder_authentication_verification_value"
)
)
val INTERNAL_VISA_ERROR =
StandInProcessingReason(JsonField.of("internal_visa_error"))
val MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED =
StandInProcessingReason(
JsonField.of(
"merchant_transaction_advisory_service_authentication_required"
)
)
val OTHER = StandInProcessingReason(JsonField.of("other"))
fun of(value: String) = StandInProcessingReason(JsonField.of(value))
}
enum class Known {
ISSUER_ERROR,
INVALID_PHYSICAL_CARD,
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
INTERNAL_VISA_ERROR,
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
OTHER,
}
enum class Value {
ISSUER_ERROR,
INVALID_PHYSICAL_CARD,
INVALID_CARDHOLDER_AUTHENTICATION_VERIFICATION_VALUE,
INTERNAL_VISA_ERROR,
MERCHANT_TRANSACTION_ADVISORY_SERVICE_AUTHENTICATION_REQUIRED,
OTHER,
_UNKNOWN,
}
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
OTHER -> Value.OTHER
else -> Value._UNKNOWN
}
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
OTHER -> Known.OTHER
else ->
throw IncreaseInvalidDataException(
"Unknown StandInProcessingReason: $value"
)
}
fun asString(): String = _value().asStringOrThrow()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Visa && this.electronicCommerceIndicator == other.electronicCommerceIndicator && this.pointOfServiceEntryMode == other.pointOfServiceEntryMode && this.standInProcessingReason == other.standInProcessingReason && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(electronicCommerceIndicator, pointOfServiceEntryMode, standInProcessingReason, additionalProperties) /* spotless:on */
}
return 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 /* spotless:off */ other is NetworkDetails && this.category == other.category && this.visa == other.visa && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(category, visa, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"NetworkDetails{category=$category, visa=$visa, additionalProperties=$additionalProperties}"
}
/** Network-specific identifiers for a specific request or transaction. */
@JsonDeserialize(builder = NetworkIdentifiers.Builder::class)
@NoAutoDetect
class NetworkIdentifiers
private constructor(
private val retrievalReferenceNumber: JsonField,
private val traceNumber: JsonField,
private val transactionId: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* 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(): String? =
retrievalReferenceNumber.getNullable("retrieval_reference_number")
/**
* A counter used to verify an individual authorization. Expected to be unique per
* acquirer within a window of time.
*/
fun traceNumber(): String? = traceNumber.getNullable("trace_number")
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
fun transactionId(): String? = transactionId.getNullable("transaction_id")
/**
* 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.
*/
@JsonProperty("retrieval_reference_number")
@ExcludeMissing
fun _retrievalReferenceNumber() = retrievalReferenceNumber
/**
* A counter used to verify an individual authorization. Expected to be unique per
* acquirer within a window of time.
*/
@JsonProperty("trace_number") @ExcludeMissing fun _traceNumber() = traceNumber
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
@JsonProperty("transaction_id") @ExcludeMissing fun _transactionId() = transactionId
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): NetworkIdentifiers = apply {
if (!validated) {
retrievalReferenceNumber()
traceNumber()
transactionId()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var retrievalReferenceNumber: JsonField = JsonMissing.of()
private var traceNumber: JsonField = JsonMissing.of()
private var transactionId: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(networkIdentifiers: NetworkIdentifiers) = apply {
this.retrievalReferenceNumber = networkIdentifiers.retrievalReferenceNumber
this.traceNumber = networkIdentifiers.traceNumber
this.transactionId = networkIdentifiers.transactionId
additionalProperties(networkIdentifiers.additionalProperties)
}
/**
* 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.of(retrievalReferenceNumber))
/**
* 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.
*/
@JsonProperty("retrieval_reference_number")
@ExcludeMissing
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.of(traceNumber))
/**
* A counter used to verify an individual authorization. Expected to be unique
* per acquirer within a window of time.
*/
@JsonProperty("trace_number")
@ExcludeMissing
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.of(transactionId))
/**
* A globally unique transaction identifier provided by the card network, used
* across multiple life-cycle requests.
*/
@JsonProperty("transaction_id")
@ExcludeMissing
fun transactionId(transactionId: JsonField) = apply {
this.transactionId = transactionId
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): NetworkIdentifiers =
NetworkIdentifiers(
retrievalReferenceNumber,
traceNumber,
transactionId,
additionalProperties.toImmutable(),
)
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is NetworkIdentifiers && this.retrievalReferenceNumber == other.retrievalReferenceNumber && this.traceNumber == other.traceNumber && this.transactionId == other.transactionId && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(retrievalReferenceNumber, traceNumber, transactionId, additionalProperties) /* spotless:on */
}
return hashCode
}
override fun toString() =
"NetworkIdentifiers{retrievalReferenceNumber=$retrievalReferenceNumber, traceNumber=$traceNumber, transactionId=$transactionId, additionalProperties=$additionalProperties}"
}
class ProcessingCategory
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is ProcessingCategory && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACCOUNT_FUNDING = ProcessingCategory(JsonField.of("account_funding"))
val AUTOMATIC_FUEL_DISPENSER =
ProcessingCategory(JsonField.of("automatic_fuel_dispenser"))
val BILL_PAYMENT = ProcessingCategory(JsonField.of("bill_payment"))
val PURCHASE = ProcessingCategory(JsonField.of("purchase"))
val QUASI_CASH = ProcessingCategory(JsonField.of("quasi_cash"))
val REFUND = ProcessingCategory(JsonField.of("refund"))
fun of(value: String) = ProcessingCategory(JsonField.of(value))
}
enum class Known {
ACCOUNT_FUNDING,
AUTOMATIC_FUEL_DISPENSER,
BILL_PAYMENT,
PURCHASE,
QUASI_CASH,
REFUND,
}
enum class Value {
ACCOUNT_FUNDING,
AUTOMATIC_FUEL_DISPENSER,
BILL_PAYMENT,
PURCHASE,
QUASI_CASH,
REFUND,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACCOUNT_FUNDING -> Value.ACCOUNT_FUNDING
AUTOMATIC_FUEL_DISPENSER -> Value.AUTOMATIC_FUEL_DISPENSER
BILL_PAYMENT -> Value.BILL_PAYMENT
PURCHASE -> Value.PURCHASE
QUASI_CASH -> Value.QUASI_CASH
REFUND -> Value.REFUND
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACCOUNT_FUNDING -> Known.ACCOUNT_FUNDING
AUTOMATIC_FUEL_DISPENSER -> Known.AUTOMATIC_FUEL_DISPENSER
BILL_PAYMENT -> Known.BILL_PAYMENT
PURCHASE -> Known.PURCHASE
QUASI_CASH -> Known.QUASI_CASH
REFUND -> Known.REFUND
else ->
throw IncreaseInvalidDataException("Unknown ProcessingCategory: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class Type
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Type && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CARD_AUTHORIZATION = Type(JsonField.of("card_authorization"))
fun of(value: String) = Type(JsonField.of(value))
}
enum class Known {
CARD_AUTHORIZATION,
}
enum class Value {
CARD_AUTHORIZATION,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CARD_AUTHORIZATION -> Value.CARD_AUTHORIZATION
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CARD_AUTHORIZATION -> Known.CARD_AUTHORIZATION
else -> throw IncreaseInvalidDataException("Unknown Type: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
/** Fields related to verification of cardholder-provided values. */
@JsonDeserialize(builder = Verification.Builder::class)
@NoAutoDetect
class Verification
private constructor(
private val cardVerificationCode: JsonField,
private val cardholderAddress: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
fun cardVerificationCode(): CardVerificationCode =
cardVerificationCode.getRequired("card_verification_code")
/**
* Cardholder address provided in the authorization request and the address on file
* we verified it against.
*/
fun cardholderAddress(): CardholderAddress =
cardholderAddress.getRequired("cardholder_address")
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
@JsonProperty("card_verification_code")
@ExcludeMissing
fun _cardVerificationCode() = cardVerificationCode
/**
* Cardholder address provided in the authorization request and the address on file
* we verified it against.
*/
@JsonProperty("cardholder_address")
@ExcludeMissing
fun _cardholderAddress() = cardholderAddress
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Verification = apply {
if (!validated) {
cardVerificationCode().validate()
cardholderAddress().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var cardVerificationCode: JsonField =
JsonMissing.of()
private var cardholderAddress: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(verification: Verification) = apply {
this.cardVerificationCode = verification.cardVerificationCode
this.cardholderAddress = verification.cardholderAddress
additionalProperties(verification.additionalProperties)
}
/**
* 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))
/**
* Fields related to verification of the Card Verification Code, a 3-digit code
* on the back of the card.
*/
@JsonProperty("card_verification_code")
@ExcludeMissing
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))
/**
* Cardholder address provided in the authorization request and the address on
* file we verified it against.
*/
@JsonProperty("cardholder_address")
@ExcludeMissing
fun cardholderAddress(cardholderAddress: JsonField) = apply {
this.cardholderAddress = cardholderAddress
}
fun additionalProperties(additionalProperties: Map) = apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.putAll(additionalProperties)
}
fun build(): Verification =
Verification(
cardVerificationCode,
cardholderAddress,
additionalProperties.toImmutable(),
)
}
/**
* Fields related to verification of the Card Verification Code, a 3-digit code on
* the back of the card.
*/
@JsonDeserialize(builder = CardVerificationCode.Builder::class)
@NoAutoDetect
class CardVerificationCode
private constructor(
private val result: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
/** The result of verifying the Card Verification Code. */
fun result(): Result = result.getRequired("result")
/** The result of verifying the Card Verification Code. */
@JsonProperty("result") @ExcludeMissing fun _result() = result
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardVerificationCode = apply {
if (!validated) {
result()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var result: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(cardVerificationCode: CardVerificationCode) = apply {
this.result = cardVerificationCode.result
additionalProperties(cardVerificationCode.additionalProperties)
}
/** The result of verifying the Card Verification Code. */
fun result(result: Result) = result(JsonField.of(result))
/** The result of verifying the Card Verification Code. */
@JsonProperty("result")
@ExcludeMissing
fun result(result: JsonField) = apply { this.result = result }
fun additionalProperties(additionalProperties: Map) =
apply {
this.additionalProperties.clear()
this.additionalProperties.putAll(additionalProperties)
}
@JsonAnySetter
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
this.additionalProperties.put(key, value)
}
fun putAllAdditionalProperties(
additionalProperties: Map
) = apply { this.additionalProperties.putAll(additionalProperties) }
fun build(): CardVerificationCode =
CardVerificationCode(result, additionalProperties.toImmutable())
}
class Result
@JsonCreator
private constructor(
private val value: JsonField,
) : Enum {
@com.fasterxml.jackson.annotation.JsonValue
fun _value(): JsonField = value
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is Result && this.value == other.value /* spotless:on */
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val NOT_CHECKED = Result(JsonField.of("not_checked"))
val MATCH = Result(JsonField.of("match"))
val NO_MATCH = Result(JsonField.of("no_match"))
fun of(value: String) = Result(JsonField.of(value))
}
enum class Known {
NOT_CHECKED,
MATCH,
NO_MATCH,
}
enum class Value {
NOT_CHECKED,
MATCH,
NO_MATCH,
_UNKNOWN,
}
fun value(): Value =
when (this) {
NOT_CHECKED -> Value.NOT_CHECKED
MATCH -> Value.MATCH
NO_MATCH -> Value.NO_MATCH
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
NOT_CHECKED -> Known.NOT_CHECKED
MATCH -> Known.MATCH
NO_MATCH -> Known.NO_MATCH
else -> throw IncreaseInvalidDataException("Unknown Result: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return /* spotless:off */ other is CardVerificationCode && this.result == other.result && this.additionalProperties == other.additionalProperties /* spotless:on */
}
private var hashCode: Int = 0
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode = /* spotless:off */ Objects.hash(result, additionalProperties) /* spotless:on */
}
return 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.
*/
@JsonDeserialize(builder = CardholderAddress.Builder::class)
@NoAutoDetect
class CardholderAddress
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: Map,
) {
private var validated: Boolean = false
/** Line 1 of the address on file for the cardholder. */
fun actualLine1(): String? = actualLine1.getNullable("actual_line1")
/** The postal code of the address on file for the cardholder. */
fun actualPostalCode(): String? =
actualPostalCode.getNullable("actual_postal_code")
/**
* The cardholder address line 1 provided for verification in the authorization
* request.
*/
fun providedLine1(): String? = providedLine1.getNullable("provided_line1")
/** The postal code provided for verification in the authorization request. */
fun providedPostalCode(): String? =
providedPostalCode.getNullable("provided_postal_code")
/** The address verification result returned to the card network. */
fun result(): Result = result.getRequired("result")
/** Line 1 of the address on file for the cardholder. */
@JsonProperty("actual_line1") @ExcludeMissing fun _actualLine1() = actualLine1
/** The postal code of the address on file for the cardholder. */
@JsonProperty("actual_postal_code")
@ExcludeMissing
fun _actualPostalCode() = actualPostalCode
/**
* The cardholder address line 1 provided for verification in the authorization
* request.
*/
@JsonProperty("provided_line1")
@ExcludeMissing
fun _providedLine1() = providedLine1
/** The postal code provided for verification in the authorization request. */
@JsonProperty("provided_postal_code")
@ExcludeMissing
fun _providedPostalCode() = providedPostalCode
/** The address verification result returned to the card network. */
@JsonProperty("result") @ExcludeMissing fun _result() = result
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardholderAddress = apply {
if (!validated) {
actualLine1()
actualPostalCode()
providedLine1()
providedPostalCode()
result()
validated = true
}
}
fun toBuilder() = Builder().from(this)
companion object {
fun builder() = Builder()
}
class Builder {
private var actualLine1: JsonField = JsonMissing.of()
private var actualPostalCode: JsonField = JsonMissing.of()
private var providedLine1: JsonField = JsonMissing.of()
private var providedPostalCode: JsonField = JsonMissing.of()
private var result: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap =
mutableMapOf()
internal fun from(cardholderAddress: CardholderAddress) = apply {
this.actualLine1 = cardholderAddress.actualLine1
this.actualPostalCode = cardholderAddress.actualPostalCode
this.providedLine1 = cardholderAddress.providedLine1
this.providedPostalCode = cardholderAddress.providedPostalCode
this.result = cardholderAddress.result
additionalProperties(cardholderAddress.additionalProperties)
}
/** Line 1 of the address on file for the cardholder. */
fun actualLine1(actualLine1: String) =
actualLine1(JsonField.of(actualLine1))
/** Line 1 of the address on file for the cardholder. */
@JsonProperty("actual_line1")
@ExcludeMissing
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.of(actualPostalCode))
/** The postal code of the address on file for the cardholder. */
@JsonProperty("actual_postal_code")
@ExcludeMissing
fun actualPostalCode(actualPostalCode: JsonField