From 9d7144272bf59c85babb2acb8bba7b8ce245fefd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:22:51 +0000 Subject: [PATCH 1/3] feat(api): api update --- .stats.yml | 4 +- .../api/models/cardpayments/CardPayment.kt | 213 ++- .../DeclinedTransaction.kt | 71 +- .../pendingtransactions/PendingTransaction.kt | 71 +- .../realtimedecisions/RealTimeDecision.kt | 282 +++- .../RealTimeDecisionActionParams.kt | 1261 ++++++++++++++++- .../RealTimeDecisionActionParamsTest.kt | 90 ++ .../realtimedecisions/RealTimeDecisionTest.kt | 15 + .../async/RealTimeDecisionServiceAsyncTest.kt | 33 + .../blocking/RealTimeDecisionServiceTest.kt | 33 + 10 files changed, 1932 insertions(+), 141 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0ece17005..cb9d34e48 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-387c9e5ff5305d470ddf290a424b9d0f087fa295b56cf82265f2dfe8355a589a.yml -openapi_spec_hash: 2c624b8535be90329028f6b10281a313 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-10d8a2e25ff71893e14a81477ef7dbbf761af689e6ff074e13da10729a75cc9d.yml +openapi_spec_hash: 77a4f7c4b166e73a84c3b7f4e177631c config_hash: e1885b38eded054b77308a024c5d80cc diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt index 522ced589..41e75f825 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/cardpayments/CardPayment.kt @@ -11683,20 +11683,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -11707,23 +11708,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -11738,18 +11756,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an * unknown value. @@ -11767,14 +11794,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -11790,14 +11817,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } @@ -21028,20 +21055,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -21052,23 +21080,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -21083,18 +21128,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an * unknown value. @@ -21112,14 +21166,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -21135,14 +21189,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } @@ -55312,20 +55366,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -55336,23 +55391,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -55367,18 +55439,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an * unknown value. @@ -55396,14 +55477,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -55419,14 +55500,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt index 8b84c962e..3bceefdea 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/declinedtransactions/DeclinedTransaction.kt @@ -10751,20 +10751,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -10775,23 +10776,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -10806,18 +10824,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an * unknown value. @@ -10835,14 +10862,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -10858,14 +10885,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt index d2f44d6cb..1e1e6d511 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/pendingtransactions/PendingTransaction.kt @@ -10357,20 +10357,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -10381,23 +10382,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -10412,18 +10430,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an * unknown value. @@ -10441,14 +10468,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -10464,14 +10491,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt index 5fad02390..276da737f 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecision.kt @@ -1557,6 +1557,7 @@ private constructor( private val additionalAmounts: JsonField, private val cardId: JsonField, private val decision: JsonField, + private val decline: JsonField, private val digitalWalletTokenId: JsonField, private val direction: JsonField, private val merchantAcceptorId: JsonField, @@ -1594,6 +1595,7 @@ private constructor( @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), + @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), @JsonProperty("digital_wallet_token_id") @ExcludeMissing digitalWalletTokenId: JsonField = JsonMissing.of(), @@ -1665,6 +1667,7 @@ private constructor( additionalAmounts, cardId, decision, + decline, digitalWalletTokenId, direction, merchantAcceptorId, @@ -1725,6 +1728,15 @@ private constructor( */ fun decision(): Optional = decision.getOptional("decision") + /** + * Present if and only if `decision` is `decline`. Contains information related to the + * reason the authorization was declined. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun decline(): Optional = decline.getOptional("decline") + /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay purchase), * the identifier of the token that was used. @@ -1952,6 +1964,13 @@ private constructor( */ @JsonProperty("decision") @ExcludeMissing fun _decision(): JsonField = decision + /** + * Returns the raw JSON value of [decline]. + * + * Unlike [decline], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline + /** * Returns the raw JSON value of [digitalWalletTokenId]. * @@ -2193,6 +2212,7 @@ private constructor( * .additionalAmounts() * .cardId() * .decision() + * .decline() * .digitalWalletTokenId() * .direction() * .merchantAcceptorId() @@ -2227,6 +2247,7 @@ private constructor( private var additionalAmounts: JsonField? = null private var cardId: JsonField? = null private var decision: JsonField? = null + private var decline: JsonField? = null private var digitalWalletTokenId: JsonField? = null private var direction: JsonField? = null private var merchantAcceptorId: JsonField? = null @@ -2257,6 +2278,7 @@ private constructor( additionalAmounts = cardAuthorization.additionalAmounts cardId = cardAuthorization.cardId decision = cardAuthorization.decision + decline = cardAuthorization.decline digitalWalletTokenId = cardAuthorization.digitalWalletTokenId direction = cardAuthorization.direction merchantAcceptorId = cardAuthorization.merchantAcceptorId @@ -2340,6 +2362,24 @@ private constructor( */ fun decision(decision: JsonField) = apply { this.decision = decision } + /** + * Present if and only if `decision` is `decline`. Contains information related to the + * reason the authorization was declined. + */ + fun decline(decline: Decline?) = decline(JsonField.ofNullable(decline)) + + /** Alias for calling [Builder.decline] with `decline.orElse(null)`. */ + fun decline(decline: Optional) = decline(decline.getOrNull()) + + /** + * Sets [Builder.decline] to an arbitrary JSON value. + * + * You should usually call [Builder.decline] with a well-typed [Decline] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun decline(decline: JsonField) = apply { this.decline = decline } + /** * If the authorization was made via a Digital Wallet Token (such as an Apple Pay * purchase), the identifier of the token that was used. @@ -2779,6 +2819,7 @@ private constructor( * .additionalAmounts() * .cardId() * .decision() + * .decline() * .digitalWalletTokenId() * .direction() * .merchantAcceptorId() @@ -2811,6 +2852,7 @@ private constructor( checkRequired("additionalAmounts", additionalAmounts), checkRequired("cardId", cardId), checkRequired("decision", decision), + checkRequired("decline", decline), checkRequired("digitalWalletTokenId", digitalWalletTokenId), checkRequired("direction", direction), checkRequired("merchantAcceptorId", merchantAcceptorId), @@ -2848,6 +2890,7 @@ private constructor( additionalAmounts().validate() cardId() decision().ifPresent { it.validate() } + decline().ifPresent { it.validate() } digitalWalletTokenId() direction().validate() merchantAcceptorId() @@ -2893,6 +2936,7 @@ private constructor( (additionalAmounts.asKnown().getOrNull()?.validity() ?: 0) + (if (cardId.asKnown().isPresent) 1 else 0) + (decision.asKnown().getOrNull()?.validity() ?: 0) + + (decline.asKnown().getOrNull()?.validity() ?: 0) + (if (digitalWalletTokenId.asKnown().isPresent) 1 else 0) + (direction.asKnown().getOrNull()?.validity() ?: 0) + (if (merchantAcceptorId.asKnown().isPresent) 1 else 0) + @@ -5571,6 +5615,169 @@ private constructor( override fun toString() = value.toString() } + /** + * Present if and only if `decision` is `decline`. Contains information related to the + * reason the authorization was declined. + */ + class Decline + private constructor( + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() + ) : this(reason, mutableMapOf()) + + /** + * The reason the authorization was declined. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun reason(): String = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Decline]. + * + * The following fields are required: + * ```java + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Decline]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(decline: Decline) = apply { + reason = decline.reason + additionalProperties = decline.additionalProperties.toMutableMap() + } + + /** The reason the authorization was declined. */ + fun reason(reason: String) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [String] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Decline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Decline = + Decline(checkRequired("reason", reason), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Decline = apply { + if (validated) { + return@apply + } + + reason() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = (if (reason.asKnown().isPresent) 1 else 0) + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Decline && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Decline{reason=$reason, additionalProperties=$additionalProperties}" + } + /** * The direction describes the direction the funds will move, either from the cardholder to * the merchant or from the merchant to the cardholder. @@ -9295,20 +9502,21 @@ private constructor( companion object { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ @JvmField val NOT_CHECKED = of("not_checked") - /** Postal code matches, but the street address was not verified. */ - @JvmField - val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = - of("postal_code_match_address_not_checked") - - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ @JvmField val POSTAL_CODE_MATCH_ADDRESS_NO_MATCH = of("postal_code_match_address_no_match") - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ @JvmField val POSTAL_CODE_NO_MATCH_ADDRESS_MATCH = of("postal_code_no_match_address_match") @@ -9319,23 +9527,40 @@ private constructor( /** Postal code and street address do not match. */ @JvmField val NO_MATCH = of("no_match") + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + @JvmField + val POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED = + of("postal_code_match_address_not_checked") + @JvmStatic fun of(value: String) = Result(JsonField.of(value)) } /** An enum containing [Result]'s known values. */ enum class Known { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, } /** @@ -9348,18 +9573,27 @@ private constructor( * - It was constructed with an arbitrary value using the [of] method. */ enum class Value { - /** No address was provided in the authorization request. */ + /** No address information was provided in the authorization request. */ NOT_CHECKED, - /** Postal code matches, but the street address was not verified. */ - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, - /** Postal code matches, but the street address does not match. */ + /** + * Postal code matches, but the street address does not match or was not + * provided. + */ POSTAL_CODE_MATCH_ADDRESS_NO_MATCH, - /** Postal code does not match, but the street address matches. */ + /** + * Postal code does not match, but the street address matches or was not + * provided. + */ POSTAL_CODE_NO_MATCH_ADDRESS_MATCH, /** Postal code and street address match. */ MATCH, /** Postal code and street address do not match. */ NO_MATCH, + /** + * Postal code matches, but the street address was not verified. + * (deprecated) + */ + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED, /** * An enum member indicating that [Result] was instantiated with an unknown * value. @@ -9377,14 +9611,14 @@ private constructor( fun value(): Value = when (this) { NOT_CHECKED -> Value.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Value.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Value.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Value.MATCH NO_MATCH -> Value.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Value.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> Value._UNKNOWN } @@ -9400,14 +9634,14 @@ private constructor( fun known(): Known = when (this) { NOT_CHECKED -> Known.NOT_CHECKED - POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> - Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED POSTAL_CODE_MATCH_ADDRESS_NO_MATCH -> Known.POSTAL_CODE_MATCH_ADDRESS_NO_MATCH POSTAL_CODE_NO_MATCH_ADDRESS_MATCH -> Known.POSTAL_CODE_NO_MATCH_ADDRESS_MATCH MATCH -> Known.MATCH NO_MATCH -> Known.NO_MATCH + POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED -> + Known.POSTAL_CODE_MATCH_ADDRESS_NOT_CHECKED else -> throw IncreaseInvalidDataException("Unknown Result: $value") } @@ -9528,6 +9762,7 @@ private constructor( additionalAmounts == other.additionalAmounts && cardId == other.cardId && decision == other.decision && + decline == other.decline && digitalWalletTokenId == other.digitalWalletTokenId && direction == other.direction && merchantAcceptorId == other.merchantAcceptorId && @@ -9559,6 +9794,7 @@ private constructor( additionalAmounts, cardId, decision, + decline, digitalWalletTokenId, direction, merchantAcceptorId, @@ -9588,7 +9824,7 @@ private constructor( override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthorization{accountId=$accountId, additionalAmounts=$additionalAmounts, cardId=$cardId, decision=$decision, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, requestDetails=$requestDetails, settlementAmount=$settlementAmount, settlementCurrency=$settlementCurrency, terminalId=$terminalId, upcomingCardPaymentId=$upcomingCardPaymentId, verification=$verification, additionalProperties=$additionalProperties}" + "CardAuthorization{accountId=$accountId, additionalAmounts=$additionalAmounts, cardId=$cardId, decision=$decision, decline=$decline, digitalWalletTokenId=$digitalWalletTokenId, direction=$direction, merchantAcceptorId=$merchantAcceptorId, merchantCategoryCode=$merchantCategoryCode, merchantCity=$merchantCity, merchantCountry=$merchantCountry, merchantDescriptor=$merchantDescriptor, merchantPostalCode=$merchantPostalCode, merchantState=$merchantState, networkDetails=$networkDetails, networkIdentifiers=$networkIdentifiers, networkRiskScore=$networkRiskScore, physicalCardId=$physicalCardId, presentmentAmount=$presentmentAmount, presentmentCurrency=$presentmentCurrency, processingCategory=$processingCategory, requestDetails=$requestDetails, settlementAmount=$settlementAmount, settlementCurrency=$settlementCurrency, terminalId=$terminalId, upcomingCardPaymentId=$upcomingCardPaymentId, verification=$verification, additionalProperties=$additionalProperties}" } /** The category of the Real-Time Decision. */ diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt index aebb9eb0e..491a28ef8 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt @@ -1419,6 +1419,8 @@ private constructor( class CardAuthorization private constructor( private val decision: JsonField, + private val approval: JsonField, + private val decline: JsonField, private val declineReason: JsonField, private val additionalProperties: MutableMap, ) { @@ -1428,10 +1430,14 @@ private constructor( @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), + @JsonProperty("approval") + @ExcludeMissing + approval: JsonField = JsonMissing.of(), + @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), @JsonProperty("decline_reason") @ExcludeMissing declineReason: JsonField = JsonMissing.of(), - ) : this(decision, declineReason, mutableMapOf()) + ) : this(decision, approval, decline, declineReason, mutableMapOf()) /** * Whether the card authorization should be approved or declined. @@ -1441,9 +1447,29 @@ private constructor( */ fun decision(): Decision = decision.getRequired("decision") + /** + * If your application approves the authorization, this contains metadata about your + * decision to approve. Your response here is advisory to the acquiring bank. The bank may + * choose to reverse the authorization if you approve the transaction but indicate the + * address does not match. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun approval(): Optional = approval.getOptional("approval") + + /** + * If your application declines the authorization, this contains details about the decline. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if + * the server responded with an unexpected value). + */ + fun decline(): Optional = decline.getOptional("decline") + /** * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * code that is sent to the card network. This field is deprecated, please transition to + * using the `decline` object as this field will be removed in a future release. * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). @@ -1457,6 +1483,20 @@ private constructor( */ @JsonProperty("decision") @ExcludeMissing fun _decision(): JsonField = decision + /** + * Returns the raw JSON value of [approval]. + * + * Unlike [approval], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("approval") @ExcludeMissing fun _approval(): JsonField = approval + + /** + * Returns the raw JSON value of [decline]. + * + * Unlike [decline], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline + /** * Returns the raw JSON value of [declineReason]. * @@ -1496,12 +1536,16 @@ private constructor( class Builder internal constructor() { private var decision: JsonField? = null + private var approval: JsonField = JsonMissing.of() + private var decline: JsonField = JsonMissing.of() private var declineReason: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(cardAuthorization: CardAuthorization) = apply { decision = cardAuthorization.decision + approval = cardAuthorization.approval + decline = cardAuthorization.decline declineReason = cardAuthorization.declineReason additionalProperties = cardAuthorization.additionalProperties.toMutableMap() } @@ -1518,9 +1562,42 @@ private constructor( */ fun decision(decision: JsonField) = apply { this.decision = decision } + /** + * If your application approves the authorization, this contains metadata about your + * decision to approve. Your response here is advisory to the acquiring bank. The bank + * may choose to reverse the authorization if you approve the transaction but indicate + * the address does not match. + */ + fun approval(approval: Approval) = approval(JsonField.of(approval)) + + /** + * Sets [Builder.approval] to an arbitrary JSON value. + * + * You should usually call [Builder.approval] with a well-typed [Approval] value + * instead. This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun approval(approval: JsonField) = apply { this.approval = approval } + + /** + * If your application declines the authorization, this contains details about the + * decline. + */ + fun decline(decline: Decline) = decline(JsonField.of(decline)) + + /** + * Sets [Builder.decline] to an arbitrary JSON value. + * + * You should usually call [Builder.decline] with a well-typed [Decline] value instead. + * This method is primarily for setting the field to an undocumented or not yet + * supported value. + */ + fun decline(decline: JsonField) = apply { this.decline = decline } + /** * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * code that is sent to the card network. This field is deprecated, please transition to + * using the `decline` object as this field will be removed in a future release. */ fun declineReason(declineReason: DeclineReason) = declineReason(JsonField.of(declineReason)) @@ -1570,6 +1647,8 @@ private constructor( fun build(): CardAuthorization = CardAuthorization( checkRequired("decision", decision), + approval, + decline, declineReason, additionalProperties.toMutableMap(), ) @@ -1583,6 +1662,8 @@ private constructor( } decision().validate() + approval().ifPresent { it.validate() } + decline().ifPresent { it.validate() } declineReason().ifPresent { it.validate() } validated = true } @@ -1604,6 +1685,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (decision.asKnown().getOrNull()?.validity() ?: 0) + + (approval.asKnown().getOrNull()?.validity() ?: 0) + + (decline.asKnown().getOrNull()?.validity() ?: 0) + (declineReason.asKnown().getOrNull()?.validity() ?: 0) /** Whether the card authorization should be approved or declined. */ @@ -1743,9 +1826,1162 @@ private constructor( override fun toString() = value.toString() } + /** + * If your application approves the authorization, this contains metadata about your + * decision to approve. Your response here is advisory to the acquiring bank. The bank may + * choose to reverse the authorization if you approve the transaction but indicate the + * address does not match. + */ + class Approval + private constructor( + private val cardholderAddressVerificationResult: + JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("cardholder_address_verification_result") + @ExcludeMissing + cardholderAddressVerificationResult: + JsonField = + JsonMissing.of() + ) : this(cardholderAddressVerificationResult, mutableMapOf()) + + /** + * Your decisions on whether or not each provided address component is a match. Your + * response here is evaluated against the customer's provided `postal_code` and `line1`, + * and an appropriate network response is generated. For example, if you would like to + * approve all transactions for a given card, you can submit `match` for both + * `postal_code` and `line1` and Increase will generate an approval with an Address + * Verification System (AVS) code that will match all of the available address + * information, or will report that no check was performed if no address information is + * available. If you do not provide a response, the address verification result will be + * calculated by Increase using the available address information available on the card. + * If none is available, Increase will report that no check was performed. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. + * if the server responded with an unexpected value). + */ + fun cardholderAddressVerificationResult(): + Optional = + cardholderAddressVerificationResult.getOptional( + "cardholder_address_verification_result" + ) + + /** + * Returns the raw JSON value of [cardholderAddressVerificationResult]. + * + * Unlike [cardholderAddressVerificationResult], this method doesn't throw if the JSON + * field has an unexpected type. + */ + @JsonProperty("cardholder_address_verification_result") + @ExcludeMissing + fun _cardholderAddressVerificationResult(): + JsonField = cardholderAddressVerificationResult + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** Returns a mutable builder for constructing an instance of [Approval]. */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Approval]. */ + class Builder internal constructor() { + + private var cardholderAddressVerificationResult: + JsonField = + JsonMissing.of() + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(approval: Approval) = apply { + cardholderAddressVerificationResult = + approval.cardholderAddressVerificationResult + additionalProperties = approval.additionalProperties.toMutableMap() + } + + /** + * Your decisions on whether or not each provided address component is a match. Your + * response here is evaluated against the customer's provided `postal_code` and + * `line1`, and an appropriate network response is generated. For example, if you + * would like to approve all transactions for a given card, you can submit `match` + * for both `postal_code` and `line1` and Increase will generate an approval with an + * Address Verification System (AVS) code that will match all of the available + * address information, or will report that no check was performed if no address + * information is available. If you do not provide a response, the address + * verification result will be calculated by Increase using the available address + * information available on the card. If none is available, Increase will report + * that no check was performed. + */ + fun cardholderAddressVerificationResult( + cardholderAddressVerificationResult: CardholderAddressVerificationResult + ) = + cardholderAddressVerificationResult( + JsonField.of(cardholderAddressVerificationResult) + ) + + /** + * Sets [Builder.cardholderAddressVerificationResult] to an arbitrary JSON value. + * + * You should usually call [Builder.cardholderAddressVerificationResult] with a + * well-typed [CardholderAddressVerificationResult] value instead. This method is + * primarily for setting the field to an undocumented or not yet supported value. + */ + fun cardholderAddressVerificationResult( + cardholderAddressVerificationResult: + JsonField + ) = apply { + this.cardholderAddressVerificationResult = cardholderAddressVerificationResult + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Approval]. + * + * Further updates to this [Builder] will not mutate the returned instance. + */ + fun build(): Approval = + Approval( + cardholderAddressVerificationResult, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Approval = apply { + if (validated) { + return@apply + } + + cardholderAddressVerificationResult().ifPresent { it.validate() } + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (cardholderAddressVerificationResult.asKnown().getOrNull()?.validity() ?: 0) + + /** + * Your decisions on whether or not each provided address component is a match. Your + * response here is evaluated against the customer's provided `postal_code` and `line1`, + * and an appropriate network response is generated. For example, if you would like to + * approve all transactions for a given card, you can submit `match` for both + * `postal_code` and `line1` and Increase will generate an approval with an Address + * Verification System (AVS) code that will match all of the available address + * information, or will report that no check was performed if no address information is + * available. If you do not provide a response, the address verification result will be + * calculated by Increase using the available address information available on the card. + * If none is available, Increase will report that no check was performed. + */ + class CardholderAddressVerificationResult + private constructor( + private val line1: JsonField, + private val postalCode: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("line1") + @ExcludeMissing + line1: JsonField = JsonMissing.of(), + @JsonProperty("postal_code") + @ExcludeMissing + postalCode: JsonField = JsonMissing.of(), + ) : this(line1, postalCode, mutableMapOf()) + + /** + * Your decision on the address line of the provided address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun line1(): Line1 = line1.getRequired("line1") + + /** + * Your decision on the postal code of the provided address. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or + * is unexpectedly missing or null (e.g. if the server responded with an + * unexpected value). + */ + fun postalCode(): PostalCode = postalCode.getRequired("postal_code") + + /** + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. + */ + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + + /** + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an + * unexpected type. + */ + @JsonProperty("postal_code") + @ExcludeMissing + fun _postalCode(): JsonField = postalCode + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of + * [CardholderAddressVerificationResult]. + * + * The following fields are required: + * ```java + * .line1() + * .postalCode() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [CardholderAddressVerificationResult]. */ + class Builder internal constructor() { + + private var line1: JsonField? = null + private var postalCode: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from( + cardholderAddressVerificationResult: CardholderAddressVerificationResult + ) = apply { + line1 = cardholderAddressVerificationResult.line1 + postalCode = cardholderAddressVerificationResult.postalCode + additionalProperties = + cardholderAddressVerificationResult.additionalProperties.toMutableMap() + } + + /** Your decision on the address line of the provided address. */ + fun line1(line1: Line1) = line1(JsonField.of(line1)) + + /** + * Sets [Builder.line1] to an arbitrary JSON value. + * + * You should usually call [Builder.line1] with a well-typed [Line1] value + * instead. This method is primarily for setting the field to an undocumented or + * not yet supported value. + */ + fun line1(line1: JsonField) = apply { this.line1 = line1 } + + /** Your decision on the postal code of the provided address. */ + fun postalCode(postalCode: PostalCode) = postalCode(JsonField.of(postalCode)) + + /** + * Sets [Builder.postalCode] to an arbitrary JSON value. + * + * You should usually call [Builder.postalCode] with a well-typed [PostalCode] + * value instead. This method is primarily for setting the field to an + * undocumented or not yet supported value. + */ + fun postalCode(postalCode: JsonField) = apply { + this.postalCode = postalCode + } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [CardholderAddressVerificationResult]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .line1() + * .postalCode() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): CardholderAddressVerificationResult = + CardholderAddressVerificationResult( + checkRequired("line1", line1), + checkRequired("postalCode", postalCode), + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): CardholderAddressVerificationResult = apply { + if (validated) { + return@apply + } + + line1().validate() + postalCode().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = + (line1.asKnown().getOrNull()?.validity() ?: 0) + + (postalCode.asKnown().getOrNull()?.validity() ?: 0) + + /** Your decision on the address line of the provided address. */ + class Line1 @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + @JvmField val MATCH = of("match") + + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + @JvmField val NO_MATCH = of("no_match") + + @JvmStatic fun of(value: String) = Line1(JsonField.of(value)) + } + + /** An enum containing [Line1]'s known values. */ + enum class Known { + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + MATCH, + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + NO_MATCH, + } + + /** + * An enum containing [Line1]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Line1] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + MATCH, + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + NO_MATCH, + /** + * An enum member indicating that [Line1] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + else -> throw IncreaseInvalidDataException("Unknown Line1: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Line1 = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Line1 && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + /** Your decision on the postal code of the provided address. */ + class PostalCode + @JsonCreator + private constructor(private val value: JsonField) : Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue + fun _value(): JsonField = value + + companion object { + + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + @JvmField val MATCH = of("match") + + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + @JvmField val NO_MATCH = of("no_match") + + @JvmStatic fun of(value: String) = PostalCode(JsonField.of(value)) + } + + /** An enum containing [PostalCode]'s known values. */ + enum class Known { + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + MATCH, + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + NO_MATCH, + } + + /** + * An enum containing [PostalCode]'s known values, as well as an [_UNKNOWN] + * member. + * + * An instance of [PostalCode] can contain an unknown value in a couple of + * cases: + * - It was deserialized from data that doesn't match any known member. For + * example, if the SDK is on an older version than the API, then the API may + * respond with new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * The cardholder address verification result matches the address provided + * by the merchant. + */ + MATCH, + /** + * The cardholder address verification result does not match the address + * provided by the merchant. + */ + NO_MATCH, + /** + * An enum member indicating that [PostalCode] was instantiated with an + * unknown value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or + * if you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + MATCH -> Value.MATCH + NO_MATCH -> Value.NO_MATCH + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known + * and don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not + * a known member. + */ + fun known(): Known = + when (this) { + MATCH -> Known.MATCH + NO_MATCH -> Known.NO_MATCH + else -> throw IncreaseInvalidDataException("Unknown PostalCode: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not + * have the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): PostalCode = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is PostalCode && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is CardholderAddressVerificationResult && + line1 == other.line1 && + postalCode == other.postalCode && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(line1, postalCode, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "CardholderAddressVerificationResult{line1=$line1, postalCode=$postalCode, additionalProperties=$additionalProperties}" + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Approval && + cardholderAddressVerificationResult == + other.cardholderAddressVerificationResult && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { + Objects.hash(cardholderAddressVerificationResult, additionalProperties) + } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Approval{cardholderAddressVerificationResult=$cardholderAddressVerificationResult, additionalProperties=$additionalProperties}" + } + + /** + * If your application declines the authorization, this contains details about the decline. + */ + class Decline + private constructor( + private val reason: JsonField, + private val additionalProperties: MutableMap, + ) { + + @JsonCreator + private constructor( + @JsonProperty("reason") @ExcludeMissing reason: JsonField = JsonMissing.of() + ) : this(reason, mutableMapOf()) + + /** + * The reason the card authorization was declined. This translates to a specific decline + * code that is sent to the card network. + * + * @throws IncreaseInvalidDataException if the JSON field has an unexpected type or is + * unexpectedly missing or null (e.g. if the server responded with an unexpected + * value). + */ + fun reason(): Reason = reason.getRequired("reason") + + /** + * Returns the raw JSON value of [reason]. + * + * Unlike [reason], this method doesn't throw if the JSON field has an unexpected type. + */ + @JsonProperty("reason") @ExcludeMissing fun _reason(): JsonField = reason + + @JsonAnySetter + private fun putAdditionalProperty(key: String, value: JsonValue) { + additionalProperties.put(key, value) + } + + @JsonAnyGetter + @ExcludeMissing + fun _additionalProperties(): Map = + Collections.unmodifiableMap(additionalProperties) + + fun toBuilder() = Builder().from(this) + + companion object { + + /** + * Returns a mutable builder for constructing an instance of [Decline]. + * + * The following fields are required: + * ```java + * .reason() + * ``` + */ + @JvmStatic fun builder() = Builder() + } + + /** A builder for [Decline]. */ + class Builder internal constructor() { + + private var reason: JsonField? = null + private var additionalProperties: MutableMap = mutableMapOf() + + @JvmSynthetic + internal fun from(decline: Decline) = apply { + reason = decline.reason + additionalProperties = decline.additionalProperties.toMutableMap() + } + + /** + * The reason the card authorization was declined. This translates to a specific + * decline code that is sent to the card network. + */ + fun reason(reason: Reason) = reason(JsonField.of(reason)) + + /** + * Sets [Builder.reason] to an arbitrary JSON value. + * + * You should usually call [Builder.reason] with a well-typed [Reason] value + * instead. This method is primarily for setting the field to an undocumented or not + * yet supported value. + */ + fun reason(reason: JsonField) = apply { this.reason = reason } + + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) + } + + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, value) + } + + fun putAllAdditionalProperties(additionalProperties: Map) = + apply { + this.additionalProperties.putAll(additionalProperties) + } + + fun removeAdditionalProperty(key: String) = apply { + additionalProperties.remove(key) + } + + fun removeAllAdditionalProperties(keys: Set) = apply { + keys.forEach(::removeAdditionalProperty) + } + + /** + * Returns an immutable instance of [Decline]. + * + * Further updates to this [Builder] will not mutate the returned instance. + * + * The following fields are required: + * ```java + * .reason() + * ``` + * + * @throws IllegalStateException if any required field is unset. + */ + fun build(): Decline = + Decline(checkRequired("reason", reason), additionalProperties.toMutableMap()) + } + + private var validated: Boolean = false + + fun validate(): Decline = apply { + if (validated) { + return@apply + } + + reason().validate() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic + internal fun validity(): Int = (reason.asKnown().getOrNull()?.validity() ?: 0) + + /** + * The reason the card authorization was declined. This translates to a specific decline + * code that is sent to the card network. + */ + class Reason @JsonCreator private constructor(private val value: JsonField) : + Enum { + + /** + * Returns this class instance's raw value. + * + * This is usually only useful if this instance was deserialized from data that + * doesn't match any known member, and you want to know that value. For example, if + * the SDK is on an older version than the API, then the API may respond with new + * members that the SDK is unaware of. + */ + @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + + companion object { + + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") + + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") + + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") + + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") + + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + @JvmField val OTHER = of("other") + + @JvmStatic fun of(value: String) = Reason(JsonField.of(value)) + } + + /** An enum containing [Reason]'s known values. */ + enum class Known { + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + } + + /** + * An enum containing [Reason]'s known values, as well as an [_UNKNOWN] member. + * + * An instance of [Reason] can contain an unknown value in a couple of cases: + * - It was deserialized from data that doesn't match any known member. For example, + * if the SDK is on an older version than the API, then the API may respond with + * new members that the SDK is unaware of. + * - It was constructed with an arbitrary value using the [of] method. + */ + enum class Value { + /** + * The cardholder does not have sufficient funds to cover the transaction. The + * merchant may attempt to process the transaction again. + */ + INSUFFICIENT_FUNDS, + /** + * This type of transaction is not allowed for this card. This transaction + * should not be retried. + */ + TRANSACTION_NEVER_ALLOWED, + /** + * The transaction amount exceeds the cardholder's approval limit. The merchant + * may attempt to process the transaction again. + */ + EXCEEDS_APPROVAL_LIMIT, + /** + * The card has been temporarily disabled or not yet activated. The merchant may + * attempt to process the transaction again. + */ + CARD_TEMPORARILY_DISABLED, + /** + * The transaction is suspected to be fraudulent. The merchant may attempt to + * process the transaction again. + */ + SUSPECTED_FRAUD, + /** + * The transaction was declined for another reason. The merchant may attempt to + * process the transaction again. This should be used sparingly. + */ + OTHER, + /** + * An enum member indicating that [Reason] was instantiated with an unknown + * value. + */ + _UNKNOWN, + } + + /** + * Returns an enum member corresponding to this class instance's value, or + * [Value._UNKNOWN] if the class was instantiated with an unknown value. + * + * Use the [known] method instead if you're certain the value is always known or if + * you want to throw for the unknown case. + */ + fun value(): Value = + when (this) { + INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD + OTHER -> Value.OTHER + else -> Value._UNKNOWN + } + + /** + * Returns an enum member corresponding to this class instance's value. + * + * Use the [value] method instead if you're uncertain the value is always known and + * don't want to throw for the unknown case. + * + * @throws IncreaseInvalidDataException if this class instance's value is a not a + * known member. + */ + fun known(): Known = + when (this) { + INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS + TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED + EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT + CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED + SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD + OTHER -> Known.OTHER + else -> throw IncreaseInvalidDataException("Unknown Reason: $value") + } + + /** + * Returns this class instance's primitive wire representation. + * + * This differs from the [toString] method because that method is primarily for + * debugging and generally doesn't throw. + * + * @throws IncreaseInvalidDataException if this class instance's value does not have + * the expected primitive type. + */ + fun asString(): String = + _value().asString().orElseThrow { + IncreaseInvalidDataException("Value is not a String") + } + + private var validated: Boolean = false + + fun validate(): Reason = apply { + if (validated) { + return@apply + } + + known() + validated = true + } + + fun isValid(): Boolean = + try { + validate() + true + } catch (e: IncreaseInvalidDataException) { + false + } + + /** + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. + */ + @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Reason && value == other.value + } + + override fun hashCode() = value.hashCode() + + override fun toString() = value.toString() + } + + override fun equals(other: Any?): Boolean { + if (this === other) { + return true + } + + return other is Decline && + reason == other.reason && + additionalProperties == other.additionalProperties + } + + private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } + + override fun hashCode(): Int = hashCode + + override fun toString() = + "Decline{reason=$reason, additionalProperties=$additionalProperties}" + } + /** * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * code that is sent to the card network. This field is deprecated, please transition to + * using the `decline` object as this field will be removed in a future release. */ class DeclineReason @JsonCreator private constructor(private val value: JsonField) : Enum { @@ -1981,18 +3217,20 @@ private constructor( return other is CardAuthorization && decision == other.decision && + approval == other.approval && + decline == other.decline && declineReason == other.declineReason && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(decision, declineReason, additionalProperties) + Objects.hash(decision, approval, decline, declineReason, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthorization{decision=$decision, declineReason=$declineReason, additionalProperties=$additionalProperties}" + "CardAuthorization{decision=$decision, approval=$approval, decline=$decline, declineReason=$declineReason, additionalProperties=$additionalProperties}" } /** @@ -2021,6 +3259,9 @@ private constructor( fun result(): Result = result.getRequired("result") /** + * If your application was able to deliver the one-time passcode, this contains metadata + * about the delivery. Exactly one of `phone` or `email` must be provided. + * * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if * the server responded with an unexpected value). */ @@ -2093,6 +3334,10 @@ private constructor( */ fun result(result: JsonField) = apply { this.result = result } + /** + * If your application was able to deliver the one-time passcode, this contains metadata + * about the delivery. Exactly one of `phone` or `email` must be provided. + */ fun success(success: Success) = success(JsonField.of(success)) /** @@ -2316,6 +3561,10 @@ private constructor( override fun toString() = value.toString() } + /** + * If your application was able to deliver the one-time passcode, this contains metadata + * about the delivery. Exactly one of `phone` or `email` must be provided. + */ class Success private constructor( private val email: JsonField, diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt index 0efe3c55b..7f57ae4cd 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt @@ -24,6 +24,36 @@ internal class RealTimeDecisionActionParamsTest { .cardAuthorization( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) + .approval( + RealTimeDecisionActionParams.CardAuthorization.Approval.builder() + .cardholderAddressVerificationResult( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .builder() + .line1( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .Line1 + .MATCH + ) + .postalCode( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .PostalCode + .NO_MATCH + ) + .build() + ) + .build() + ) + .decline( + RealTimeDecisionActionParams.CardAuthorization.Decline.builder() + .reason( + RealTimeDecisionActionParams.CardAuthorization.Decline.Reason + .INSUFFICIENT_FUNDS + ) + .build() + ) .declineReason( RealTimeDecisionActionParams.CardAuthorization.DeclineReason .INSUFFICIENT_FUNDS @@ -91,6 +121,36 @@ internal class RealTimeDecisionActionParamsTest { .cardAuthorization( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) + .approval( + RealTimeDecisionActionParams.CardAuthorization.Approval.builder() + .cardholderAddressVerificationResult( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .builder() + .line1( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .Line1 + .MATCH + ) + .postalCode( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .PostalCode + .NO_MATCH + ) + .build() + ) + .build() + ) + .decline( + RealTimeDecisionActionParams.CardAuthorization.Decline.builder() + .reason( + RealTimeDecisionActionParams.CardAuthorization.Decline.Reason + .INSUFFICIENT_FUNDS + ) + .build() + ) .declineReason( RealTimeDecisionActionParams.CardAuthorization.DeclineReason .INSUFFICIENT_FUNDS @@ -146,6 +206,36 @@ internal class RealTimeDecisionActionParamsTest { .contains( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) + .approval( + RealTimeDecisionActionParams.CardAuthorization.Approval.builder() + .cardholderAddressVerificationResult( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .builder() + .line1( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .Line1 + .MATCH + ) + .postalCode( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .PostalCode + .NO_MATCH + ) + .build() + ) + .build() + ) + .decline( + RealTimeDecisionActionParams.CardAuthorization.Decline.builder() + .reason( + RealTimeDecisionActionParams.CardAuthorization.Decline.Reason + .INSUFFICIENT_FUNDS + ) + .build() + ) .declineReason( RealTimeDecisionActionParams.CardAuthorization.DeclineReason .INSUFFICIENT_FUNDS diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt index 890f8639b..6d59aa739 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionTest.kt @@ -108,6 +108,11 @@ internal class RealTimeDecisionTest { ) .cardId("card_oubs0hwk5rn6knuecxg2") .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE) + .decline( + RealTimeDecision.CardAuthorization.Decline.builder() + .reason("reason") + .build() + ) .digitalWalletTokenId(null) .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") @@ -336,6 +341,11 @@ internal class RealTimeDecisionTest { ) .cardId("card_oubs0hwk5rn6knuecxg2") .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE) + .decline( + RealTimeDecision.CardAuthorization.Decline.builder() + .reason("reason") + .build() + ) .digitalWalletTokenId(null) .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") @@ -570,6 +580,11 @@ internal class RealTimeDecisionTest { ) .cardId("card_oubs0hwk5rn6knuecxg2") .decision(RealTimeDecision.CardAuthorization.Decision.APPROVE) + .decline( + RealTimeDecision.CardAuthorization.Decline.builder() + .reason("reason") + .build() + ) .digitalWalletTokenId(null) .direction(RealTimeDecision.CardAuthorization.Direction.SETTLEMENT) .merchantAcceptorId("5665270011000168") diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt index 602e5c586..946f26927 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt @@ -60,6 +60,39 @@ internal class RealTimeDecisionServiceAsyncTest { .decision( RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE ) + .approval( + RealTimeDecisionActionParams.CardAuthorization.Approval.builder() + .cardholderAddressVerificationResult( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .builder() + .line1( + RealTimeDecisionActionParams.CardAuthorization + .Approval + .CardholderAddressVerificationResult + .Line1 + .MATCH + ) + .postalCode( + RealTimeDecisionActionParams.CardAuthorization + .Approval + .CardholderAddressVerificationResult + .PostalCode + .NO_MATCH + ) + .build() + ) + .build() + ) + .decline( + RealTimeDecisionActionParams.CardAuthorization.Decline.builder() + .reason( + RealTimeDecisionActionParams.CardAuthorization.Decline + .Reason + .INSUFFICIENT_FUNDS + ) + .build() + ) .declineReason( RealTimeDecisionActionParams.CardAuthorization.DeclineReason .INSUFFICIENT_FUNDS diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt index 378ddfda0..0224cb96c 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt @@ -59,6 +59,39 @@ internal class RealTimeDecisionServiceTest { .decision( RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE ) + .approval( + RealTimeDecisionActionParams.CardAuthorization.Approval.builder() + .cardholderAddressVerificationResult( + RealTimeDecisionActionParams.CardAuthorization.Approval + .CardholderAddressVerificationResult + .builder() + .line1( + RealTimeDecisionActionParams.CardAuthorization + .Approval + .CardholderAddressVerificationResult + .Line1 + .MATCH + ) + .postalCode( + RealTimeDecisionActionParams.CardAuthorization + .Approval + .CardholderAddressVerificationResult + .PostalCode + .NO_MATCH + ) + .build() + ) + .build() + ) + .decline( + RealTimeDecisionActionParams.CardAuthorization.Decline.builder() + .reason( + RealTimeDecisionActionParams.CardAuthorization.Decline + .Reason + .INSUFFICIENT_FUNDS + ) + .build() + ) .declineReason( RealTimeDecisionActionParams.CardAuthorization.DeclineReason .INSUFFICIENT_FUNDS From d54462c0bf87bd43a49535a4a0d6e37c1a5515b7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:59:01 +0000 Subject: [PATCH 2/3] feat(api): api update --- .stats.yml | 4 +- .../RealTimeDecisionActionParams.kt | 289 +----------------- .../RealTimeDecisionActionParamsTest.kt | 12 - .../async/RealTimeDecisionServiceAsyncTest.kt | 4 - .../blocking/RealTimeDecisionServiceTest.kt | 4 - 5 files changed, 6 insertions(+), 307 deletions(-) diff --git a/.stats.yml b/.stats.yml index cb9d34e48..7efaaa57e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 217 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-10d8a2e25ff71893e14a81477ef7dbbf761af689e6ff074e13da10729a75cc9d.yml -openapi_spec_hash: 77a4f7c4b166e73a84c3b7f4e177631c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-94d559b14c3611637885b103aa75adb26dff816369b1fdb758440e288d1ea83b.yml +openapi_spec_hash: 4e257b20b410526bc54fd6ced9db3a5d config_hash: e1885b38eded054b77308a024c5d80cc diff --git a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt index 491a28ef8..a1c79f545 100644 --- a/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt +++ b/increase-java-core/src/main/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParams.kt @@ -1421,7 +1421,6 @@ private constructor( private val decision: JsonField, private val approval: JsonField, private val decline: JsonField, - private val declineReason: JsonField, private val additionalProperties: MutableMap, ) { @@ -1434,10 +1433,7 @@ private constructor( @ExcludeMissing approval: JsonField = JsonMissing.of(), @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), - @JsonProperty("decline_reason") - @ExcludeMissing - declineReason: JsonField = JsonMissing.of(), - ) : this(decision, approval, decline, declineReason, mutableMapOf()) + ) : this(decision, approval, decline, mutableMapOf()) /** * Whether the card authorization should be approved or declined. @@ -1466,16 +1462,6 @@ private constructor( */ fun decline(): Optional = decline.getOptional("decline") - /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. This field is deprecated, please transition to - * using the `decline` object as this field will be removed in a future release. - * - * @throws IncreaseInvalidDataException if the JSON field has an unexpected type (e.g. if - * the server responded with an unexpected value). - */ - fun declineReason(): Optional = declineReason.getOptional("decline_reason") - /** * Returns the raw JSON value of [decision]. * @@ -1497,16 +1483,6 @@ private constructor( */ @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline - /** - * Returns the raw JSON value of [declineReason]. - * - * Unlike [declineReason], this method doesn't throw if the JSON field has an unexpected - * type. - */ - @JsonProperty("decline_reason") - @ExcludeMissing - fun _declineReason(): JsonField = declineReason - @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { additionalProperties.put(key, value) @@ -1538,7 +1514,6 @@ private constructor( private var decision: JsonField? = null private var approval: JsonField = JsonMissing.of() private var decline: JsonField = JsonMissing.of() - private var declineReason: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic @@ -1546,7 +1521,6 @@ private constructor( decision = cardAuthorization.decision approval = cardAuthorization.approval decline = cardAuthorization.decline - declineReason = cardAuthorization.declineReason additionalProperties = cardAuthorization.additionalProperties.toMutableMap() } @@ -1594,25 +1568,6 @@ private constructor( */ fun decline(decline: JsonField) = apply { this.decline = decline } - /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. This field is deprecated, please transition to - * using the `decline` object as this field will be removed in a future release. - */ - fun declineReason(declineReason: DeclineReason) = - declineReason(JsonField.of(declineReason)) - - /** - * Sets [Builder.declineReason] to an arbitrary JSON value. - * - * You should usually call [Builder.declineReason] with a well-typed [DeclineReason] - * value instead. This method is primarily for setting the field to an undocumented or - * not yet supported value. - */ - fun declineReason(declineReason: JsonField) = apply { - this.declineReason = declineReason - } - fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() putAllAdditionalProperties(additionalProperties) @@ -1649,7 +1604,6 @@ private constructor( checkRequired("decision", decision), approval, decline, - declineReason, additionalProperties.toMutableMap(), ) } @@ -1664,7 +1618,6 @@ private constructor( decision().validate() approval().ifPresent { it.validate() } decline().ifPresent { it.validate() } - declineReason().ifPresent { it.validate() } validated = true } @@ -1686,8 +1639,7 @@ private constructor( internal fun validity(): Int = (decision.asKnown().getOrNull()?.validity() ?: 0) + (approval.asKnown().getOrNull()?.validity() ?: 0) + - (decline.asKnown().getOrNull()?.validity() ?: 0) + - (declineReason.asKnown().getOrNull()?.validity() ?: 0) + (decline.asKnown().getOrNull()?.validity() ?: 0) /** Whether the card authorization should be approved or declined. */ class Decision @JsonCreator private constructor(private val value: JsonField) : @@ -2978,238 +2930,6 @@ private constructor( "Decline{reason=$reason, additionalProperties=$additionalProperties}" } - /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. This field is deprecated, please transition to - * using the `decline` object as this field will be removed in a future release. - */ - class DeclineReason @JsonCreator private constructor(private val value: JsonField) : - Enum { - - /** - * Returns this class instance's raw value. - * - * This is usually only useful if this instance was deserialized from data that doesn't - * match any known member, and you want to know that value. For example, if the SDK is - * on an older version than the API, then the API may respond with new members that the - * SDK is unaware of. - */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value - - companion object { - - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - @JvmField val INSUFFICIENT_FUNDS = of("insufficient_funds") - - /** - * This type of transaction is not allowed for this card. This transaction should - * not be retried. - */ - @JvmField val TRANSACTION_NEVER_ALLOWED = of("transaction_never_allowed") - - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant may - * attempt to process the transaction again. - */ - @JvmField val EXCEEDS_APPROVAL_LIMIT = of("exceeds_approval_limit") - - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") - - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") - - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - @JvmField val OTHER = of("other") - - @JvmStatic fun of(value: String) = DeclineReason(JsonField.of(value)) - } - - /** An enum containing [DeclineReason]'s known values. */ - enum class Known { - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction should - * not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant may - * attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - } - - /** - * An enum containing [DeclineReason]'s known values, as well as an [_UNKNOWN] member. - * - * An instance of [DeclineReason] can contain an unknown value in a couple of cases: - * - It was deserialized from data that doesn't match any known member. For example, if - * the SDK is on an older version than the API, then the API may respond with new - * members that the SDK is unaware of. - * - It was constructed with an arbitrary value using the [of] method. - */ - enum class Value { - /** - * The cardholder does not have sufficient funds to cover the transaction. The - * merchant may attempt to process the transaction again. - */ - INSUFFICIENT_FUNDS, - /** - * This type of transaction is not allowed for this card. This transaction should - * not be retried. - */ - TRANSACTION_NEVER_ALLOWED, - /** - * The transaction amount exceeds the cardholder's approval limit. The merchant may - * attempt to process the transaction again. - */ - EXCEEDS_APPROVAL_LIMIT, - /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. - */ - CARD_TEMPORARILY_DISABLED, - /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. - */ - SUSPECTED_FRAUD, - /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. - */ - OTHER, - /** - * An enum member indicating that [DeclineReason] was instantiated with an unknown - * value. - */ - _UNKNOWN, - } - - /** - * Returns an enum member corresponding to this class instance's value, or - * [Value._UNKNOWN] if the class was instantiated with an unknown value. - * - * Use the [known] method instead if you're certain the value is always known or if you - * want to throw for the unknown case. - */ - fun value(): Value = - when (this) { - INSUFFICIENT_FUNDS -> Value.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Value.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Value.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Value.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Value.SUSPECTED_FRAUD - OTHER -> Value.OTHER - else -> Value._UNKNOWN - } - - /** - * Returns an enum member corresponding to this class instance's value. - * - * Use the [value] method instead if you're uncertain the value is always known and - * don't want to throw for the unknown case. - * - * @throws IncreaseInvalidDataException if this class instance's value is a not a known - * member. - */ - fun known(): Known = - when (this) { - INSUFFICIENT_FUNDS -> Known.INSUFFICIENT_FUNDS - TRANSACTION_NEVER_ALLOWED -> Known.TRANSACTION_NEVER_ALLOWED - EXCEEDS_APPROVAL_LIMIT -> Known.EXCEEDS_APPROVAL_LIMIT - CARD_TEMPORARILY_DISABLED -> Known.CARD_TEMPORARILY_DISABLED - SUSPECTED_FRAUD -> Known.SUSPECTED_FRAUD - OTHER -> Known.OTHER - else -> throw IncreaseInvalidDataException("Unknown DeclineReason: $value") - } - - /** - * Returns this class instance's primitive wire representation. - * - * This differs from the [toString] method because that method is primarily for - * debugging and generally doesn't throw. - * - * @throws IncreaseInvalidDataException if this class instance's value does not have the - * expected primitive type. - */ - fun asString(): String = - _value().asString().orElseThrow { - IncreaseInvalidDataException("Value is not a String") - } - - private var validated: Boolean = false - - fun validate(): DeclineReason = apply { - if (validated) { - return@apply - } - - known() - validated = true - } - - fun isValid(): Boolean = - try { - validate() - true - } catch (e: IncreaseInvalidDataException) { - false - } - - /** - * Returns a score indicating how many valid values are contained in this object - * recursively. - * - * Used for best match union deserialization. - */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 - - override fun equals(other: Any?): Boolean { - if (this === other) { - return true - } - - return other is DeclineReason && value == other.value - } - - override fun hashCode() = value.hashCode() - - override fun toString() = value.toString() - } - override fun equals(other: Any?): Boolean { if (this === other) { return true @@ -3219,18 +2939,17 @@ private constructor( decision == other.decision && approval == other.approval && decline == other.decline && - declineReason == other.declineReason && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(decision, approval, decline, declineReason, additionalProperties) + Objects.hash(decision, approval, decline, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthorization{decision=$decision, approval=$approval, decline=$decline, declineReason=$declineReason, additionalProperties=$additionalProperties}" + "CardAuthorization{decision=$decision, approval=$approval, decline=$decline, additionalProperties=$additionalProperties}" } /** diff --git a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt index 7f57ae4cd..a2b8183a0 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/models/realtimedecisions/RealTimeDecisionActionParamsTest.kt @@ -54,10 +54,6 @@ internal class RealTimeDecisionActionParamsTest { ) .build() ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS - ) .build() ) .digitalWalletAuthentication( @@ -151,10 +147,6 @@ internal class RealTimeDecisionActionParamsTest { ) .build() ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS - ) .build() ) .digitalWalletAuthentication( @@ -236,10 +228,6 @@ internal class RealTimeDecisionActionParamsTest { ) .build() ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS - ) .build() ) assertThat(body.digitalWalletAuthentication()) diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt index 946f26927..f4d577458 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/async/RealTimeDecisionServiceAsyncTest.kt @@ -93,10 +93,6 @@ internal class RealTimeDecisionServiceAsyncTest { ) .build() ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS - ) .build() ) .digitalWalletAuthentication( diff --git a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt index 0224cb96c..5b841468e 100644 --- a/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt +++ b/increase-java-core/src/test/kotlin/com/increase/api/services/blocking/RealTimeDecisionServiceTest.kt @@ -92,10 +92,6 @@ internal class RealTimeDecisionServiceTest { ) .build() ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS - ) .build() ) .digitalWalletAuthentication( From 32b79fcf81aa6ce4010eb9734a3a3325a99e94da Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 19:59:26 +0000 Subject: [PATCH 3/3] release: 0.322.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ README.md | 10 +++++----- build.gradle.kts | 2 +- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index db5791310..4942d18ad 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.321.0" + ".": "0.322.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index ed12b4755..6b8bc7f43 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.322.0 (2025-09-09) + +Full Changelog: [v0.321.0...v0.322.0](https://github.com/Increase/increase-java/compare/v0.321.0...v0.322.0) + +### Features + +* **api:** api update ([d54462c](https://github.com/Increase/increase-java/commit/d54462c0bf87bd43a49535a4a0d6e37c1a5515b7)) +* **api:** api update ([9d71442](https://github.com/Increase/increase-java/commit/9d7144272bf59c85babb2acb8bba7b8ce245fefd)) + ## 0.321.0 (2025-09-08) Full Changelog: [v0.320.0...v0.321.0](https://github.com/Increase/increase-java/compare/v0.320.0...v0.321.0) diff --git a/README.md b/README.md index 2785439e1..7edaefd38 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,8 @@ -[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.321.0) -[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.321.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.321.0) +[![Maven Central](https://img.shields.io/maven-central/v/com.increase.api/increase-java)](https://central.sonatype.com/artifact/com.increase.api/increase-java/0.322.0) +[![javadoc](https://javadoc.io/badge2/com.increase.api/increase-java/0.322.0/javadoc.svg)](https://javadoc.io/doc/com.increase.api/increase-java/0.322.0) @@ -13,7 +13,7 @@ The Increase Java SDK is similar to the Increase Kotlin SDK but with minor diffe -The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.321.0). +The REST API documentation can be found on [increase.com](https://increase.com/documentation). Javadocs are available on [javadoc.io](https://javadoc.io/doc/com.increase.api/increase-java/0.322.0). @@ -24,7 +24,7 @@ The REST API documentation can be found on [increase.com](https://increase.com/d ### Gradle ```kotlin -implementation("com.increase.api:increase-java:0.321.0") +implementation("com.increase.api:increase-java:0.322.0") ``` ### Maven @@ -33,7 +33,7 @@ implementation("com.increase.api:increase-java:0.321.0") com.increase.api increase-java - 0.321.0 + 0.322.0 ``` diff --git a/build.gradle.kts b/build.gradle.kts index deecf5363..360a6583d 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,7 +8,7 @@ repositories { allprojects { group = "com.increase.api" - version = "0.321.0" // x-release-please-version + version = "0.322.0" // x-release-please-version } subprojects {