Skip to content

Commit d23e0d8

Browse files
committed
fix(api): correct type for other fees details (#118)
1 parent 4d85587 commit d23e0d8

6 files changed

Lines changed: 98 additions & 50 deletions

File tree

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

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,8 @@ private constructor(
701701
private val retries: JsonField<Long>,
702702
private val returnReasonCode: JsonField<String>,
703703
private val secCode: JsonField<SecCode>,
704+
private val companyId: JsonField<String>,
705+
private val receiptRoutingNumber: JsonField<String>,
704706
private val additionalProperties: Map<String, JsonValue>,
705707
) {
706708

@@ -715,6 +717,11 @@ private constructor(
715717

716718
fun secCode(): SecCode = secCode.getRequired("sec_code")
717719

720+
fun companyId(): Optional<String> = Optional.ofNullable(companyId.getNullable("company_id"))
721+
722+
fun receiptRoutingNumber(): Optional<String> =
723+
Optional.ofNullable(receiptRoutingNumber.getNullable("receipt_routing_number"))
724+
718725
@JsonProperty("retries") @ExcludeMissing fun _retries() = retries
719726

720727
@JsonProperty("return_reason_code")
@@ -723,6 +730,12 @@ private constructor(
723730

724731
@JsonProperty("sec_code") @ExcludeMissing fun _secCode() = secCode
725732

733+
@JsonProperty("company_id") @ExcludeMissing fun _companyId() = companyId
734+
735+
@JsonProperty("receipt_routing_number")
736+
@ExcludeMissing
737+
fun _receiptRoutingNumber() = receiptRoutingNumber
738+
726739
@JsonAnyGetter
727740
@ExcludeMissing
728741
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -732,6 +745,8 @@ private constructor(
732745
retries()
733746
returnReasonCode()
734747
secCode()
748+
companyId()
749+
receiptRoutingNumber()
735750
validated = true
736751
}
737752
}
@@ -747,6 +762,8 @@ private constructor(
747762
this.retries == other.retries &&
748763
this.returnReasonCode == other.returnReasonCode &&
749764
this.secCode == other.secCode &&
765+
this.companyId == other.companyId &&
766+
this.receiptRoutingNumber == other.receiptRoutingNumber &&
750767
this.additionalProperties == other.additionalProperties
751768
}
752769

@@ -757,14 +774,16 @@ private constructor(
757774
retries,
758775
returnReasonCode,
759776
secCode,
777+
companyId,
778+
receiptRoutingNumber,
760779
additionalProperties,
761780
)
762781
}
763782
return hashCode
764783
}
765784

766785
override fun toString() =
767-
"PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, additionalProperties=$additionalProperties}"
786+
"PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, additionalProperties=$additionalProperties}"
768787

769788
companion object {
770789

@@ -776,13 +795,17 @@ private constructor(
776795
private var retries: JsonField<Long> = JsonMissing.of()
777796
private var returnReasonCode: JsonField<String> = JsonMissing.of()
778797
private var secCode: JsonField<SecCode> = JsonMissing.of()
798+
private var companyId: JsonField<String> = JsonMissing.of()
799+
private var receiptRoutingNumber: JsonField<String> = JsonMissing.of()
779800
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
780801

781802
@JvmSynthetic
782803
internal fun from(paymentMethodAttributes: PaymentMethodAttributes) = apply {
783804
this.retries = paymentMethodAttributes.retries
784805
this.returnReasonCode = paymentMethodAttributes.returnReasonCode
785806
this.secCode = paymentMethodAttributes.secCode
807+
this.companyId = paymentMethodAttributes.companyId
808+
this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber
786809
additionalProperties(paymentMethodAttributes.additionalProperties)
787810
}
788811

@@ -807,6 +830,21 @@ private constructor(
807830
@ExcludeMissing
808831
fun secCode(secCode: JsonField<SecCode>) = apply { this.secCode = secCode }
809832

833+
fun companyId(companyId: String) = companyId(JsonField.of(companyId))
834+
835+
@JsonProperty("company_id")
836+
@ExcludeMissing
837+
fun companyId(companyId: JsonField<String>) = apply { this.companyId = companyId }
838+
839+
fun receiptRoutingNumber(receiptRoutingNumber: String) =
840+
receiptRoutingNumber(JsonField.of(receiptRoutingNumber))
841+
842+
@JsonProperty("receipt_routing_number")
843+
@ExcludeMissing
844+
fun receiptRoutingNumber(receiptRoutingNumber: JsonField<String>) = apply {
845+
this.receiptRoutingNumber = receiptRoutingNumber
846+
}
847+
810848
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
811849
this.additionalProperties.clear()
812850
this.additionalProperties.putAll(additionalProperties)
@@ -826,6 +864,8 @@ private constructor(
826864
retries,
827865
returnReasonCode,
828866
secCode,
867+
companyId,
868+
receiptRoutingNumber,
829869
additionalProperties.toUnmodifiable(),
830870
)
831871
}

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

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,8 @@ constructor(
500500
private val retries: Long?,
501501
private val returnReasonCode: String?,
502502
private val secCode: SecCode?,
503+
private val companyId: String?,
504+
private val receiptRoutingNumber: String?,
503505
private val additionalProperties: Map<String, JsonValue>,
504506
) {
505507

@@ -511,6 +513,11 @@ constructor(
511513

512514
@JsonProperty("sec_code") fun secCode(): SecCode? = secCode
513515

516+
@JsonProperty("company_id") fun companyId(): String? = companyId
517+
518+
@JsonProperty("receipt_routing_number")
519+
fun receiptRoutingNumber(): String? = receiptRoutingNumber
520+
514521
@JsonAnyGetter
515522
@ExcludeMissing
516523
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
@@ -526,6 +533,8 @@ constructor(
526533
this.retries == other.retries &&
527534
this.returnReasonCode == other.returnReasonCode &&
528535
this.secCode == other.secCode &&
536+
this.companyId == other.companyId &&
537+
this.receiptRoutingNumber == other.receiptRoutingNumber &&
529538
this.additionalProperties == other.additionalProperties
530539
}
531540

@@ -536,14 +545,16 @@ constructor(
536545
retries,
537546
returnReasonCode,
538547
secCode,
548+
companyId,
549+
receiptRoutingNumber,
539550
additionalProperties,
540551
)
541552
}
542553
return hashCode
543554
}
544555

545556
override fun toString() =
546-
"PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, additionalProperties=$additionalProperties}"
557+
"PaymentMethodAttributes{retries=$retries, returnReasonCode=$returnReasonCode, secCode=$secCode, companyId=$companyId, receiptRoutingNumber=$receiptRoutingNumber, additionalProperties=$additionalProperties}"
547558

548559
companion object {
549560

@@ -555,13 +566,17 @@ constructor(
555566
private var retries: Long? = null
556567
private var returnReasonCode: String? = null
557568
private var secCode: SecCode? = null
569+
private var companyId: String? = null
570+
private var receiptRoutingNumber: String? = null
558571
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
559572

560573
@JvmSynthetic
561574
internal fun from(paymentMethodAttributes: PaymentMethodAttributes) = apply {
562575
this.retries = paymentMethodAttributes.retries
563576
this.returnReasonCode = paymentMethodAttributes.returnReasonCode
564577
this.secCode = paymentMethodAttributes.secCode
578+
this.companyId = paymentMethodAttributes.companyId
579+
this.receiptRoutingNumber = paymentMethodAttributes.receiptRoutingNumber
565580
additionalProperties(paymentMethodAttributes.additionalProperties)
566581
}
567582

@@ -575,6 +590,14 @@ constructor(
575590
@JsonProperty("sec_code")
576591
fun secCode(secCode: SecCode) = apply { this.secCode = secCode }
577592

593+
@JsonProperty("company_id")
594+
fun companyId(companyId: String) = apply { this.companyId = companyId }
595+
596+
@JsonProperty("receipt_routing_number")
597+
fun receiptRoutingNumber(receiptRoutingNumber: String) = apply {
598+
this.receiptRoutingNumber = receiptRoutingNumber
599+
}
600+
578601
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
579602
this.additionalProperties.clear()
580603
this.additionalProperties.putAll(additionalProperties)
@@ -594,6 +617,8 @@ constructor(
594617
retries,
595618
returnReasonCode,
596619
checkNotNull(secCode) { "`secCode` is required but was not set" },
620+
companyId,
621+
receiptRoutingNumber,
597622
additionalProperties.toUnmodifiable(),
598623
)
599624
}

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

Lines changed: 19 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import com.lithic.api.core.toUnmodifiable
1616
import com.lithic.api.errors.LithicInvalidDataException
1717
import java.time.OffsetDateTime
1818
import java.util.Objects
19+
import java.util.Optional
1920

2021
@JsonDeserialize(builder = SettlementDetail.Builder::class)
2122
@NoAutoDetect
@@ -24,7 +25,7 @@ private constructor(
2425
private val token: JsonField<String>,
2526
private val institution: JsonField<String>,
2627
private val accountToken: JsonField<String>,
27-
private val eventTokens: JsonField<List<JsonValue>>,
28+
private val eventTokens: JsonField<List<String>>,
2829
private val transactionToken: JsonField<String>,
2930
private val cardToken: JsonField<String>,
3031
private val cardProgramToken: JsonField<String>,
@@ -56,7 +57,7 @@ private constructor(
5657
fun accountToken(): String = accountToken.getRequired("account_token")
5758

5859
/** Globally unique identifiers denoting the Events associated with this settlement. */
59-
fun eventTokens(): List<JsonValue> = eventTokens.getRequired("event_tokens")
60+
fun eventTokens(): List<String> = eventTokens.getRequired("event_tokens")
6061

6162
/** Globally unique identifier denoting the associated Transaction object. */
6263
fun transactionToken(): String = transactionToken.getRequired("transaction_token")
@@ -274,7 +275,7 @@ private constructor(
274275
private var token: JsonField<String> = JsonMissing.of()
275276
private var institution: JsonField<String> = JsonMissing.of()
276277
private var accountToken: JsonField<String> = JsonMissing.of()
277-
private var eventTokens: JsonField<List<JsonValue>> = JsonMissing.of()
278+
private var eventTokens: JsonField<List<String>> = JsonMissing.of()
278279
private var transactionToken: JsonField<String> = JsonMissing.of()
279280
private var cardToken: JsonField<String> = JsonMissing.of()
280281
private var cardProgramToken: JsonField<String> = JsonMissing.of()
@@ -349,12 +350,12 @@ private constructor(
349350
}
350351

351352
/** Globally unique identifiers denoting the Events associated with this settlement. */
352-
fun eventTokens(eventTokens: List<JsonValue>) = eventTokens(JsonField.of(eventTokens))
353+
fun eventTokens(eventTokens: List<String>) = eventTokens(JsonField.of(eventTokens))
353354

354355
/** Globally unique identifiers denoting the Events associated with this settlement. */
355356
@JsonProperty("event_tokens")
356357
@ExcludeMissing
357-
fun eventTokens(eventTokens: JsonField<List<JsonValue>>) = apply {
358+
fun eventTokens(eventTokens: JsonField<List<String>>) = apply {
358359
this.eventTokens = eventTokens
359360
}
360361

@@ -627,25 +628,25 @@ private constructor(
627628
@NoAutoDetect
628629
class OtherFeesDetails
629630
private constructor(
630-
private val title: JsonValue,
631-
private val type: JsonValue,
631+
private val isa: JsonField<Long>,
632632
private val additionalProperties: Map<String, JsonValue>,
633633
) {
634634

635635
private var validated: Boolean = false
636636

637637
private var hashCode: Int = 0
638638

639-
@JsonProperty("title") @ExcludeMissing fun _title() = title
639+
fun isa(): Optional<Long> = Optional.ofNullable(isa.getNullable("ISA"))
640640

641-
@JsonProperty("type") @ExcludeMissing fun _type() = type
641+
@JsonProperty("ISA") @ExcludeMissing fun _isa() = isa
642642

643643
@JsonAnyGetter
644644
@ExcludeMissing
645645
fun _additionalProperties(): Map<String, JsonValue> = additionalProperties
646646

647647
fun validate(): OtherFeesDetails = apply {
648648
if (!validated) {
649+
isa()
649650
validated = true
650651
}
651652
}
@@ -658,25 +659,19 @@ private constructor(
658659
}
659660

660661
return other is OtherFeesDetails &&
661-
this.title == other.title &&
662-
this.type == other.type &&
662+
this.isa == other.isa &&
663663
this.additionalProperties == other.additionalProperties
664664
}
665665

666666
override fun hashCode(): Int {
667667
if (hashCode == 0) {
668-
hashCode =
669-
Objects.hash(
670-
title,
671-
type,
672-
additionalProperties,
673-
)
668+
hashCode = Objects.hash(isa, additionalProperties)
674669
}
675670
return hashCode
676671
}
677672

678673
override fun toString() =
679-
"OtherFeesDetails{title=$title, type=$type, additionalProperties=$additionalProperties}"
674+
"OtherFeesDetails{isa=$isa, additionalProperties=$additionalProperties}"
680675

681676
companion object {
682677

@@ -685,24 +680,20 @@ private constructor(
685680

686681
class Builder {
687682

688-
private var title: JsonValue = JsonMissing.of()
689-
private var type: JsonValue = JsonMissing.of()
683+
private var isa: JsonField<Long> = JsonMissing.of()
690684
private var additionalProperties: MutableMap<String, JsonValue> = mutableMapOf()
691685

692686
@JvmSynthetic
693687
internal fun from(otherFeesDetails: OtherFeesDetails) = apply {
694-
this.title = otherFeesDetails.title
695-
this.type = otherFeesDetails.type
688+
this.isa = otherFeesDetails.isa
696689
additionalProperties(otherFeesDetails.additionalProperties)
697690
}
698691

699-
@JsonProperty("title")
700-
@ExcludeMissing
701-
fun title(title: JsonValue) = apply { this.title = title }
692+
fun isa(isa: Long) = isa(JsonField.of(isa))
702693

703-
@JsonProperty("type")
694+
@JsonProperty("ISA")
704695
@ExcludeMissing
705-
fun type(type: JsonValue) = apply { this.type = type }
696+
fun isa(isa: JsonField<Long>) = apply { this.isa = isa }
706697

707698
fun additionalProperties(additionalProperties: Map<String, JsonValue>) = apply {
708699
this.additionalProperties.clear()
@@ -719,11 +710,7 @@ private constructor(
719710
}
720711

721712
fun build(): OtherFeesDetails =
722-
OtherFeesDetails(
723-
title,
724-
type,
725-
additionalProperties.toUnmodifiable(),
726-
)
713+
OtherFeesDetails(isa, additionalProperties.toUnmodifiable())
727714
}
728715
}
729716
}

lithic-java-core/src/test/kotlin/com/lithic/api/models/PaymentCreateParamsTest.kt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ class PaymentCreateParamsTest {
1818
.methodAttributes(
1919
PaymentCreateParams.PaymentMethodAttributes.builder()
2020
.secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD)
21+
.companyId("string")
22+
.receiptRoutingNumber("string")
2123
.retries(123L)
2224
.returnReasonCode("string")
2325
.build()
@@ -40,6 +42,8 @@ class PaymentCreateParamsTest {
4042
.methodAttributes(
4143
PaymentCreateParams.PaymentMethodAttributes.builder()
4244
.secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD)
45+
.companyId("string")
46+
.receiptRoutingNumber("string")
4347
.retries(123L)
4448
.returnReasonCode("string")
4549
.build()
@@ -60,6 +64,8 @@ class PaymentCreateParamsTest {
6064
.isEqualTo(
6165
PaymentCreateParams.PaymentMethodAttributes.builder()
6266
.secCode(PaymentCreateParams.PaymentMethodAttributes.SecCode.PPD)
67+
.companyId("string")
68+
.receiptRoutingNumber("string")
6369
.retries(123L)
6470
.returnReasonCode("string")
6571
.build()

0 commit comments

Comments
 (0)