Skip to content

Commit d514efc

Browse files
chore(api): small updates to verification addresses and Statement and LoanTape fields (#324)
- mark `verification_address` as deprecated when updating an Account - add `statement_type` to Statements - add `ending_balance` and `available_credit` to LoanTapes
1 parent 3b2b9aa commit d514efc

10 files changed

Lines changed: 153 additions & 22 deletions

File tree

lithic-java-core/src/main/kotlin/com/lithic/api/models/AccountUpdateParams.kt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,8 @@ constructor(
106106

107107
/**
108108
* Address used during Address Verification Service (AVS) checks during transactions if
109-
* enabled via Auth Rules.
109+
* enabled via Auth Rules. This field is deprecated as AVS checks are no longer supported by
110+
* Authorization Rules. The field will be removed from the schema in a future release.
110111
*/
111112
@JsonProperty("verification_address")
112113
fun verificationAddress(): VerificationAddress? = verificationAddress
@@ -177,7 +178,9 @@ constructor(
177178

178179
/**
179180
* Address used during Address Verification Service (AVS) checks during transactions if
180-
* enabled via Auth Rules.
181+
* enabled via Auth Rules. This field is deprecated as AVS checks are no longer
182+
* supported by Authorization Rules. The field will be removed from the schema in a
183+
* future release.
181184
*/
182185
@JsonProperty("verification_address")
183186
fun verificationAddress(verificationAddress: VerificationAddress) = apply {
@@ -352,7 +355,8 @@ constructor(
352355

353356
/**
354357
* Address used during Address Verification Service (AVS) checks during transactions if
355-
* enabled via Auth Rules.
358+
* enabled via Auth Rules. This field is deprecated as AVS checks are no longer supported by
359+
* Authorization Rules. The field will be removed from the schema in a future release.
356360
*/
357361
fun verificationAddress(verificationAddress: VerificationAddress) = apply {
358362
this.verificationAddress = verificationAddress
@@ -485,7 +489,8 @@ constructor(
485489

486490
/**
487491
* Address used during Address Verification Service (AVS) checks during transactions if enabled
488-
* via Auth Rules.
492+
* via Auth Rules. This field is deprecated as AVS checks are no longer supported by
493+
* Authorization Rules. The field will be removed from the schema in a future release.
489494
*/
490495
@JsonDeserialize(builder = VerificationAddress.Builder::class)
491496
@NoAutoDetect

lithic-java-core/src/main/kotlin/com/lithic/api/models/LoanTape.kt

Lines changed: 47 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@ private constructor(
3636
private val balancePastDue: JsonField<CategoryBalances>,
3737
private val balanceDue: JsonField<CategoryBalances>,
3838
private val balanceNextDue: JsonField<CategoryBalances>,
39+
private val endingBalance: JsonField<Long>,
3940
private val creditLimit: JsonField<Long>,
41+
private val availableCredit: JsonField<Long>,
4042
private val excessCredits: JsonField<Long>,
4143
private val accountStanding: JsonField<AccountStanding>,
4244
private val creditProductToken: JsonField<String>,
@@ -89,12 +91,18 @@ private constructor(
8991
*/
9092
fun balanceNextDue(): CategoryBalances = balanceNextDue.getRequired("balance_next_due")
9193

94+
/** Balance at the end of the day */
95+
fun endingBalance(): Long = endingBalance.getRequired("ending_balance")
96+
9297
/**
9398
* For prepay accounts, this is the minimum prepay balance that must be maintained. For charge
9499
* card accounts, this is the maximum credit balance extended by a lender
95100
*/
96101
fun creditLimit(): Long = creditLimit.getRequired("credit_limit")
97102

103+
/** Amount of credit available to spend in cents */
104+
fun availableCredit(): Long = availableCredit.getRequired("available_credit")
105+
98106
/**
99107
* Excess credits in the form of provisional credits, payments, or purchase refunds. If
100108
* positive, the account is in net credit state with no outstanding balances. An overpayment
@@ -159,12 +167,18 @@ private constructor(
159167
*/
160168
@JsonProperty("balance_next_due") @ExcludeMissing fun _balanceNextDue() = balanceNextDue
161169

170+
/** Balance at the end of the day */
171+
@JsonProperty("ending_balance") @ExcludeMissing fun _endingBalance() = endingBalance
172+
162173
/**
163174
* For prepay accounts, this is the minimum prepay balance that must be maintained. For charge
164175
* card accounts, this is the maximum credit balance extended by a lender
165176
*/
166177
@JsonProperty("credit_limit") @ExcludeMissing fun _creditLimit() = creditLimit
167178

179+
/** Amount of credit available to spend in cents */
180+
@JsonProperty("available_credit") @ExcludeMissing fun _availableCredit() = availableCredit
181+
168182
/**
169183
* Excess credits in the form of provisional credits, payments, or purchase refunds. If
170184
* positive, the account is in net credit state with no outstanding balances. An overpayment
@@ -210,7 +224,9 @@ private constructor(
210224
balancePastDue().validate()
211225
balanceDue().validate()
212226
balanceNextDue().validate()
227+
endingBalance()
213228
creditLimit()
229+
availableCredit()
214230
excessCredits()
215231
accountStanding().validate()
216232
creditProductToken()
@@ -243,7 +259,9 @@ private constructor(
243259
private var balancePastDue: JsonField<CategoryBalances> = JsonMissing.of()
244260
private var balanceDue: JsonField<CategoryBalances> = JsonMissing.of()
245261
private var balanceNextDue: JsonField<CategoryBalances> = JsonMissing.of()
262+
private var endingBalance: JsonField<Long> = JsonMissing.of()
246263
private var creditLimit: JsonField<Long> = JsonMissing.of()
264+
private var availableCredit: JsonField<Long> = JsonMissing.of()
247265
private var excessCredits: JsonField<Long> = JsonMissing.of()
248266
private var accountStanding: JsonField<AccountStanding> = JsonMissing.of()
249267
private var creditProductToken: JsonField<String> = JsonMissing.of()
@@ -267,7 +285,9 @@ private constructor(
267285
this.balancePastDue = loanTape.balancePastDue
268286
this.balanceDue = loanTape.balanceDue
269287
this.balanceNextDue = loanTape.balanceNextDue
288+
this.endingBalance = loanTape.endingBalance
270289
this.creditLimit = loanTape.creditLimit
290+
this.availableCredit = loanTape.availableCredit
271291
this.excessCredits = loanTape.excessCredits
272292
this.accountStanding = loanTape.accountStanding
273293
this.creditProductToken = loanTape.creditProductToken
@@ -393,6 +413,16 @@ private constructor(
393413
this.balanceNextDue = balanceNextDue
394414
}
395415

416+
/** Balance at the end of the day */
417+
fun endingBalance(endingBalance: Long) = endingBalance(JsonField.of(endingBalance))
418+
419+
/** Balance at the end of the day */
420+
@JsonProperty("ending_balance")
421+
@ExcludeMissing
422+
fun endingBalance(endingBalance: JsonField<Long>) = apply {
423+
this.endingBalance = endingBalance
424+
}
425+
396426
/**
397427
* For prepay accounts, this is the minimum prepay balance that must be maintained. For
398428
* charge card accounts, this is the maximum credit balance extended by a lender
@@ -407,6 +437,16 @@ private constructor(
407437
@ExcludeMissing
408438
fun creditLimit(creditLimit: JsonField<Long>) = apply { this.creditLimit = creditLimit }
409439

440+
/** Amount of credit available to spend in cents */
441+
fun availableCredit(availableCredit: Long) = availableCredit(JsonField.of(availableCredit))
442+
443+
/** Amount of credit available to spend in cents */
444+
@JsonProperty("available_credit")
445+
@ExcludeMissing
446+
fun availableCredit(availableCredit: JsonField<Long>) = apply {
447+
this.availableCredit = availableCredit
448+
}
449+
410450
/**
411451
* Excess credits in the form of provisional credits, payments, or purchase refunds. If
412452
* positive, the account is in net credit state with no outstanding balances. An overpayment
@@ -508,7 +548,9 @@ private constructor(
508548
balancePastDue,
509549
balanceDue,
510550
balanceNextDue,
551+
endingBalance,
511552
creditLimit,
553+
availableCredit,
512554
excessCredits,
513555
accountStanding,
514556
creditProductToken,
@@ -1341,7 +1383,9 @@ private constructor(
13411383
this.balancePastDue == other.balancePastDue &&
13421384
this.balanceDue == other.balanceDue &&
13431385
this.balanceNextDue == other.balanceNextDue &&
1386+
this.endingBalance == other.endingBalance &&
13441387
this.creditLimit == other.creditLimit &&
1388+
this.availableCredit == other.availableCredit &&
13451389
this.excessCredits == other.excessCredits &&
13461390
this.accountStanding == other.accountStanding &&
13471391
this.creditProductToken == other.creditProductToken &&
@@ -1370,7 +1414,9 @@ private constructor(
13701414
balancePastDue,
13711415
balanceDue,
13721416
balanceNextDue,
1417+
endingBalance,
13731418
creditLimit,
1419+
availableCredit,
13741420
excessCredits,
13751421
accountStanding,
13761422
creditProductToken,
@@ -1385,5 +1431,5 @@ private constructor(
13851431
}
13861432

13871433
override fun toString() =
1388-
"LoanTape{token=$token, financialAccountToken=$financialAccountToken, date=$date, created=$created, updated=$updated, version=$version, ytdTotals=$ytdTotals, periodTotals=$periodTotals, dayTotals=$dayTotals, balancePastDue=$balancePastDue, balanceDue=$balanceDue, balanceNextDue=$balanceNextDue, creditLimit=$creditLimit, excessCredits=$excessCredits, accountStanding=$accountStanding, creditProductToken=$creditProductToken, tier=$tier, paymentAllocation=$paymentAllocation, minimumPaymentBalance=$minimumPaymentBalance, previousStatementBalance=$previousStatementBalance, additionalProperties=$additionalProperties}"
1434+
"LoanTape{token=$token, financialAccountToken=$financialAccountToken, date=$date, created=$created, updated=$updated, version=$version, ytdTotals=$ytdTotals, periodTotals=$periodTotals, dayTotals=$dayTotals, balancePastDue=$balancePastDue, balanceDue=$balanceDue, balanceNextDue=$balanceNextDue, endingBalance=$endingBalance, creditLimit=$creditLimit, availableCredit=$availableCredit, excessCredits=$excessCredits, accountStanding=$accountStanding, creditProductToken=$creditProductToken, tier=$tier, paymentAllocation=$paymentAllocation, minimumPaymentBalance=$minimumPaymentBalance, previousStatementBalance=$previousStatementBalance, additionalProperties=$additionalProperties}"
13891435
}

lithic-java-core/src/main/kotlin/com/lithic/api/models/Statement.kt

Lines changed: 77 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ private constructor(
4444
private val accountStanding: JsonField<AccountStanding>,
4545
private val amountDue: JsonField<AmountDue>,
4646
private val interestDetails: JsonField<InterestDetails>,
47+
private val statementType: JsonField<StatementType>,
4748
private val additionalProperties: Map<String, JsonValue>,
4849
) {
4950

@@ -111,6 +112,8 @@ private constructor(
111112
fun interestDetails(): Optional<InterestDetails> =
112113
Optional.ofNullable(interestDetails.getNullable("interest_details"))
113114

115+
fun statementType(): StatementType = statementType.getRequired("statement_type")
116+
114117
/** Globally unique identifier for a statement */
115118
@JsonProperty("token") @ExcludeMissing fun _token() = token
116119

@@ -181,6 +184,8 @@ private constructor(
181184

182185
@JsonProperty("interest_details") @ExcludeMissing fun _interestDetails() = interestDetails
183186

187+
@JsonProperty("statement_type") @ExcludeMissing fun _statementType() = statementType
188+
184189
@JsonAnyGetter
185190
@ExcludeMissing
186191
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -207,6 +212,7 @@ private constructor(
207212
accountStanding().validate()
208213
amountDue().validate()
209214
interestDetails().map { it.validate() }
215+
statementType()
210216
validated = true
211217
}
212218
}
@@ -240,6 +246,7 @@ private constructor(
240246
private var accountStanding: JsonField<AccountStanding> = JsonMissing.of()
241247
private var amountDue: JsonField<AmountDue> = JsonMissing.of()
242248
private var interestDetails: JsonField<InterestDetails> = JsonMissing.of()
249+
private var statementType: JsonField<StatementType> = JsonMissing.of()
243250
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
244251

245252
@JvmSynthetic
@@ -264,6 +271,7 @@ private constructor(
264271
this.accountStanding = statement.accountStanding
265272
this.amountDue = statement.amountDue
266273
this.interestDetails = statement.interestDetails
274+
this.statementType = statement.statementType
267275
additionalProperties(statement.additionalProperties)
268276
}
269277

@@ -460,6 +468,14 @@ private constructor(
460468
this.interestDetails = interestDetails
461469
}
462470

471+
fun statementType(statementType: StatementType) = statementType(JsonField.of(statementType))
472+
473+
@JsonProperty("statement_type")
474+
@ExcludeMissing
475+
fun statementType(statementType: JsonField<StatementType>) = apply {
476+
this.statementType = statementType
477+
}
478+
463479
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
464480
this.additionalProperties.clear()
465481
this.additionalProperties.putAll(additionalProperties)
@@ -496,6 +512,7 @@ private constructor(
496512
accountStanding,
497513
amountDue,
498514
interestDetails,
515+
statementType,
499516
additionalProperties.toUnmodifiable(),
500517
)
501518
}
@@ -1196,6 +1213,63 @@ private constructor(
11961213
"StatementTotals{payments=$payments, purchases=$purchases, fees=$fees, credits=$credits, interest=$interest, cashAdvances=$cashAdvances, balanceTransfers=$balanceTransfers, additionalProperties=$additionalProperties}"
11971214
}
11981215

1216+
class StatementType
1217+
@JsonCreator
1218+
private constructor(
1219+
private val value: JsonField<String>,
1220+
) : Enum {
1221+
1222+
@com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField<String> = value
1223+
1224+
override fun equals(other: Any?): Boolean {
1225+
if (this === other) {
1226+
return true
1227+
}
1228+
1229+
return other is StatementType && this.value == other.value
1230+
}
1231+
1232+
override fun hashCode() = value.hashCode()
1233+
1234+
override fun toString() = value.toString()
1235+
1236+
companion object {
1237+
1238+
@JvmField val INITIAL = StatementType(JsonField.of("INITIAL"))
1239+
1240+
@JvmField val PERIOD_END = StatementType(JsonField.of("PERIOD_END"))
1241+
1242+
@JvmStatic fun of(value: String) = StatementType(JsonField.of(value))
1243+
}
1244+
1245+
enum class Known {
1246+
INITIAL,
1247+
PERIOD_END,
1248+
}
1249+
1250+
enum class Value {
1251+
INITIAL,
1252+
PERIOD_END,
1253+
_UNKNOWN,
1254+
}
1255+
1256+
fun value(): Value =
1257+
when (this) {
1258+
INITIAL -> Value.INITIAL
1259+
PERIOD_END -> Value.PERIOD_END
1260+
else -> Value._UNKNOWN
1261+
}
1262+
1263+
fun known(): Known =
1264+
when (this) {
1265+
INITIAL -> Known.INITIAL
1266+
PERIOD_END -> Known.PERIOD_END
1267+
else -> throw LithicInvalidDataException("Unknown StatementType: $value")
1268+
}
1269+
1270+
fun asString(): String = _value().asStringOrThrow()
1271+
}
1272+
11991273
@JsonDeserialize(builder = InterestDetails.Builder::class)
12001274
@NoAutoDetect
12011275
class InterestDetails
@@ -1655,6 +1729,7 @@ private constructor(
16551729
this.accountStanding == other.accountStanding &&
16561730
this.amountDue == other.amountDue &&
16571731
this.interestDetails == other.interestDetails &&
1732+
this.statementType == other.statementType &&
16581733
this.additionalProperties == other.additionalProperties
16591734
}
16601735

@@ -1684,12 +1759,13 @@ private constructor(
16841759
accountStanding,
16851760
amountDue,
16861761
interestDetails,
1762+
statementType,
16871763
additionalProperties,
16881764
)
16891765
}
16901766
return hashCode
16911767
}
16921768

16931769
override fun toString() =
1694-
"Statement{token=$token, financialAccountToken=$financialAccountToken, statementStartDate=$statementStartDate, statementEndDate=$statementEndDate, nextStatementEndDate=$nextStatementEndDate, paymentDueDate=$paymentDueDate, nextPaymentDueDate=$nextPaymentDueDate, daysInBillingCycle=$daysInBillingCycle, creditLimit=$creditLimit, availableCredit=$availableCredit, startingBalance=$startingBalance, endingBalance=$endingBalance, periodTotals=$periodTotals, ytdTotals=$ytdTotals, created=$created, updated=$updated, creditProductToken=$creditProductToken, accountStanding=$accountStanding, amountDue=$amountDue, interestDetails=$interestDetails, additionalProperties=$additionalProperties}"
1770+
"Statement{token=$token, financialAccountToken=$financialAccountToken, statementStartDate=$statementStartDate, statementEndDate=$statementEndDate, nextStatementEndDate=$nextStatementEndDate, paymentDueDate=$paymentDueDate, nextPaymentDueDate=$nextPaymentDueDate, daysInBillingCycle=$daysInBillingCycle, creditLimit=$creditLimit, availableCredit=$availableCredit, startingBalance=$startingBalance, endingBalance=$endingBalance, periodTotals=$periodTotals, ytdTotals=$ytdTotals, created=$created, updated=$updated, creditProductToken=$creditProductToken, accountStanding=$accountStanding, amountDue=$amountDue, interestDetails=$interestDetails, statementType=$statementType, additionalProperties=$additionalProperties}"
16951771
}

lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AccountServiceAsync.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,9 @@ interface AccountServiceAsync {
2424
): CompletableFuture<Account>
2525

2626
/**
27-
* Update account configuration such as spend limits and verification address. Can only be run
28-
* on accounts that are part of the program managed by this API key.
29-
*
30-
* Accounts that are in the `PAUSED` state will not be able to transact or create new cards.
27+
* Update account configuration such as state or spend limits. Can only be run on accounts that
28+
* are part of the program managed by this API key. Accounts that are in the `PAUSED` state will
29+
* not be able to transact or create new cards.
3130
*/
3231
@JvmOverloads
3332
fun update(

lithic-java-core/src/main/kotlin/com/lithic/api/services/async/AccountServiceAsyncImpl.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,9 @@ constructor(
6161
jsonHandler<Account>(clientOptions.jsonMapper).withErrorHandler(errorHandler)
6262

6363
/**
64-
* Update account configuration such as spend limits and verification address. Can only be run
65-
* on accounts that are part of the program managed by this API key.
66-
*
67-
* Accounts that are in the `PAUSED` state will not be able to transact or create new cards.
64+
* Update account configuration such as state or spend limits. Can only be run on accounts that
65+
* are part of the program managed by this API key. Accounts that are in the `PAUSED` state will
66+
* not be able to transact or create new cards.
6867
*/
6968
override fun update(
7069
params: AccountUpdateParams,

lithic-java-core/src/main/kotlin/com/lithic/api/services/blocking/AccountService.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ interface AccountService {
2323
): Account
2424

2525
/**
26-
* Update account configuration such as spend limits and verification address. Can only be run
27-
* on accounts that are part of the program managed by this API key.
28-
*
29-
* Accounts that are in the `PAUSED` state will not be able to transact or create new cards.
26+
* Update account configuration such as state or spend limits. Can only be run on accounts that
27+
* are part of the program managed by this API key. Accounts that are in the `PAUSED` state will
28+
* not be able to transact or create new cards.
3029
*/
3130
@JvmOverloads
3231
fun update(

0 commit comments

Comments
 (0)