com.lithic.api.models.Transaction.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of lithic-kotlin-core Show documentation
Show all versions of lithic-kotlin-core Show documentation
The Lithic Developer API is designed to provide a predictable programmatic
interface for accessing your Lithic account through an API and transaction
webhooks. Note that your API key is a secret and should be treated as such.
Don't share it with anyone, including us. We will never ask you for it.
// File generated from our OpenAPI spec by Stainless.
package com.lithic.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.lithic.api.core.Enum
import com.lithic.api.core.ExcludeMissing
import com.lithic.api.core.JsonField
import com.lithic.api.core.JsonMissing
import com.lithic.api.core.JsonValue
import com.lithic.api.core.NoAutoDetect
import com.lithic.api.core.toUnmodifiable
import com.lithic.api.errors.LithicInvalidDataException
import java.time.OffsetDateTime
import java.util.Objects
@JsonDeserialize(builder = Transaction.Builder::class)
@NoAutoDetect
class Transaction
private constructor(
private val acquirerFee: JsonField,
private val acquirerReferenceNumber: JsonField,
private val amount: JsonField,
private val amounts: JsonField,
private val authorizationAmount: JsonField,
private val authorizationCode: JsonField,
private val avs: JsonField,
private val cardToken: JsonField,
private val cardholderAuthentication: JsonField,
private val created: JsonField,
private val events: JsonField>,
private val merchant: JsonField,
private val merchantAmount: JsonField,
private val merchantAuthorizationAmount: JsonField,
private val merchantCurrency: JsonField,
private val network: JsonField,
private val networkRiskScore: JsonField,
private val pos: JsonField,
private val result: JsonField,
private val settledAmount: JsonField,
private val status: JsonField,
private val token: JsonField,
private val tokenInfo: JsonField,
private val updated: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/**
* Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the
* currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative value
* to indicate credited fees.
*/
fun acquirerFee(): Long? = acquirerFee.getNullable("acquirer_fee")
/**
* Unique identifier assigned to a transaction by the acquirer that can be used in dispute and
* chargeback filing.
*/
fun acquirerReferenceNumber(): String? =
acquirerReferenceNumber.getNullable("acquirer_reference_number")
/**
* Authorization amount of the transaction (in cents), including any acquirer fees. This may
* change over time, and will represent the settled amount once the transaction is settled.
*/
fun amount(): Long = amount.getRequired("amount")
fun amounts(): TransactionAggregateAmounts = amounts.getRequired("amounts")
/**
* Authorization amount (in cents) of the transaction, including any acquirer fees. This amount
* always represents the amount authorized for the transaction, unaffected by settlement.
*/
fun authorizationAmount(): Long? = authorizationAmount.getNullable("authorization_amount")
/**
* A fixed-width 6-digit numeric identifier that can be used to identify a transaction with
* networks.
*/
fun authorizationCode(): String? = authorizationCode.getNullable("authorization_code")
fun avs(): Avs? = avs.getNullable("avs")
/** Token for the card used in this transaction. */
fun cardToken(): String = cardToken.getRequired("card_token")
fun cardholderAuthentication(): CardholderAuthentication? =
cardholderAuthentication.getNullable("cardholder_authentication")
/** Date and time when the transaction first occurred. UTC time zone. */
fun created(): OffsetDateTime = created.getRequired("created")
/** A list of all events that have modified this transaction. */
fun events(): List = events.getRequired("events")
fun merchant(): Merchant = merchant.getRequired("merchant")
/**
* Analogous to the "amount" property, but will represent the amount in the transaction's local
* currency (smallest unit), including any acquirer fees.
*/
fun merchantAmount(): Long? = merchantAmount.getNullable("merchant_amount")
/**
* Analogous to the "authorization_amount" property, but will represent the amount in the
* transaction's local currency (smallest unit), including any acquirer fees.
*/
fun merchantAuthorizationAmount(): Long? =
merchantAuthorizationAmount.getNullable("merchant_authorization_amount")
/** 3-digit alphabetic ISO 4217 code for the local currency of the transaction. */
fun merchantCurrency(): String = merchantCurrency.getRequired("merchant_currency")
/**
* Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, `VISA`, or
* `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the network code from the upstream
* provider.
*/
fun network(): Network? = network.getNullable("network")
/**
* Network-provided score assessing risk level associated with a given authorization. Scores are
* on a range of 0-999, with 0 representing the lowest risk and 999 representing the highest
* risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will normalize
* the score by multiplying the raw score by 10x.
*
* A score may not be available for all authorizations, and where it is not, this field will be
* set to null.
*/
fun networkRiskScore(): Long? = networkRiskScore.getNullable("network_risk_score")
fun pos(): Pos? = pos.getNullable("pos")
/** `APPROVED` or decline reason. See Event result types */
fun result(): Result = result.getRequired("result")
/**
* Amount of the transaction that has been settled (in cents), including any acquirer fees. This
* may change over time.
*/
fun settledAmount(): Long = settledAmount.getRequired("settled_amount")
/**
* Status types:
* - `DECLINED` - The transaction was declined.
* - `EXPIRED` - Lithic reversed the authorization as it has passed its expiration time.
* - `PENDING` - Authorization is pending completion from the merchant.
* - `SETTLED` - The transaction is complete.
* - `VOIDED` - The merchant has voided the previously pending authorization.
*/
fun status(): Status = status.getRequired("status")
/** Globally unique identifier. */
fun token(): String = token.getRequired("token")
fun tokenInfo(): TokenInfo? = tokenInfo.getNullable("token_info")
/** Date and time when the transaction last updated. UTC time zone. */
fun updated(): OffsetDateTime = updated.getRequired("updated")
/**
* Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the
* currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative value
* to indicate credited fees.
*/
@JsonProperty("acquirer_fee") @ExcludeMissing fun _acquirerFee() = acquirerFee
/**
* Unique identifier assigned to a transaction by the acquirer that can be used in dispute and
* chargeback filing.
*/
@JsonProperty("acquirer_reference_number")
@ExcludeMissing
fun _acquirerReferenceNumber() = acquirerReferenceNumber
/**
* Authorization amount of the transaction (in cents), including any acquirer fees. This may
* change over time, and will represent the settled amount once the transaction is settled.
*/
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
@JsonProperty("amounts") @ExcludeMissing fun _amounts() = amounts
/**
* Authorization amount (in cents) of the transaction, including any acquirer fees. This amount
* always represents the amount authorized for the transaction, unaffected by settlement.
*/
@JsonProperty("authorization_amount")
@ExcludeMissing
fun _authorizationAmount() = authorizationAmount
/**
* A fixed-width 6-digit numeric identifier that can be used to identify a transaction with
* networks.
*/
@JsonProperty("authorization_code") @ExcludeMissing fun _authorizationCode() = authorizationCode
@JsonProperty("avs") @ExcludeMissing fun _avs() = avs
/** Token for the card used in this transaction. */
@JsonProperty("card_token") @ExcludeMissing fun _cardToken() = cardToken
@JsonProperty("cardholder_authentication")
@ExcludeMissing
fun _cardholderAuthentication() = cardholderAuthentication
/** Date and time when the transaction first occurred. UTC time zone. */
@JsonProperty("created") @ExcludeMissing fun _created() = created
/** A list of all events that have modified this transaction. */
@JsonProperty("events") @ExcludeMissing fun _events() = events
@JsonProperty("merchant") @ExcludeMissing fun _merchant() = merchant
/**
* Analogous to the "amount" property, but will represent the amount in the transaction's local
* currency (smallest unit), including any acquirer fees.
*/
@JsonProperty("merchant_amount") @ExcludeMissing fun _merchantAmount() = merchantAmount
/**
* Analogous to the "authorization_amount" property, but will represent the amount in the
* transaction's local currency (smallest unit), including any acquirer fees.
*/
@JsonProperty("merchant_authorization_amount")
@ExcludeMissing
fun _merchantAuthorizationAmount() = merchantAuthorizationAmount
/** 3-digit alphabetic ISO 4217 code for the local currency of the transaction. */
@JsonProperty("merchant_currency") @ExcludeMissing fun _merchantCurrency() = merchantCurrency
/**
* Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, `VISA`, or
* `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the network code from the upstream
* provider.
*/
@JsonProperty("network") @ExcludeMissing fun _network() = network
/**
* Network-provided score assessing risk level associated with a given authorization. Scores are
* on a range of 0-999, with 0 representing the lowest risk and 999 representing the highest
* risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will normalize
* the score by multiplying the raw score by 10x.
*
* A score may not be available for all authorizations, and where it is not, this field will be
* set to null.
*/
@JsonProperty("network_risk_score") @ExcludeMissing fun _networkRiskScore() = networkRiskScore
@JsonProperty("pos") @ExcludeMissing fun _pos() = pos
/** `APPROVED` or decline reason. See Event result types */
@JsonProperty("result") @ExcludeMissing fun _result() = result
/**
* Amount of the transaction that has been settled (in cents), including any acquirer fees. This
* may change over time.
*/
@JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount
/**
* Status types:
* - `DECLINED` - The transaction was declined.
* - `EXPIRED` - Lithic reversed the authorization as it has passed its expiration time.
* - `PENDING` - Authorization is pending completion from the merchant.
* - `SETTLED` - The transaction is complete.
* - `VOIDED` - The merchant has voided the previously pending authorization.
*/
@JsonProperty("status") @ExcludeMissing fun _status() = status
/** Globally unique identifier. */
@JsonProperty("token") @ExcludeMissing fun _token() = token
@JsonProperty("token_info") @ExcludeMissing fun _tokenInfo() = tokenInfo
/** Date and time when the transaction last updated. UTC time zone. */
@JsonProperty("updated") @ExcludeMissing fun _updated() = updated
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Transaction = apply {
if (!validated) {
acquirerFee()
acquirerReferenceNumber()
amount()
amounts().validate()
authorizationAmount()
authorizationCode()
avs()?.validate()
cardToken()
cardholderAuthentication()?.validate()
created()
events().forEach { it.validate() }
merchant().validate()
merchantAmount()
merchantAuthorizationAmount()
merchantCurrency()
network()
networkRiskScore()
pos()?.validate()
result()
settledAmount()
status()
token()
tokenInfo()?.validate()
updated()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Transaction &&
this.acquirerFee == other.acquirerFee &&
this.acquirerReferenceNumber == other.acquirerReferenceNumber &&
this.amount == other.amount &&
this.amounts == other.amounts &&
this.authorizationAmount == other.authorizationAmount &&
this.authorizationCode == other.authorizationCode &&
this.avs == other.avs &&
this.cardToken == other.cardToken &&
this.cardholderAuthentication == other.cardholderAuthentication &&
this.created == other.created &&
this.events == other.events &&
this.merchant == other.merchant &&
this.merchantAmount == other.merchantAmount &&
this.merchantAuthorizationAmount == other.merchantAuthorizationAmount &&
this.merchantCurrency == other.merchantCurrency &&
this.network == other.network &&
this.networkRiskScore == other.networkRiskScore &&
this.pos == other.pos &&
this.result == other.result &&
this.settledAmount == other.settledAmount &&
this.status == other.status &&
this.token == other.token &&
this.tokenInfo == other.tokenInfo &&
this.updated == other.updated &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
acquirerFee,
acquirerReferenceNumber,
amount,
amounts,
authorizationAmount,
authorizationCode,
avs,
cardToken,
cardholderAuthentication,
created,
events,
merchant,
merchantAmount,
merchantAuthorizationAmount,
merchantCurrency,
network,
networkRiskScore,
pos,
result,
settledAmount,
status,
token,
tokenInfo,
updated,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Transaction{acquirerFee=$acquirerFee, acquirerReferenceNumber=$acquirerReferenceNumber, amount=$amount, amounts=$amounts, authorizationAmount=$authorizationAmount, authorizationCode=$authorizationCode, avs=$avs, cardToken=$cardToken, cardholderAuthentication=$cardholderAuthentication, created=$created, events=$events, merchant=$merchant, merchantAmount=$merchantAmount, merchantAuthorizationAmount=$merchantAuthorizationAmount, merchantCurrency=$merchantCurrency, network=$network, networkRiskScore=$networkRiskScore, pos=$pos, result=$result, settledAmount=$settledAmount, status=$status, token=$token, tokenInfo=$tokenInfo, updated=$updated, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var acquirerFee: JsonField = JsonMissing.of()
private var acquirerReferenceNumber: JsonField = JsonMissing.of()
private var amount: JsonField = JsonMissing.of()
private var amounts: JsonField = JsonMissing.of()
private var authorizationAmount: JsonField = JsonMissing.of()
private var authorizationCode: JsonField = JsonMissing.of()
private var avs: JsonField = JsonMissing.of()
private var cardToken: JsonField = JsonMissing.of()
private var cardholderAuthentication: JsonField = JsonMissing.of()
private var created: JsonField = JsonMissing.of()
private var events: JsonField> = JsonMissing.of()
private var merchant: JsonField = JsonMissing.of()
private var merchantAmount: JsonField = JsonMissing.of()
private var merchantAuthorizationAmount: JsonField = JsonMissing.of()
private var merchantCurrency: JsonField = JsonMissing.of()
private var network: JsonField = JsonMissing.of()
private var networkRiskScore: JsonField = JsonMissing.of()
private var pos: JsonField = JsonMissing.of()
private var result: JsonField = JsonMissing.of()
private var settledAmount: JsonField = JsonMissing.of()
private var status: JsonField = JsonMissing.of()
private var token: JsonField = JsonMissing.of()
private var tokenInfo: JsonField = JsonMissing.of()
private var updated: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(transaction: Transaction) = apply {
this.acquirerFee = transaction.acquirerFee
this.acquirerReferenceNumber = transaction.acquirerReferenceNumber
this.amount = transaction.amount
this.amounts = transaction.amounts
this.authorizationAmount = transaction.authorizationAmount
this.authorizationCode = transaction.authorizationCode
this.avs = transaction.avs
this.cardToken = transaction.cardToken
this.cardholderAuthentication = transaction.cardholderAuthentication
this.created = transaction.created
this.events = transaction.events
this.merchant = transaction.merchant
this.merchantAmount = transaction.merchantAmount
this.merchantAuthorizationAmount = transaction.merchantAuthorizationAmount
this.merchantCurrency = transaction.merchantCurrency
this.network = transaction.network
this.networkRiskScore = transaction.networkRiskScore
this.pos = transaction.pos
this.result = transaction.result
this.settledAmount = transaction.settledAmount
this.status = transaction.status
this.token = transaction.token
this.tokenInfo = transaction.tokenInfo
this.updated = transaction.updated
additionalProperties(transaction.additionalProperties)
}
/**
* Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the
* currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative
* value to indicate credited fees.
*/
fun acquirerFee(acquirerFee: Long) = acquirerFee(JsonField.of(acquirerFee))
/**
* Fee assessed by the merchant and paid for by the cardholder in the smallest unit of the
* currency. Will be zero if no fee is assessed. Rebates may be transmitted as a negative
* value to indicate credited fees.
*/
@JsonProperty("acquirer_fee")
@ExcludeMissing
fun acquirerFee(acquirerFee: JsonField) = apply { this.acquirerFee = acquirerFee }
/**
* Unique identifier assigned to a transaction by the acquirer that can be used in dispute
* and chargeback filing.
*/
fun acquirerReferenceNumber(acquirerReferenceNumber: String) =
acquirerReferenceNumber(JsonField.of(acquirerReferenceNumber))
/**
* Unique identifier assigned to a transaction by the acquirer that can be used in dispute
* and chargeback filing.
*/
@JsonProperty("acquirer_reference_number")
@ExcludeMissing
fun acquirerReferenceNumber(acquirerReferenceNumber: JsonField) = apply {
this.acquirerReferenceNumber = acquirerReferenceNumber
}
/**
* Authorization amount of the transaction (in cents), including any acquirer fees. This may
* change over time, and will represent the settled amount once the transaction is settled.
*/
fun amount(amount: Long) = amount(JsonField.of(amount))
/**
* Authorization amount of the transaction (in cents), including any acquirer fees. This may
* change over time, and will represent the settled amount once the transaction is settled.
*/
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
fun amounts(amounts: TransactionAggregateAmounts) = amounts(JsonField.of(amounts))
@JsonProperty("amounts")
@ExcludeMissing
fun amounts(amounts: JsonField) = apply {
this.amounts = amounts
}
/**
* Authorization amount (in cents) of the transaction, including any acquirer fees. This
* amount always represents the amount authorized for the transaction, unaffected by
* settlement.
*/
fun authorizationAmount(authorizationAmount: Long) =
authorizationAmount(JsonField.of(authorizationAmount))
/**
* Authorization amount (in cents) of the transaction, including any acquirer fees. This
* amount always represents the amount authorized for the transaction, unaffected by
* settlement.
*/
@JsonProperty("authorization_amount")
@ExcludeMissing
fun authorizationAmount(authorizationAmount: JsonField) = apply {
this.authorizationAmount = authorizationAmount
}
/**
* A fixed-width 6-digit numeric identifier that can be used to identify a transaction with
* networks.
*/
fun authorizationCode(authorizationCode: String) =
authorizationCode(JsonField.of(authorizationCode))
/**
* A fixed-width 6-digit numeric identifier that can be used to identify a transaction with
* networks.
*/
@JsonProperty("authorization_code")
@ExcludeMissing
fun authorizationCode(authorizationCode: JsonField) = apply {
this.authorizationCode = authorizationCode
}
fun avs(avs: Avs) = avs(JsonField.of(avs))
@JsonProperty("avs") @ExcludeMissing fun avs(avs: JsonField) = apply { this.avs = avs }
/** Token for the card used in this transaction. */
fun cardToken(cardToken: String) = cardToken(JsonField.of(cardToken))
/** Token for the card used in this transaction. */
@JsonProperty("card_token")
@ExcludeMissing
fun cardToken(cardToken: JsonField) = apply { this.cardToken = cardToken }
fun cardholderAuthentication(cardholderAuthentication: CardholderAuthentication) =
cardholderAuthentication(JsonField.of(cardholderAuthentication))
@JsonProperty("cardholder_authentication")
@ExcludeMissing
fun cardholderAuthentication(
cardholderAuthentication: JsonField
) = apply { this.cardholderAuthentication = cardholderAuthentication }
/** Date and time when the transaction first occurred. UTC time zone. */
fun created(created: OffsetDateTime) = created(JsonField.of(created))
/** Date and time when the transaction first occurred. UTC time zone. */
@JsonProperty("created")
@ExcludeMissing
fun created(created: JsonField) = apply { this.created = created }
/** A list of all events that have modified this transaction. */
fun events(events: List) = events(JsonField.of(events))
/** A list of all events that have modified this transaction. */
@JsonProperty("events")
@ExcludeMissing
fun events(events: JsonField>) = apply { this.events = events }
fun merchant(merchant: Merchant) = merchant(JsonField.of(merchant))
@JsonProperty("merchant")
@ExcludeMissing
fun merchant(merchant: JsonField) = apply { this.merchant = merchant }
/**
* Analogous to the "amount" property, but will represent the amount in the transaction's
* local currency (smallest unit), including any acquirer fees.
*/
fun merchantAmount(merchantAmount: Long) = merchantAmount(JsonField.of(merchantAmount))
/**
* Analogous to the "amount" property, but will represent the amount in the transaction's
* local currency (smallest unit), including any acquirer fees.
*/
@JsonProperty("merchant_amount")
@ExcludeMissing
fun merchantAmount(merchantAmount: JsonField) = apply {
this.merchantAmount = merchantAmount
}
/**
* Analogous to the "authorization_amount" property, but will represent the amount in the
* transaction's local currency (smallest unit), including any acquirer fees.
*/
fun merchantAuthorizationAmount(merchantAuthorizationAmount: Long) =
merchantAuthorizationAmount(JsonField.of(merchantAuthorizationAmount))
/**
* Analogous to the "authorization_amount" property, but will represent the amount in the
* transaction's local currency (smallest unit), including any acquirer fees.
*/
@JsonProperty("merchant_authorization_amount")
@ExcludeMissing
fun merchantAuthorizationAmount(merchantAuthorizationAmount: JsonField) = apply {
this.merchantAuthorizationAmount = merchantAuthorizationAmount
}
/** 3-digit alphabetic ISO 4217 code for the local currency of the transaction. */
fun merchantCurrency(merchantCurrency: String) =
merchantCurrency(JsonField.of(merchantCurrency))
/** 3-digit alphabetic ISO 4217 code for the local currency of the transaction. */
@JsonProperty("merchant_currency")
@ExcludeMissing
fun merchantCurrency(merchantCurrency: JsonField) = apply {
this.merchantCurrency = merchantCurrency
}
/**
* Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, `VISA`,
* or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the network code from the
* upstream provider.
*/
fun network(network: Network) = network(JsonField.of(network))
/**
* Card network of the authorization. Can be `INTERLINK`, `MAESTRO`, `MASTERCARD`, `VISA`,
* or `UNKNOWN`. Value is `UNKNOWN` when Lithic cannot determine the network code from the
* upstream provider.
*/
@JsonProperty("network")
@ExcludeMissing
fun network(network: JsonField) = apply { this.network = network }
/**
* Network-provided score assessing risk level associated with a given authorization. Scores
* are on a range of 0-999, with 0 representing the lowest risk and 999 representing the
* highest risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will
* normalize the score by multiplying the raw score by 10x.
*
* A score may not be available for all authorizations, and where it is not, this field will
* be set to null.
*/
fun networkRiskScore(networkRiskScore: Long) =
networkRiskScore(JsonField.of(networkRiskScore))
/**
* Network-provided score assessing risk level associated with a given authorization. Scores
* are on a range of 0-999, with 0 representing the lowest risk and 999 representing the
* highest risk. For Visa transactions, where the raw score has a range of 0-99, Lithic will
* normalize the score by multiplying the raw score by 10x.
*
* A score may not be available for all authorizations, and where it is not, this field will
* be set to null.
*/
@JsonProperty("network_risk_score")
@ExcludeMissing
fun networkRiskScore(networkRiskScore: JsonField) = apply {
this.networkRiskScore = networkRiskScore
}
fun pos(pos: Pos) = pos(JsonField.of(pos))
@JsonProperty("pos") @ExcludeMissing fun pos(pos: JsonField) = apply { this.pos = pos }
/** `APPROVED` or decline reason. See Event result types */
fun result(result: Result) = result(JsonField.of(result))
/** `APPROVED` or decline reason. See Event result types */
@JsonProperty("result")
@ExcludeMissing
fun result(result: JsonField) = apply { this.result = result }
/**
* Amount of the transaction that has been settled (in cents), including any acquirer fees.
* This may change over time.
*/
fun settledAmount(settledAmount: Long) = settledAmount(JsonField.of(settledAmount))
/**
* Amount of the transaction that has been settled (in cents), including any acquirer fees.
* This may change over time.
*/
@JsonProperty("settled_amount")
@ExcludeMissing
fun settledAmount(settledAmount: JsonField) = apply {
this.settledAmount = settledAmount
}
/**
* Status types:
* - `DECLINED` - The transaction was declined.
* - `EXPIRED` - Lithic reversed the authorization as it has passed its expiration time.
* - `PENDING` - Authorization is pending completion from the merchant.
* - `SETTLED` - The transaction is complete.
* - `VOIDED` - The merchant has voided the previously pending authorization.
*/
fun status(status: Status) = status(JsonField.of(status))
/**
* Status types:
* - `DECLINED` - The transaction was declined.
* - `EXPIRED` - Lithic reversed the authorization as it has passed its expiration time.
* - `PENDING` - Authorization is pending completion from the merchant.
* - `SETTLED` - The transaction is complete.
* - `VOIDED` - The merchant has voided the previously pending authorization.
*/
@JsonProperty("status")
@ExcludeMissing
fun status(status: JsonField) = apply { this.status = status }
/** Globally unique identifier. */
fun token(token: String) = token(JsonField.of(token))
/** Globally unique identifier. */
@JsonProperty("token")
@ExcludeMissing
fun token(token: JsonField) = apply { this.token = token }
fun tokenInfo(tokenInfo: TokenInfo) = tokenInfo(JsonField.of(tokenInfo))
@JsonProperty("token_info")
@ExcludeMissing
fun tokenInfo(tokenInfo: JsonField) = apply { this.tokenInfo = tokenInfo }
/** Date and time when the transaction last updated. UTC time zone. */
fun updated(updated: OffsetDateTime) = updated(JsonField.of(updated))
/** Date and time when the transaction last updated. UTC time zone. */
@JsonProperty("updated")
@ExcludeMissing
fun updated(updated: JsonField) = apply { this.updated = updated }
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(): Transaction =
Transaction(
acquirerFee,
acquirerReferenceNumber,
amount,
amounts,
authorizationAmount,
authorizationCode,
avs,
cardToken,
cardholderAuthentication,
created,
events.map { it.toUnmodifiable() },
merchant,
merchantAmount,
merchantAuthorizationAmount,
merchantCurrency,
network,
networkRiskScore,
pos,
result,
settledAmount,
status,
token,
tokenInfo,
updated,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = TransactionAggregateAmounts.Builder::class)
@NoAutoDetect
class TransactionAggregateAmounts
private constructor(
private val cardholder: JsonField,
private val hold: JsonField,
private val merchant: JsonField,
private val settlement: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun cardholder(): CardholderAggregateAmount = cardholder.getRequired("cardholder")
fun hold(): HoldAggregateAmount = hold.getRequired("hold")
fun merchant(): MerchantAggregateAmount = merchant.getRequired("merchant")
fun settlement(): SettlementAggregateAmount = settlement.getRequired("settlement")
@JsonProperty("cardholder") @ExcludeMissing fun _cardholder() = cardholder
@JsonProperty("hold") @ExcludeMissing fun _hold() = hold
@JsonProperty("merchant") @ExcludeMissing fun _merchant() = merchant
@JsonProperty("settlement") @ExcludeMissing fun _settlement() = settlement
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): TransactionAggregateAmounts = apply {
if (!validated) {
cardholder().validate()
hold().validate()
merchant().validate()
settlement().validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is TransactionAggregateAmounts &&
this.cardholder == other.cardholder &&
this.hold == other.hold &&
this.merchant == other.merchant &&
this.settlement == other.settlement &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
cardholder,
hold,
merchant,
settlement,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"TransactionAggregateAmounts{cardholder=$cardholder, hold=$hold, merchant=$merchant, settlement=$settlement, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var cardholder: JsonField = JsonMissing.of()
private var hold: JsonField = JsonMissing.of()
private var merchant: JsonField = JsonMissing.of()
private var settlement: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(transactionAggregateAmounts: TransactionAggregateAmounts) = apply {
this.cardholder = transactionAggregateAmounts.cardholder
this.hold = transactionAggregateAmounts.hold
this.merchant = transactionAggregateAmounts.merchant
this.settlement = transactionAggregateAmounts.settlement
additionalProperties(transactionAggregateAmounts.additionalProperties)
}
fun cardholder(cardholder: CardholderAggregateAmount) =
cardholder(JsonField.of(cardholder))
@JsonProperty("cardholder")
@ExcludeMissing
fun cardholder(cardholder: JsonField) = apply {
this.cardholder = cardholder
}
fun hold(hold: HoldAggregateAmount) = hold(JsonField.of(hold))
@JsonProperty("hold")
@ExcludeMissing
fun hold(hold: JsonField) = apply { this.hold = hold }
fun merchant(merchant: MerchantAggregateAmount) = merchant(JsonField.of(merchant))
@JsonProperty("merchant")
@ExcludeMissing
fun merchant(merchant: JsonField) = apply {
this.merchant = merchant
}
fun settlement(settlement: SettlementAggregateAmount) =
settlement(JsonField.of(settlement))
@JsonProperty("settlement")
@ExcludeMissing
fun settlement(settlement: JsonField) = apply {
this.settlement = settlement
}
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(): TransactionAggregateAmounts =
TransactionAggregateAmounts(
cardholder,
hold,
merchant,
settlement,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = CardholderAggregateAmount.Builder::class)
@NoAutoDetect
class CardholderAggregateAmount
private constructor(
private val amount: JsonField,
private val conversionRate: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
fun conversionRate(): String = conversionRate.getRequired("conversion_rate")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
@JsonProperty("conversion_rate") @ExcludeMissing fun _conversionRate() = conversionRate
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardholderAggregateAmount = apply {
if (!validated) {
amount()
conversionRate()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardholderAggregateAmount &&
this.amount == other.amount &&
this.conversionRate == other.conversionRate &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
conversionRate,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardholderAggregateAmount{amount=$amount, conversionRate=$conversionRate, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var conversionRate: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardholderAggregateAmount: CardholderAggregateAmount) = apply {
this.amount = cardholderAggregateAmount.amount
this.conversionRate = cardholderAggregateAmount.conversionRate
this.currency = cardholderAggregateAmount.currency
additionalProperties(cardholderAggregateAmount.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
fun conversionRate(conversionRate: String) =
conversionRate(JsonField.of(conversionRate))
@JsonProperty("conversion_rate")
@ExcludeMissing
fun conversionRate(conversionRate: JsonField) = apply {
this.conversionRate = conversionRate
}
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): CardholderAggregateAmount =
CardholderAggregateAmount(
amount,
conversionRate,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = HoldAggregateAmount.Builder::class)
@NoAutoDetect
class HoldAggregateAmount
private constructor(
private val amount: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): HoldAggregateAmount = apply {
if (!validated) {
amount()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is HoldAggregateAmount &&
this.amount == other.amount &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"HoldAggregateAmount{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(holdAggregateAmount: HoldAggregateAmount) = apply {
this.amount = holdAggregateAmount.amount
this.currency = holdAggregateAmount.currency
additionalProperties(holdAggregateAmount.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): HoldAggregateAmount =
HoldAggregateAmount(
amount,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = MerchantAggregateAmount.Builder::class)
@NoAutoDetect
class MerchantAggregateAmount
private constructor(
private val amount: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): MerchantAggregateAmount = apply {
if (!validated) {
amount()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is MerchantAggregateAmount &&
this.amount == other.amount &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"MerchantAggregateAmount{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(merchantAggregateAmount: MerchantAggregateAmount) = apply {
this.amount = merchantAggregateAmount.amount
this.currency = merchantAggregateAmount.currency
additionalProperties(merchantAggregateAmount.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): MerchantAggregateAmount =
MerchantAggregateAmount(
amount,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = SettlementAggregateAmount.Builder::class)
@NoAutoDetect
class SettlementAggregateAmount
private constructor(
private val amount: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): SettlementAggregateAmount = apply {
if (!validated) {
amount()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is SettlementAggregateAmount &&
this.amount == other.amount &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"SettlementAggregateAmount{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(settlementAggregateAmount: SettlementAggregateAmount) = apply {
this.amount = settlementAggregateAmount.amount
this.currency = settlementAggregateAmount.currency
additionalProperties(settlementAggregateAmount.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): SettlementAggregateAmount =
SettlementAggregateAmount(
amount,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
}
@JsonDeserialize(builder = Avs.Builder::class)
@NoAutoDetect
class Avs
private constructor(
private val address: JsonField,
private val zipcode: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Cardholder address */
fun address(): String? = address.getNullable("address")
/** Cardholder ZIP code */
fun zipcode(): String? = zipcode.getNullable("zipcode")
/** Cardholder address */
@JsonProperty("address") @ExcludeMissing fun _address() = address
/** Cardholder ZIP code */
@JsonProperty("zipcode") @ExcludeMissing fun _zipcode() = zipcode
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): Avs = apply {
if (!validated) {
address()
zipcode()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is Avs &&
this.address == other.address &&
this.zipcode == other.zipcode &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
address,
zipcode,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"Avs{address=$address, zipcode=$zipcode, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var address: JsonField = JsonMissing.of()
private var zipcode: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(avs: Avs) = apply {
this.address = avs.address
this.zipcode = avs.zipcode
additionalProperties(avs.additionalProperties)
}
/** Cardholder address */
fun address(address: String) = address(JsonField.of(address))
/** Cardholder address */
@JsonProperty("address")
@ExcludeMissing
fun address(address: JsonField) = apply { this.address = address }
/** Cardholder ZIP code */
fun zipcode(zipcode: String) = zipcode(JsonField.of(zipcode))
/** Cardholder ZIP code */
@JsonProperty("zipcode")
@ExcludeMissing
fun zipcode(zipcode: JsonField) = apply { this.zipcode = zipcode }
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(): Avs =
Avs(
address,
zipcode,
additionalProperties.toUnmodifiable(),
)
}
}
/**
* A single card transaction may include multiple events that affect the transaction state and
* lifecycle.
*/
@JsonDeserialize(builder = TransactionEvent.Builder::class)
@NoAutoDetect
class TransactionEvent
private constructor(
private val amount: JsonField,
private val amounts: JsonField,
private val created: JsonField,
private val detailedResults: JsonField>,
private val effectivePolarity: JsonField,
private val result: JsonField,
private val token: JsonField,
private val type: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
/** Amount of the transaction event (in cents), including any acquirer fees. */
fun amount(): Long = amount.getRequired("amount")
fun amounts(): TransactionEventAmounts = amounts.getRequired("amounts")
/** RFC 3339 date and time this event entered the system. UTC time zone. */
fun created(): OffsetDateTime = created.getRequired("created")
fun detailedResults(): List =
detailedResults.getRequired("detailed_results")
/** Indicates whether the transaction event is a credit or debit to the account. */
fun effectivePolarity(): EffectivePolarity? =
effectivePolarity.getNullable("effective_polarity")
/**
* `APPROVED` or decline reason.
*
* Result types:
* - `ACCOUNT_STATE_TRANSACTION_FAIL` - Contact
* [[email protected]](mailto:[email protected]).
* - `APPROVED` - Transaction is approved.
* - `BANK_CONNECTION_ERROR` - Please reconnect a funding source.
* - `BANK_NOT_VERIFIED` - Please confirm the funding source.
* - `CARD_CLOSED` - Card state was closed at the time of authorization.
* - `CARD_PAUSED` - Card state was paused at the time of authorization.
* - `FRAUD_ADVICE` - Transaction declined due to risk.
* - `INACTIVE_ACCOUNT` - Account is inactive. Contact
* [[email protected]](mailto:[email protected]).
* - `INCORRECT_PIN` - PIN verification failed.
* - `INVALID_CARD_DETAILS` - Incorrect CVV or expiry date.
* - `INSUFFICIENT_FUNDS` - Please ensure the funding source is connected and up to date.
* - `MERCHANT_BLACKLIST` - This merchant is disallowed on the platform.
* - `SINGLE_USE_RECHARGED` - Single use card attempted multiple times.
* - `SWITCH_INOPERATIVE_ADVICE` - Network error, re-attempt the transaction.
* - `UNAUTHORIZED_MERCHANT` - Merchant locked card attempted at different merchant.
* - `UNKNOWN_HOST_TIMEOUT` - Network error, re-attempt the transaction.
* - `USER_TRANSACTION_LIMIT` - User-set spend limit exceeded.
*/
fun result(): Result = result.getRequired("result")
/** Globally unique identifier. */
fun token(): String = token.getRequired("token")
/**
* Event types:
* - `AUTHORIZATION` - Authorize a transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a transaction.
* - `AUTHORIZATION_EXPIRY` - Authorization has expired and reversed by Lithic.
* - `AUTHORIZATION_REVERSAL` - Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A balance inquiry (typically a $0 authorization) has occurred on a
* card.
* - `CLEARING` - Transaction is settled.
* - `CORRECTION_DEBIT` - Manual transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit authorization from a merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit authorization was approved on your behalf by
* the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit funds without additional
* clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit funds
* without additional clearing.
* - `RETURN` - A refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A refund has been reversed (e.g., when a merchant reverses an
* incorrect refund).
*/
fun type(): Type = type.getRequired("type")
/** Amount of the transaction event (in cents), including any acquirer fees. */
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
@JsonProperty("amounts") @ExcludeMissing fun _amounts() = amounts
/** RFC 3339 date and time this event entered the system. UTC time zone. */
@JsonProperty("created") @ExcludeMissing fun _created() = created
@JsonProperty("detailed_results") @ExcludeMissing fun _detailedResults() = detailedResults
/** Indicates whether the transaction event is a credit or debit to the account. */
@JsonProperty("effective_polarity")
@ExcludeMissing
fun _effectivePolarity() = effectivePolarity
/**
* `APPROVED` or decline reason.
*
* Result types:
* - `ACCOUNT_STATE_TRANSACTION_FAIL` - Contact
* [[email protected]](mailto:[email protected]).
* - `APPROVED` - Transaction is approved.
* - `BANK_CONNECTION_ERROR` - Please reconnect a funding source.
* - `BANK_NOT_VERIFIED` - Please confirm the funding source.
* - `CARD_CLOSED` - Card state was closed at the time of authorization.
* - `CARD_PAUSED` - Card state was paused at the time of authorization.
* - `FRAUD_ADVICE` - Transaction declined due to risk.
* - `INACTIVE_ACCOUNT` - Account is inactive. Contact
* [[email protected]](mailto:[email protected]).
* - `INCORRECT_PIN` - PIN verification failed.
* - `INVALID_CARD_DETAILS` - Incorrect CVV or expiry date.
* - `INSUFFICIENT_FUNDS` - Please ensure the funding source is connected and up to date.
* - `MERCHANT_BLACKLIST` - This merchant is disallowed on the platform.
* - `SINGLE_USE_RECHARGED` - Single use card attempted multiple times.
* - `SWITCH_INOPERATIVE_ADVICE` - Network error, re-attempt the transaction.
* - `UNAUTHORIZED_MERCHANT` - Merchant locked card attempted at different merchant.
* - `UNKNOWN_HOST_TIMEOUT` - Network error, re-attempt the transaction.
* - `USER_TRANSACTION_LIMIT` - User-set spend limit exceeded.
*/
@JsonProperty("result") @ExcludeMissing fun _result() = result
/** Globally unique identifier. */
@JsonProperty("token") @ExcludeMissing fun _token() = token
/**
* Event types:
* - `AUTHORIZATION` - Authorize a transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a transaction.
* - `AUTHORIZATION_EXPIRY` - Authorization has expired and reversed by Lithic.
* - `AUTHORIZATION_REVERSAL` - Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A balance inquiry (typically a $0 authorization) has occurred on a
* card.
* - `CLEARING` - Transaction is settled.
* - `CORRECTION_DEBIT` - Manual transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit authorization from a merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit authorization was approved on your behalf by
* the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit funds without additional
* clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit funds
* without additional clearing.
* - `RETURN` - A refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A refund has been reversed (e.g., when a merchant reverses an
* incorrect refund).
*/
@JsonProperty("type") @ExcludeMissing fun _type() = type
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): TransactionEvent = apply {
if (!validated) {
amount()
amounts().validate()
created()
detailedResults()
effectivePolarity()
result()
token()
type()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is TransactionEvent &&
this.amount == other.amount &&
this.amounts == other.amounts &&
this.created == other.created &&
this.detailedResults == other.detailedResults &&
this.effectivePolarity == other.effectivePolarity &&
this.result == other.result &&
this.token == other.token &&
this.type == other.type &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
amounts,
created,
detailedResults,
effectivePolarity,
result,
token,
type,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"TransactionEvent{amount=$amount, amounts=$amounts, created=$created, detailedResults=$detailedResults, effectivePolarity=$effectivePolarity, result=$result, token=$token, type=$type, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var amounts: JsonField = JsonMissing.of()
private var created: JsonField = JsonMissing.of()
private var detailedResults: JsonField> = JsonMissing.of()
private var effectivePolarity: JsonField = JsonMissing.of()
private var result: JsonField = JsonMissing.of()
private var token: JsonField = JsonMissing.of()
private var type: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(transactionEvent: TransactionEvent) = apply {
this.amount = transactionEvent.amount
this.amounts = transactionEvent.amounts
this.created = transactionEvent.created
this.detailedResults = transactionEvent.detailedResults
this.effectivePolarity = transactionEvent.effectivePolarity
this.result = transactionEvent.result
this.token = transactionEvent.token
this.type = transactionEvent.type
additionalProperties(transactionEvent.additionalProperties)
}
/** Amount of the transaction event (in cents), including any acquirer fees. */
fun amount(amount: Long) = amount(JsonField.of(amount))
/** Amount of the transaction event (in cents), including any acquirer fees. */
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
fun amounts(amounts: TransactionEventAmounts) = amounts(JsonField.of(amounts))
@JsonProperty("amounts")
@ExcludeMissing
fun amounts(amounts: JsonField) = apply {
this.amounts = amounts
}
/** RFC 3339 date and time this event entered the system. UTC time zone. */
fun created(created: OffsetDateTime) = created(JsonField.of(created))
/** RFC 3339 date and time this event entered the system. UTC time zone. */
@JsonProperty("created")
@ExcludeMissing
fun created(created: JsonField) = apply { this.created = created }
fun detailedResults(detailedResults: List) =
detailedResults(JsonField.of(detailedResults))
@JsonProperty("detailed_results")
@ExcludeMissing
fun detailedResults(detailedResults: JsonField>) = apply {
this.detailedResults = detailedResults
}
/** Indicates whether the transaction event is a credit or debit to the account. */
fun effectivePolarity(effectivePolarity: EffectivePolarity) =
effectivePolarity(JsonField.of(effectivePolarity))
/** Indicates whether the transaction event is a credit or debit to the account. */
@JsonProperty("effective_polarity")
@ExcludeMissing
fun effectivePolarity(effectivePolarity: JsonField) = apply {
this.effectivePolarity = effectivePolarity
}
/**
* `APPROVED` or decline reason.
*
* Result types:
* - `ACCOUNT_STATE_TRANSACTION_FAIL` - Contact
* [[email protected]](mailto:[email protected]).
* - `APPROVED` - Transaction is approved.
* - `BANK_CONNECTION_ERROR` - Please reconnect a funding source.
* - `BANK_NOT_VERIFIED` - Please confirm the funding source.
* - `CARD_CLOSED` - Card state was closed at the time of authorization.
* - `CARD_PAUSED` - Card state was paused at the time of authorization.
* - `FRAUD_ADVICE` - Transaction declined due to risk.
* - `INACTIVE_ACCOUNT` - Account is inactive. Contact
* [[email protected]](mailto:[email protected]).
* - `INCORRECT_PIN` - PIN verification failed.
* - `INVALID_CARD_DETAILS` - Incorrect CVV or expiry date.
* - `INSUFFICIENT_FUNDS` - Please ensure the funding source is connected and up to
* date.
* - `MERCHANT_BLACKLIST` - This merchant is disallowed on the platform.
* - `SINGLE_USE_RECHARGED` - Single use card attempted multiple times.
* - `SWITCH_INOPERATIVE_ADVICE` - Network error, re-attempt the transaction.
* - `UNAUTHORIZED_MERCHANT` - Merchant locked card attempted at different merchant.
* - `UNKNOWN_HOST_TIMEOUT` - Network error, re-attempt the transaction.
* - `USER_TRANSACTION_LIMIT` - User-set spend limit exceeded.
*/
fun result(result: Result) = result(JsonField.of(result))
/**
* `APPROVED` or decline reason.
*
* Result types:
* - `ACCOUNT_STATE_TRANSACTION_FAIL` - Contact
* [[email protected]](mailto:[email protected]).
* - `APPROVED` - Transaction is approved.
* - `BANK_CONNECTION_ERROR` - Please reconnect a funding source.
* - `BANK_NOT_VERIFIED` - Please confirm the funding source.
* - `CARD_CLOSED` - Card state was closed at the time of authorization.
* - `CARD_PAUSED` - Card state was paused at the time of authorization.
* - `FRAUD_ADVICE` - Transaction declined due to risk.
* - `INACTIVE_ACCOUNT` - Account is inactive. Contact
* [[email protected]](mailto:[email protected]).
* - `INCORRECT_PIN` - PIN verification failed.
* - `INVALID_CARD_DETAILS` - Incorrect CVV or expiry date.
* - `INSUFFICIENT_FUNDS` - Please ensure the funding source is connected and up to
* date.
* - `MERCHANT_BLACKLIST` - This merchant is disallowed on the platform.
* - `SINGLE_USE_RECHARGED` - Single use card attempted multiple times.
* - `SWITCH_INOPERATIVE_ADVICE` - Network error, re-attempt the transaction.
* - `UNAUTHORIZED_MERCHANT` - Merchant locked card attempted at different merchant.
* - `UNKNOWN_HOST_TIMEOUT` - Network error, re-attempt the transaction.
* - `USER_TRANSACTION_LIMIT` - User-set spend limit exceeded.
*/
@JsonProperty("result")
@ExcludeMissing
fun result(result: JsonField) = apply { this.result = result }
/** Globally unique identifier. */
fun token(token: String) = token(JsonField.of(token))
/** Globally unique identifier. */
@JsonProperty("token")
@ExcludeMissing
fun token(token: JsonField) = apply { this.token = token }
/**
* Event types:
* - `AUTHORIZATION` - Authorize a transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a transaction.
* - `AUTHORIZATION_EXPIRY` - Authorization has expired and reversed by Lithic.
* - `AUTHORIZATION_REVERSAL` - Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A balance inquiry (typically a $0 authorization) has occurred
* on a card.
* - `CLEARING` - Transaction is settled.
* - `CORRECTION_DEBIT` - Manual transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit authorization from a merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit authorization was approved on your behalf
* by the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit funds without
* additional clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit
* funds without additional clearing.
* - `RETURN` - A refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A refund has been reversed (e.g., when a merchant reverses an
* incorrect refund).
*/
fun type(type: Type) = type(JsonField.of(type))
/**
* Event types:
* - `AUTHORIZATION` - Authorize a transaction.
* - `AUTHORIZATION_ADVICE` - Advice on a transaction.
* - `AUTHORIZATION_EXPIRY` - Authorization has expired and reversed by Lithic.
* - `AUTHORIZATION_REVERSAL` - Authorization was reversed by the merchant.
* - `BALANCE_INQUIRY` - A balance inquiry (typically a $0 authorization) has occurred
* on a card.
* - `CLEARING` - Transaction is settled.
* - `CORRECTION_DEBIT` - Manual transaction correction (Debit).
* - `CORRECTION_CREDIT` - Manual transaction correction (Credit).
* - `CREDIT_AUTHORIZATION` - A refund or credit authorization from a merchant.
* - `CREDIT_AUTHORIZATION_ADVICE` - A credit authorization was approved on your behalf
* by the network.
* - `FINANCIAL_AUTHORIZATION` - A request from a merchant to debit funds without
* additional clearing.
* - `FINANCIAL_CREDIT_AUTHORIZATION` - A request from a merchant to refund or credit
* funds without additional clearing.
* - `RETURN` - A refund has been processed on the transaction.
* - `RETURN_REVERSAL` - A refund has been reversed (e.g., when a merchant reverses an
* incorrect refund).
*/
@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(): TransactionEvent =
TransactionEvent(
amount,
amounts,
created,
detailedResults.map { it.toUnmodifiable() },
effectivePolarity,
result,
token,
type,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = TransactionEventAmounts.Builder::class)
@NoAutoDetect
class TransactionEventAmounts
private constructor(
private val cardholder: JsonField,
private val merchant: JsonField,
private val settlement: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun cardholder(): CardholderEventAmounts = cardholder.getRequired("cardholder")
fun merchant(): MerchantEventAmounts = merchant.getRequired("merchant")
fun settlement(): SettlementEventAmounts? = settlement.getNullable("settlement")
@JsonProperty("cardholder") @ExcludeMissing fun _cardholder() = cardholder
@JsonProperty("merchant") @ExcludeMissing fun _merchant() = merchant
@JsonProperty("settlement") @ExcludeMissing fun _settlement() = settlement
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): TransactionEventAmounts = apply {
if (!validated) {
cardholder().validate()
merchant().validate()
settlement()?.validate()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is TransactionEventAmounts &&
this.cardholder == other.cardholder &&
this.merchant == other.merchant &&
this.settlement == other.settlement &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
cardholder,
merchant,
settlement,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"TransactionEventAmounts{cardholder=$cardholder, merchant=$merchant, settlement=$settlement, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var cardholder: JsonField = JsonMissing.of()
private var merchant: JsonField = JsonMissing.of()
private var settlement: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(transactionEventAmounts: TransactionEventAmounts) = apply {
this.cardholder = transactionEventAmounts.cardholder
this.merchant = transactionEventAmounts.merchant
this.settlement = transactionEventAmounts.settlement
additionalProperties(transactionEventAmounts.additionalProperties)
}
fun cardholder(cardholder: CardholderEventAmounts) =
cardholder(JsonField.of(cardholder))
@JsonProperty("cardholder")
@ExcludeMissing
fun cardholder(cardholder: JsonField) = apply {
this.cardholder = cardholder
}
fun merchant(merchant: MerchantEventAmounts) = merchant(JsonField.of(merchant))
@JsonProperty("merchant")
@ExcludeMissing
fun merchant(merchant: JsonField) = apply {
this.merchant = merchant
}
fun settlement(settlement: SettlementEventAmounts) =
settlement(JsonField.of(settlement))
@JsonProperty("settlement")
@ExcludeMissing
fun settlement(settlement: JsonField) = apply {
this.settlement = settlement
}
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(): TransactionEventAmounts =
TransactionEventAmounts(
cardholder,
merchant,
settlement,
additionalProperties.toUnmodifiable(),
)
}
@JsonDeserialize(builder = CardholderEventAmounts.Builder::class)
@NoAutoDetect
class CardholderEventAmounts
private constructor(
private val amount: JsonField,
private val conversionRate: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
fun conversionRate(): String = conversionRate.getRequired("conversion_rate")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
@JsonProperty("conversion_rate")
@ExcludeMissing
fun _conversionRate() = conversionRate
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): CardholderEventAmounts = apply {
if (!validated) {
amount()
conversionRate()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is CardholderEventAmounts &&
this.amount == other.amount &&
this.conversionRate == other.conversionRate &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
conversionRate,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"CardholderEventAmounts{amount=$amount, conversionRate=$conversionRate, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var conversionRate: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(cardholderEventAmounts: CardholderEventAmounts) = apply {
this.amount = cardholderEventAmounts.amount
this.conversionRate = cardholderEventAmounts.conversionRate
this.currency = cardholderEventAmounts.currency
additionalProperties(cardholderEventAmounts.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
fun conversionRate(conversionRate: String) =
conversionRate(JsonField.of(conversionRate))
@JsonProperty("conversion_rate")
@ExcludeMissing
fun conversionRate(conversionRate: JsonField) = apply {
this.conversionRate = conversionRate
}
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): CardholderEventAmounts =
CardholderEventAmounts(
amount,
conversionRate,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = MerchantEventAmounts.Builder::class)
@NoAutoDetect
class MerchantEventAmounts
private constructor(
private val amount: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): MerchantEventAmounts = apply {
if (!validated) {
amount()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is MerchantEventAmounts &&
this.amount == other.amount &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"MerchantEventAmounts{amount=$amount, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(merchantEventAmounts: MerchantEventAmounts) = apply {
this.amount = merchantEventAmounts.amount
this.currency = merchantEventAmounts.currency
additionalProperties(merchantEventAmounts.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): MerchantEventAmounts =
MerchantEventAmounts(
amount,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
@JsonDeserialize(builder = SettlementEventAmounts.Builder::class)
@NoAutoDetect
class SettlementEventAmounts
private constructor(
private val amount: JsonField,
private val conversionRate: JsonField,
private val currency: JsonField,
private val additionalProperties: Map,
) {
private var validated: Boolean = false
private var hashCode: Int = 0
fun amount(): Long = amount.getRequired("amount")
fun conversionRate(): String = conversionRate.getRequired("conversion_rate")
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
fun currency(): Currency = currency.getRequired("currency")
@JsonProperty("amount") @ExcludeMissing fun _amount() = amount
@JsonProperty("conversion_rate")
@ExcludeMissing
fun _conversionRate() = conversionRate
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some special
* currencies like ``XXX`. Enumerants names are lowercase currency code e.g.
* :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency") @ExcludeMissing fun _currency() = currency
@JsonAnyGetter
@ExcludeMissing
fun _additionalProperties(): Map = additionalProperties
fun validate(): SettlementEventAmounts = apply {
if (!validated) {
amount()
conversionRate()
currency()
validated = true
}
}
fun toBuilder() = Builder().from(this)
override fun equals(other: Any?): Boolean {
if (this === other) {
return true
}
return other is SettlementEventAmounts &&
this.amount == other.amount &&
this.conversionRate == other.conversionRate &&
this.currency == other.currency &&
this.additionalProperties == other.additionalProperties
}
override fun hashCode(): Int {
if (hashCode == 0) {
hashCode =
Objects.hash(
amount,
conversionRate,
currency,
additionalProperties,
)
}
return hashCode
}
override fun toString() =
"SettlementEventAmounts{amount=$amount, conversionRate=$conversionRate, currency=$currency, additionalProperties=$additionalProperties}"
companion object {
fun builder() = Builder()
}
class Builder {
private var amount: JsonField = JsonMissing.of()
private var conversionRate: JsonField = JsonMissing.of()
private var currency: JsonField = JsonMissing.of()
private var additionalProperties: MutableMap = mutableMapOf()
internal fun from(settlementEventAmounts: SettlementEventAmounts) = apply {
this.amount = settlementEventAmounts.amount
this.conversionRate = settlementEventAmounts.conversionRate
this.currency = settlementEventAmounts.currency
additionalProperties(settlementEventAmounts.additionalProperties)
}
fun amount(amount: Long) = amount(JsonField.of(amount))
@JsonProperty("amount")
@ExcludeMissing
fun amount(amount: JsonField) = apply { this.amount = amount }
fun conversionRate(conversionRate: String) =
conversionRate(JsonField.of(conversionRate))
@JsonProperty("conversion_rate")
@ExcludeMissing
fun conversionRate(conversionRate: JsonField) = apply {
this.conversionRate = conversionRate
}
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
fun currency(currency: Currency) = currency(JsonField.of(currency))
/**
* ISO 4217 currency. Its enumerants are ISO 4217 currencies except for some
* special currencies like ``XXX`. Enumerants names are lowercase currency code
* e.g. :attr:`EUR`, :attr:`USD`.
*/
@JsonProperty("currency")
@ExcludeMissing
fun currency(currency: JsonField) = apply { this.currency = currency }
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(): SettlementEventAmounts =
SettlementEventAmounts(
amount,
conversionRate,
currency,
additionalProperties.toUnmodifiable(),
)
}
}
}
class DetailedResult
@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 other is DetailedResult && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED =
DetailedResult(JsonField.of("ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED"))
val ACCOUNT_DELINQUENT = DetailedResult(JsonField.of("ACCOUNT_DELINQUENT"))
val ACCOUNT_INACTIVE = DetailedResult(JsonField.of("ACCOUNT_INACTIVE"))
val ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED =
DetailedResult(JsonField.of("ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED"))
val ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED =
DetailedResult(JsonField.of("ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED"))
val ACCOUNT_UNDER_REVIEW = DetailedResult(JsonField.of("ACCOUNT_UNDER_REVIEW"))
val ADDRESS_INCORRECT = DetailedResult(JsonField.of("ADDRESS_INCORRECT"))
val APPROVED = DetailedResult(JsonField.of("APPROVED"))
val AUTH_RULE_ALLOWED_COUNTRY =
DetailedResult(JsonField.of("AUTH_RULE_ALLOWED_COUNTRY"))
val AUTH_RULE_ALLOWED_MCC = DetailedResult(JsonField.of("AUTH_RULE_ALLOWED_MCC"))
val AUTH_RULE_BLOCKED_COUNTRY =
DetailedResult(JsonField.of("AUTH_RULE_BLOCKED_COUNTRY"))
val AUTH_RULE_BLOCKED_MCC = DetailedResult(JsonField.of("AUTH_RULE_BLOCKED_MCC"))
val CARD_CLOSED = DetailedResult(JsonField.of("CARD_CLOSED"))
val CARD_CRYPTOGRAM_VALIDATION_FAILURE =
DetailedResult(JsonField.of("CARD_CRYPTOGRAM_VALIDATION_FAILURE"))
val CARD_EXPIRED = DetailedResult(JsonField.of("CARD_EXPIRED"))
val CARD_EXPIRY_DATE_INCORRECT =
DetailedResult(JsonField.of("CARD_EXPIRY_DATE_INCORRECT"))
val CARD_INVALID = DetailedResult(JsonField.of("CARD_INVALID"))
val CARD_NOT_ACTIVATED = DetailedResult(JsonField.of("CARD_NOT_ACTIVATED"))
val CARD_PAUSED = DetailedResult(JsonField.of("CARD_PAUSED"))
val CARD_PIN_INCORRECT = DetailedResult(JsonField.of("CARD_PIN_INCORRECT"))
val CARD_RESTRICTED = DetailedResult(JsonField.of("CARD_RESTRICTED"))
val CARD_SECURITY_CODE_INCORRECT =
DetailedResult(JsonField.of("CARD_SECURITY_CODE_INCORRECT"))
val CARD_SPEND_LIMIT_EXCEEDED =
DetailedResult(JsonField.of("CARD_SPEND_LIMIT_EXCEEDED"))
val CONTACT_CARD_ISSUER = DetailedResult(JsonField.of("CONTACT_CARD_ISSUER"))
val CUSTOMER_ASA_TIMEOUT = DetailedResult(JsonField.of("CUSTOMER_ASA_TIMEOUT"))
val CUSTOM_ASA_RESULT = DetailedResult(JsonField.of("CUSTOM_ASA_RESULT"))
val DECLINED = DetailedResult(JsonField.of("DECLINED"))
val DO_NOT_HONOR = DetailedResult(JsonField.of("DO_NOT_HONOR"))
val DRIVER_NUMBER_INVALID = DetailedResult(JsonField.of("DRIVER_NUMBER_INVALID"))
val FORMAT_ERROR = DetailedResult(JsonField.of("FORMAT_ERROR"))
val INSUFFICIENT_FUNDING_SOURCE_BALANCE =
DetailedResult(JsonField.of("INSUFFICIENT_FUNDING_SOURCE_BALANCE"))
val INSUFFICIENT_FUNDS = DetailedResult(JsonField.of("INSUFFICIENT_FUNDS"))
val LITHIC_SYSTEM_ERROR = DetailedResult(JsonField.of("LITHIC_SYSTEM_ERROR"))
val LITHIC_SYSTEM_RATE_LIMIT =
DetailedResult(JsonField.of("LITHIC_SYSTEM_RATE_LIMIT"))
val MALFORMED_ASA_RESPONSE = DetailedResult(JsonField.of("MALFORMED_ASA_RESPONSE"))
val MERCHANT_INVALID = DetailedResult(JsonField.of("MERCHANT_INVALID"))
val MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE =
DetailedResult(JsonField.of("MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE"))
val MERCHANT_NOT_PERMITTED = DetailedResult(JsonField.of("MERCHANT_NOT_PERMITTED"))
val OVER_REVERSAL_ATTEMPTED =
DetailedResult(JsonField.of("OVER_REVERSAL_ATTEMPTED"))
val PROGRAM_CARD_SPEND_LIMIT_EXCEEDED =
DetailedResult(JsonField.of("PROGRAM_CARD_SPEND_LIMIT_EXCEEDED"))
val PROGRAM_SUSPENDED = DetailedResult(JsonField.of("PROGRAM_SUSPENDED"))
val PROGRAM_USAGE_RESTRICTION =
DetailedResult(JsonField.of("PROGRAM_USAGE_RESTRICTION"))
val REVERSAL_UNMATCHED = DetailedResult(JsonField.of("REVERSAL_UNMATCHED"))
val SECURITY_VIOLATION = DetailedResult(JsonField.of("SECURITY_VIOLATION"))
val SINGLE_USE_CARD_REATTEMPTED =
DetailedResult(JsonField.of("SINGLE_USE_CARD_REATTEMPTED"))
val TRANSACTION_INVALID = DetailedResult(JsonField.of("TRANSACTION_INVALID"))
val TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL =
DetailedResult(
JsonField.of("TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL")
)
val TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER =
DetailedResult(
JsonField.of("TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER")
)
val TRANSACTION_PREVIOUSLY_COMPLETED =
DetailedResult(JsonField.of("TRANSACTION_PREVIOUSLY_COMPLETED"))
val UNAUTHORIZED_MERCHANT = DetailedResult(JsonField.of("UNAUTHORIZED_MERCHANT"))
val VEHICLE_NUMBER_INVALID = DetailedResult(JsonField.of("VEHICLE_NUMBER_INVALID"))
fun of(value: String) = DetailedResult(JsonField.of(value))
}
enum class Known {
ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED,
ACCOUNT_DELINQUENT,
ACCOUNT_INACTIVE,
ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED,
ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED,
ACCOUNT_UNDER_REVIEW,
ADDRESS_INCORRECT,
APPROVED,
AUTH_RULE_ALLOWED_COUNTRY,
AUTH_RULE_ALLOWED_MCC,
AUTH_RULE_BLOCKED_COUNTRY,
AUTH_RULE_BLOCKED_MCC,
CARD_CLOSED,
CARD_CRYPTOGRAM_VALIDATION_FAILURE,
CARD_EXPIRED,
CARD_EXPIRY_DATE_INCORRECT,
CARD_INVALID,
CARD_NOT_ACTIVATED,
CARD_PAUSED,
CARD_PIN_INCORRECT,
CARD_RESTRICTED,
CARD_SECURITY_CODE_INCORRECT,
CARD_SPEND_LIMIT_EXCEEDED,
CONTACT_CARD_ISSUER,
CUSTOMER_ASA_TIMEOUT,
CUSTOM_ASA_RESULT,
DECLINED,
DO_NOT_HONOR,
DRIVER_NUMBER_INVALID,
FORMAT_ERROR,
INSUFFICIENT_FUNDING_SOURCE_BALANCE,
INSUFFICIENT_FUNDS,
LITHIC_SYSTEM_ERROR,
LITHIC_SYSTEM_RATE_LIMIT,
MALFORMED_ASA_RESPONSE,
MERCHANT_INVALID,
MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE,
MERCHANT_NOT_PERMITTED,
OVER_REVERSAL_ATTEMPTED,
PROGRAM_CARD_SPEND_LIMIT_EXCEEDED,
PROGRAM_SUSPENDED,
PROGRAM_USAGE_RESTRICTION,
REVERSAL_UNMATCHED,
SECURITY_VIOLATION,
SINGLE_USE_CARD_REATTEMPTED,
TRANSACTION_INVALID,
TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL,
TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER,
TRANSACTION_PREVIOUSLY_COMPLETED,
UNAUTHORIZED_MERCHANT,
VEHICLE_NUMBER_INVALID,
}
enum class Value {
ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED,
ACCOUNT_DELINQUENT,
ACCOUNT_INACTIVE,
ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED,
ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED,
ACCOUNT_UNDER_REVIEW,
ADDRESS_INCORRECT,
APPROVED,
AUTH_RULE_ALLOWED_COUNTRY,
AUTH_RULE_ALLOWED_MCC,
AUTH_RULE_BLOCKED_COUNTRY,
AUTH_RULE_BLOCKED_MCC,
CARD_CLOSED,
CARD_CRYPTOGRAM_VALIDATION_FAILURE,
CARD_EXPIRED,
CARD_EXPIRY_DATE_INCORRECT,
CARD_INVALID,
CARD_NOT_ACTIVATED,
CARD_PAUSED,
CARD_PIN_INCORRECT,
CARD_RESTRICTED,
CARD_SECURITY_CODE_INCORRECT,
CARD_SPEND_LIMIT_EXCEEDED,
CONTACT_CARD_ISSUER,
CUSTOMER_ASA_TIMEOUT,
CUSTOM_ASA_RESULT,
DECLINED,
DO_NOT_HONOR,
DRIVER_NUMBER_INVALID,
FORMAT_ERROR,
INSUFFICIENT_FUNDING_SOURCE_BALANCE,
INSUFFICIENT_FUNDS,
LITHIC_SYSTEM_ERROR,
LITHIC_SYSTEM_RATE_LIMIT,
MALFORMED_ASA_RESPONSE,
MERCHANT_INVALID,
MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE,
MERCHANT_NOT_PERMITTED,
OVER_REVERSAL_ATTEMPTED,
PROGRAM_CARD_SPEND_LIMIT_EXCEEDED,
PROGRAM_SUSPENDED,
PROGRAM_USAGE_RESTRICTION,
REVERSAL_UNMATCHED,
SECURITY_VIOLATION,
SINGLE_USE_CARD_REATTEMPTED,
TRANSACTION_INVALID,
TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL,
TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER,
TRANSACTION_PREVIOUSLY_COMPLETED,
UNAUTHORIZED_MERCHANT,
VEHICLE_NUMBER_INVALID,
_UNKNOWN,
}
fun value(): Value =
when (this) {
ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> Value.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED
ACCOUNT_DELINQUENT -> Value.ACCOUNT_DELINQUENT
ACCOUNT_INACTIVE -> Value.ACCOUNT_INACTIVE
ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED ->
Value.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED
ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED ->
Value.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED
ACCOUNT_UNDER_REVIEW -> Value.ACCOUNT_UNDER_REVIEW
ADDRESS_INCORRECT -> Value.ADDRESS_INCORRECT
APPROVED -> Value.APPROVED
AUTH_RULE_ALLOWED_COUNTRY -> Value.AUTH_RULE_ALLOWED_COUNTRY
AUTH_RULE_ALLOWED_MCC -> Value.AUTH_RULE_ALLOWED_MCC
AUTH_RULE_BLOCKED_COUNTRY -> Value.AUTH_RULE_BLOCKED_COUNTRY
AUTH_RULE_BLOCKED_MCC -> Value.AUTH_RULE_BLOCKED_MCC
CARD_CLOSED -> Value.CARD_CLOSED
CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Value.CARD_CRYPTOGRAM_VALIDATION_FAILURE
CARD_EXPIRED -> Value.CARD_EXPIRED
CARD_EXPIRY_DATE_INCORRECT -> Value.CARD_EXPIRY_DATE_INCORRECT
CARD_INVALID -> Value.CARD_INVALID
CARD_NOT_ACTIVATED -> Value.CARD_NOT_ACTIVATED
CARD_PAUSED -> Value.CARD_PAUSED
CARD_PIN_INCORRECT -> Value.CARD_PIN_INCORRECT
CARD_RESTRICTED -> Value.CARD_RESTRICTED
CARD_SECURITY_CODE_INCORRECT -> Value.CARD_SECURITY_CODE_INCORRECT
CARD_SPEND_LIMIT_EXCEEDED -> Value.CARD_SPEND_LIMIT_EXCEEDED
CONTACT_CARD_ISSUER -> Value.CONTACT_CARD_ISSUER
CUSTOMER_ASA_TIMEOUT -> Value.CUSTOMER_ASA_TIMEOUT
CUSTOM_ASA_RESULT -> Value.CUSTOM_ASA_RESULT
DECLINED -> Value.DECLINED
DO_NOT_HONOR -> Value.DO_NOT_HONOR
DRIVER_NUMBER_INVALID -> Value.DRIVER_NUMBER_INVALID
FORMAT_ERROR -> Value.FORMAT_ERROR
INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Value.INSUFFICIENT_FUNDING_SOURCE_BALANCE
INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS
LITHIC_SYSTEM_ERROR -> Value.LITHIC_SYSTEM_ERROR
LITHIC_SYSTEM_RATE_LIMIT -> Value.LITHIC_SYSTEM_RATE_LIMIT
MALFORMED_ASA_RESPONSE -> Value.MALFORMED_ASA_RESPONSE
MERCHANT_INVALID -> Value.MERCHANT_INVALID
MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE ->
Value.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE
MERCHANT_NOT_PERMITTED -> Value.MERCHANT_NOT_PERMITTED
OVER_REVERSAL_ATTEMPTED -> Value.OVER_REVERSAL_ATTEMPTED
PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> Value.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED
PROGRAM_SUSPENDED -> Value.PROGRAM_SUSPENDED
PROGRAM_USAGE_RESTRICTION -> Value.PROGRAM_USAGE_RESTRICTION
REVERSAL_UNMATCHED -> Value.REVERSAL_UNMATCHED
SECURITY_VIOLATION -> Value.SECURITY_VIOLATION
SINGLE_USE_CARD_REATTEMPTED -> Value.SINGLE_USE_CARD_REATTEMPTED
TRANSACTION_INVALID -> Value.TRANSACTION_INVALID
TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL ->
Value.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL
TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER ->
Value.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER
TRANSACTION_PREVIOUSLY_COMPLETED -> Value.TRANSACTION_PREVIOUSLY_COMPLETED
UNAUTHORIZED_MERCHANT -> Value.UNAUTHORIZED_MERCHANT
VEHICLE_NUMBER_INVALID -> Value.VEHICLE_NUMBER_INVALID
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED -> Known.ACCOUNT_DAILY_SPEND_LIMIT_EXCEEDED
ACCOUNT_DELINQUENT -> Known.ACCOUNT_DELINQUENT
ACCOUNT_INACTIVE -> Known.ACCOUNT_INACTIVE
ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED ->
Known.ACCOUNT_LIFETIME_SPEND_LIMIT_EXCEEDED
ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED ->
Known.ACCOUNT_MONTHLY_SPEND_LIMIT_EXCEEDED
ACCOUNT_UNDER_REVIEW -> Known.ACCOUNT_UNDER_REVIEW
ADDRESS_INCORRECT -> Known.ADDRESS_INCORRECT
APPROVED -> Known.APPROVED
AUTH_RULE_ALLOWED_COUNTRY -> Known.AUTH_RULE_ALLOWED_COUNTRY
AUTH_RULE_ALLOWED_MCC -> Known.AUTH_RULE_ALLOWED_MCC
AUTH_RULE_BLOCKED_COUNTRY -> Known.AUTH_RULE_BLOCKED_COUNTRY
AUTH_RULE_BLOCKED_MCC -> Known.AUTH_RULE_BLOCKED_MCC
CARD_CLOSED -> Known.CARD_CLOSED
CARD_CRYPTOGRAM_VALIDATION_FAILURE -> Known.CARD_CRYPTOGRAM_VALIDATION_FAILURE
CARD_EXPIRED -> Known.CARD_EXPIRED
CARD_EXPIRY_DATE_INCORRECT -> Known.CARD_EXPIRY_DATE_INCORRECT
CARD_INVALID -> Known.CARD_INVALID
CARD_NOT_ACTIVATED -> Known.CARD_NOT_ACTIVATED
CARD_PAUSED -> Known.CARD_PAUSED
CARD_PIN_INCORRECT -> Known.CARD_PIN_INCORRECT
CARD_RESTRICTED -> Known.CARD_RESTRICTED
CARD_SECURITY_CODE_INCORRECT -> Known.CARD_SECURITY_CODE_INCORRECT
CARD_SPEND_LIMIT_EXCEEDED -> Known.CARD_SPEND_LIMIT_EXCEEDED
CONTACT_CARD_ISSUER -> Known.CONTACT_CARD_ISSUER
CUSTOMER_ASA_TIMEOUT -> Known.CUSTOMER_ASA_TIMEOUT
CUSTOM_ASA_RESULT -> Known.CUSTOM_ASA_RESULT
DECLINED -> Known.DECLINED
DO_NOT_HONOR -> Known.DO_NOT_HONOR
DRIVER_NUMBER_INVALID -> Known.DRIVER_NUMBER_INVALID
FORMAT_ERROR -> Known.FORMAT_ERROR
INSUFFICIENT_FUNDING_SOURCE_BALANCE -> Known.INSUFFICIENT_FUNDING_SOURCE_BALANCE
INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS
LITHIC_SYSTEM_ERROR -> Known.LITHIC_SYSTEM_ERROR
LITHIC_SYSTEM_RATE_LIMIT -> Known.LITHIC_SYSTEM_RATE_LIMIT
MALFORMED_ASA_RESPONSE -> Known.MALFORMED_ASA_RESPONSE
MERCHANT_INVALID -> Known.MERCHANT_INVALID
MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE ->
Known.MERCHANT_LOCKED_CARD_ATTEMPTED_ELSEWHERE
MERCHANT_NOT_PERMITTED -> Known.MERCHANT_NOT_PERMITTED
OVER_REVERSAL_ATTEMPTED -> Known.OVER_REVERSAL_ATTEMPTED
PROGRAM_CARD_SPEND_LIMIT_EXCEEDED -> Known.PROGRAM_CARD_SPEND_LIMIT_EXCEEDED
PROGRAM_SUSPENDED -> Known.PROGRAM_SUSPENDED
PROGRAM_USAGE_RESTRICTION -> Known.PROGRAM_USAGE_RESTRICTION
REVERSAL_UNMATCHED -> Known.REVERSAL_UNMATCHED
SECURITY_VIOLATION -> Known.SECURITY_VIOLATION
SINGLE_USE_CARD_REATTEMPTED -> Known.SINGLE_USE_CARD_REATTEMPTED
TRANSACTION_INVALID -> Known.TRANSACTION_INVALID
TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL ->
Known.TRANSACTION_NOT_PERMITTED_TO_ACQUIRER_OR_TERMINAL
TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER ->
Known.TRANSACTION_NOT_PERMITTED_TO_ISSUER_OR_CARDHOLDER
TRANSACTION_PREVIOUSLY_COMPLETED -> Known.TRANSACTION_PREVIOUSLY_COMPLETED
UNAUTHORIZED_MERCHANT -> Known.UNAUTHORIZED_MERCHANT
VEHICLE_NUMBER_INVALID -> Known.VEHICLE_NUMBER_INVALID
else -> throw LithicInvalidDataException("Unknown DetailedResult: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
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 other is Result && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val APPROVED = Result(JsonField.of("APPROVED"))
val BANK_CONNECTION_ERROR = Result(JsonField.of("BANK_CONNECTION_ERROR"))
val BANK_NOT_VERIFIED = Result(JsonField.of("BANK_NOT_VERIFIED"))
val CARD_CLOSED = Result(JsonField.of("CARD_CLOSED"))
val CARD_PAUSED = Result(JsonField.of("CARD_PAUSED"))
val DECLINED = Result(JsonField.of("DECLINED"))
val FRAUD_ADVICE = Result(JsonField.of("FRAUD_ADVICE"))
val INACTIVE_ACCOUNT = Result(JsonField.of("INACTIVE_ACCOUNT"))
val INCORRECT_PIN = Result(JsonField.of("INCORRECT_PIN"))
val INSUFFICIENT_FUNDS = Result(JsonField.of("INSUFFICIENT_FUNDS"))
val INVALID_CARD_DETAILS = Result(JsonField.of("INVALID_CARD_DETAILS"))
val MERCHANT_BLACKLIST = Result(JsonField.of("MERCHANT_BLACKLIST"))
val SINGLE_USE_RECHARGED = Result(JsonField.of("SINGLE_USE_RECHARGED"))
val SWITCH_INOPERATIVE_ADVICE = Result(JsonField.of("SWITCH_INOPERATIVE_ADVICE"))
val UNAUTHORIZED_MERCHANT = Result(JsonField.of("UNAUTHORIZED_MERCHANT"))
val UNKNOWN_HOST_TIMEOUT = Result(JsonField.of("UNKNOWN_HOST_TIMEOUT"))
val USER_TRANSACTION_LIMIT = Result(JsonField.of("USER_TRANSACTION_LIMIT"))
fun of(value: String) = Result(JsonField.of(value))
}
enum class Known {
APPROVED,
BANK_CONNECTION_ERROR,
BANK_NOT_VERIFIED,
CARD_CLOSED,
CARD_PAUSED,
DECLINED,
FRAUD_ADVICE,
INACTIVE_ACCOUNT,
INCORRECT_PIN,
INSUFFICIENT_FUNDS,
INVALID_CARD_DETAILS,
MERCHANT_BLACKLIST,
SINGLE_USE_RECHARGED,
SWITCH_INOPERATIVE_ADVICE,
UNAUTHORIZED_MERCHANT,
UNKNOWN_HOST_TIMEOUT,
USER_TRANSACTION_LIMIT,
}
enum class Value {
APPROVED,
BANK_CONNECTION_ERROR,
BANK_NOT_VERIFIED,
CARD_CLOSED,
CARD_PAUSED,
DECLINED,
FRAUD_ADVICE,
INACTIVE_ACCOUNT,
INCORRECT_PIN,
INSUFFICIENT_FUNDS,
INVALID_CARD_DETAILS,
MERCHANT_BLACKLIST,
SINGLE_USE_RECHARGED,
SWITCH_INOPERATIVE_ADVICE,
UNAUTHORIZED_MERCHANT,
UNKNOWN_HOST_TIMEOUT,
USER_TRANSACTION_LIMIT,
_UNKNOWN,
}
fun value(): Value =
when (this) {
APPROVED -> Value.APPROVED
BANK_CONNECTION_ERROR -> Value.BANK_CONNECTION_ERROR
BANK_NOT_VERIFIED -> Value.BANK_NOT_VERIFIED
CARD_CLOSED -> Value.CARD_CLOSED
CARD_PAUSED -> Value.CARD_PAUSED
DECLINED -> Value.DECLINED
FRAUD_ADVICE -> Value.FRAUD_ADVICE
INACTIVE_ACCOUNT -> Value.INACTIVE_ACCOUNT
INCORRECT_PIN -> Value.INCORRECT_PIN
INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS
INVALID_CARD_DETAILS -> Value.INVALID_CARD_DETAILS
MERCHANT_BLACKLIST -> Value.MERCHANT_BLACKLIST
SINGLE_USE_RECHARGED -> Value.SINGLE_USE_RECHARGED
SWITCH_INOPERATIVE_ADVICE -> Value.SWITCH_INOPERATIVE_ADVICE
UNAUTHORIZED_MERCHANT -> Value.UNAUTHORIZED_MERCHANT
UNKNOWN_HOST_TIMEOUT -> Value.UNKNOWN_HOST_TIMEOUT
USER_TRANSACTION_LIMIT -> Value.USER_TRANSACTION_LIMIT
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
APPROVED -> Known.APPROVED
BANK_CONNECTION_ERROR -> Known.BANK_CONNECTION_ERROR
BANK_NOT_VERIFIED -> Known.BANK_NOT_VERIFIED
CARD_CLOSED -> Known.CARD_CLOSED
CARD_PAUSED -> Known.CARD_PAUSED
DECLINED -> Known.DECLINED
FRAUD_ADVICE -> Known.FRAUD_ADVICE
INACTIVE_ACCOUNT -> Known.INACTIVE_ACCOUNT
INCORRECT_PIN -> Known.INCORRECT_PIN
INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS
INVALID_CARD_DETAILS -> Known.INVALID_CARD_DETAILS
MERCHANT_BLACKLIST -> Known.MERCHANT_BLACKLIST
SINGLE_USE_RECHARGED -> Known.SINGLE_USE_RECHARGED
SWITCH_INOPERATIVE_ADVICE -> Known.SWITCH_INOPERATIVE_ADVICE
UNAUTHORIZED_MERCHANT -> Known.UNAUTHORIZED_MERCHANT
UNKNOWN_HOST_TIMEOUT -> Known.UNKNOWN_HOST_TIMEOUT
USER_TRANSACTION_LIMIT -> Known.USER_TRANSACTION_LIMIT
else -> throw LithicInvalidDataException("Unknown Result: $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 other is Type && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val AUTHORIZATION = Type(JsonField.of("AUTHORIZATION"))
val AUTHORIZATION_ADVICE = Type(JsonField.of("AUTHORIZATION_ADVICE"))
val AUTHORIZATION_EXPIRY = Type(JsonField.of("AUTHORIZATION_EXPIRY"))
val AUTHORIZATION_REVERSAL = Type(JsonField.of("AUTHORIZATION_REVERSAL"))
val BALANCE_INQUIRY = Type(JsonField.of("BALANCE_INQUIRY"))
val CLEARING = Type(JsonField.of("CLEARING"))
val CORRECTION_CREDIT = Type(JsonField.of("CORRECTION_CREDIT"))
val CORRECTION_DEBIT = Type(JsonField.of("CORRECTION_DEBIT"))
val CREDIT_AUTHORIZATION = Type(JsonField.of("CREDIT_AUTHORIZATION"))
val CREDIT_AUTHORIZATION_ADVICE = Type(JsonField.of("CREDIT_AUTHORIZATION_ADVICE"))
val FINANCIAL_AUTHORIZATION = Type(JsonField.of("FINANCIAL_AUTHORIZATION"))
val FINANCIAL_CREDIT_AUTHORIZATION =
Type(JsonField.of("FINANCIAL_CREDIT_AUTHORIZATION"))
val RETURN = Type(JsonField.of("RETURN"))
val RETURN_REVERSAL = Type(JsonField.of("RETURN_REVERSAL"))
val VOID = Type(JsonField.of("VOID"))
fun of(value: String) = Type(JsonField.of(value))
}
enum class Known {
AUTHORIZATION,
AUTHORIZATION_ADVICE,
AUTHORIZATION_EXPIRY,
AUTHORIZATION_REVERSAL,
BALANCE_INQUIRY,
CLEARING,
CORRECTION_CREDIT,
CORRECTION_DEBIT,
CREDIT_AUTHORIZATION,
CREDIT_AUTHORIZATION_ADVICE,
FINANCIAL_AUTHORIZATION,
FINANCIAL_CREDIT_AUTHORIZATION,
RETURN,
RETURN_REVERSAL,
VOID,
}
enum class Value {
AUTHORIZATION,
AUTHORIZATION_ADVICE,
AUTHORIZATION_EXPIRY,
AUTHORIZATION_REVERSAL,
BALANCE_INQUIRY,
CLEARING,
CORRECTION_CREDIT,
CORRECTION_DEBIT,
CREDIT_AUTHORIZATION,
CREDIT_AUTHORIZATION_ADVICE,
FINANCIAL_AUTHORIZATION,
FINANCIAL_CREDIT_AUTHORIZATION,
RETURN,
RETURN_REVERSAL,
VOID,
_UNKNOWN,
}
fun value(): Value =
when (this) {
AUTHORIZATION -> Value.AUTHORIZATION
AUTHORIZATION_ADVICE -> Value.AUTHORIZATION_ADVICE
AUTHORIZATION_EXPIRY -> Value.AUTHORIZATION_EXPIRY
AUTHORIZATION_REVERSAL -> Value.AUTHORIZATION_REVERSAL
BALANCE_INQUIRY -> Value.BALANCE_INQUIRY
CLEARING -> Value.CLEARING
CORRECTION_CREDIT -> Value.CORRECTION_CREDIT
CORRECTION_DEBIT -> Value.CORRECTION_DEBIT
CREDIT_AUTHORIZATION -> Value.CREDIT_AUTHORIZATION
CREDIT_AUTHORIZATION_ADVICE -> Value.CREDIT_AUTHORIZATION_ADVICE
FINANCIAL_AUTHORIZATION -> Value.FINANCIAL_AUTHORIZATION
FINANCIAL_CREDIT_AUTHORIZATION -> Value.FINANCIAL_CREDIT_AUTHORIZATION
RETURN -> Value.RETURN
RETURN_REVERSAL -> Value.RETURN_REVERSAL
VOID -> Value.VOID
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
AUTHORIZATION -> Known.AUTHORIZATION
AUTHORIZATION_ADVICE -> Known.AUTHORIZATION_ADVICE
AUTHORIZATION_EXPIRY -> Known.AUTHORIZATION_EXPIRY
AUTHORIZATION_REVERSAL -> Known.AUTHORIZATION_REVERSAL
BALANCE_INQUIRY -> Known.BALANCE_INQUIRY
CLEARING -> Known.CLEARING
CORRECTION_CREDIT -> Known.CORRECTION_CREDIT
CORRECTION_DEBIT -> Known.CORRECTION_DEBIT
CREDIT_AUTHORIZATION -> Known.CREDIT_AUTHORIZATION
CREDIT_AUTHORIZATION_ADVICE -> Known.CREDIT_AUTHORIZATION_ADVICE
FINANCIAL_AUTHORIZATION -> Known.FINANCIAL_AUTHORIZATION
FINANCIAL_CREDIT_AUTHORIZATION -> Known.FINANCIAL_CREDIT_AUTHORIZATION
RETURN -> Known.RETURN
RETURN_REVERSAL -> Known.RETURN_REVERSAL
VOID -> Known.VOID
else -> throw LithicInvalidDataException("Unknown Type: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
class EffectivePolarity
@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 other is EffectivePolarity && this.value == other.value
}
override fun hashCode() = value.hashCode()
override fun toString() = value.toString()
companion object {
val CREDIT = EffectivePolarity(JsonField.of("CREDIT"))
val DEBIT = EffectivePolarity(JsonField.of("DEBIT"))
fun of(value: String) = EffectivePolarity(JsonField.of(value))
}
enum class Known {
CREDIT,
DEBIT,
}
enum class Value {
CREDIT,
DEBIT,
_UNKNOWN,
}
fun value(): Value =
when (this) {
CREDIT -> Value.CREDIT
DEBIT -> Value.DEBIT
else -> Value._UNKNOWN
}
fun known(): Known =
when (this) {
CREDIT -> Known.CREDIT
DEBIT -> Known.DEBIT
else -> throw LithicInvalidDataException("Unknown EffectivePolarity: $value")
}
fun asString(): String = _value().asStringOrThrow()
}
}
@JsonDeserialize(builder = Merchant.Builder::class)
@NoAutoDetect
class Merchant
private constructor(
private val acceptorId: JsonField,
private val city: JsonField,
private val country: JsonField,
private val descriptor: JsonField,
private val mcc: JsonField