diff --git a/.release-please-manifest.json b/.release-please-manifest.json
index 3e05ae562..3ca49358e 100644
--- a/.release-please-manifest.json
+++ b/.release-please-manifest.json
@@ -1,3 +1,3 @@
{
- ".": "0.108.0"
+ ".": "0.109.0"
}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
index 13cfc26b6..f728fc48c 100644
--- a/.stats.yml
+++ b/.stats.yml
@@ -1,4 +1,4 @@
-configured_endpoints: 170
-openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-b1839661d8405911184d5cb7230f16e626a616e5b744634bd7f0bb4e730bf899.yml
-openapi_spec_hash: c1c2c5a5c2a4067a714b35f873e3846f
-config_hash: 98214f2eab6804b5c0048331e32c08e3
+configured_endpoints: 169
+openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/lithic%2Flithic-6432801dcf017d9234739b9f6153a8cfecd91255af4765f24ba5209f3e320b5c.yml
+openapi_spec_hash: c2cfee2f044ba15d15b5bfdbd37280c0
+config_hash: 8ac73ccdb428816c89c84802c794a3f8
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 332f39e8d..f56c9c95f 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,13 @@
# Changelog
+## 0.109.0 (2025-10-23)
+
+Full Changelog: [v0.108.0...v0.109.0](https://github.com/lithic-com/lithic-java/compare/v0.108.0...v0.109.0)
+
+### Features
+
+* **api:** updates to Auth Rules and Card provisioning ([f6866cc](https://github.com/lithic-com/lithic-java/commit/f6866ccb2402a93cad1dd152bd47cc7ffa74cb81))
+
## 0.108.0 (2025-10-08)
Full Changelog: [v0.107.0...v0.108.0](https://github.com/lithic-com/lithic-java/compare/v0.107.0...v0.108.0)
diff --git a/README.md b/README.md
index 968f5f15f..55f8ed5a9 100644
--- a/README.md
+++ b/README.md
@@ -2,8 +2,8 @@
-[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.108.0)
-[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.108.0)
+[](https://central.sonatype.com/artifact/com.lithic.api/lithic-java/0.109.0)
+[](https://javadoc.io/doc/com.lithic.api/lithic-java/0.109.0)
@@ -13,7 +13,7 @@ The Lithic Java SDK is similar to the Lithic Kotlin SDK but with minor differenc
-The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.108.0).
+The REST API documentation can be found on [docs.lithic.com](https://docs.lithic.com). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.lithic.api/lithic-java/0.109.0).
@@ -24,7 +24,7 @@ The REST API documentation can be found on [docs.lithic.com](https://docs.lithic
### Gradle
```kotlin
-implementation("com.lithic.api:lithic-java:0.108.0")
+implementation("com.lithic.api:lithic-java:0.109.0")
```
### Maven
@@ -33,7 +33,7 @@ implementation("com.lithic.api:lithic-java:0.108.0")
com.lithic.api
lithic-java
- 0.108.0
+ 0.109.0
```
diff --git a/build.gradle.kts b/build.gradle.kts
index 49e10140c..0a4bbd131 100644
--- a/build.gradle.kts
+++ b/build.gradle.kts
@@ -8,7 +8,7 @@ repositories {
allprojects {
group = "com.lithic.api"
- version = "0.108.0" // x-release-please-version
+ version = "0.109.0" // x-release-please-version
}
subprojects {
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
index a9dad29b2..68f308289 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPage.kt
@@ -46,36 +46,29 @@ private constructor(
.first()
.accept(
object : AccountActivityListResponse.Visitor> {
- override fun visitFinancialTransaction(
- financialTransaction:
- AccountActivityListResponse.FinancialTransaction
- ): Optional =
- financialTransaction._token().getOptional("token")
+ override fun visitInternal(
+ internal_: AccountActivityListResponse.FinancialTransaction
+ ): Optional = internal_._token().getOptional("token")
- override fun visitBookTransferTransaction(
- bookTransferTransaction:
- AccountActivityListResponse.BookTransferTransaction
- ): Optional =
- bookTransferTransaction._token().getOptional("token")
+ override fun visitTransfer(
+ transfer: BookTransferResponse
+ ): Optional = transfer._token().getOptional("token")
- override fun visitCardTransaction(
- cardTransaction: AccountActivityListResponse.CardTransaction
- ): Optional = cardTransaction._token().getOptional("token")
+ override fun visitCard(
+ card: AccountActivityListResponse.CardTransaction
+ ): Optional = card._token().getOptional("token")
- override fun visitPaymentTransaction(
- paymentTransaction:
- AccountActivityListResponse.PaymentTransaction
- ): Optional =
- paymentTransaction._token().getOptional("token")
+ override fun visitPayment(payment: Payment): Optional =
+ payment._token().getOptional("token")
override fun visitExternalPayment(
externalPayment: ExternalPayment
): Optional = externalPayment._token().getOptional("token")
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
): Optional =
- managementOperationTransaction._token().getOptional("token")
+ managementOperation._token().getOptional("token")
}
)
)
@@ -88,36 +81,29 @@ private constructor(
.last()
.accept(
object : AccountActivityListResponse.Visitor> {
- override fun visitFinancialTransaction(
- financialTransaction:
- AccountActivityListResponse.FinancialTransaction
- ): Optional =
- financialTransaction._token().getOptional("token")
+ override fun visitInternal(
+ internal_: AccountActivityListResponse.FinancialTransaction
+ ): Optional = internal_._token().getOptional("token")
- override fun visitBookTransferTransaction(
- bookTransferTransaction:
- AccountActivityListResponse.BookTransferTransaction
- ): Optional =
- bookTransferTransaction._token().getOptional("token")
+ override fun visitTransfer(
+ transfer: BookTransferResponse
+ ): Optional = transfer._token().getOptional("token")
- override fun visitCardTransaction(
- cardTransaction: AccountActivityListResponse.CardTransaction
- ): Optional = cardTransaction._token().getOptional("token")
+ override fun visitCard(
+ card: AccountActivityListResponse.CardTransaction
+ ): Optional = card._token().getOptional("token")
- override fun visitPaymentTransaction(
- paymentTransaction:
- AccountActivityListResponse.PaymentTransaction
- ): Optional =
- paymentTransaction._token().getOptional("token")
+ override fun visitPayment(payment: Payment): Optional =
+ payment._token().getOptional("token")
override fun visitExternalPayment(
externalPayment: ExternalPayment
): Optional = externalPayment._token().getOptional("token")
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
): Optional =
- managementOperationTransaction._token().getOptional("token")
+ managementOperation._token().getOptional("token")
}
)
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
index 5fd09f7a0..cc509dfd6 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageAsync.kt
@@ -49,36 +49,29 @@ private constructor(
.first()
.accept(
object : AccountActivityListResponse.Visitor> {
- override fun visitFinancialTransaction(
- financialTransaction:
- AccountActivityListResponse.FinancialTransaction
- ): Optional =
- financialTransaction._token().getOptional("token")
+ override fun visitInternal(
+ internal_: AccountActivityListResponse.FinancialTransaction
+ ): Optional = internal_._token().getOptional("token")
- override fun visitBookTransferTransaction(
- bookTransferTransaction:
- AccountActivityListResponse.BookTransferTransaction
- ): Optional =
- bookTransferTransaction._token().getOptional("token")
+ override fun visitTransfer(
+ transfer: BookTransferResponse
+ ): Optional = transfer._token().getOptional("token")
- override fun visitCardTransaction(
- cardTransaction: AccountActivityListResponse.CardTransaction
- ): Optional = cardTransaction._token().getOptional("token")
+ override fun visitCard(
+ card: AccountActivityListResponse.CardTransaction
+ ): Optional = card._token().getOptional("token")
- override fun visitPaymentTransaction(
- paymentTransaction:
- AccountActivityListResponse.PaymentTransaction
- ): Optional =
- paymentTransaction._token().getOptional("token")
+ override fun visitPayment(payment: Payment): Optional =
+ payment._token().getOptional("token")
override fun visitExternalPayment(
externalPayment: ExternalPayment
): Optional = externalPayment._token().getOptional("token")
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
): Optional =
- managementOperationTransaction._token().getOptional("token")
+ managementOperation._token().getOptional("token")
}
)
)
@@ -91,36 +84,29 @@ private constructor(
.last()
.accept(
object : AccountActivityListResponse.Visitor> {
- override fun visitFinancialTransaction(
- financialTransaction:
- AccountActivityListResponse.FinancialTransaction
- ): Optional =
- financialTransaction._token().getOptional("token")
+ override fun visitInternal(
+ internal_: AccountActivityListResponse.FinancialTransaction
+ ): Optional = internal_._token().getOptional("token")
- override fun visitBookTransferTransaction(
- bookTransferTransaction:
- AccountActivityListResponse.BookTransferTransaction
- ): Optional =
- bookTransferTransaction._token().getOptional("token")
+ override fun visitTransfer(
+ transfer: BookTransferResponse
+ ): Optional = transfer._token().getOptional("token")
- override fun visitCardTransaction(
- cardTransaction: AccountActivityListResponse.CardTransaction
- ): Optional = cardTransaction._token().getOptional("token")
+ override fun visitCard(
+ card: AccountActivityListResponse.CardTransaction
+ ): Optional = card._token().getOptional("token")
- override fun visitPaymentTransaction(
- paymentTransaction:
- AccountActivityListResponse.PaymentTransaction
- ): Optional =
- paymentTransaction._token().getOptional("token")
+ override fun visitPayment(payment: Payment): Optional =
+ payment._token().getOptional("token")
override fun visitExternalPayment(
externalPayment: ExternalPayment
): Optional = externalPayment._token().getOptional("token")
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
): Optional =
- managementOperationTransaction._token().getOptional("token")
+ managementOperation._token().getOptional("token")
}
)
)
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
index 79bb4c7d7..29731923e 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListPageResponse.kt
@@ -127,33 +127,20 @@ private constructor(
}
}
- /**
- * Alias for calling [addData] with
- * `AccountActivityListResponse.ofFinancialTransaction(financialTransaction)`.
- */
- fun addData(financialTransaction: AccountActivityListResponse.FinancialTransaction) =
- addData(AccountActivityListResponse.ofFinancialTransaction(financialTransaction))
+ /** Alias for calling [addData] with `AccountActivityListResponse.ofInternal(internal_)`. */
+ fun addData(internal_: AccountActivityListResponse.FinancialTransaction) =
+ addData(AccountActivityListResponse.ofInternal(internal_))
- /**
- * Alias for calling [addData] with
- * `AccountActivityListResponse.ofBookTransferTransaction(bookTransferTransaction)`.
- */
- fun addData(bookTransferTransaction: AccountActivityListResponse.BookTransferTransaction) =
- addData(AccountActivityListResponse.ofBookTransferTransaction(bookTransferTransaction))
+ /** Alias for calling [addData] with `AccountActivityListResponse.ofTransfer(transfer)`. */
+ fun addData(transfer: BookTransferResponse) =
+ addData(AccountActivityListResponse.ofTransfer(transfer))
- /**
- * Alias for calling [addData] with
- * `AccountActivityListResponse.ofCardTransaction(cardTransaction)`.
- */
- fun addData(cardTransaction: AccountActivityListResponse.CardTransaction) =
- addData(AccountActivityListResponse.ofCardTransaction(cardTransaction))
+ /** Alias for calling [addData] with `AccountActivityListResponse.ofCard(card)`. */
+ fun addData(card: AccountActivityListResponse.CardTransaction) =
+ addData(AccountActivityListResponse.ofCard(card))
- /**
- * Alias for calling [addData] with
- * `AccountActivityListResponse.ofPaymentTransaction(paymentTransaction)`.
- */
- fun addData(paymentTransaction: AccountActivityListResponse.PaymentTransaction) =
- addData(AccountActivityListResponse.ofPaymentTransaction(paymentTransaction))
+ /** Alias for calling [addData] with `AccountActivityListResponse.ofPayment(payment)`. */
+ fun addData(payment: Payment) = addData(AccountActivityListResponse.ofPayment(payment))
/**
* Alias for calling [addData] with
@@ -164,14 +151,10 @@ private constructor(
/**
* Alias for calling [addData] with
- * `AccountActivityListResponse.ofManagementOperationTransaction(managementOperationTransaction)`.
+ * `AccountActivityListResponse.ofManagementOperation(managementOperation)`.
*/
- fun addData(managementOperationTransaction: ManagementOperationTransaction) =
- addData(
- AccountActivityListResponse.ofManagementOperationTransaction(
- managementOperationTransaction
- )
- )
+ fun addData(managementOperation: ManagementOperationTransaction) =
+ addData(AccountActivityListResponse.ofManagementOperation(managementOperation))
/** Indicates if there are more transactions available for pagination */
fun hasMore(hasMore: Boolean) = hasMore(JsonField.of(hasMore))
diff --git a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
index 62ad82e20..5175793d0 100644
--- a/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
+++ b/lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountActivityListResponse.kt
@@ -20,96 +20,93 @@ 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.allMaxBy
import com.lithic.api.core.checkKnown
import com.lithic.api.core.checkRequired
import com.lithic.api.core.getOrThrow
import com.lithic.api.core.toImmutable
import com.lithic.api.errors.LithicInvalidDataException
-import java.time.LocalDate
import java.time.OffsetDateTime
import java.util.Collections
import java.util.Objects
import java.util.Optional
import kotlin.jvm.optionals.getOrNull
-/** Response containing multiple transaction types */
+/**
+ * Response containing multiple transaction types. The `family` field determines which transaction
+ * type is returned: INTERNAL returns FinancialTransaction, TRANSFER returns
+ * BookTransferTransaction, CARD returns CardTransaction, PAYMENT returns PaymentTransaction,
+ * EXTERNAL_PAYMENT returns ExternalPaymentResponse, and MANAGEMENT_OPERATION returns
+ * ManagementOperationTransaction
+ */
@JsonDeserialize(using = AccountActivityListResponse.Deserializer::class)
@JsonSerialize(using = AccountActivityListResponse.Serializer::class)
class AccountActivityListResponse
private constructor(
- private val financialTransaction: FinancialTransaction? = null,
- private val bookTransferTransaction: BookTransferTransaction? = null,
- private val cardTransaction: CardTransaction? = null,
- private val paymentTransaction: PaymentTransaction? = null,
+ private val internal_: FinancialTransaction? = null,
+ private val transfer: BookTransferResponse? = null,
+ private val card: CardTransaction? = null,
+ private val payment: Payment? = null,
private val externalPayment: ExternalPayment? = null,
- private val managementOperationTransaction: ManagementOperationTransaction? = null,
+ private val managementOperation: ManagementOperationTransaction? = null,
private val _json: JsonValue? = null,
) {
/** Financial transaction with inheritance from unified base transaction */
- fun financialTransaction(): Optional =
- Optional.ofNullable(financialTransaction)
+ fun internal_(): Optional = Optional.ofNullable(internal_)
/** Book transfer transaction */
- fun bookTransferTransaction(): Optional =
- Optional.ofNullable(bookTransferTransaction)
+ fun transfer(): Optional = Optional.ofNullable(transfer)
- /** Base class for all transaction types in the ledger service */
- fun cardTransaction(): Optional = Optional.ofNullable(cardTransaction)
+ /** Card transaction with ledger base properties */
+ fun card(): Optional = Optional.ofNullable(card)
/** Payment transaction */
- fun paymentTransaction(): Optional = Optional.ofNullable(paymentTransaction)
+ fun payment(): Optional = Optional.ofNullable(payment)
fun externalPayment(): Optional = Optional.ofNullable(externalPayment)
- fun managementOperationTransaction(): Optional =
- Optional.ofNullable(managementOperationTransaction)
+ fun managementOperation(): Optional =
+ Optional.ofNullable(managementOperation)
- fun isFinancialTransaction(): Boolean = financialTransaction != null
+ fun isInternal(): Boolean = internal_ != null
- fun isBookTransferTransaction(): Boolean = bookTransferTransaction != null
+ fun isTransfer(): Boolean = transfer != null
- fun isCardTransaction(): Boolean = cardTransaction != null
+ fun isCard(): Boolean = card != null
- fun isPaymentTransaction(): Boolean = paymentTransaction != null
+ fun isPayment(): Boolean = payment != null
fun isExternalPayment(): Boolean = externalPayment != null
- fun isManagementOperationTransaction(): Boolean = managementOperationTransaction != null
+ fun isManagementOperation(): Boolean = managementOperation != null
/** Financial transaction with inheritance from unified base transaction */
- fun asFinancialTransaction(): FinancialTransaction =
- financialTransaction.getOrThrow("financialTransaction")
+ fun asInternal(): FinancialTransaction = internal_.getOrThrow("internal_")
/** Book transfer transaction */
- fun asBookTransferTransaction(): BookTransferTransaction =
- bookTransferTransaction.getOrThrow("bookTransferTransaction")
+ fun asTransfer(): BookTransferResponse = transfer.getOrThrow("transfer")
- /** Base class for all transaction types in the ledger service */
- fun asCardTransaction(): CardTransaction = cardTransaction.getOrThrow("cardTransaction")
+ /** Card transaction with ledger base properties */
+ fun asCard(): CardTransaction = card.getOrThrow("card")
/** Payment transaction */
- fun asPaymentTransaction(): PaymentTransaction =
- paymentTransaction.getOrThrow("paymentTransaction")
+ fun asPayment(): Payment = payment.getOrThrow("payment")
fun asExternalPayment(): ExternalPayment = externalPayment.getOrThrow("externalPayment")
- fun asManagementOperationTransaction(): ManagementOperationTransaction =
- managementOperationTransaction.getOrThrow("managementOperationTransaction")
+ fun asManagementOperation(): ManagementOperationTransaction =
+ managementOperation.getOrThrow("managementOperation")
fun _json(): Optional = Optional.ofNullable(_json)
fun accept(visitor: Visitor): T =
when {
- financialTransaction != null -> visitor.visitFinancialTransaction(financialTransaction)
- bookTransferTransaction != null ->
- visitor.visitBookTransferTransaction(bookTransferTransaction)
- cardTransaction != null -> visitor.visitCardTransaction(cardTransaction)
- paymentTransaction != null -> visitor.visitPaymentTransaction(paymentTransaction)
+ internal_ != null -> visitor.visitInternal(internal_)
+ transfer != null -> visitor.visitTransfer(transfer)
+ card != null -> visitor.visitCard(card)
+ payment != null -> visitor.visitPayment(payment)
externalPayment != null -> visitor.visitExternalPayment(externalPayment)
- managementOperationTransaction != null ->
- visitor.visitManagementOperationTransaction(managementOperationTransaction)
+ managementOperation != null -> visitor.visitManagementOperation(managementOperation)
else -> visitor.unknown(_json)
}
@@ -122,32 +119,30 @@ private constructor(
accept(
object : Visitor {
- override fun visitFinancialTransaction(financialTransaction: FinancialTransaction) {
- financialTransaction.validate()
+ override fun visitInternal(internal_: FinancialTransaction) {
+ internal_.validate()
}
- override fun visitBookTransferTransaction(
- bookTransferTransaction: BookTransferTransaction
- ) {
- bookTransferTransaction.validate()
+ override fun visitTransfer(transfer: BookTransferResponse) {
+ transfer.validate()
}
- override fun visitCardTransaction(cardTransaction: CardTransaction) {
- cardTransaction.validate()
+ override fun visitCard(card: CardTransaction) {
+ card.validate()
}
- override fun visitPaymentTransaction(paymentTransaction: PaymentTransaction) {
- paymentTransaction.validate()
+ override fun visitPayment(payment: Payment) {
+ payment.validate()
}
override fun visitExternalPayment(externalPayment: ExternalPayment) {
externalPayment.validate()
}
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
) {
- managementOperationTransaction.validate()
+ managementOperation.validate()
}
}
)
@@ -171,25 +166,20 @@ private constructor(
internal fun validity(): Int =
accept(
object : Visitor {
- override fun visitFinancialTransaction(financialTransaction: FinancialTransaction) =
- financialTransaction.validity()
+ override fun visitInternal(internal_: FinancialTransaction) = internal_.validity()
- override fun visitBookTransferTransaction(
- bookTransferTransaction: BookTransferTransaction
- ) = bookTransferTransaction.validity()
+ override fun visitTransfer(transfer: BookTransferResponse) = transfer.validity()
- override fun visitCardTransaction(cardTransaction: CardTransaction) =
- cardTransaction.validity()
+ override fun visitCard(card: CardTransaction) = card.validity()
- override fun visitPaymentTransaction(paymentTransaction: PaymentTransaction) =
- paymentTransaction.validity()
+ override fun visitPayment(payment: Payment) = payment.validity()
override fun visitExternalPayment(externalPayment: ExternalPayment) =
externalPayment.validity()
- override fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
- ) = managementOperationTransaction.validity()
+ override fun visitManagementOperation(
+ managementOperation: ManagementOperationTransaction
+ ) = managementOperation.validity()
override fun unknown(json: JsonValue?) = 0
}
@@ -201,38 +191,27 @@ private constructor(
}
return other is AccountActivityListResponse &&
- financialTransaction == other.financialTransaction &&
- bookTransferTransaction == other.bookTransferTransaction &&
- cardTransaction == other.cardTransaction &&
- paymentTransaction == other.paymentTransaction &&
+ internal_ == other.internal_ &&
+ transfer == other.transfer &&
+ card == other.card &&
+ payment == other.payment &&
externalPayment == other.externalPayment &&
- managementOperationTransaction == other.managementOperationTransaction
+ managementOperation == other.managementOperation
}
override fun hashCode(): Int =
- Objects.hash(
- financialTransaction,
- bookTransferTransaction,
- cardTransaction,
- paymentTransaction,
- externalPayment,
- managementOperationTransaction,
- )
+ Objects.hash(internal_, transfer, card, payment, externalPayment, managementOperation)
override fun toString(): String =
when {
- financialTransaction != null ->
- "AccountActivityListResponse{financialTransaction=$financialTransaction}"
- bookTransferTransaction != null ->
- "AccountActivityListResponse{bookTransferTransaction=$bookTransferTransaction}"
- cardTransaction != null ->
- "AccountActivityListResponse{cardTransaction=$cardTransaction}"
- paymentTransaction != null ->
- "AccountActivityListResponse{paymentTransaction=$paymentTransaction}"
+ internal_ != null -> "AccountActivityListResponse{internal_=$internal_}"
+ transfer != null -> "AccountActivityListResponse{transfer=$transfer}"
+ card != null -> "AccountActivityListResponse{card=$card}"
+ payment != null -> "AccountActivityListResponse{payment=$payment}"
externalPayment != null ->
"AccountActivityListResponse{externalPayment=$externalPayment}"
- managementOperationTransaction != null ->
- "AccountActivityListResponse{managementOperationTransaction=$managementOperationTransaction}"
+ managementOperation != null ->
+ "AccountActivityListResponse{managementOperation=$managementOperation}"
_json != null -> "AccountActivityListResponse{_unknown=$_json}"
else -> throw IllegalStateException("Invalid AccountActivityListResponse")
}
@@ -241,35 +220,27 @@ private constructor(
/** Financial transaction with inheritance from unified base transaction */
@JvmStatic
- fun ofFinancialTransaction(financialTransaction: FinancialTransaction) =
- AccountActivityListResponse(financialTransaction = financialTransaction)
+ fun ofInternal(internal_: FinancialTransaction) =
+ AccountActivityListResponse(internal_ = internal_)
/** Book transfer transaction */
@JvmStatic
- fun ofBookTransferTransaction(bookTransferTransaction: BookTransferTransaction) =
- AccountActivityListResponse(bookTransferTransaction = bookTransferTransaction)
+ fun ofTransfer(transfer: BookTransferResponse) =
+ AccountActivityListResponse(transfer = transfer)
- /** Base class for all transaction types in the ledger service */
- @JvmStatic
- fun ofCardTransaction(cardTransaction: CardTransaction) =
- AccountActivityListResponse(cardTransaction = cardTransaction)
+ /** Card transaction with ledger base properties */
+ @JvmStatic fun ofCard(card: CardTransaction) = AccountActivityListResponse(card = card)
/** Payment transaction */
- @JvmStatic
- fun ofPaymentTransaction(paymentTransaction: PaymentTransaction) =
- AccountActivityListResponse(paymentTransaction = paymentTransaction)
+ @JvmStatic fun ofPayment(payment: Payment) = AccountActivityListResponse(payment = payment)
@JvmStatic
fun ofExternalPayment(externalPayment: ExternalPayment) =
AccountActivityListResponse(externalPayment = externalPayment)
@JvmStatic
- fun ofManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
- ) =
- AccountActivityListResponse(
- managementOperationTransaction = managementOperationTransaction
- )
+ fun ofManagementOperation(managementOperation: ManagementOperationTransaction) =
+ AccountActivityListResponse(managementOperation = managementOperation)
}
/**
@@ -279,22 +250,20 @@ private constructor(
interface Visitor {
/** Financial transaction with inheritance from unified base transaction */
- fun visitFinancialTransaction(financialTransaction: FinancialTransaction): T
+ fun visitInternal(internal_: FinancialTransaction): T
/** Book transfer transaction */
- fun visitBookTransferTransaction(bookTransferTransaction: BookTransferTransaction): T
+ fun visitTransfer(transfer: BookTransferResponse): T
- /** Base class for all transaction types in the ledger service */
- fun visitCardTransaction(cardTransaction: CardTransaction): T
+ /** Card transaction with ledger base properties */
+ fun visitCard(card: CardTransaction): T
/** Payment transaction */
- fun visitPaymentTransaction(paymentTransaction: PaymentTransaction): T
+ fun visitPayment(payment: Payment): T
fun visitExternalPayment(externalPayment: ExternalPayment): T
- fun visitManagementOperationTransaction(
- managementOperationTransaction: ManagementOperationTransaction
- ): T
+ fun visitManagementOperation(managementOperation: ManagementOperationTransaction): T
/**
* Maps an unknown variant of [AccountActivityListResponse] to a value of type [T].
@@ -318,45 +287,41 @@ private constructor(
val json = JsonValue.fromJsonNode(node)
val family = json.asObject().getOrNull()?.get("family")?.asString()?.getOrNull()
- when (family) {}
-
- val bestMatches =
- sequenceOf(
- tryDeserialize(node, jacksonTypeRef())?.let {
- AccountActivityListResponse(financialTransaction = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())?.let {
- AccountActivityListResponse(bookTransferTransaction = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())?.let {
- AccountActivityListResponse(cardTransaction = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())?.let {
- AccountActivityListResponse(paymentTransaction = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())?.let {
- AccountActivityListResponse(externalPayment = it, _json = json)
- },
- tryDeserialize(node, jacksonTypeRef())
- ?.let {
- AccountActivityListResponse(
- managementOperationTransaction = it,
- _json = json,
- )
- },
- )
- .filterNotNull()
- .allMaxBy { it.validity() }
- .toList()
- return when (bestMatches.size) {
- // This can happen if what we're deserializing is completely incompatible with all
- // the possible variants (e.g. deserializing from boolean).
- 0 -> AccountActivityListResponse(_json = json)
- 1 -> bestMatches.single()
- // If there's more than one match with the highest validity, then use the first
- // completely valid match, or simply the first match if none are completely valid.
- else -> bestMatches.firstOrNull { it.isValid() } ?: bestMatches.first()
+ when (family) {
+ "INTERNAL" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(internal_ = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
+ "TRANSFER" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(transfer = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
+ "CARD" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(card = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
+ "PAYMENT" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(payment = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
+ "EXTERNAL_PAYMENT" -> {
+ return tryDeserialize(node, jacksonTypeRef())?.let {
+ AccountActivityListResponse(externalPayment = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
+ "MANAGEMENT_OPERATION" -> {
+ return tryDeserialize(node, jacksonTypeRef())
+ ?.let {
+ AccountActivityListResponse(managementOperation = it, _json = json)
+ } ?: AccountActivityListResponse(_json = json)
+ }
}
+
+ return AccountActivityListResponse(_json = json)
}
}
@@ -369,15 +334,13 @@ private constructor(
provider: SerializerProvider,
) {
when {
- value.financialTransaction != null ->
- generator.writeObject(value.financialTransaction)
- value.bookTransferTransaction != null ->
- generator.writeObject(value.bookTransferTransaction)
- value.cardTransaction != null -> generator.writeObject(value.cardTransaction)
- value.paymentTransaction != null -> generator.writeObject(value.paymentTransaction)
+ value.internal_ != null -> generator.writeObject(value.internal_)
+ value.transfer != null -> generator.writeObject(value.transfer)
+ value.card != null -> generator.writeObject(value.card)
+ value.payment != null -> generator.writeObject(value.payment)
value.externalPayment != null -> generator.writeObject(value.externalPayment)
- value.managementOperationTransaction != null ->
- generator.writeObject(value.managementOperationTransaction)
+ value.managementOperation != null ->
+ generator.writeObject(value.managementOperation)
value._json != null -> generator.writeObject(value._json)
else -> throw IllegalStateException("Invalid AccountActivityListResponse")
}
@@ -394,7 +357,7 @@ private constructor(
private val currency: JsonField,
private val descriptor: JsonField,
private val events: JsonField>,
- private val family: JsonField,
+ private val family: JsonField,
private val financialAccountToken: JsonField,
private val pendingAmount: JsonField,
private val result: JsonField,
@@ -422,9 +385,7 @@ private constructor(
@JsonProperty("events")
@ExcludeMissing
events: JsonField> = JsonMissing.of(),
- @JsonProperty("family")
- @ExcludeMissing
- family: JsonField = JsonMissing.of(),
+ @JsonProperty("family") @ExcludeMissing family: JsonField = JsonMissing.of(),
@JsonProperty("financial_account_token")
@ExcludeMissing
financialAccountToken: JsonField = JsonMissing.of(),
@@ -509,10 +470,12 @@ private constructor(
fun events(): List = events.getRequired("events")
/**
+ * INTERNAL - Financial Transaction
+ *
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun family(): TransactionFamilyTypes = family.getRequired("family")
+ fun family(): Family = family.getRequired("family")
/**
* Financial account token associated with the transaction
@@ -616,9 +579,7 @@ private constructor(
*
* Unlike [family], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("family")
- @ExcludeMissing
- fun _family(): JsonField = family
+ @JsonProperty("family") @ExcludeMissing fun _family(): JsonField = family
/**
* Returns the raw JSON value of [financialAccountToken].
@@ -717,7 +678,7 @@ private constructor(
private var currency: JsonField? = null
private var descriptor: JsonField? = null
private var events: JsonField>? = null
- private var family: JsonField? = null
+ private var family: JsonField? = null
private var financialAccountToken: JsonField? = null
private var pendingAmount: JsonField? = null
private var result: JsonField? = null
@@ -832,16 +793,17 @@ private constructor(
}
}
- fun family(family: TransactionFamilyTypes) = family(JsonField.of(family))
+ /** INTERNAL - Financial Transaction */
+ fun family(family: Family) = family(JsonField.of(family))
/**
* Sets [Builder.family] to an arbitrary JSON value.
*
- * You should usually call [Builder.family] with a well-typed [TransactionFamilyTypes]
- * value instead. This method is primarily for setting the field to an undocumented or
- * not yet supported value.
+ * You should usually call [Builder.family] with a well-typed [Family] value instead.
+ * This method is primarily for setting the field to an undocumented or not yet
+ * supported value.
*/
- fun family(family: JsonField) = apply { this.family = family }
+ fun family(family: JsonField) = apply { this.family = family }
/** Financial account token associated with the transaction */
fun financialAccountToken(financialAccountToken: String) =
@@ -2253,9 +2215,8 @@ private constructor(
"FinancialEvent{token=$token, amount=$amount, created=$created, result=$result, type=$type, additionalProperties=$additionalProperties}"
}
- class TransactionFamilyTypes
- @JsonCreator
- private constructor(private val value: JsonField) : Enum {
+ /** INTERNAL - Financial Transaction */
+ class Family @JsonCreator private constructor(private val value: JsonField) : Enum {
/**
* Returns this class instance's raw value.
@@ -2269,52 +2230,29 @@ private constructor(
companion object {
- @JvmField val CARD = of("CARD")
-
- @JvmField val PAYMENT = of("PAYMENT")
-
- @JvmField val TRANSFER = of("TRANSFER")
-
@JvmField val INTERNAL = of("INTERNAL")
- @JvmField val EXTERNAL_PAYMENT = of("EXTERNAL_PAYMENT")
-
- @JvmField val MANAGEMENT_OPERATION = of("MANAGEMENT_OPERATION")
-
- @JvmStatic fun of(value: String) = TransactionFamilyTypes(JsonField.of(value))
+ @JvmStatic fun of(value: String) = Family(JsonField.of(value))
}
- /** An enum containing [TransactionFamilyTypes]'s known values. */
+ /** An enum containing [Family]'s known values. */
enum class Known {
- CARD,
- PAYMENT,
- TRANSFER,
- INTERNAL,
- EXTERNAL_PAYMENT,
- MANAGEMENT_OPERATION,
+ INTERNAL
}
/**
- * An enum containing [TransactionFamilyTypes]'s known values, as well as an [_UNKNOWN]
- * member.
+ * An enum containing [Family]'s known values, as well as an [_UNKNOWN] member.
*
- * An instance of [TransactionFamilyTypes] can contain an unknown value in a couple of
- * cases:
+ * An instance of [Family] can contain an unknown value in a couple of cases:
* - It was deserialized from data that doesn't match any known member. For example, if
* the SDK is on an older version than the API, then the API may respond with new
* members that the SDK is unaware of.
* - It was constructed with an arbitrary value using the [of] method.
*/
enum class Value {
- CARD,
- PAYMENT,
- TRANSFER,
INTERNAL,
- EXTERNAL_PAYMENT,
- MANAGEMENT_OPERATION,
/**
- * An enum member indicating that [TransactionFamilyTypes] was instantiated with an
- * unknown value.
+ * An enum member indicating that [Family] was instantiated with an unknown value.
*/
_UNKNOWN,
}
@@ -2328,12 +2266,7 @@ private constructor(
*/
fun value(): Value =
when (this) {
- CARD -> Value.CARD
- PAYMENT -> Value.PAYMENT
- TRANSFER -> Value.TRANSFER
INTERNAL -> Value.INTERNAL
- EXTERNAL_PAYMENT -> Value.EXTERNAL_PAYMENT
- MANAGEMENT_OPERATION -> Value.MANAGEMENT_OPERATION
else -> Value._UNKNOWN
}
@@ -2348,14 +2281,8 @@ private constructor(
*/
fun known(): Known =
when (this) {
- CARD -> Known.CARD
- PAYMENT -> Known.PAYMENT
- TRANSFER -> Known.TRANSFER
INTERNAL -> Known.INTERNAL
- EXTERNAL_PAYMENT -> Known.EXTERNAL_PAYMENT
- MANAGEMENT_OPERATION -> Known.MANAGEMENT_OPERATION
- else ->
- throw LithicInvalidDataException("Unknown TransactionFamilyTypes: $value")
+ else -> throw LithicInvalidDataException("Unknown Family: $value")
}
/**
@@ -2374,7 +2301,7 @@ private constructor(
private var validated: Boolean = false
- fun validate(): TransactionFamilyTypes = apply {
+ fun validate(): Family = apply {
if (validated) {
return@apply
}
@@ -2404,7 +2331,7 @@ private constructor(
return true
}
- return other is TransactionFamilyTypes && value == other.value
+ return other is Family && value == other.value
}
override fun hashCode() = value.hashCode()
@@ -2745,99 +2672,177 @@ private constructor(
"FinancialTransaction{token=$token, category=$category, created=$created, currency=$currency, descriptor=$descriptor, events=$events, family=$family, financialAccountToken=$financialAccountToken, pendingAmount=$pendingAmount, result=$result, settledAmount=$settledAmount, status=$status, updated=$updated, additionalProperties=$additionalProperties}"
}
- /** Book transfer transaction */
- class BookTransferTransaction
+ /** Card transaction with ledger base properties */
+ class CardTransaction
@JsonCreator(mode = JsonCreator.Mode.DISABLED)
private constructor(
private val token: JsonField,
- private val category: JsonField,
+ private val accountToken: JsonField,
+ 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 currency: JsonField,
- private val events: JsonField>,
- private val family: JsonField,
- private val fromFinancialAccountToken: JsonField,
- private val pendingAmount: JsonField,
- private val result: JsonField,
+ private val financialAccountToken: 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 toFinancialAccountToken: JsonField,
+ private val status: JsonField,
+ private val tokenInfo: JsonField,
private val updated: JsonField,
- private val externalId: JsonField,
- private val externalResource: JsonField,
- private val transactionSeries: JsonField,
+ private val events: JsonField>,
+ private val family: JsonField,
private val additionalProperties: MutableMap,
) {
@JsonCreator
private constructor(
@JsonProperty("token") @ExcludeMissing token: JsonField = JsonMissing.of(),
- @JsonProperty("category")
+ @JsonProperty("account_token")
+ @ExcludeMissing
+ accountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("acquirer_fee")
+ @ExcludeMissing
+ acquirerFee: JsonField = JsonMissing.of(),
+ @JsonProperty("acquirer_reference_number")
+ @ExcludeMissing
+ acquirerReferenceNumber: JsonField = JsonMissing.of(),
+ @JsonProperty("amount") @ExcludeMissing amount: JsonField = JsonMissing.of(),
+ @JsonProperty("amounts")
+ @ExcludeMissing
+ amounts: JsonField = JsonMissing.of(),
+ @JsonProperty("authorization_amount")
+ @ExcludeMissing
+ authorizationAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("authorization_code")
+ @ExcludeMissing
+ authorizationCode: JsonField = JsonMissing.of(),
+ @JsonProperty("avs") @ExcludeMissing avs: JsonField = JsonMissing.of(),
+ @JsonProperty("card_token")
+ @ExcludeMissing
+ cardToken: JsonField = JsonMissing.of(),
+ @JsonProperty("cardholder_authentication")
@ExcludeMissing
- category: JsonField = JsonMissing.of(),
+ cardholderAuthentication: JsonField =
+ JsonMissing.of(),
@JsonProperty("created")
@ExcludeMissing
created: JsonField = JsonMissing.of(),
- @JsonProperty("currency")
+ @JsonProperty("financial_account_token")
@ExcludeMissing
- currency: JsonField = JsonMissing.of(),
- @JsonProperty("events")
+ financialAccountToken: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant")
@ExcludeMissing
- events: JsonField> = JsonMissing.of(),
- @JsonProperty("family")
+ merchant: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_amount")
@ExcludeMissing
- family: JsonField = JsonMissing.of(),
- @JsonProperty("from_financial_account_token")
+ merchantAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_authorization_amount")
@ExcludeMissing
- fromFinancialAccountToken: JsonField = JsonMissing.of(),
- @JsonProperty("pending_amount")
+ merchantAuthorizationAmount: JsonField = JsonMissing.of(),
+ @JsonProperty("merchant_currency")
@ExcludeMissing
- pendingAmount: JsonField = JsonMissing.of(),
+ merchantCurrency: JsonField = JsonMissing.of(),
+ @JsonProperty("network")
+ @ExcludeMissing
+ network: JsonField = JsonMissing.of(),
+ @JsonProperty("network_risk_score")
+ @ExcludeMissing
+ networkRiskScore: JsonField = JsonMissing.of(),
+ @JsonProperty("pos") @ExcludeMissing pos: JsonField = JsonMissing.of(),
@JsonProperty("result")
@ExcludeMissing
- result: JsonField = JsonMissing.of(),
+ result: JsonField = JsonMissing.of(),
@JsonProperty("settled_amount")
@ExcludeMissing
settledAmount: JsonField = JsonMissing.of(),
@JsonProperty("status")
@ExcludeMissing
- status: JsonField = JsonMissing.of(),
- @JsonProperty("to_financial_account_token")
+ status: JsonField = JsonMissing.of(),
+ @JsonProperty("token_info")
@ExcludeMissing
- toFinancialAccountToken: JsonField = JsonMissing.of(),
+ tokenInfo: JsonField = JsonMissing.of(),
@JsonProperty("updated")
@ExcludeMissing
updated: JsonField = JsonMissing.of(),
- @JsonProperty("external_id")
- @ExcludeMissing
- externalId: JsonField = JsonMissing.of(),
- @JsonProperty("external_resource")
- @ExcludeMissing
- externalResource: JsonField = JsonMissing.of(),
- @JsonProperty("transaction_series")
+ @JsonProperty("events")
@ExcludeMissing
- transactionSeries: JsonField = JsonMissing.of(),
+ events: JsonField> = JsonMissing.of(),
+ @JsonProperty("family") @ExcludeMissing family: JsonField = JsonMissing.of(),
) : this(
token,
- category,
+ accountToken,
+ acquirerFee,
+ acquirerReferenceNumber,
+ amount,
+ amounts,
+ authorizationAmount,
+ authorizationCode,
+ avs,
+ cardToken,
+ cardholderAuthentication,
created,
- currency,
- events,
- family,
- fromFinancialAccountToken,
- pendingAmount,
+ financialAccountToken,
+ merchant,
+ merchantAmount,
+ merchantAuthorizationAmount,
+ merchantCurrency,
+ network,
+ networkRiskScore,
+ pos,
result,
settledAmount,
status,
- toFinancialAccountToken,
+ tokenInfo,
updated,
- externalId,
- externalResource,
- transactionSeries,
+ events,
+ family,
mutableMapOf(),
)
+ fun toTransaction(): Transaction =
+ Transaction.builder()
+ .token(token)
+ .accountToken(accountToken)
+ .acquirerFee(acquirerFee)
+ .acquirerReferenceNumber(acquirerReferenceNumber)
+ .amount(amount)
+ .amounts(amounts)
+ .authorizationAmount(authorizationAmount)
+ .authorizationCode(authorizationCode)
+ .avs(avs)
+ .cardToken(cardToken)
+ .cardholderAuthentication(cardholderAuthentication)
+ .created(created)
+ .financialAccountToken(financialAccountToken)
+ .merchant(merchant)
+ .merchantAmount(merchantAmount)
+ .merchantAuthorizationAmount(merchantAuthorizationAmount)
+ .merchantCurrency(merchantCurrency)
+ .network(network)
+ .networkRiskScore(networkRiskScore)
+ .pos(pos)
+ .result(result)
+ .settledAmount(settledAmount)
+ .status(status)
+ .tokenInfo(tokenInfo)
+ .updated(updated)
+ .events(events)
+ .build()
+
/**
- * Unique identifier for the transaction
+ * Globally unique identifier.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
@@ -2845,120 +2850,217 @@ private constructor(
fun token(): String = token.getRequired("token")
/**
+ * The token for the account associated with this transaction.
+ *
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun category(): BookTransferCategory = category.getRequired("category")
+ fun accountToken(): String = accountToken.getRequired("account_token")
/**
- * ISO 8601 timestamp of when the transaction was created
+ * 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.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun created(): OffsetDateTime = created.getRequired("created")
+ fun acquirerFee(): Optional = acquirerFee.getOptional("acquirer_fee")
/**
- * Currency of the transaction in ISO 4217 format
+ * Unique identifier assigned to a transaction by the acquirer that can be used in dispute
+ * and chargeback filing. This field has been deprecated in favor of the
+ * `acquirer_reference_number` that resides in the event-level `network_info`.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun currency(): String = currency.getRequired("currency")
+ @Deprecated("deprecated")
+ fun acquirerReferenceNumber(): Optional =
+ acquirerReferenceNumber.getOptional("acquirer_reference_number")
/**
- * List of events associated with this book transfer
+ * When the transaction is pending, this represents the authorization amount of the
+ * transaction in the anticipated settlement currency. Once the transaction has settled,
+ * this field represents the settled amount in the settlement currency.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun events(): List = events.getRequired("events")
+ @Deprecated("deprecated") fun amount(): Long = amount.getRequired("amount")
/**
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun family(): TransactionFamilyTypes = family.getRequired("family")
+ fun amounts(): Transaction.TransactionAmounts = amounts.getRequired("amounts")
/**
- * Source account token
+ * The authorization amount of the transaction in the anticipated settlement currency.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun fromFinancialAccountToken(): String =
- fromFinancialAccountToken.getRequired("from_financial_account_token")
+ @Deprecated("deprecated")
+ fun authorizationAmount(): Optional =
+ authorizationAmount.getOptional("authorization_amount")
/**
- * The pending amount of the transaction in cents
+ * A fixed-width 6-digit numeric identifier that can be used to identify a transaction with
+ * networks.
*
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
- */
- fun pendingAmount(): Long = pendingAmount.getRequired("pending_amount")
-
- /**
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun result(): TransactionResult = result.getRequired("result")
+ fun authorizationCode(): Optional =
+ authorizationCode.getOptional("authorization_code")
/**
- * The settled amount of the transaction in cents
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun settledAmount(): Long = settledAmount.getRequired("settled_amount")
+ fun avs(): Optional = avs.getOptional("avs")
/**
- * The status of the transaction
+ * Token for the card used in this transaction.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun status(): TransactionStatus = status.getRequired("status")
+ fun cardToken(): String = cardToken.getRequired("card_token")
/**
- * Destination account token
- *
- * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
- * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
*/
- fun toFinancialAccountToken(): String =
- toFinancialAccountToken.getRequired("to_financial_account_token")
+ fun cardholderAuthentication(): Optional =
+ cardholderAuthentication.getOptional("cardholder_authentication")
/**
- * ISO 8601 timestamp of when the transaction was last updated
+ * Date and time when the transaction first occurred. UTC time zone.
*
* @throws LithicInvalidDataException if the JSON field has an unexpected type or is
* unexpectedly missing or null (e.g. if the server responded with an unexpected value).
*/
- fun updated(): OffsetDateTime = updated.getRequired("updated")
+ fun created(): OffsetDateTime = created.getRequired("created")
/**
- * External identifier for the transaction
- *
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun externalId(): Optional = externalId.getOptional("external_id")
+ fun financialAccountToken(): Optional =
+ financialAccountToken.getOptional("financial_account_token")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun merchant(): Transaction.Merchant = merchant.getRequired("merchant")
+
+ /**
+ * Analogous to the 'amount', but in the merchant currency.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ @Deprecated("deprecated")
+ fun merchantAmount(): Optional = merchantAmount.getOptional("merchant_amount")
+
+ /**
+ * Analogous to the 'authorization_amount', but in the merchant currency.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ @Deprecated("deprecated")
+ fun merchantAuthorizationAmount(): Optional =
+ merchantAuthorizationAmount.getOptional("merchant_authorization_amount")
+
+ /**
+ * 3-character alphabetic ISO 4217 code for the local currency of the transaction.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ @Deprecated("deprecated")
+ fun merchantCurrency(): String = merchantCurrency.getRequired("merchant_currency")
+
+ /**
+ * Card network of the authorization. Value is `UNKNOWN` when Lithic cannot determine the
+ * network code from the upstream provider.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun network(): Optional = network.getOptional("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.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun networkRiskScore(): Optional = networkRiskScore.getOptional("network_risk_score")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun pos(): Transaction.Pos = pos.getRequired("pos")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun result(): Transaction.DeclineResult = result.getRequired("result")
+
+ /**
+ * The settled amount of the transaction in the settlement currency.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ @Deprecated("deprecated")
+ fun settledAmount(): Long = settledAmount.getRequired("settled_amount")
+
+ /**
+ * Status of the transaction.
+ *
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun status(): Transaction.Status = status.getRequired("status")
+
+ /**
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
+ * server responded with an unexpected value).
+ */
+ fun tokenInfo(): Optional = tokenInfo.getOptional("token_info")
/**
- * External resource associated with the management operation
+ * Date and time when the transaction last updated. UTC time zone.
*
+ * @throws LithicInvalidDataException if the JSON field has an unexpected type or is
+ * unexpectedly missing or null (e.g. if the server responded with an unexpected value).
+ */
+ fun updated(): OffsetDateTime = updated.getRequired("updated")
+
+ /**
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun externalResource(): Optional =
- externalResource.getOptional("external_resource")
+ fun events(): Optional> = events.getOptional("events")
/**
+ * CARD - Card Transaction
+ *
* @throws LithicInvalidDataException if the JSON field has an unexpected type (e.g. if the
* server responded with an unexpected value).
*/
- fun transactionSeries(): Optional =
- transactionSeries.getOptional("transaction_series")
+ fun family(): Optional = family.getOptional("family")
/**
* Returns the raw JSON value of [token].
@@ -2968,216 +3070,361 @@ private constructor(
@JsonProperty("token") @ExcludeMissing fun _token(): JsonField = token
/**
- * Returns the raw JSON value of [category].
+ * Returns the raw JSON value of [accountToken].
*
- * Unlike [category], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [accountToken], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- @JsonProperty("category")
+ @JsonProperty("account_token")
@ExcludeMissing
- fun _category(): JsonField = category
+ fun _accountToken(): JsonField = accountToken
/**
- * Returns the raw JSON value of [created].
+ * Returns the raw JSON value of [acquirerFee].
*
- * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [acquirerFee], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
+ @JsonProperty("acquirer_fee")
+ @ExcludeMissing
+ fun _acquirerFee(): JsonField = acquirerFee
/**
- * Returns the raw JSON value of [currency].
+ * Returns the raw JSON value of [acquirerReferenceNumber].
*
- * Unlike [currency], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [acquirerReferenceNumber], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- @JsonProperty("currency") @ExcludeMissing fun _currency(): JsonField = currency
+ @Deprecated("deprecated")
+ @JsonProperty("acquirer_reference_number")
+ @ExcludeMissing
+ fun _acquirerReferenceNumber(): JsonField = acquirerReferenceNumber
/**
- * Returns the raw JSON value of [events].
+ * Returns the raw JSON value of [amount].
*
- * Unlike [events], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [amount], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("events")
+ @Deprecated("deprecated")
+ @JsonProperty("amount")
@ExcludeMissing
- fun _events(): JsonField> = events
+ fun _amount(): JsonField = amount
/**
- * Returns the raw JSON value of [family].
+ * Returns the raw JSON value of [amounts].
*
- * Unlike [family], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [amounts], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("family")
+ @JsonProperty("amounts")
@ExcludeMissing
- fun _family(): JsonField = family
+ fun _amounts(): JsonField = amounts
/**
- * Returns the raw JSON value of [fromFinancialAccountToken].
+ * Returns the raw JSON value of [authorizationAmount].
*
- * Unlike [fromFinancialAccountToken], this method doesn't throw if the JSON field has an
+ * Unlike [authorizationAmount], this method doesn't throw if the JSON field has an
* unexpected type.
*/
- @JsonProperty("from_financial_account_token")
+ @Deprecated("deprecated")
+ @JsonProperty("authorization_amount")
@ExcludeMissing
- fun _fromFinancialAccountToken(): JsonField = fromFinancialAccountToken
+ fun _authorizationAmount(): JsonField = authorizationAmount
/**
- * Returns the raw JSON value of [pendingAmount].
+ * Returns the raw JSON value of [authorizationCode].
*
- * Unlike [pendingAmount], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [authorizationCode], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("pending_amount")
+ @JsonProperty("authorization_code")
@ExcludeMissing
- fun _pendingAmount(): JsonField = pendingAmount
+ fun _authorizationCode(): JsonField = authorizationCode
/**
- * Returns the raw JSON value of [result].
+ * Returns the raw JSON value of [avs].
*
- * Unlike [result], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [avs], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("result") @ExcludeMissing fun _result(): JsonField = result
+ @JsonProperty("avs") @ExcludeMissing fun _avs(): JsonField = avs
/**
- * Returns the raw JSON value of [settledAmount].
+ * Returns the raw JSON value of [cardToken].
*
- * Unlike [settledAmount], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [cardToken], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("settled_amount")
+ @JsonProperty("card_token") @ExcludeMissing fun _cardToken(): JsonField = cardToken
+
+ /**
+ * Returns the raw JSON value of [cardholderAuthentication].
+ *
+ * Unlike [cardholderAuthentication], this method doesn't throw if the JSON field has an
+ * unexpected type.
+ */
+ @JsonProperty("cardholder_authentication")
@ExcludeMissing
- fun _settledAmount(): JsonField = settledAmount
+ fun _cardholderAuthentication(): JsonField =
+ cardholderAuthentication
/**
- * Returns the raw JSON value of [status].
+ * Returns the raw JSON value of [created].
*
- * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [created], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("status") @ExcludeMissing fun _status(): JsonField = status
+ @JsonProperty("created") @ExcludeMissing fun _created(): JsonField = created
/**
- * Returns the raw JSON value of [toFinancialAccountToken].
+ * Returns the raw JSON value of [financialAccountToken].
*
- * Unlike [toFinancialAccountToken], this method doesn't throw if the JSON field has an
+ * Unlike [financialAccountToken], this method doesn't throw if the JSON field has an
* unexpected type.
*/
- @JsonProperty("to_financial_account_token")
+ @JsonProperty("financial_account_token")
@ExcludeMissing
- fun _toFinancialAccountToken(): JsonField = toFinancialAccountToken
+ fun _financialAccountToken(): JsonField = financialAccountToken
/**
- * Returns the raw JSON value of [updated].
+ * Returns the raw JSON value of [merchant].
*
- * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [merchant], this method doesn't throw if the JSON field has an unexpected type.
*/
- @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated
+ @JsonProperty("merchant")
+ @ExcludeMissing
+ fun _merchant(): JsonField = merchant
/**
- * Returns the raw JSON value of [externalId].
+ * Returns the raw JSON value of [merchantAmount].
*
- * Unlike [externalId], this method doesn't throw if the JSON field has an unexpected type.
+ * Unlike [merchantAmount], this method doesn't throw if the JSON field has an unexpected
+ * type.
*/
- @JsonProperty("external_id")
+ @Deprecated("deprecated")
+ @JsonProperty("merchant_amount")
@ExcludeMissing
- fun _externalId(): JsonField = externalId
+ fun _merchantAmount(): JsonField = merchantAmount
/**
- * Returns the raw JSON value of [externalResource].
+ * Returns the raw JSON value of [merchantAuthorizationAmount].
*
- * Unlike [externalResource], this method doesn't throw if the JSON field has an unexpected
- * type.
+ * Unlike [merchantAuthorizationAmount], this method doesn't throw if the JSON field has an
+ * unexpected type.
*/
- @JsonProperty("external_resource")
+ @Deprecated("deprecated")
+ @JsonProperty("merchant_authorization_amount")
@ExcludeMissing
- fun _externalResource(): JsonField = externalResource
+ fun _merchantAuthorizationAmount(): JsonField = merchantAuthorizationAmount
/**
- * Returns the raw JSON value of [transactionSeries].
+ * Returns the raw JSON value of [merchantCurrency].
*
- * Unlike [transactionSeries], this method doesn't throw if the JSON field has an unexpected
+ * Unlike [merchantCurrency], this method doesn't throw if the JSON field has an unexpected
* type.
*/
- @JsonProperty("transaction_series")
+ @Deprecated("deprecated")
+ @JsonProperty("merchant_currency")
@ExcludeMissing
- fun _transactionSeries(): JsonField = transactionSeries
+ fun _merchantCurrency(): JsonField = merchantCurrency
- @JsonAnySetter
- private fun putAdditionalProperty(key: String, value: JsonValue) {
- additionalProperties.put(key, value)
- }
+ /**
+ * Returns the raw JSON value of [network].
+ *
+ * Unlike [network], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("network")
+ @ExcludeMissing
+ fun _network(): JsonField = network
- @JsonAnyGetter
+ /**
+ * Returns the raw JSON value of [networkRiskScore].
+ *
+ * Unlike [networkRiskScore], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @JsonProperty("network_risk_score")
@ExcludeMissing
- fun _additionalProperties(): Map =
- Collections.unmodifiableMap(additionalProperties)
+ fun _networkRiskScore(): JsonField = networkRiskScore
- fun toBuilder() = Builder().from(this)
+ /**
+ * Returns the raw JSON value of [pos].
+ *
+ * Unlike [pos], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("pos") @ExcludeMissing fun _pos(): JsonField = pos
- companion object {
+ /**
+ * Returns the raw JSON value of [result].
+ *
+ * Unlike [result], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("result")
+ @ExcludeMissing
+ fun _result(): JsonField = result
- /**
- * Returns a mutable builder for constructing an instance of [BookTransferTransaction].
- *
- * The following fields are required:
- * ```java
+ /**
+ * Returns the raw JSON value of [settledAmount].
+ *
+ * Unlike [settledAmount], this method doesn't throw if the JSON field has an unexpected
+ * type.
+ */
+ @Deprecated("deprecated")
+ @JsonProperty("settled_amount")
+ @ExcludeMissing
+ fun _settledAmount(): JsonField = settledAmount
+
+ /**
+ * Returns the raw JSON value of [status].
+ *
+ * Unlike [status], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("status")
+ @ExcludeMissing
+ fun _status(): JsonField = status
+
+ /**
+ * Returns the raw JSON value of [tokenInfo].
+ *
+ * Unlike [tokenInfo], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("token_info")
+ @ExcludeMissing
+ fun _tokenInfo(): JsonField = tokenInfo
+
+ /**
+ * Returns the raw JSON value of [updated].
+ *
+ * Unlike [updated], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("updated") @ExcludeMissing fun _updated(): JsonField = updated
+
+ /**
+ * Returns the raw JSON value of [events].
+ *
+ * Unlike [events], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("events")
+ @ExcludeMissing
+ fun _events(): JsonField> = events
+
+ /**
+ * Returns the raw JSON value of [family].
+ *
+ * Unlike [family], this method doesn't throw if the JSON field has an unexpected type.
+ */
+ @JsonProperty("family") @ExcludeMissing fun _family(): JsonField = family
+
+ @JsonAnySetter
+ private fun putAdditionalProperty(key: String, value: JsonValue) {
+ additionalProperties.put(key, value)
+ }
+
+ @JsonAnyGetter
+ @ExcludeMissing
+ fun _additionalProperties(): Map =
+ Collections.unmodifiableMap(additionalProperties)
+
+ fun toBuilder() = Builder().from(this)
+
+ companion object {
+
+ /**
+ * Returns a mutable builder for constructing an instance of [CardTransaction].
+ *
+ * The following fields are required:
+ * ```java
* .token()
- * .category()
+ * .accountToken()
+ * .acquirerFee()
+ * .acquirerReferenceNumber()
+ * .amount()
+ * .amounts()
+ * .authorizationAmount()
+ * .authorizationCode()
+ * .avs()
+ * .cardToken()
+ * .cardholderAuthentication()
* .created()
- * .currency()
- * .events()
- * .family()
- * .fromFinancialAccountToken()
- * .pendingAmount()
+ * .financialAccountToken()
+ * .merchant()
+ * .merchantAmount()
+ * .merchantAuthorizationAmount()
+ * .merchantCurrency()
+ * .network()
+ * .networkRiskScore()
+ * .pos()
* .result()
* .settledAmount()
* .status()
- * .toFinancialAccountToken()
+ * .tokenInfo()
* .updated()
* ```
*/
@JvmStatic fun builder() = Builder()
}
- /** A builder for [BookTransferTransaction]. */
+ /** A builder for [CardTransaction]. */
class Builder internal constructor() {
private var token: JsonField? = null
- private var category: JsonField? = null
+ private var accountToken: JsonField? = null
+ private var acquirerFee: JsonField? = null
+ private var acquirerReferenceNumber: JsonField? = null
+ private var amount: JsonField? = null
+ private var amounts: JsonField? = null
+ private var authorizationAmount: JsonField? = null
+ private var authorizationCode: JsonField? = null
+ private var avs: JsonField? = null
+ private var cardToken: JsonField? = null
+ private var cardholderAuthentication: JsonField? =
+ null
private var created: JsonField? = null
- private var currency: JsonField