Skip to content

Commit 39e7f41

Browse files
feat(api): updates to documentation and addition of new 3DS simulation methods (#330)
- new simulation endpoints for 3DS for simulating challenges and challenge responses - extracts LoanTape balances properties into their own sub-property under `balances` - updates to documentation and required properties on Transaction and Card - updates response type for V1 -> V2 AuthRule migration endpoint to allow for multiple responses
1 parent 9028be7 commit 39e7f41

37 files changed

Lines changed: 5250 additions & 6424 deletions

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 153
1+
configured_endpoints: 155

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

Lines changed: 0 additions & 1985 deletions
This file was deleted.

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

Lines changed: 4 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -19,28 +19,18 @@ import java.util.Optional
1919
@NoAutoDetect
2020
class AuthenticationSimulateResponse
2121
private constructor(
22-
private val debuggingRequestId: JsonField<String>,
2322
private val token: JsonField<String>,
2423
private val additionalProperties: Map<String, JsonValue>,
2524
) {
2625

2726
private var validated: Boolean = false
2827

29-
/** Debugging request ID to share with Lithic Support team. */
30-
fun debuggingRequestId(): Optional<String> =
31-
Optional.ofNullable(debuggingRequestId.getNullable("debugging_request_id"))
32-
3328
/**
3429
* A unique token to reference this transaction with later calls to void or clear the
3530
* authorization.
3631
*/
3732
fun token(): Optional<String> = Optional.ofNullable(token.getNullable("token"))
3833

39-
/** Debugging request ID to share with Lithic Support team. */
40-
@JsonProperty("debugging_request_id")
41-
@ExcludeMissing
42-
fun _debuggingRequestId() = debuggingRequestId
43-
4434
/**
4535
* A unique token to reference this transaction with later calls to void or clear the
4636
* authorization.
@@ -53,7 +43,6 @@ private constructor(
5343

5444
fun validate(): AuthenticationSimulateResponse = apply {
5545
if (!validated) {
56-
debuggingRequestId()
5746
token()
5847
validated = true
5948
}
@@ -68,28 +57,15 @@ private constructor(
6857

6958
class Builder {
7059

71-
private var debuggingRequestId: JsonField<String> = JsonMissing.of()
7260
private var token: JsonField<String> = JsonMissing.of()
7361
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
7462

7563
@JvmSynthetic
7664
internal fun from(authenticationSimulateResponse: AuthenticationSimulateResponse) = apply {
77-
this.debuggingRequestId = authenticationSimulateResponse.debuggingRequestId
7865
this.token = authenticationSimulateResponse.token
7966
additionalProperties(authenticationSimulateResponse.additionalProperties)
8067
}
8168

82-
/** Debugging request ID to share with Lithic Support team. */
83-
fun debuggingRequestId(debuggingRequestId: String) =
84-
debuggingRequestId(JsonField.of(debuggingRequestId))
85-
86-
/** Debugging request ID to share with Lithic Support team. */
87-
@JsonProperty("debugging_request_id")
88-
@ExcludeMissing
89-
fun debuggingRequestId(debuggingRequestId: JsonField<String>) = apply {
90-
this.debuggingRequestId = debuggingRequestId
91-
}
92-
9369
/**
9470
* A unique token to reference this transaction with later calls to void or clear the
9571
* authorization.
@@ -119,30 +95,26 @@ private constructor(
11995
}
12096

12197
fun build(): AuthenticationSimulateResponse =
122-
AuthenticationSimulateResponse(
123-
debuggingRequestId,
124-
token,
125-
additionalProperties.toUnmodifiable(),
126-
)
98+
AuthenticationSimulateResponse(token, additionalProperties.toUnmodifiable())
12799
}
128100

129101
override fun equals(other: Any?): Boolean {
130102
if (this === other) {
131103
return true
132104
}
133105

134-
return /* spotless:off */ other is AuthenticationSimulateResponse && this.debuggingRequestId == other.debuggingRequestId && this.token == other.token && this.additionalProperties == other.additionalProperties /* spotless:on */
106+
return /* spotless:off */ other is AuthenticationSimulateResponse && this.token == other.token && this.additionalProperties == other.additionalProperties /* spotless:on */
135107
}
136108

137109
private var hashCode: Int = 0
138110

139111
override fun hashCode(): Int {
140112
if (hashCode == 0) {
141-
hashCode = /* spotless:off */ Objects.hash(debuggingRequestId, token, additionalProperties) /* spotless:on */
113+
hashCode = /* spotless:off */ Objects.hash(token, additionalProperties) /* spotless:on */
142114
}
143115
return hashCode
144116
}
145117

146118
override fun toString() =
147-
"AuthenticationSimulateResponse{debuggingRequestId=$debuggingRequestId, token=$token, additionalProperties=$additionalProperties}"
119+
"AuthenticationSimulateResponse{token=$token, additionalProperties=$additionalProperties}"
148120
}

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

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -99,10 +99,7 @@ private constructor(
9999
/** Last four digits of the card number. */
100100
fun lastFour(): String = lastFour.getRequired("last_four")
101101

102-
/**
103-
* Friendly name to identify the card. We recommend against using this field to store JSON data
104-
* as it can cause unexpected behavior.
105-
*/
102+
/** Friendly name to identify the card. */
106103
fun memo(): Optional<String> = Optional.ofNullable(memo.getNullable("memo"))
107104

108105
/**
@@ -237,10 +234,7 @@ private constructor(
237234
/** Last four digits of the card number. */
238235
@JsonProperty("last_four") @ExcludeMissing fun _lastFour() = lastFour
239236

240-
/**
241-
* Friendly name to identify the card. We recommend against using this field to store JSON data
242-
* as it can cause unexpected behavior.
243-
*/
237+
/** Friendly name to identify the card. */
244238
@JsonProperty("memo") @ExcludeMissing fun _memo() = memo
245239

246240
/**
@@ -547,16 +541,10 @@ private constructor(
547541
@ExcludeMissing
548542
fun lastFour(lastFour: JsonField<String>) = apply { this.lastFour = lastFour }
549543

550-
/**
551-
* Friendly name to identify the card. We recommend against using this field to store JSON
552-
* data as it can cause unexpected behavior.
553-
*/
544+
/** Friendly name to identify the card. */
554545
fun memo(memo: String) = memo(JsonField.of(memo))
555546

556-
/**
557-
* Friendly name to identify the card. We recommend against using this field to store JSON
558-
* data as it can cause unexpected behavior.
559-
*/
547+
/** Friendly name to identify the card. */
560548
@JsonProperty("memo")
561549
@ExcludeMissing
562550
fun memo(memo: JsonField<String>) = apply { this.memo = memo }

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,7 @@ constructor(
176176
*/
177177
@JsonProperty("exp_year") fun expYear(): String? = expYear
178178

179-
/**
180-
* Friendly name to identify the card. We recommend against using this field to store JSON
181-
* data as it can cause unexpected behavior.
182-
*/
179+
/** Friendly name to identify the card. */
183180
@JsonProperty("memo") fun memo(): String? = memo
184181

185182
/**
@@ -361,10 +358,7 @@ constructor(
361358
@JsonProperty("exp_year")
362359
fun expYear(expYear: String) = apply { this.expYear = expYear }
363360

364-
/**
365-
* Friendly name to identify the card. We recommend against using this field to store
366-
* JSON data as it can cause unexpected behavior.
367-
*/
361+
/** Friendly name to identify the card. */
368362
@JsonProperty("memo") fun memo(memo: String) = apply { this.memo = memo }
369363

370364
/**
@@ -635,10 +629,7 @@ constructor(
635629
*/
636630
fun expYear(expYear: String) = apply { this.expYear = expYear }
637631

638-
/**
639-
* Friendly name to identify the card. We recommend against using this field to store JSON
640-
* data as it can cause unexpected behavior.
641-
*/
632+
/** Friendly name to identify the card. */
642633
fun memo(memo: String) = apply { this.memo = memo }
643634

644635
/**

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

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -97,10 +97,7 @@ constructor(
9797
@JsonProperty("digital_card_art_token")
9898
fun digitalCardArtToken(): String? = digitalCardArtToken
9999

100-
/**
101-
* Friendly name to identify the card. We recommend against using this field to store JSON
102-
* data as it can cause unexpected behavior.
103-
*/
100+
/** Friendly name to identify the card. */
104101
@JsonProperty("memo") fun memo(): String? = memo
105102

106103
/**
@@ -192,10 +189,7 @@ constructor(
192189
this.digitalCardArtToken = digitalCardArtToken
193190
}
194191

195-
/**
196-
* Friendly name to identify the card. We recommend against using this field to store
197-
* JSON data as it can cause unexpected behavior.
198-
*/
192+
/** Friendly name to identify the card. */
199193
@JsonProperty("memo") fun memo(memo: String) = apply { this.memo = memo }
200194

201195
/**
@@ -367,10 +361,7 @@ constructor(
367361
this.digitalCardArtToken = digitalCardArtToken
368362
}
369363

370-
/**
371-
* Friendly name to identify the card. We recommend against using this field to store JSON
372-
* data as it can cause unexpected behavior.
373-
*/
364+
/** Friendly name to identify the card. */
374365
fun memo(memo: String) = apply { this.memo = memo }
375366

376367
/**
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
// File generated from our OpenAPI spec by Stainless.
2+
3+
package com.lithic.api.models
4+
5+
import com.fasterxml.jackson.annotation.JsonAnyGetter
6+
import com.fasterxml.jackson.annotation.JsonAnySetter
7+
import com.fasterxml.jackson.annotation.JsonProperty
8+
import com.fasterxml.jackson.databind.annotation.JsonDeserialize
9+
import com.lithic.api.core.ExcludeMissing
10+
import com.lithic.api.core.JsonField
11+
import com.lithic.api.core.JsonMissing
12+
import com.lithic.api.core.JsonValue
13+
import com.lithic.api.core.NoAutoDetect
14+
import com.lithic.api.core.toUnmodifiable
15+
import java.util.Objects
16+
17+
@JsonDeserialize(builder = ChallengeResponse.Builder::class)
18+
@NoAutoDetect
19+
class ChallengeResponse
20+
private constructor(
21+
private val token: JsonField<String>,
22+
private val challengeResponse: JsonField<ChallengeResult>,
23+
private val additionalProperties: Map<String, JsonValue>,
24+
) {
25+
26+
private var validated: Boolean = false
27+
28+
/**
29+
* Globally unique identifier for the 3DS authentication. This token is sent as part of the
30+
* initial 3DS Decisioning Request and as part of the 3DS Challenge Event in the
31+
* [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) object
32+
*/
33+
fun token(): String = token.getRequired("token")
34+
35+
/** Whether the Cardholder has Approved or Declined the issued Challenge */
36+
fun challengeResponse(): ChallengeResult = challengeResponse.getRequired("challenge_response")
37+
38+
/**
39+
* Globally unique identifier for the 3DS authentication. This token is sent as part of the
40+
* initial 3DS Decisioning Request and as part of the 3DS Challenge Event in the
41+
* [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) object
42+
*/
43+
@JsonProperty("token") @ExcludeMissing fun _token() = token
44+
45+
/** Whether the Cardholder has Approved or Declined the issued Challenge */
46+
@JsonProperty("challenge_response") @ExcludeMissing fun _challengeResponse() = challengeResponse
47+
48+
@JsonAnyGetter
49+
@ExcludeMissing
50+
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
51+
52+
fun validate(): ChallengeResponse = apply {
53+
if (!validated) {
54+
token()
55+
challengeResponse()
56+
validated = true
57+
}
58+
}
59+
60+
fun toBuilder() = Builder().from(this)
61+
62+
companion object {
63+
64+
@JvmStatic fun builder() = Builder()
65+
}
66+
67+
class Builder {
68+
69+
private var token: JsonField<String> = JsonMissing.of()
70+
private var challengeResponse: JsonField<ChallengeResult> = JsonMissing.of()
71+
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
72+
73+
@JvmSynthetic
74+
internal fun from(challengeResponse: ChallengeResponse) = apply {
75+
this.token = challengeResponse.token
76+
this.challengeResponse = challengeResponse.challengeResponse
77+
additionalProperties(challengeResponse.additionalProperties)
78+
}
79+
80+
/**
81+
* Globally unique identifier for the 3DS authentication. This token is sent as part of the
82+
* initial 3DS Decisioning Request and as part of the 3DS Challenge Event in the
83+
* [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) object
84+
*/
85+
fun token(token: String) = token(JsonField.of(token))
86+
87+
/**
88+
* Globally unique identifier for the 3DS authentication. This token is sent as part of the
89+
* initial 3DS Decisioning Request and as part of the 3DS Challenge Event in the
90+
* [ThreeDSAuthentication](#/components/schemas/ThreeDSAuthentication) object
91+
*/
92+
@JsonProperty("token")
93+
@ExcludeMissing
94+
fun token(token: JsonField<String>) = apply { this.token = token }
95+
96+
/** Whether the Cardholder has Approved or Declined the issued Challenge */
97+
fun challengeResponse(challengeResponse: ChallengeResult) =
98+
challengeResponse(JsonField.of(challengeResponse))
99+
100+
/** Whether the Cardholder has Approved or Declined the issued Challenge */
101+
@JsonProperty("challenge_response")
102+
@ExcludeMissing
103+
fun challengeResponse(challengeResponse: JsonField<ChallengeResult>) = apply {
104+
this.challengeResponse = challengeResponse
105+
}
106+
107+
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
108+
this.additionalProperties.clear()
109+
this.additionalProperties.putAll(additionalProperties)
110+
}
111+
112+
@JsonAnySetter
113+
fun putAdditionalProperty(key: String, value: JsonValue) = apply {
114+
this.additionalProperties.put(key, value)
115+
}
116+
117+
fun putAllAdditionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
118+
this.additionalProperties.putAll(additionalProperties)
119+
}
120+
121+
fun build(): ChallengeResponse =
122+
ChallengeResponse(
123+
token,
124+
challengeResponse,
125+
additionalProperties.toUnmodifiable(),
126+
)
127+
}
128+
129+
override fun equals(other: Any?): Boolean {
130+
if (this === other) {
131+
return true
132+
}
133+
134+
return /* spotless:off */ other is ChallengeResponse && this.token == other.token && this.challengeResponse == other.challengeResponse && this.additionalProperties == other.additionalProperties /* spotless:on */
135+
}
136+
137+
private var hashCode: Int = 0
138+
139+
override fun hashCode(): Int {
140+
if (hashCode == 0) {
141+
hashCode = /* spotless:off */ Objects.hash(token, challengeResponse, additionalProperties) /* spotless:on */
142+
}
143+
return hashCode
144+
}
145+
146+
override fun toString() =
147+
"ChallengeResponse{token=$token, challengeResponse=$challengeResponse, additionalProperties=$additionalProperties}"
148+
}

0 commit comments

Comments
 (0)