Skip to content

Commit b4b4afb

Browse files
chore(api): new ConvertPhysical endpoint to convert a virtual card to a physical card (#415)
- adds `name` and `excluded_card_tokens` params to AuthRules - adds `CARD_TRANSACTION_COUNT` attributes to AuthRules - adds `pin` to Transaction simulations - small updates to documentation on Cards - adds `card.converted` Event - adds `RETURNED_PAYMENT` and `RETURNED_PAYMENT_REVERSAL` Event types
1 parent 1ca4834 commit b4b4afb

File tree

60 files changed

+2717
-182
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

60 files changed

+2717
-182
lines changed

.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: 154

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

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -554,12 +554,17 @@ constructor(
554554
class ApplyAuthRuleRequestProgramLevel
555555
private constructor(
556556
private val programLevel: Boolean?,
557+
private val excludedCardTokens: List<String>?,
557558
private val additionalProperties: Map<String, JsonValue>,
558559
) {
559560

560561
/** Whether the Auth Rule applies to all authorizations on the card program. */
561562
@JsonProperty("program_level") fun programLevel(): Boolean? = programLevel
562563

564+
/** Card tokens to which the Auth Rule does not apply. */
565+
@JsonProperty("excluded_card_tokens")
566+
fun excludedCardTokens(): List<String>? = excludedCardTokens
567+
563568
@JsonAnyGetter
564569
@ExcludeMissing
565570
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -574,19 +579,27 @@ constructor(
574579
class Builder {
575580

576581
private var programLevel: Boolean? = null
582+
private var excludedCardTokens: List<String>? = null
577583
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
578584

579585
@JvmSynthetic
580586
internal fun from(applyAuthRuleRequestProgramLevel: ApplyAuthRuleRequestProgramLevel) =
581587
apply {
582588
this.programLevel = applyAuthRuleRequestProgramLevel.programLevel
589+
this.excludedCardTokens = applyAuthRuleRequestProgramLevel.excludedCardTokens
583590
additionalProperties(applyAuthRuleRequestProgramLevel.additionalProperties)
584591
}
585592

586593
/** Whether the Auth Rule applies to all authorizations on the card program. */
587594
@JsonProperty("program_level")
588595
fun programLevel(programLevel: Boolean) = apply { this.programLevel = programLevel }
589596

597+
/** Card tokens to which the Auth Rule does not apply. */
598+
@JsonProperty("excluded_card_tokens")
599+
fun excludedCardTokens(excludedCardTokens: List<String>) = apply {
600+
this.excludedCardTokens = excludedCardTokens
601+
}
602+
590603
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
591604
this.additionalProperties.clear()
592605
this.additionalProperties.putAll(additionalProperties)
@@ -604,7 +617,8 @@ constructor(
604617
fun build(): ApplyAuthRuleRequestProgramLevel =
605618
ApplyAuthRuleRequestProgramLevel(
606619
checkNotNull(programLevel) { "`programLevel` is required but was not set" },
607-
additionalProperties.toImmutable()
620+
excludedCardTokens?.toImmutable(),
621+
additionalProperties.toImmutable(),
608622
)
609623
}
610624

@@ -613,17 +627,17 @@ constructor(
613627
return true
614628
}
615629

616-
return /* spotless:off */ other is ApplyAuthRuleRequestProgramLevel && programLevel == other.programLevel && additionalProperties == other.additionalProperties /* spotless:on */
630+
return /* spotless:off */ other is ApplyAuthRuleRequestProgramLevel && programLevel == other.programLevel && excludedCardTokens == other.excludedCardTokens && additionalProperties == other.additionalProperties /* spotless:on */
617631
}
618632

619633
/* spotless:off */
620-
private val hashCode: Int by lazy { Objects.hash(programLevel, additionalProperties) }
634+
private val hashCode: Int by lazy { Objects.hash(programLevel, excludedCardTokens, additionalProperties) }
621635
/* spotless:on */
622636

623637
override fun hashCode(): Int = hashCode
624638

625639
override fun toString() =
626-
"ApplyAuthRuleRequestProgramLevel{programLevel=$programLevel, additionalProperties=$additionalProperties}"
640+
"ApplyAuthRuleRequestProgramLevel{programLevel=$programLevel, excludedCardTokens=$excludedCardTokens, additionalProperties=$additionalProperties}"
627641
}
628642

629643
override fun equals(other: Any?): Boolean {

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

Lines changed: 143 additions & 9 deletions
Large diffs are not rendered by default.

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

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,6 +553,10 @@ constructor(
553553
* lowest risk and 999 representing the highest risk. For Visa transactions, where
554554
* the raw score has a range of 0-99, Lithic will normalize the score by
555555
* multiplying the raw score by 10x.
556+
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
557+
* trailing hour up and until the authorization.
558+
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
559+
* trailing 24 hours up and until the authorization.
556560
*/
557561
fun attribute(): Optional<Attribute> =
558562
Optional.ofNullable(attribute.getNullable("attribute"))
@@ -595,6 +599,10 @@ constructor(
595599
* lowest risk and 999 representing the highest risk. For Visa transactions, where
596600
* the raw score has a range of 0-99, Lithic will normalize the score by
597601
* multiplying the raw score by 10x.
602+
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
603+
* trailing hour up and until the authorization.
604+
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
605+
* trailing 24 hours up and until the authorization.
598606
*/
599607
@JsonProperty("attribute") @ExcludeMissing fun _attribute() = attribute
600608

@@ -670,6 +678,10 @@ constructor(
670678
* the lowest risk and 999 representing the highest risk. For Visa
671679
* transactions, where the raw score has a range of 0-99, Lithic will
672680
* normalize the score by multiplying the raw score by 10x.
681+
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
682+
* trailing hour up and until the authorization.
683+
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
684+
* trailing 24 hours up and until the authorization.
673685
*/
674686
fun attribute(attribute: Attribute) = attribute(JsonField.of(attribute))
675687

@@ -704,6 +716,10 @@ constructor(
704716
* the lowest risk and 999 representing the highest risk. For Visa
705717
* transactions, where the raw score has a range of 0-99, Lithic will
706718
* normalize the score by multiplying the raw score by 10x.
719+
* - `CARD_TRANSACTION_COUNT_1H`: The number of transactions on the card in the
720+
* trailing hour up and until the authorization.
721+
* - `CARD_TRANSACTION_COUNT_24H`: The number of transactions on the card in the
722+
* trailing 24 hours up and until the authorization.
707723
*/
708724
@JsonProperty("attribute")
709725
@ExcludeMissing
@@ -782,6 +798,10 @@ constructor(
782798

783799
@JvmField val RISK_SCORE = of("RISK_SCORE")
784800

801+
@JvmField val CARD_TRANSACTION_COUNT_1_H = of("CARD_TRANSACTION_COUNT_1H")
802+
803+
@JvmField val CARD_TRANSACTION_COUNT_24_H = of("CARD_TRANSACTION_COUNT_24H")
804+
785805
@JvmStatic fun of(value: String) = Attribute(JsonField.of(value))
786806
}
787807

@@ -795,6 +815,8 @@ constructor(
795815
PAN_ENTRY_MODE,
796816
TRANSACTION_AMOUNT,
797817
RISK_SCORE,
818+
CARD_TRANSACTION_COUNT_1_H,
819+
CARD_TRANSACTION_COUNT_24_H,
798820
}
799821

800822
enum class Value {
@@ -807,6 +829,8 @@ constructor(
807829
PAN_ENTRY_MODE,
808830
TRANSACTION_AMOUNT,
809831
RISK_SCORE,
832+
CARD_TRANSACTION_COUNT_1_H,
833+
CARD_TRANSACTION_COUNT_24_H,
810834
_UNKNOWN,
811835
}
812836

@@ -821,6 +845,8 @@ constructor(
821845
PAN_ENTRY_MODE -> Value.PAN_ENTRY_MODE
822846
TRANSACTION_AMOUNT -> Value.TRANSACTION_AMOUNT
823847
RISK_SCORE -> Value.RISK_SCORE
848+
CARD_TRANSACTION_COUNT_1_H -> Value.CARD_TRANSACTION_COUNT_1_H
849+
CARD_TRANSACTION_COUNT_24_H -> Value.CARD_TRANSACTION_COUNT_24_H
824850
else -> Value._UNKNOWN
825851
}
826852

@@ -835,6 +861,8 @@ constructor(
835861
PAN_ENTRY_MODE -> Known.PAN_ENTRY_MODE
836862
TRANSACTION_AMOUNT -> Known.TRANSACTION_AMOUNT
837863
RISK_SCORE -> Known.RISK_SCORE
864+
CARD_TRANSACTION_COUNT_1_H -> Known.CARD_TRANSACTION_COUNT_1_H
865+
CARD_TRANSACTION_COUNT_24_H -> Known.CARD_TRANSACTION_COUNT_24_H
838866
else -> throw LithicInvalidDataException("Unknown Attribute: $value")
839867
}
840868

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

Lines changed: 34 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import java.util.Optional
2222
class AuthRuleV2UpdateParams
2323
constructor(
2424
private val authRuleToken: String,
25+
private val name: String?,
2526
private val state: State?,
2627
private val additionalHeaders: Headers,
2728
private val additionalQueryParams: QueryParams,
@@ -30,6 +31,8 @@ constructor(
3031

3132
fun authRuleToken(): String = authRuleToken
3233

34+
fun name(): Optional<String> = Optional.ofNullable(name)
35+
3336
fun state(): Optional<State> = Optional.ofNullable(state)
3437

3538
fun _additionalHeaders(): Headers = additionalHeaders
@@ -40,7 +43,11 @@ constructor(
4043

4144
@JvmSynthetic
4245
internal fun getBody(): AuthRuleV2UpdateBody {
43-
return AuthRuleV2UpdateBody(state, additionalBodyProperties)
46+
return AuthRuleV2UpdateBody(
47+
name,
48+
state,
49+
additionalBodyProperties,
50+
)
4451
}
4552

4653
@JvmSynthetic internal fun getHeaders(): Headers = additionalHeaders
@@ -58,10 +65,14 @@ constructor(
5865
@NoAutoDetect
5966
class AuthRuleV2UpdateBody
6067
internal constructor(
68+
private val name: String?,
6169
private val state: State?,
6270
private val additionalProperties: Map<String, JsonValue>,
6371
) {
6472

73+
/** Auth Rule Name */
74+
@JsonProperty("name") fun name(): String? = name
75+
6576
/**
6677
* The desired state of the Auth Rule.
6778
*
@@ -84,15 +95,20 @@ constructor(
8495

8596
class Builder {
8697

98+
private var name: String? = null
8799
private var state: State? = null
88100
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
89101

90102
@JvmSynthetic
91103
internal fun from(authRuleV2UpdateBody: AuthRuleV2UpdateBody) = apply {
104+
this.name = authRuleV2UpdateBody.name
92105
this.state = authRuleV2UpdateBody.state
93106
additionalProperties(authRuleV2UpdateBody.additionalProperties)
94107
}
95108

109+
/** Auth Rule Name */
110+
@JsonProperty("name") fun name(name: String) = apply { this.name = name }
111+
96112
/**
97113
* The desired state of the Auth Rule.
98114
*
@@ -117,25 +133,29 @@ constructor(
117133
}
118134

119135
fun build(): AuthRuleV2UpdateBody =
120-
AuthRuleV2UpdateBody(state, additionalProperties.toImmutable())
136+
AuthRuleV2UpdateBody(
137+
name,
138+
state,
139+
additionalProperties.toImmutable(),
140+
)
121141
}
122142

123143
override fun equals(other: Any?): Boolean {
124144
if (this === other) {
125145
return true
126146
}
127147

128-
return /* spotless:off */ other is AuthRuleV2UpdateBody && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */
148+
return /* spotless:off */ other is AuthRuleV2UpdateBody && name == other.name && state == other.state && additionalProperties == other.additionalProperties /* spotless:on */
129149
}
130150

131151
/* spotless:off */
132-
private val hashCode: Int by lazy { Objects.hash(state, additionalProperties) }
152+
private val hashCode: Int by lazy { Objects.hash(name, state, additionalProperties) }
133153
/* spotless:on */
134154

135155
override fun hashCode(): Int = hashCode
136156

137157
override fun toString() =
138-
"AuthRuleV2UpdateBody{state=$state, additionalProperties=$additionalProperties}"
158+
"AuthRuleV2UpdateBody{name=$name, state=$state, additionalProperties=$additionalProperties}"
139159
}
140160

141161
fun toBuilder() = Builder().from(this)
@@ -149,6 +169,7 @@ constructor(
149169
class Builder {
150170

151171
private var authRuleToken: String? = null
172+
private var name: String? = null
152173
private var state: State? = null
153174
private var additionalHeaders: Headers.Builder = Headers.builder()
154175
private var additionalQueryParams: QueryParams.Builder = QueryParams.builder()
@@ -157,6 +178,7 @@ constructor(
157178
@JvmSynthetic
158179
internal fun from(authRuleV2UpdateParams: AuthRuleV2UpdateParams) = apply {
159180
authRuleToken = authRuleV2UpdateParams.authRuleToken
181+
name = authRuleV2UpdateParams.name
160182
state = authRuleV2UpdateParams.state
161183
additionalHeaders = authRuleV2UpdateParams.additionalHeaders.toBuilder()
162184
additionalQueryParams = authRuleV2UpdateParams.additionalQueryParams.toBuilder()
@@ -166,6 +188,9 @@ constructor(
166188

167189
fun authRuleToken(authRuleToken: String) = apply { this.authRuleToken = authRuleToken }
168190

191+
/** Auth Rule Name */
192+
fun name(name: String) = apply { this.name = name }
193+
169194
/**
170195
* The desired state of the Auth Rule.
171196
*
@@ -298,6 +323,7 @@ constructor(
298323
fun build(): AuthRuleV2UpdateParams =
299324
AuthRuleV2UpdateParams(
300325
checkNotNull(authRuleToken) { "`authRuleToken` is required but was not set" },
326+
name,
301327
state,
302328
additionalHeaders.build(),
303329
additionalQueryParams.build(),
@@ -361,11 +387,11 @@ constructor(
361387
return true
362388
}
363389

364-
return /* spotless:off */ other is AuthRuleV2UpdateParams && authRuleToken == other.authRuleToken && state == other.state && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
390+
return /* spotless:off */ other is AuthRuleV2UpdateParams && authRuleToken == other.authRuleToken && name == other.name && state == other.state && additionalHeaders == other.additionalHeaders && additionalQueryParams == other.additionalQueryParams && additionalBodyProperties == other.additionalBodyProperties /* spotless:on */
365391
}
366392

367-
override fun hashCode(): Int = /* spotless:off */ Objects.hash(authRuleToken, state, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
393+
override fun hashCode(): Int = /* spotless:off */ Objects.hash(authRuleToken, name, state, additionalHeaders, additionalQueryParams, additionalBodyProperties) /* spotless:on */
368394

369395
override fun toString() =
370-
"AuthRuleV2UpdateParams{authRuleToken=$authRuleToken, state=$state, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
396+
"AuthRuleV2UpdateParams{authRuleToken=$authRuleToken, name=$name, state=$state, additionalHeaders=$additionalHeaders, additionalQueryParams=$additionalQueryParams, additionalBodyProperties=$additionalBodyProperties}"
371397
}

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

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ private constructor(
169169
* - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state
170170
* `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state
171171
* `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be used
172-
* for e-commerce transactions. API clients should update the card's state to `OPEN` only
173-
* after the cardholder confirms receipt of the card.
172+
* for e-commerce transactions or can be added to mobile wallets. API clients should update
173+
* the card's state to `OPEN` only after the cardholder confirms receipt of the card.
174174
*
175175
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually manufactured.
176176
*/
@@ -313,8 +313,8 @@ private constructor(
313313
* - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state
314314
* `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state
315315
* `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be used
316-
* for e-commerce transactions. API clients should update the card's state to `OPEN` only
317-
* after the cardholder confirms receipt of the card.
316+
* for e-commerce transactions or can be added to mobile wallets. API clients should update
317+
* the card's state to `OPEN` only after the cardholder confirms receipt of the card.
318318
*
319319
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually manufactured.
320320
*/
@@ -712,8 +712,9 @@ private constructor(
712712
* - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state
713713
* `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state
714714
* `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be
715-
* used for e-commerce transactions. API clients should update the card's state to `OPEN`
716-
* only after the cardholder confirms receipt of the card.
715+
* used for e-commerce transactions or can be added to mobile wallets. API clients should
716+
* update the card's state to `OPEN` only after the cardholder confirms receipt of the
717+
* card.
717718
*
718719
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually
719720
* manufactured.
@@ -732,8 +733,9 @@ private constructor(
732733
* - `PENDING_ACTIVATION` - At regular intervals, cards of type `PHYSICAL` in state
733734
* `PENDING_FULFILLMENT` are sent to the card production warehouse and updated to state
734735
* `PENDING_ACTIVATION` . Similar to `PENDING_FULFILLMENT`, cards in this state can be
735-
* used for e-commerce transactions. API clients should update the card's state to `OPEN`
736-
* only after the cardholder confirms receipt of the card.
736+
* used for e-commerce transactions or can be added to mobile wallets. API clients should
737+
* update the card's state to `OPEN` only after the cardholder confirms receipt of the
738+
* card.
737739
*
738740
* In sandbox, the same daily batch fulfillment occurs, but no cards are actually
739741
* manufactured.

0 commit comments

Comments
 (0)