Skip to content

Commit 42796e1

Browse files
feat(api)!: updates book transfer status, updates to transactions, add currency model (#305)
- Breaking: Removed book transfer status `PENDING`. While technically a breaking change, that was a mistake and should not impact user code, the API never accepted `PENDING` as a status for book transfer. - Add book transfer status `REVERSED` - Add `updated` and `amounts` fields to transactions - Add shared model `Currency` # Migration The SDK previously stated that `PENDING` was an accepted value for book transfer status. That was a mistake, `PENDING` has never been accepted by the API for book transfers. While this is a breaking change we do not expect user code to be impacted.
1 parent f52f5c7 commit 42796e1

22 files changed

Lines changed: 3109 additions & 363 deletions

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

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -42,21 +42,15 @@ private constructor(
4242
fun city(): String = city.getRequired("city")
4343

4444
/**
45-
* Valid country code. Only USA is currently supported, entered in uppercase ISO 3166-1 alpha-3
45+
* Valid country code. USA and CAN are supported, entered in uppercase ISO 3166-1 alpha-3
4646
* three-character format.
4747
*/
4848
fun country(): String = country.getRequired("country")
4949

50-
/**
51-
* Valid postal code. Only USA postal codes (ZIP codes) are currently supported, entered as a
52-
* five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.
53-
*/
50+
/** Valid postal code. */
5451
fun postalCode(): String = postalCode.getRequired("postal_code")
5552

56-
/**
57-
* Valid state code. Only USA state codes are currently supported, entered in uppercase ISO
58-
* 3166-2 two-character format.
59-
*/
53+
/** Valid state code. */
6054
fun state(): String = state.getRequired("state")
6155

6256
/** Valid deliverable address (no PO boxes). */
@@ -69,21 +63,15 @@ private constructor(
6963
@JsonProperty("city") @ExcludeMissing fun _city() = city
7064

7165
/**
72-
* Valid country code. Only USA is currently supported, entered in uppercase ISO 3166-1 alpha-3
66+
* Valid country code. USA and CAN are supported, entered in uppercase ISO 3166-1 alpha-3
7367
* three-character format.
7468
*/
7569
@JsonProperty("country") @ExcludeMissing fun _country() = country
7670

77-
/**
78-
* Valid postal code. Only USA postal codes (ZIP codes) are currently supported, entered as a
79-
* five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.
80-
*/
71+
/** Valid postal code. */
8172
@JsonProperty("postal_code") @ExcludeMissing fun _postalCode() = postalCode
8273

83-
/**
84-
* Valid state code. Only USA state codes are currently supported, entered in uppercase ISO
85-
* 3166-2 two-character format.
86-
*/
74+
/** Valid state code. */
8775
@JsonProperty("state") @ExcludeMissing fun _state() = state
8876

8977
@JsonAnyGetter
@@ -189,43 +177,31 @@ private constructor(
189177
fun city(city: JsonField<String>) = apply { this.city = city }
190178

191179
/**
192-
* Valid country code. Only USA is currently supported, entered in uppercase ISO 3166-1
193-
* alpha-3 three-character format.
180+
* Valid country code. USA and CAN are supported, entered in uppercase ISO 3166-1 alpha-3
181+
* three-character format.
194182
*/
195183
fun country(country: String) = country(JsonField.of(country))
196184

197185
/**
198-
* Valid country code. Only USA is currently supported, entered in uppercase ISO 3166-1
199-
* alpha-3 three-character format.
186+
* Valid country code. USA and CAN are supported, entered in uppercase ISO 3166-1 alpha-3
187+
* three-character format.
200188
*/
201189
@JsonProperty("country")
202190
@ExcludeMissing
203191
fun country(country: JsonField<String>) = apply { this.country = country }
204192

205-
/**
206-
* Valid postal code. Only USA postal codes (ZIP codes) are currently supported, entered as
207-
* a five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.
208-
*/
193+
/** Valid postal code. */
209194
fun postalCode(postalCode: String) = postalCode(JsonField.of(postalCode))
210195

211-
/**
212-
* Valid postal code. Only USA postal codes (ZIP codes) are currently supported, entered as
213-
* a five-digit postal code or nine-digit postal code (ZIP+4) using the format 12345-1234.
214-
*/
196+
/** Valid postal code. */
215197
@JsonProperty("postal_code")
216198
@ExcludeMissing
217199
fun postalCode(postalCode: JsonField<String>) = apply { this.postalCode = postalCode }
218200

219-
/**
220-
* Valid state code. Only USA state codes are currently supported, entered in uppercase ISO
221-
* 3166-2 two-character format.
222-
*/
201+
/** Valid state code. */
223202
fun state(state: String) = state(JsonField.of(state))
224203

225-
/**
226-
* Valid state code. Only USA state codes are currently supported, entered in uppercase ISO
227-
* 3166-2 two-character format.
228-
*/
204+
/** Valid state code. */
229205
@JsonProperty("state")
230206
@ExcludeMissing
231207
fun state(state: JsonField<String>) = apply { this.state = state }

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

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ private constructor(
8080
fun settledAmount(): Long = settledAmount.getRequired("settled_amount")
8181

8282
/**
83-
* Status types: _ `DECLINED` - The transfer was declined. _ `PENDING` - The transfer is pending
84-
* release from a hold. \* `SETTLED` - The transfer is completed.
83+
* Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The transfer was
84+
* reversed \* `SETTLED` - The transfer is completed.
8585
*/
8686
fun status(): Status = status.getRequired("status")
8787

@@ -134,8 +134,8 @@ private constructor(
134134
@JsonProperty("settled_amount") @ExcludeMissing fun _settledAmount() = settledAmount
135135

136136
/**
137-
* Status types: _ `DECLINED` - The transfer was declined. _ `PENDING` - The transfer is pending
138-
* release from a hold. \* `SETTLED` - The transfer is completed.
137+
* Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The transfer was
138+
* reversed \* `SETTLED` - The transfer is completed.
139139
*/
140140
@JsonProperty("status") @ExcludeMissing fun _status() = status
141141

@@ -361,14 +361,14 @@ private constructor(
361361
}
362362

363363
/**
364-
* Status types: _ `DECLINED` - The transfer was declined. _ `PENDING` - The transfer is
365-
* pending release from a hold. \* `SETTLED` - The transfer is completed.
364+
* Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The transfer was
365+
* reversed \* `SETTLED` - The transfer is completed.
366366
*/
367367
fun status(status: Status) = status(JsonField.of(status))
368368

369369
/**
370-
* Status types: _ `DECLINED` - The transfer was declined. _ `PENDING` - The transfer is
371-
* pending release from a hold. \* `SETTLED` - The transfer is completed.
370+
* Status types: _ `DECLINED` - The transfer was declined. _ `REVERSED` - The transfer was
371+
* reversed \* `SETTLED` - The transfer is completed.
372372
*/
373373
@JsonProperty("status")
374374
@ExcludeMissing
@@ -997,7 +997,7 @@ private constructor(
997997

998998
@JvmField val DECLINED = Status(JsonField.of("DECLINED"))
999999

1000-
@JvmField val PENDING = Status(JsonField.of("PENDING"))
1000+
@JvmField val REVERSED = Status(JsonField.of("REVERSED"))
10011001

10021002
@JvmField val SETTLED = Status(JsonField.of("SETTLED"))
10031003

@@ -1006,29 +1006,29 @@ private constructor(
10061006

10071007
enum class Known {
10081008
DECLINED,
1009-
PENDING,
1009+
REVERSED,
10101010
SETTLED,
10111011
}
10121012

10131013
enum class Value {
10141014
DECLINED,
1015-
PENDING,
1015+
REVERSED,
10161016
SETTLED,
10171017
_UNKNOWN,
10181018
}
10191019

10201020
fun value(): Value =
10211021
when (this) {
10221022
DECLINED -> Value.DECLINED
1023-
PENDING -> Value.PENDING
1023+
REVERSED -> Value.REVERSED
10241024
SETTLED -> Value.SETTLED
10251025
else -> Value._UNKNOWN
10261026
}
10271027

10281028
fun known(): Known =
10291029
when (this) {
10301030
DECLINED -> Known.DECLINED
1031-
PENDING -> Known.PENDING
1031+
REVERSED -> Known.REVERSED
10321032
SETTLED -> Known.SETTLED
10331033
else -> throw LithicInvalidDataException("Unknown Status: $value")
10341034
}

0 commit comments

Comments
 (0)