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/.stats.yml b/.stats.yml index 0ece17005..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-387c9e5ff5305d470ddf290a424b9d0f087fa295b56cf82265f2dfe8355a589a.yml -openapi_spec_hash: 2c624b8535be90329028f6b10281a313 +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/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 { 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..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 @@ -1419,7 +1419,8 @@ private constructor( class CardAuthorization private constructor( private val decision: JsonField, - private val declineReason: JsonField, + private val approval: JsonField, + private val decline: JsonField, private val additionalProperties: MutableMap, ) { @@ -1428,10 +1429,11 @@ private constructor( @JsonProperty("decision") @ExcludeMissing decision: JsonField = JsonMissing.of(), - @JsonProperty("decline_reason") + @JsonProperty("approval") @ExcludeMissing - declineReason: JsonField = JsonMissing.of(), - ) : this(decision, declineReason, mutableMapOf()) + approval: JsonField = JsonMissing.of(), + @JsonProperty("decline") @ExcludeMissing decline: JsonField = JsonMissing.of(), + ) : this(decision, approval, decline, mutableMapOf()) /** * Whether the card authorization should be approved or declined. @@ -1442,13 +1444,23 @@ private constructor( fun decision(): Decision = decision.getRequired("decision") /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * 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 declineReason(): Optional = declineReason.getOptional("decline_reason") + fun decline(): Optional = decline.getOptional("decline") /** * Returns the raw JSON value of [decision]. @@ -1458,14 +1470,18 @@ private constructor( @JsonProperty("decision") @ExcludeMissing fun _decision(): JsonField = decision /** - * Returns the raw JSON value of [declineReason]. + * 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 [declineReason], this method doesn't throw if the JSON field has an unexpected - * type. + * Unlike [decline], this method doesn't throw if the JSON field has an unexpected type. */ - @JsonProperty("decline_reason") - @ExcludeMissing - fun _declineReason(): JsonField = declineReason + @JsonProperty("decline") @ExcludeMissing fun _decline(): JsonField = decline @JsonAnySetter private fun putAdditionalProperty(key: String, value: JsonValue) { @@ -1496,13 +1512,15 @@ private constructor( class Builder internal constructor() { private var decision: JsonField? = null - private var declineReason: JsonField = JsonMissing.of() + private var approval: JsonField = JsonMissing.of() + private var decline: JsonField = JsonMissing.of() private var additionalProperties: MutableMap = mutableMapOf() @JvmSynthetic internal fun from(cardAuthorization: CardAuthorization) = apply { decision = cardAuthorization.decision - declineReason = cardAuthorization.declineReason + approval = cardAuthorization.approval + decline = cardAuthorization.decline additionalProperties = cardAuthorization.additionalProperties.toMutableMap() } @@ -1519,22 +1537,36 @@ private constructor( fun decision(decision: JsonField) = apply { this.decision = decision } /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * 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 declineReason(declineReason: DeclineReason) = - declineReason(JsonField.of(declineReason)) + fun approval(approval: Approval) = approval(JsonField.of(approval)) /** - * Sets [Builder.declineReason] to an arbitrary JSON value. + * Sets [Builder.approval] 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. + * 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 declineReason(declineReason: JsonField) = apply { - this.declineReason = declineReason - } + 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 } fun additionalProperties(additionalProperties: Map) = apply { this.additionalProperties.clear() @@ -1570,7 +1602,8 @@ private constructor( fun build(): CardAuthorization = CardAuthorization( checkRequired("decision", decision), - declineReason, + approval, + decline, additionalProperties.toMutableMap(), ) } @@ -1583,7 +1616,8 @@ private constructor( } decision().validate() - declineReason().ifPresent { it.validate() } + approval().ifPresent { it.validate() } + decline().ifPresent { it.validate() } validated = true } @@ -1604,7 +1638,8 @@ private constructor( @JvmSynthetic internal fun validity(): Int = (decision.asKnown().getOrNull()?.validity() ?: 0) + - (declineReason.asKnown().getOrNull()?.validity() ?: 0) + (approval.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) : @@ -1744,204 +1779,888 @@ private constructor( } /** - * The reason the card authorization was declined. This translates to a specific decline - * code that is sent to the card network. + * 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 DeclineReason @JsonCreator private constructor(private val value: JsonField) : - Enum { + 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 this class instance's raw value. + * Returns the raw JSON value of [cardholderAddressVerificationResult]. * - * 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. + * Unlike [cardholderAddressVerificationResult], this method doesn't throw if the JSON + * field has an unexpected type. */ - @com.fasterxml.jackson.annotation.JsonValue fun _value(): JsonField = value + @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 { - /** - * 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") + /** Returns a mutable builder for constructing an instance of [Approval]. */ + @JvmStatic fun builder() = Builder() + } - /** - * 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") + /** A builder for [Approval]. */ + class Builder internal constructor() { - /** - * 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") + 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() + } /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. + * 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. */ - @JvmField val CARD_TEMPORARILY_DISABLED = of("card_temporarily_disabled") + fun cardholderAddressVerificationResult( + cardholderAddressVerificationResult: CardholderAddressVerificationResult + ) = + cardholderAddressVerificationResult( + JsonField.of(cardholderAddressVerificationResult) + ) /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. + * 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. */ - @JvmField val SUSPECTED_FRAUD = of("suspected_fraud") + 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) + } /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. + * Returns an immutable instance of [Approval]. + * + * Further updates to this [Builder] will not mutate the returned instance. */ - @JvmField val OTHER = of("other") + fun build(): Approval = + Approval( + cardholderAddressVerificationResult, + additionalProperties.toMutableMap(), + ) + } + + private var validated: Boolean = false + + fun validate(): Approval = apply { + if (validated) { + return@apply + } - @JvmStatic fun of(value: String) = DeclineReason(JsonField.of(value)) + cardholderAddressVerificationResult().ifPresent { it.validate() } + validated = true } - /** 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, + 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()) + /** - * This type of transaction is not allowed for this card. This transaction should - * not be retried. + * 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). */ - TRANSACTION_NEVER_ALLOWED, + fun line1(): Line1 = line1.getRequired("line1") + /** - * The transaction amount exceeds the cardholder's approval limit. The merchant may - * attempt to process the transaction again. + * 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). */ - EXCEEDS_APPROVAL_LIMIT, + fun postalCode(): PostalCode = postalCode.getRequired("postal_code") + /** - * The card has been temporarily disabled or not yet activated. The merchant may - * attempt to process the transaction again. + * Returns the raw JSON value of [line1]. + * + * Unlike [line1], this method doesn't throw if the JSON field has an unexpected + * type. */ - CARD_TEMPORARILY_DISABLED, + @JsonProperty("line1") @ExcludeMissing fun _line1(): JsonField = line1 + /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. + * Returns the raw JSON value of [postalCode]. + * + * Unlike [postalCode], this method doesn't throw if the JSON field has an + * unexpected type. */ - SUSPECTED_FRAUD, + @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 + } + /** - * The transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. + * Returns a score indicating how many valid values are contained in this object + * recursively. + * + * Used for best match union deserialization. */ - OTHER, + @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()) + /** - * An enum containing [DeclineReason]'s known values, as well as an [_UNKNOWN] member. + * The reason the card authorization was declined. This translates to a specific decline + * code that is sent to the card network. * - * 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. + * @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). */ - 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, + 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 { + /** - * The transaction is suspected to be fraudulent. The merchant may attempt to - * process the transaction again. + * Returns a mutable builder for constructing an instance of [Decline]. + * + * The following fields are required: + * ```java + * .reason() + * ``` */ - SUSPECTED_FRAUD, + @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 transaction was declined for another reason. The merchant may attempt to - * process the transaction again. This should be used sparingly. + * The reason the card authorization was declined. This translates to a specific + * decline code that is sent to the card network. */ - OTHER, + fun reason(reason: Reason) = reason(JsonField.of(reason)) + /** - * An enum member indicating that [DeclineReason] was instantiated with an unknown - * value. + * 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. */ - _UNKNOWN, - } + fun reason(reason: JsonField) = apply { this.reason = reason } - /** - * 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 + fun additionalProperties(additionalProperties: Map) = apply { + this.additionalProperties.clear() + putAllAdditionalProperties(additionalProperties) } - /** - * 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") + fun putAdditionalProperty(key: String, value: JsonValue) = apply { + additionalProperties.put(key, 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") + 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(): DeclineReason = apply { + fun validate(): Decline = apply { if (validated) { return@apply } - known() + reason().validate() validated = true } @@ -1959,19 +2678,256 @@ private constructor( * * Used for best match union deserialization. */ - @JvmSynthetic internal fun validity(): Int = if (value() == Value._UNKNOWN) 0 else 1 + @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 DeclineReason && value == other.value + return other is Decline && + reason == other.reason && + additionalProperties == other.additionalProperties } - override fun hashCode() = value.hashCode() + private val hashCode: Int by lazy { Objects.hash(reason, additionalProperties) } - override fun toString() = value.toString() + override fun hashCode(): Int = hashCode + + override fun toString() = + "Decline{reason=$reason, additionalProperties=$additionalProperties}" } override fun equals(other: Any?): Boolean { @@ -1981,18 +2937,19 @@ private constructor( return other is CardAuthorization && decision == other.decision && - declineReason == other.declineReason && + approval == other.approval && + decline == other.decline && additionalProperties == other.additionalProperties } private val hashCode: Int by lazy { - Objects.hash(decision, declineReason, additionalProperties) + Objects.hash(decision, approval, decline, additionalProperties) } override fun hashCode(): Int = hashCode override fun toString() = - "CardAuthorization{decision=$decision, declineReason=$declineReason, additionalProperties=$additionalProperties}" + "CardAuthorization{decision=$decision, approval=$approval, decline=$decline, additionalProperties=$additionalProperties}" } /** @@ -2021,6 +2978,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 +3053,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 +3280,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..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 @@ -24,9 +24,35 @@ internal class RealTimeDecisionActionParamsTest { .cardAuthorization( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS + .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() ) .build() ) @@ -91,9 +117,35 @@ internal class RealTimeDecisionActionParamsTest { .cardAuthorization( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS + .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() ) .build() ) @@ -146,9 +198,35 @@ internal class RealTimeDecisionActionParamsTest { .contains( RealTimeDecisionActionParams.CardAuthorization.builder() .decision(RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS + .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() ) .build() ) 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..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 @@ -60,9 +60,38 @@ internal class RealTimeDecisionServiceAsyncTest { .decision( RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS + .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() ) .build() ) 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..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 @@ -59,9 +59,38 @@ internal class RealTimeDecisionServiceTest { .decision( RealTimeDecisionActionParams.CardAuthorization.Decision.APPROVE ) - .declineReason( - RealTimeDecisionActionParams.CardAuthorization.DeclineReason - .INSUFFICIENT_FUNDS + .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() ) .build() )