diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0a8ad7e..434d81b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ jobs: timeout-minutes: 10 name: lint runs-on: ${{ github.repository == 'stainless-sdks/increase-csharp' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 @@ -38,7 +38,7 @@ jobs: timeout-minutes: 10 name: build runs-on: ${{ github.repository == 'stainless-sdks/increase-csharp' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} - if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + if: (github.event_name == 'push' || github.event.pull_request.head.repo.fork) && (github.event_name != 'push' || github.event.head_commit.message != 'codegen metadata') steps: - uses: actions/checkout@v6 diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969..3d2ac0b 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.1.0" } \ No newline at end of file diff --git a/.stats.yml b/.stats.yml index 2f89707..3e05b57 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 236 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-c125ce952e66ce3ea3b9a4d1c5a2449584ec7290497e3b6bba8358960713fb79.yml -openapi_spec_hash: 1ed3f6bc7b08ca891adea5fab74430c9 -config_hash: 0997ade8b52ec04e82d5b0c3b61bb51e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/increase%2Fincrease-e3103e9bb8480e11581841c322e0bd0255b64413d401873c96cd00a3e6d6c3f7.yml +openapi_spec_hash: 962e1efe27066cf84b405a6695dd8288 +config_hash: 4945e03affdf289484733306e4797f81 diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..3080d32 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +## 0.1.0 (2026-04-02) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/Increase/increase-csharp/compare/v0.0.1...v0.1.0) + +### Features + +* **api:** api update ([b0bdea2](https://github.com/Increase/increase-csharp/commit/b0bdea262d5a46dc0feeaa1bdbec9107d354b778)) +* **api:** api update ([2754272](https://github.com/Increase/increase-csharp/commit/2754272bdce162f764b4b7560fce1ae3d073cdb3)) +* **api:** api update ([4614bbc](https://github.com/Increase/increase-csharp/commit/4614bbc0e12efe8068323e3f37992ab516b033cb)) +* **api:** api update ([43811bb](https://github.com/Increase/increase-csharp/commit/43811bb8fc69b1b93ad12d08a648fdca20486c48)) +* **api:** api update ([03709bc](https://github.com/Increase/increase-csharp/commit/03709bc20250cde62ae7e44ac9b0eafb27254e3f)) +* **api:** api update ([0ce3dab](https://github.com/Increase/increase-csharp/commit/0ce3dabb33e81b15631bfe34fe5689ec36e55b26)) +* **api:** api update ([5a98590](https://github.com/Increase/increase-csharp/commit/5a98590482b32f43fbe78fc6cf42d26e7d4e5507)) +* **api:** api update ([e512543](https://github.com/Increase/increase-csharp/commit/e5125437fadd0e21b7bc78f6d3eca5a9ead5a021)) +* **api:** api update ([0df1b29](https://github.com/Increase/increase-csharp/commit/0df1b29b5b197be1e405efe2a2b8442ee52d196f)) +* **api:** api update ([9d743a8](https://github.com/Increase/increase-csharp/commit/9d743a86448720e56848d8ec51d2c72b4ee21250)) +* **api:** api update ([9adaaf5](https://github.com/Increase/increase-csharp/commit/9adaaf524863a6b2593c85356923986ad1dbf4b2)) +* **api:** api update ([fbb5df5](https://github.com/Increase/increase-csharp/commit/fbb5df55c354758f270b0bcbf98e217ab868f22f)) +* **api:** api update ([240228b](https://github.com/Increase/increase-csharp/commit/240228ba2a119d90f53c6d00363f68d1353bd44b)) +* **client:** enable gzip decompression ([a9ea2e6](https://github.com/Increase/increase-csharp/commit/a9ea2e6f2125eb498f82846bb32e659f7f20d9cd)) + + +### Bug Fixes + +* **client:** allow cancelling when enumerating over an http response ([d554312](https://github.com/Increase/increase-csharp/commit/d554312718fdb5e372bc18ab3d93e47d083a8f56)) +* **tests:** handle ambiguous null values properly with overloaded methods ([04b6967](https://github.com/Increase/increase-csharp/commit/04b6967c8cc1f44ec89484d473c9273470b2d3ef)) + + +### Chores + +* **ci:** skip lint on metadata-only changes ([efa546f](https://github.com/Increase/increase-csharp/commit/efa546ff6ead9bdc0f3dde5d63e2658bfd4a696e)) +* **internal:** update multipart form array serialization ([a717858](https://github.com/Increase/increase-csharp/commit/a7178580659ac154ea217f895ce03c28445609a5)) +* **tests:** bump steady to v0.19.7 ([4a88992](https://github.com/Increase/increase-csharp/commit/4a88992bd2a8929bd26d524afc129f396b30a2a5)) +* **tests:** bump steady to v0.20.1 ([c1544ba](https://github.com/Increase/increase-csharp/commit/c1544ba4d4956abd2afa12609baab8ba761fde07)) +* **tests:** bump steady to v0.20.2 ([e27647a](https://github.com/Increase/increase-csharp/commit/e27647a4f3b341b644a1b6d1a49c144bea8c0c7a)) diff --git a/scripts/mock b/scripts/mock index 1983fb9..1aea7aa 100755 --- a/scripts/mock +++ b/scripts/mock @@ -22,9 +22,9 @@ echo "==> Starting mock server with URL ${URL}" # Run steady mock on the given spec if [ "$1" == "--daemon" ]; then # Pre-install the package so the download doesn't eat into the startup timeout - npm exec --package=@stdy/cli@0.19.6 -- steady --version + npm exec --package=@stdy/cli@0.20.2 -- steady --version - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=dots --validator-query-object-format=dots "$URL" &> .stdy.log & + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=dots --validator-form-object-format=dots "$URL" &> .stdy.log & # Wait for server to come online via health endpoint (max 30s) echo -n "Waiting for server" @@ -48,5 +48,5 @@ if [ "$1" == "--daemon" ]; then echo else - npm exec --package=@stdy/cli@0.19.6 -- steady --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=dots --validator-query-object-format=dots "$URL" + npm exec --package=@stdy/cli@0.20.2 -- steady --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=dots --validator-form-object-format=dots "$URL" fi diff --git a/scripts/test b/scripts/test index 0d79aad..c37435c 100755 --- a/scripts/test +++ b/scripts/test @@ -47,7 +47,7 @@ elif ! steady_is_running ; then echo -e "To run the server, pass in the path or url of your OpenAPI" echo -e "spec to the steady command:" echo - echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.19.6 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-form-array-format=comma --validator-query-array-format=comma --validator-form-object-format=dots --validator-query-object-format=dots${NC}" + echo -e " \$ ${YELLOW}npm exec --package=@stdy/cli@0.20.2 -- steady path/to/your.openapi.yml --host 127.0.0.1 -p 4010 --validator-query-array-format=comma --validator-form-array-format=comma --validator-query-object-format=dots --validator-form-object-format=dots${NC}" echo exit 1 diff --git a/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeListPageResponseTest.cs b/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeListPageResponseTest.cs index efe15e1..aa15230 100644 --- a/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeListPageResponseTest.cs @@ -65,8 +65,8 @@ public void FieldRoundtrip_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -82,7 +82,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -117,7 +117,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -561,8 +561,8 @@ public void FieldRoundtrip_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -578,7 +578,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -612,7 +612,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -1061,8 +1061,8 @@ public void SerializationRoundtrip_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -1078,7 +1078,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -1113,7 +1113,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -1571,8 +1571,8 @@ public void FieldRoundtripThroughSerialization_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -1588,7 +1588,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -1623,7 +1623,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -2074,8 +2074,8 @@ public void FieldRoundtripThroughSerialization_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -2091,7 +2091,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -2125,7 +2125,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -2574,8 +2574,8 @@ public void Validation_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -2591,7 +2591,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -2626,7 +2626,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -3078,8 +3078,8 @@ public void CopyConstructor_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -3095,7 +3095,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -3130,7 +3130,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." diff --git a/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeTest.cs b/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeTest.cs index b25d978..0e88458 100644 --- a/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeTest.cs +++ b/src/Increase.Api.Tests/Models/CardDisputes/CardDisputeTest.cs @@ -61,8 +61,8 @@ public void FieldRoundtrip_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -78,7 +78,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -112,7 +112,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -537,8 +537,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -552,7 +552,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -583,7 +583,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -1031,8 +1031,8 @@ public void SerializationRoundtrip_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -1048,7 +1048,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -1082,7 +1082,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -1522,8 +1522,8 @@ public void FieldRoundtripThroughSerialization_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -1539,7 +1539,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -1573,7 +1573,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -2005,8 +2005,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -2020,7 +2020,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -2051,7 +2051,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -2499,8 +2499,8 @@ public void Validation_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -2516,7 +2516,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -2550,7 +2550,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -2984,8 +2984,8 @@ public void CopyConstructor_Works() "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = @@ -3001,7 +3001,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -3035,7 +3035,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -3780,8 +3780,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -3795,7 +3795,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -3826,7 +3826,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -4234,8 +4234,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -4247,7 +4247,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -4276,7 +4276,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -4702,8 +4702,8 @@ public void SerializationRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -4717,7 +4717,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -4748,7 +4748,7 @@ public void SerializationRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -5170,8 +5170,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -5185,7 +5185,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -5216,7 +5216,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -5631,8 +5631,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -5644,7 +5644,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -5673,7 +5673,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -6102,8 +6102,8 @@ public void Validation_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -6117,7 +6117,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -6148,7 +6148,7 @@ public void Validation_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -6564,8 +6564,8 @@ public void CopyConstructor_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -6579,7 +6579,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -6610,7 +6610,7 @@ public void CopyConstructor_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7027,8 +7027,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7040,7 +7040,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -7069,7 +7069,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7110,8 +7110,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7123,7 +7123,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; CardDisputes::MerchantPrearbitrationTimedOut expectedMerchantPrearbitrationTimedOut = new(); @@ -7151,7 +7151,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7220,8 +7220,8 @@ public void SerializationRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7233,7 +7233,7 @@ public void SerializationRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -7262,7 +7262,7 @@ public void SerializationRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7315,8 +7315,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7328,7 +7328,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -7357,7 +7357,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7405,8 +7405,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7418,7 +7418,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; CardDisputes::MerchantPrearbitrationTimedOut expectedMerchantPrearbitrationTimedOut = new(); @@ -7446,7 +7446,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7524,8 +7524,8 @@ public void Validation_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7537,7 +7537,7 @@ public void Validation_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -7566,7 +7566,7 @@ public void Validation_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -7747,8 +7747,8 @@ public void CopyConstructor_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -7760,7 +7760,7 @@ public void CopyConstructor_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }, @@ -7789,7 +7789,7 @@ public void CopyConstructor_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -8189,8 +8189,8 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8202,7 +8202,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; @@ -8221,8 +8221,10 @@ public void FieldRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }; - CardDisputes::DelayedChargeTransaction expectedDelayedChargeTransaction = new(null); - CardDisputes::EvidenceOfImprint expectedEvidenceOfImprint = new(null); + CardDisputes::DelayedChargeTransaction expectedDelayedChargeTransaction = new( + (string?)null + ); + CardDisputes::EvidenceOfImprint expectedEvidenceOfImprint = new((string?)null); CardDisputes::InvalidDispute expectedInvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8236,7 +8238,7 @@ public void FieldRoundtrip_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }; CardDisputes::PriorUndisputedNonFraudTransactions expectedPriorUndisputedNonFraudTransactions = - new(null); + new((string?)null); ApiEnum expectedReason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes; @@ -8277,8 +8279,8 @@ public void SerializationRoundtrip_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8290,7 +8292,7 @@ public void SerializationRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; @@ -8323,8 +8325,8 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8336,7 +8338,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; @@ -8362,8 +8364,10 @@ public void FieldRoundtripThroughSerialization_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }; - CardDisputes::DelayedChargeTransaction expectedDelayedChargeTransaction = new(null); - CardDisputes::EvidenceOfImprint expectedEvidenceOfImprint = new(null); + CardDisputes::DelayedChargeTransaction expectedDelayedChargeTransaction = new( + (string?)null + ); + CardDisputes::EvidenceOfImprint expectedEvidenceOfImprint = new((string?)null); CardDisputes::InvalidDispute expectedInvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8377,7 +8381,7 @@ public void FieldRoundtripThroughSerialization_Works() PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }; CardDisputes::PriorUndisputedNonFraudTransactions expectedPriorUndisputedNonFraudTransactions = - new(null); + new((string?)null); ApiEnum expectedReason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes; @@ -8418,8 +8422,8 @@ public void Validation_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8431,7 +8435,7 @@ public void Validation_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; @@ -8458,8 +8462,8 @@ public void CopyConstructor_Works() Explanation = "The user did not provide the required documentation.", ProcessedAt = "2020-01-31", }, - DelayedChargeTransaction = new(null), - EvidenceOfImprint = new(null), + DelayedChargeTransaction = new((string?)null), + EvidenceOfImprint = new((string?)null), InvalidDispute = new() { Explanation = "The user did not provide the required documentation.", @@ -8471,7 +8475,7 @@ public void CopyConstructor_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - PriorUndisputedNonFraudTransactions = new(null), + PriorUndisputedNonFraudTransactions = new((string?)null), Reason = CardDisputes::MerchantPrearbitrationReceivedReason.CardholderNoLongerDisputes, }; @@ -9419,7 +9423,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -9451,7 +9455,7 @@ public void FieldRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }; - CardDisputes::ProofOfCashDisbursement expectedProofOfCashDisbursement = new(null); + CardDisputes::ProofOfCashDisbursement expectedProofOfCashDisbursement = new((string?)null); ApiEnum expectedReason = CardDisputes::RepresentedReason.InvalidDispute; CardDisputes::ReversalIssued expectedReversalIssued = new( @@ -9501,7 +9505,7 @@ public void SerializationRoundtrip_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -9544,7 +9548,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -9583,7 +9587,7 @@ public void FieldRoundtripThroughSerialization_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }; - CardDisputes::ProofOfCashDisbursement expectedProofOfCashDisbursement = new(null); + CardDisputes::ProofOfCashDisbursement expectedProofOfCashDisbursement = new((string?)null); ApiEnum expectedReason = CardDisputes::RepresentedReason.InvalidDispute; CardDisputes::ReversalIssued expectedReversalIssued = new( @@ -9633,7 +9637,7 @@ public void Validation_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." @@ -9670,7 +9674,7 @@ public void CopyConstructor_Works() DestinationWalletAddress = "0x1234567890123456789012345678901234567890", PriorApprovedTransactions = "0x1234567890123456789012345678901234567890", }, - ProofOfCashDisbursement = new(null), + ProofOfCashDisbursement = new((string?)null), Reason = CardDisputes::RepresentedReason.InvalidDispute, ReversalIssued = new( "The merchant has issued a reversal for the transaction prior to the dispute being filed." diff --git a/src/Increase.Api.Tests/Models/CardPayments/CardPaymentListPageResponseTest.cs b/src/Increase.Api.Tests/Models/CardPayments/CardPaymentListPageResponseTest.cs index 23d53d4..90d6f3f 100644 --- a/src/Increase.Api.Tests/Models/CardPayments/CardPaymentListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/CardPayments/CardPaymentListPageResponseTest.cs @@ -179,6 +179,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -264,6 +276,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -350,6 +376,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -432,6 +471,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -471,6 +523,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -507,6 +573,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -644,6 +723,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -672,6 +764,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -818,6 +923,20 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -875,6 +994,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -1056,6 +1189,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -1141,6 +1286,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -1227,6 +1386,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1309,6 +1481,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -1348,6 +1533,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -1384,6 +1583,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -1521,6 +1733,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -1549,6 +1774,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -1695,6 +1933,20 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -1752,6 +2004,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -1933,6 +2199,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -2018,6 +2296,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -2104,6 +2396,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2186,6 +2491,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -2225,6 +2543,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -2261,6 +2593,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -2398,6 +2743,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -2426,6 +2784,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -2572,6 +2943,20 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -2629,6 +3014,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -2810,6 +3209,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -2895,6 +3306,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -2981,6 +3406,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3063,6 +3501,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -3102,6 +3553,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -3138,6 +3603,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -3275,6 +3753,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -3303,6 +3794,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -3449,6 +3953,20 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -3506,6 +4024,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -3534,18 +4066,6 @@ public void FieldRoundtrip_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -3725,6 +4245,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -3810,6 +4342,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -3896,9 +4442,22 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, - TerminalID = "RCN5VNXS", - Verification = new() - { + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], + TerminalID = "RCN5VNXS", + Verification = new() + { CardVerificationCode = new( CardPayments::CardDeclineVerificationCardVerificationCodeResult.Match ), @@ -3977,6 +4536,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -4016,6 +4588,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -4052,6 +4638,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -4186,6 +4785,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -4214,6 +4826,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -4359,6 +4984,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -4415,6 +5053,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -4593,6 +5244,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -4678,6 +5341,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -4764,6 +5441,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -4845,6 +5535,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -4884,6 +5587,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -4920,6 +5637,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -5054,6 +5784,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -5082,6 +5825,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -5227,6 +5983,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -5283,6 +6052,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -5461,6 +6243,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -5546,6 +6340,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -5632,6 +6440,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -5713,6 +6534,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -5752,6 +6586,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -5788,6 +6636,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -5922,6 +6783,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -5950,6 +6824,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -6095,6 +6982,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -6151,6 +7051,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -6329,6 +7242,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -6414,6 +7339,20 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -6500,6 +7439,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -6581,6 +7533,19 @@ public void FieldRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -6620,6 +7585,20 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -6656,6 +7635,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -6790,6 +7782,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -6818,6 +7823,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -6963,6 +7981,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -7019,6 +8050,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -7047,18 +8091,6 @@ public void FieldRoundtrip_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -7253,6 +8285,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -7338,6 +8382,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -7424,6 +8482,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -7506,6 +8577,19 @@ public void SerializationRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -7545,6 +8629,20 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -7581,6 +8679,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -7718,6 +8829,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -7746,6 +8870,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -7892,6 +9029,20 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -7949,6 +9100,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -8130,6 +9295,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -8215,6 +9392,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -8301,6 +9492,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -8383,6 +9587,19 @@ public void SerializationRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -8422,6 +9639,20 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -8458,6 +9689,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -8595,6 +9839,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -8623,6 +9880,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -8769,6 +10039,20 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -8826,6 +10110,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -9007,6 +10305,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -9092,6 +10402,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -9178,6 +10502,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -9260,6 +10597,19 @@ public void SerializationRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -9299,6 +10649,20 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -9335,6 +10699,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -9472,6 +10849,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -9500,6 +10890,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -9646,6 +11049,20 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -9703,6 +11120,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -9884,6 +11315,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -9969,6 +11412,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -10055,6 +11512,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -10137,6 +11607,19 @@ public void SerializationRoundtrip_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -10176,6 +11659,20 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -10212,6 +11709,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -10349,6 +11859,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -10377,6 +11900,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -10523,6 +12059,20 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -10580,6 +12130,20 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -10608,18 +12172,6 @@ public void SerializationRoundtrip_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -10816,6 +12368,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -10901,6 +12465,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -10987,6 +12565,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -11069,6 +12660,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -11108,6 +12712,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -11144,6 +12762,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -11281,6 +12912,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -11309,6 +12953,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -11455,6 +13112,20 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -11512,6 +13183,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -11693,6 +13378,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -11778,6 +13475,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -11864,6 +13575,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -11946,6 +13670,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -11985,6 +13722,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -12021,6 +13772,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -12158,6 +13922,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -12186,6 +13963,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -12332,10 +14122,24 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, - Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, - TransactionID = "transaction_uyrp7fld2ium70oa7oi", - Type = CardPayments::CardSettlementType.CardSettlement, - }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], + Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, + TransactionID = "transaction_uyrp7fld2ium70oa7oi", + Type = CardPayments::CardSettlementType.CardSettlement, + }, CardValidation = new() { ID = "card_validation_yi4e59jiaz6n9hx8tczv", @@ -12389,6 +14193,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -12570,6 +14388,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -12655,6 +14485,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -12741,6 +14585,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -12823,6 +14680,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -12862,6 +14732,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -12898,6 +14782,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -13035,6 +14932,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -13063,6 +14973,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -13209,6 +15132,20 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -13266,6 +15203,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -13447,6 +15398,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -13532,6 +15495,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -13618,6 +15595,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -13700,6 +15690,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -13739,6 +15742,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -13775,6 +15792,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -13912,6 +15942,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -13940,6 +15983,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -14086,6 +16142,20 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -14143,6 +16213,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -14171,18 +16255,6 @@ public void FieldRoundtripThroughSerialization_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -14369,6 +16441,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -14454,6 +16538,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -14540,6 +16638,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -14621,6 +16732,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -14660,6 +16784,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -14696,6 +16834,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -14830,6 +16981,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -14858,6 +17022,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -15003,6 +17180,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -15059,6 +17249,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -15237,6 +17440,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -15322,6 +17537,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -15408,6 +17637,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -15489,6 +17731,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -15528,6 +17783,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -15564,6 +17833,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -15698,6 +17980,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -15726,6 +18021,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -15871,6 +18179,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -15927,6 +18248,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -16105,6 +18439,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -16190,6 +18536,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -16276,6 +18636,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -16357,6 +18730,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -16396,6 +18782,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -16432,6 +18832,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -16566,6 +18979,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -16594,6 +19020,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -16739,6 +19178,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -16795,6 +19247,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -16973,6 +19438,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -17058,6 +19535,20 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -17144,6 +19635,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -17225,6 +19729,19 @@ public void FieldRoundtripThroughSerialization_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -17264,6 +19781,20 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -17300,6 +19831,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -17434,6 +19978,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -17462,6 +20019,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -17607,6 +20177,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -17663,6 +20246,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -17691,18 +20287,6 @@ public void FieldRoundtripThroughSerialization_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -17897,6 +20481,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -17982,6 +20578,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -18068,6 +20678,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -18150,6 +20773,19 @@ public void Validation_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -18189,6 +20825,20 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -18225,6 +20875,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -18362,6 +21025,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -18390,6 +21066,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -18536,6 +21225,20 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -18593,6 +21296,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -18774,6 +21491,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -18859,6 +21588,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -18945,6 +21688,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -19027,6 +21783,19 @@ public void Validation_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -19066,6 +21835,20 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -19102,6 +21885,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -19239,6 +22035,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -19267,6 +22076,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -19413,6 +22235,20 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -19470,6 +22306,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -19651,6 +22501,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -19736,6 +22598,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -19822,6 +22698,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -19904,6 +22793,19 @@ public void Validation_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -19943,6 +22845,20 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -19979,6 +22895,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -20116,6 +23045,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -20144,6 +23086,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -20290,6 +23245,20 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -20347,6 +23316,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -20528,6 +23511,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -20613,6 +23608,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -20699,6 +23708,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -20781,6 +23803,19 @@ public void Validation_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -20820,6 +23855,20 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -20856,8 +23905,21 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, - Type = CardPayments::CardIncrementType.CardIncrement, - UpdatedAuthorizationAmount = 120, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], + Type = CardPayments::CardIncrementType.CardIncrement, + UpdatedAuthorizationAmount = 120, }, CardRefund = new() { @@ -20993,6 +24055,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -21021,6 +24096,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -21167,6 +24255,20 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -21224,6 +24326,20 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -21252,18 +24368,6 @@ public void Validation_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -21454,6 +24558,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -21539,6 +24655,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -21625,6 +24755,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -21707,6 +24850,19 @@ public void CopyConstructor_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -21746,6 +24902,20 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -21782,6 +24952,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -21919,6 +25102,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -21947,6 +25143,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -22093,6 +25302,20 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -22150,6 +25373,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -22331,6 +25568,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -22416,6 +25665,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -22502,6 +25765,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -22584,6 +25860,19 @@ public void CopyConstructor_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -22623,6 +25912,20 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -22659,6 +25962,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -22796,6 +26112,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -22824,6 +26153,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -22970,6 +26312,20 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -23027,6 +26383,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -23208,6 +26578,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -23293,6 +26675,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -23379,6 +26775,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -23461,6 +26870,19 @@ public void CopyConstructor_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -23500,6 +26922,20 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -23536,6 +26972,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -23673,6 +27122,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -23701,6 +27163,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -23847,6 +27322,20 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -23904,6 +27393,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -24085,6 +27588,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -24170,6 +27685,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -24256,6 +27785,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -24338,6 +27880,19 @@ public void CopyConstructor_Works() ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -24377,6 +27932,20 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -24413,6 +27982,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -24550,6 +28132,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -24578,6 +28173,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -24724,6 +28332,20 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -24781,6 +28403,20 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = + CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -24809,18 +28445,6 @@ public void CopyConstructor_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, diff --git a/src/Increase.Api.Tests/Models/CardPayments/CardPaymentTest.cs b/src/Increase.Api.Tests/Models/CardPayments/CardPaymentTest.cs index a83f78c..5db84b2 100644 --- a/src/Increase.Api.Tests/Models/CardPayments/CardPaymentTest.cs +++ b/src/Increase.Api.Tests/Models/CardPayments/CardPaymentTest.cs @@ -170,6 +170,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -254,6 +266,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -339,6 +364,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -419,6 +457,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -458,6 +509,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -494,6 +558,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -624,6 +701,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -652,6 +742,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -794,6 +897,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -850,6 +966,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -1025,6 +1154,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -1109,6 +1250,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -1194,6 +1348,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1274,6 +1441,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -1313,6 +1493,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -1349,6 +1542,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -1479,6 +1685,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -1507,6 +1726,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -1649,6 +1881,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -1705,6 +1950,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -1880,6 +2138,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -1964,6 +2234,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -2049,6 +2332,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2129,6 +2425,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -2168,6 +2477,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -2204,6 +2526,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -2334,6 +2669,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -2362,6 +2710,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -2504,6 +2865,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -2560,6 +2934,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -2735,6 +3122,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -2819,6 +3218,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -2904,6 +3316,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2984,6 +3409,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -3023,6 +3461,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -3059,6 +3510,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -3189,6 +3653,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -3217,6 +3694,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -3359,6 +3849,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -3415,6 +3918,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -3443,18 +3959,6 @@ public void FieldRoundtrip_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -3620,6 +4124,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -3704,6 +4220,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -3789,6 +4318,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3869,6 +4411,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -3908,6 +4463,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -3944,6 +4512,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -4072,6 +4653,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -4100,6 +4694,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -4240,6 +4847,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -4296,6 +4916,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -4468,6 +5101,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -4552,6 +5197,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -4637,6 +5295,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -4717,6 +5388,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -4756,6 +5440,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -4792,6 +5489,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -4920,6 +5630,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -4948,6 +5671,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -5088,6 +5824,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -5144,6 +5893,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -5316,6 +6078,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -5400,6 +6174,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -5485,6 +6272,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -5565,6 +6365,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -5604,6 +6417,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -5640,6 +6466,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -5768,6 +6607,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -5796,6 +6648,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -5936,6 +6801,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -5992,6 +6870,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -6164,6 +7055,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -6248,6 +7151,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -6333,6 +7249,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -6413,6 +7342,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -6452,6 +7394,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -6488,6 +7443,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -6616,6 +7584,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -6644,6 +7625,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -6784,6 +7778,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -6840,6 +7847,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -6867,18 +7887,6 @@ public void FieldRoundtrip_Works() Other = new(), }, ]; - List expectedSchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ]; CardPayments::State expectedState = new() { AuthorizedAmount = 100, @@ -6903,11 +7911,6 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedElements[i], model.Elements[i]); } Assert.Null(model.PhysicalCardID); - Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); - for (int i = 0; i < expectedSchemeFees.Count; i++) - { - Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); - } Assert.Equal(expectedState, model.State); Assert.Equal(expectedType, model.Type); } @@ -7073,6 +8076,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -7157,6 +8172,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -7242,6 +8270,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -7322,6 +8363,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -7361,6 +8415,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -7397,6 +8464,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -7527,6 +8607,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -7555,6 +8648,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -7697,6 +8803,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -7753,6 +8872,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -7928,6 +9060,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -8012,6 +9156,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -8097,6 +9254,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -8177,6 +9347,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -8216,6 +9399,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -8252,6 +9448,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -8382,6 +9591,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -8410,6 +9632,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -8552,6 +9787,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -8608,6 +9856,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -8783,6 +10044,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -8867,6 +10140,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -8952,6 +10238,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -9032,6 +10331,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -9071,6 +10383,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -9107,6 +10432,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -9237,6 +10575,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -9265,6 +10616,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -9407,6 +10771,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -9463,6 +10840,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -9638,6 +11028,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -9722,6 +11124,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -9807,6 +11222,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -9887,6 +11315,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -9926,6 +11367,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -9962,6 +11416,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -10092,6 +11559,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -10120,6 +11600,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -10262,6 +11755,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -10318,6 +11824,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -10346,18 +11865,6 @@ public void SerializationRoundtrip_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -10541,6 +12048,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -10625,6 +12144,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -10710,6 +12242,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -10790,6 +12335,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -10829,6 +12387,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -10865,6 +12436,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -10995,6 +12579,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -11023,6 +12620,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -11165,6 +12775,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -11221,6 +12844,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -11396,6 +13032,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -11480,6 +13128,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -11565,6 +13226,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -11645,6 +13319,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -11684,6 +13371,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -11720,6 +13420,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -11850,6 +13563,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -11878,6 +13604,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -12020,6 +13759,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -12076,6 +13828,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -12251,6 +14016,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -12335,6 +14112,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -12420,6 +14210,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -12500,6 +14303,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -12539,6 +14355,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -12575,6 +14404,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -12705,6 +14547,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -12733,6 +14588,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -12875,6 +14743,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -12931,6 +14812,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -13106,6 +15000,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -13190,6 +15096,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -13275,6 +15194,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -13355,6 +15287,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -13394,6 +15339,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -13430,6 +15388,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -13560,6 +15531,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -13588,6 +15572,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -13730,6 +15727,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -13786,6 +15796,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -13814,18 +15837,6 @@ public void FieldRoundtripThroughSerialization_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -13998,6 +16009,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -14082,6 +16105,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -14167,6 +16203,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -14247,6 +16296,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -14286,6 +16348,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -14322,6 +16397,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -14450,6 +16538,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -14478,6 +16579,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -14618,6 +16732,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -14674,6 +16801,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -14846,6 +16986,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -14930,6 +17082,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -15015,6 +17180,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -15095,6 +17273,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -15134,6 +17325,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -15170,6 +17374,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -15298,6 +17515,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -15326,6 +17556,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -15466,6 +17709,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -15522,6 +17778,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -15694,6 +17963,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -15778,6 +18059,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -15863,6 +18157,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -15943,6 +18250,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -15982,6 +18302,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -16018,6 +18351,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -16146,6 +18492,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -16174,6 +18533,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -16314,6 +18686,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -16370,6 +18755,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -16542,6 +18940,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -16626,6 +19036,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -16711,6 +19134,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -16791,6 +19227,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -16830,6 +19279,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -16866,6 +19328,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -16994,6 +19469,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -17022,6 +19510,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -17162,6 +19663,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -17218,6 +19732,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -17245,18 +19772,6 @@ public void FieldRoundtripThroughSerialization_Works() Other = new(), }, ]; - List expectedSchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ]; CardPayments::State expectedState = new() { AuthorizedAmount = 100, @@ -17281,11 +19796,6 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedElements[i], deserialized.Elements[i]); } Assert.Null(deserialized.PhysicalCardID); - Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); - for (int i = 0; i < expectedSchemeFees.Count; i++) - { - Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); - } Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedType, deserialized.Type); } @@ -17451,6 +19961,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -17535,6 +20057,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -17620,6 +20155,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -17700,6 +20248,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -17739,6 +20300,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -17775,6 +20349,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -17905,6 +20492,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -17933,6 +20533,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -18075,6 +20688,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -18131,6 +20757,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -18306,6 +20945,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -18390,6 +21041,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -18475,6 +21139,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -18555,6 +21232,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -18594,6 +21284,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -18630,6 +21333,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -18760,6 +21476,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -18788,6 +21517,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -18930,6 +21672,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -18986,6 +21741,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -19161,6 +21929,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -19245,6 +22025,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -19330,6 +22123,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -19410,6 +22216,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -19449,6 +22268,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -19485,6 +22317,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -19615,6 +22460,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -19643,6 +22501,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -19785,6 +22656,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -19841,6 +22725,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -20016,6 +22913,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -20100,6 +23009,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -20185,6 +23107,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -20265,6 +23200,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -20304,6 +23252,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -20340,6 +23301,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -20470,6 +23444,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -20498,6 +23485,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -20640,6 +23640,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -20696,6 +23709,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -20724,18 +23750,6 @@ public void Validation_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -20913,6 +23927,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -20997,6 +24023,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -21082,6 +24121,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -21162,6 +24214,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -21201,6 +24266,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -21237,6 +24315,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -21367,6 +24458,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -21395,6 +24499,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -21537,6 +24654,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -21593,6 +24723,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -21768,6 +24911,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -21852,6 +25007,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -21937,6 +25105,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -22017,6 +25198,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -22056,6 +25250,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -22092,6 +25299,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -22222,6 +25442,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -22250,6 +25483,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -22392,6 +25638,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -22448,6 +25707,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -22623,6 +25895,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -22707,6 +25991,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -22792,6 +26089,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -22872,6 +26182,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -22911,6 +26234,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -22947,6 +26283,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -23077,6 +26426,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -23105,6 +26467,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -23247,6 +26622,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -23303,6 +26691,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -23478,6 +26879,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -23562,6 +26975,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -23647,6 +27073,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -23727,6 +27166,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -23766,6 +27218,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -23802,6 +27267,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -23932,6 +27410,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -23960,6 +27451,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -24102,6 +27606,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -24158,6 +27675,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -24186,18 +27716,6 @@ public void CopyConstructor_Works() }, ], PhysicalCardID = null, - SchemeFees = - [ - new() - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }, - ], State = new() { AuthorizedAmount = 100, @@ -24366,6 +27884,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -24449,6 +27979,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -24534,6 +28077,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -24614,6 +28170,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -24653,6 +28222,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -24689,6 +28271,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -24814,6 +28409,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -24842,6 +28450,19 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -24982,6 +28603,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -25038,6 +28672,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -25206,6 +28853,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -25288,6 +28947,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -25373,6 +29045,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -25453,6 +29137,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -25492,6 +29189,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -25528,6 +29238,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -25649,6 +29372,18 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -25677,6 +29412,18 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -25817,6 +29564,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -25873,6 +29633,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -26063,6 +29836,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -26146,6 +29931,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -26231,6 +30029,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -26311,6 +30122,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -26350,6 +30174,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -26386,6 +30223,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -26511,6 +30361,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -26539,6 +30402,19 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -26679,6 +30555,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -26735,6 +30624,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -26918,6 +30820,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -27001,6 +30915,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -27086,6 +31013,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -27166,6 +31106,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -27205,6 +31158,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -27241,6 +31207,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -27366,6 +31345,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -27394,6 +31386,19 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -27534,6 +31539,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -27590,6 +31608,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -27765,6 +31796,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -27847,6 +31890,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -27932,6 +31988,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -28012,6 +32080,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -28051,6 +32132,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -28087,6 +32181,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -28208,6 +32315,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -28236,6 +32355,18 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -28376,6 +32507,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -28432,6 +32576,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -28622,6 +32779,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -28705,6 +32874,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -28790,6 +32972,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -28870,6 +33065,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -28909,6 +33117,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -28945,6 +33166,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -29070,6 +33304,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -29098,6 +33345,19 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -29238,6 +33498,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -29294,6 +33567,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -29597,6 +33883,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -29680,6 +33978,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -29765,6 +34076,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -29845,6 +34169,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -29884,6 +34221,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }, @@ -29920,6 +34270,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }, @@ -30045,6 +34408,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }, @@ -30073,6 +34449,19 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -30213,6 +34602,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -30269,6 +34671,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -32864,193 +37279,234 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, - TerminalID = "RCN5VNXS", - Type = CardPayments::CardAuthorizationType.CardAuthorization, - Verification = new() - { - CardVerificationCode = new(CardPayments::Result.Match), - CardholderAddress = new() - { - ActualLine1 = "33 Liberty Street", - ActualPostalCode = "94131", - ProvidedLine1 = "33 Liberty Street", - ProvidedPostalCode = "94132", - Result = CardPayments::CardholderAddressResult.PostalCodeNoMatchAddressMatch, - }, - CardholderName = new() - { - ProvidedFirstName = "provided_first_name", - ProvidedLastName = "provided_last_name", - ProvidedMiddleName = "provided_middle_name", - }, - }, - }; - - string expectedID = "card_authorization_6iqxap6ivd0fo5eu3i8x"; - ApiEnum expectedActioner = CardPayments::Actioner.Increase; - CardPayments::AdditionalAmounts expectedAdditionalAmounts = new() - { - Clinic = new() { Amount = 0, Currency = "currency" }, - Dental = new() { Amount = 0, Currency = "currency" }, - Original = new() { Amount = 0, Currency = "currency" }, - Prescription = new() { Amount = 0, Currency = "currency" }, - Surcharge = new() { Amount = 10, Currency = "USD" }, - TotalCumulative = new() { Amount = 0, Currency = "currency" }, - TotalHealthcare = new() { Amount = 0, Currency = "currency" }, - Transit = new() { Amount = 0, Currency = "currency" }, - Unknown = new() { Amount = 0, Currency = "currency" }, - Vision = new() { Amount = 0, Currency = "currency" }, - }; - long expectedAmount = 100; - string expectedCardPaymentID = "card_payment_nd3k2kacrqjli8482ave"; - ApiEnum expectedCurrency = CardPayments::Currency.Usd; - ApiEnum expectedDirection = - CardPayments::Direction.Settlement; - DateTimeOffset expectedExpiresAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); - string expectedMerchantAcceptorID = "5665270011000168"; - string expectedMerchantCategoryCode = "5734"; - string expectedMerchantCity = "New York"; - string expectedMerchantCountry = "US"; - string expectedMerchantDescriptor = "AMAZON.COM"; - string expectedMerchantPostalCode = "10045"; - string expectedMerchantState = "NY"; - CardPayments::NetworkDetails expectedNetworkDetails = new() - { - Category = CardPayments::NetworkDetailsCategory.Visa, - Pulse = new(), - Visa = new() - { - ElectronicCommerceIndicator = - CardPayments::ElectronicCommerceIndicator.SecureElectronicCommerce, - PointOfServiceEntryMode = CardPayments::PointOfServiceEntryMode.Manual, - StandInProcessingReason = null, - TerminalEntryCapability = CardPayments::TerminalEntryCapability.MagneticStripe, - }, - }; - CardPayments::NetworkIdentifiers expectedNetworkIdentifiers = new() - { - AuthorizationIdentificationResponse = null, - RetrievalReferenceNumber = "785867080153", - TraceNumber = "487941", - TransactionID = "627199945183184", - }; - long expectedNetworkRiskScore = 10; - long expectedPresentmentAmount = 100; - string expectedPresentmentCurrency = "USD"; - ApiEnum expectedProcessingCategory = - CardPayments::ProcessingCategory.Purchase; - string expectedTerminalID = "RCN5VNXS"; - ApiEnum expectedType = - CardPayments::CardAuthorizationType.CardAuthorization; - CardPayments::Verification expectedVerification = new() - { - CardVerificationCode = new(CardPayments::Result.Match), - CardholderAddress = new() - { - ActualLine1 = "33 Liberty Street", - ActualPostalCode = "94131", - ProvidedLine1 = "33 Liberty Street", - ProvidedPostalCode = "94132", - Result = CardPayments::CardholderAddressResult.PostalCodeNoMatchAddressMatch, - }, - CardholderName = new() - { - ProvidedFirstName = "provided_first_name", - ProvidedLastName = "provided_last_name", - ProvidedMiddleName = "provided_middle_name", - }, - }; - - Assert.Equal(expectedID, model.ID); - Assert.Equal(expectedActioner, model.Actioner); - Assert.Equal(expectedAdditionalAmounts, model.AdditionalAmounts); - Assert.Equal(expectedAmount, model.Amount); - Assert.Equal(expectedCardPaymentID, model.CardPaymentID); - Assert.Equal(expectedCurrency, model.Currency); - Assert.Null(model.DigitalWalletTokenID); - Assert.Equal(expectedDirection, model.Direction); - Assert.Equal(expectedExpiresAt, model.ExpiresAt); - Assert.Equal(expectedMerchantAcceptorID, model.MerchantAcceptorID); - Assert.Equal(expectedMerchantCategoryCode, model.MerchantCategoryCode); - Assert.Equal(expectedMerchantCity, model.MerchantCity); - Assert.Equal(expectedMerchantCountry, model.MerchantCountry); - Assert.Equal(expectedMerchantDescriptor, model.MerchantDescriptor); - Assert.Equal(expectedMerchantPostalCode, model.MerchantPostalCode); - Assert.Equal(expectedMerchantState, model.MerchantState); - Assert.Equal(expectedNetworkDetails, model.NetworkDetails); - Assert.Equal(expectedNetworkIdentifiers, model.NetworkIdentifiers); - Assert.Equal(expectedNetworkRiskScore, model.NetworkRiskScore); - Assert.Null(model.PendingTransactionID); - Assert.Null(model.PhysicalCardID); - Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); - Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); - Assert.Equal(expectedProcessingCategory, model.ProcessingCategory); - Assert.Null(model.RealTimeDecisionID); - Assert.Equal(expectedTerminalID, model.TerminalID); - Assert.Equal(expectedType, model.Type); - Assert.Equal(expectedVerification, model.Verification); - } - - [Fact] - public void SerializationRoundtrip_Works() - { - var model = new CardPayments::CardAuthorization - { - ID = "card_authorization_6iqxap6ivd0fo5eu3i8x", - Actioner = CardPayments::Actioner.Increase, - AdditionalAmounts = new() - { - Clinic = new() { Amount = 0, Currency = "currency" }, - Dental = new() { Amount = 0, Currency = "currency" }, - Original = new() { Amount = 0, Currency = "currency" }, - Prescription = new() { Amount = 0, Currency = "currency" }, - Surcharge = new() { Amount = 10, Currency = "USD" }, - TotalCumulative = new() { Amount = 0, Currency = "currency" }, - TotalHealthcare = new() { Amount = 0, Currency = "currency" }, - Transit = new() { Amount = 0, Currency = "currency" }, - Unknown = new() { Amount = 0, Currency = "currency" }, - Vision = new() { Amount = 0, Currency = "currency" }, - }, - Amount = 100, - CardPaymentID = "card_payment_nd3k2kacrqjli8482ave", - Currency = CardPayments::Currency.Usd, - DigitalWalletTokenID = null, - Direction = CardPayments::Direction.Settlement, - ExpiresAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - MerchantAcceptorID = "5665270011000168", - MerchantCategoryCode = "5734", - MerchantCity = "New York", - MerchantCountry = "US", - MerchantDescriptor = "AMAZON.COM", - MerchantPostalCode = "10045", - MerchantState = "NY", - NetworkDetails = new() - { - Category = CardPayments::NetworkDetailsCategory.Visa, - Pulse = new(), - Visa = new() + SchemeFees = + [ + new() { - ElectronicCommerceIndicator = - CardPayments::ElectronicCommerceIndicator.SecureElectronicCommerce, - PointOfServiceEntryMode = CardPayments::PointOfServiceEntryMode.Manual, - StandInProcessingReason = null, - TerminalEntryCapability = CardPayments::TerminalEntryCapability.MagneticStripe, + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", }, - }, - NetworkIdentifiers = new() - { - AuthorizationIdentificationResponse = null, - RetrievalReferenceNumber = "785867080153", - TraceNumber = "487941", - TransactionID = "627199945183184", - }, - NetworkRiskScore = 10, - PendingTransactionID = null, - PhysicalCardID = null, - PresentmentAmount = 100, - PresentmentCurrency = "USD", - ProcessingCategory = CardPayments::ProcessingCategory.Purchase, - RealTimeDecisionID = null, + ], + TerminalID = "RCN5VNXS", + Type = CardPayments::CardAuthorizationType.CardAuthorization, + Verification = new() + { + CardVerificationCode = new(CardPayments::Result.Match), + CardholderAddress = new() + { + ActualLine1 = "33 Liberty Street", + ActualPostalCode = "94131", + ProvidedLine1 = "33 Liberty Street", + ProvidedPostalCode = "94132", + Result = CardPayments::CardholderAddressResult.PostalCodeNoMatchAddressMatch, + }, + CardholderName = new() + { + ProvidedFirstName = "provided_first_name", + ProvidedLastName = "provided_last_name", + ProvidedMiddleName = "provided_middle_name", + }, + }, + }; + + string expectedID = "card_authorization_6iqxap6ivd0fo5eu3i8x"; + ApiEnum expectedActioner = CardPayments::Actioner.Increase; + CardPayments::AdditionalAmounts expectedAdditionalAmounts = new() + { + Clinic = new() { Amount = 0, Currency = "currency" }, + Dental = new() { Amount = 0, Currency = "currency" }, + Original = new() { Amount = 0, Currency = "currency" }, + Prescription = new() { Amount = 0, Currency = "currency" }, + Surcharge = new() { Amount = 10, Currency = "USD" }, + TotalCumulative = new() { Amount = 0, Currency = "currency" }, + TotalHealthcare = new() { Amount = 0, Currency = "currency" }, + Transit = new() { Amount = 0, Currency = "currency" }, + Unknown = new() { Amount = 0, Currency = "currency" }, + Vision = new() { Amount = 0, Currency = "currency" }, + }; + long expectedAmount = 100; + string expectedCardPaymentID = "card_payment_nd3k2kacrqjli8482ave"; + ApiEnum expectedCurrency = CardPayments::Currency.Usd; + ApiEnum expectedDirection = + CardPayments::Direction.Settlement; + DateTimeOffset expectedExpiresAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + string expectedMerchantAcceptorID = "5665270011000168"; + string expectedMerchantCategoryCode = "5734"; + string expectedMerchantCity = "New York"; + string expectedMerchantCountry = "US"; + string expectedMerchantDescriptor = "AMAZON.COM"; + string expectedMerchantPostalCode = "10045"; + string expectedMerchantState = "NY"; + CardPayments::NetworkDetails expectedNetworkDetails = new() + { + Category = CardPayments::NetworkDetailsCategory.Visa, + Pulse = new(), + Visa = new() + { + ElectronicCommerceIndicator = + CardPayments::ElectronicCommerceIndicator.SecureElectronicCommerce, + PointOfServiceEntryMode = CardPayments::PointOfServiceEntryMode.Manual, + StandInProcessingReason = null, + TerminalEntryCapability = CardPayments::TerminalEntryCapability.MagneticStripe, + }, + }; + CardPayments::NetworkIdentifiers expectedNetworkIdentifiers = new() + { + AuthorizationIdentificationResponse = null, + RetrievalReferenceNumber = "785867080153", + TraceNumber = "487941", + TransactionID = "627199945183184", + }; + long expectedNetworkRiskScore = 10; + long expectedPresentmentAmount = 100; + string expectedPresentmentCurrency = "USD"; + ApiEnum expectedProcessingCategory = + CardPayments::ProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; + string expectedTerminalID = "RCN5VNXS"; + ApiEnum expectedType = + CardPayments::CardAuthorizationType.CardAuthorization; + CardPayments::Verification expectedVerification = new() + { + CardVerificationCode = new(CardPayments::Result.Match), + CardholderAddress = new() + { + ActualLine1 = "33 Liberty Street", + ActualPostalCode = "94131", + ProvidedLine1 = "33 Liberty Street", + ProvidedPostalCode = "94132", + Result = CardPayments::CardholderAddressResult.PostalCodeNoMatchAddressMatch, + }, + CardholderName = new() + { + ProvidedFirstName = "provided_first_name", + ProvidedLastName = "provided_last_name", + ProvidedMiddleName = "provided_middle_name", + }, + }; + + Assert.Equal(expectedID, model.ID); + Assert.Equal(expectedActioner, model.Actioner); + Assert.Equal(expectedAdditionalAmounts, model.AdditionalAmounts); + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCardPaymentID, model.CardPaymentID); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Null(model.DigitalWalletTokenID); + Assert.Equal(expectedDirection, model.Direction); + Assert.Equal(expectedExpiresAt, model.ExpiresAt); + Assert.Equal(expectedMerchantAcceptorID, model.MerchantAcceptorID); + Assert.Equal(expectedMerchantCategoryCode, model.MerchantCategoryCode); + Assert.Equal(expectedMerchantCity, model.MerchantCity); + Assert.Equal(expectedMerchantCountry, model.MerchantCountry); + Assert.Equal(expectedMerchantDescriptor, model.MerchantDescriptor); + Assert.Equal(expectedMerchantPostalCode, model.MerchantPostalCode); + Assert.Equal(expectedMerchantState, model.MerchantState); + Assert.Equal(expectedNetworkDetails, model.NetworkDetails); + Assert.Equal(expectedNetworkIdentifiers, model.NetworkIdentifiers); + Assert.Equal(expectedNetworkRiskScore, model.NetworkRiskScore); + Assert.Null(model.PendingTransactionID); + Assert.Null(model.PhysicalCardID); + Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); + Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); + Assert.Equal(expectedProcessingCategory, model.ProcessingCategory); + Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } + Assert.Equal(expectedTerminalID, model.TerminalID); + Assert.Equal(expectedType, model.Type); + Assert.Equal(expectedVerification, model.Verification); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardAuthorization + { + ID = "card_authorization_6iqxap6ivd0fo5eu3i8x", + Actioner = CardPayments::Actioner.Increase, + AdditionalAmounts = new() + { + Clinic = new() { Amount = 0, Currency = "currency" }, + Dental = new() { Amount = 0, Currency = "currency" }, + Original = new() { Amount = 0, Currency = "currency" }, + Prescription = new() { Amount = 0, Currency = "currency" }, + Surcharge = new() { Amount = 10, Currency = "USD" }, + TotalCumulative = new() { Amount = 0, Currency = "currency" }, + TotalHealthcare = new() { Amount = 0, Currency = "currency" }, + Transit = new() { Amount = 0, Currency = "currency" }, + Unknown = new() { Amount = 0, Currency = "currency" }, + Vision = new() { Amount = 0, Currency = "currency" }, + }, + Amount = 100, + CardPaymentID = "card_payment_nd3k2kacrqjli8482ave", + Currency = CardPayments::Currency.Usd, + DigitalWalletTokenID = null, + Direction = CardPayments::Direction.Settlement, + ExpiresAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + MerchantAcceptorID = "5665270011000168", + MerchantCategoryCode = "5734", + MerchantCity = "New York", + MerchantCountry = "US", + MerchantDescriptor = "AMAZON.COM", + MerchantPostalCode = "10045", + MerchantState = "NY", + NetworkDetails = new() + { + Category = CardPayments::NetworkDetailsCategory.Visa, + Pulse = new(), + Visa = new() + { + ElectronicCommerceIndicator = + CardPayments::ElectronicCommerceIndicator.SecureElectronicCommerce, + PointOfServiceEntryMode = CardPayments::PointOfServiceEntryMode.Manual, + StandInProcessingReason = null, + TerminalEntryCapability = CardPayments::TerminalEntryCapability.MagneticStripe, + }, + }, + NetworkIdentifiers = new() + { + AuthorizationIdentificationResponse = null, + RetrievalReferenceNumber = "785867080153", + TraceNumber = "487941", + TransactionID = "627199945183184", + }, + NetworkRiskScore = 10, + PendingTransactionID = null, + PhysicalCardID = null, + PresentmentAmount = 100, + PresentmentCurrency = "USD", + ProcessingCategory = CardPayments::ProcessingCategory.Purchase, + RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -33142,6 +37598,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -33224,6 +37692,18 @@ public void FieldRoundtripThroughSerialization_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = CardPayments::ProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardAuthorizationType.CardAuthorization; @@ -33271,6 +37751,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, deserialized.ProcessingCategory); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedVerification, deserialized.Verification); @@ -33336,6 +37821,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -33421,6 +37918,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardAuthorizationType.CardAuthorization, Verification = new() @@ -35289,6 +39798,296 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class SchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::SchemeFeeCurrency.Usd, + FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::SchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class SchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::SchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::SchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class FeeTypeTest : TestBase +{ + [Theory] + [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(CardPayments::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(CardPayments::FeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::FeeType.VisaMessageTransmission)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::FeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::FeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::FeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::FeeType.VisaClearingTransmission)] + [InlineData(CardPayments::FeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::FeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::FeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::FeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(CardPayments::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(CardPayments::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(CardPayments::FeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::FeeType.VisaMessageTransmission)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::FeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::FeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::FeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::FeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::FeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::FeeType.VisaClearingTransmission)] + [InlineData(CardPayments::FeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::FeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::FeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::FeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } +} + public class CardAuthorizationTypeTest : TestBase { [Theory] @@ -36280,6 +41079,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -36353,6 +41165,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }; long expectedNetworkRiskScore = 10; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardBalanceInquiryType.CardBalanceInquiry; @@ -36396,6 +41221,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedNetworkRiskScore, model.NetworkRiskScore); Assert.Null(model.PhysicalCardID); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedType, model.Type); Assert.Equal(expectedVerification, model.Verification); @@ -36456,6 +41286,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -36545,6 +41388,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -36625,6 +41481,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }; long expectedNetworkRiskScore = 10; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardBalanceInquiryType.CardBalanceInquiry; @@ -36668,6 +41537,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedNetworkRiskScore, deserialized.NetworkRiskScore); Assert.Null(deserialized.PhysicalCardID); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedVerification, deserialized.Verification); @@ -36728,6 +41602,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -36811,6 +41698,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardBalanceInquiryType.CardBalanceInquiry, Verification = new() @@ -39017,6 +43917,342 @@ public void CopyConstructor_Works() } } +public class CardBalanceInquirySchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardBalanceInquirySchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardBalanceInquirySchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardBalanceInquirySchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardBalanceInquirySchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardBalanceInquirySchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd, + FeeType = CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardBalanceInquirySchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardBalanceInquirySchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardBalanceInquirySchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works( + CardPayments::CardBalanceInquirySchemeFeeCurrency rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardBalanceInquirySchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationInternational + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardBalanceInquirySchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationInternational + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardBalanceInquirySchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardBalanceInquirySchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works( + CardPayments::CardBalanceInquirySchemeFeeFeeType rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardBalanceInquiryTypeTest : TestBase { [Theory] @@ -39793,6 +45029,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -39875,6 +45123,18 @@ public void FieldRoundtrip_Works() CardPayments::CardDeclineProcessingCategory.Purchase; ApiEnum expectedReason = CardPayments::Reason.InsufficientFunds; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; CardPayments::CardDeclineVerification expectedVerification = new() { @@ -39925,6 +45185,11 @@ public void FieldRoundtrip_Works() Assert.Null(model.RealTimeDecisionID); Assert.Null(model.RealTimeDecisionReason); Assert.Equal(expectedReason, model.Reason); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedVerification, model.Verification); } @@ -39993,6 +45258,18 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -40090,6 +45367,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -40179,6 +45468,18 @@ public void FieldRoundtripThroughSerialization_Works() CardPayments::CardDeclineProcessingCategory.Purchase; ApiEnum expectedReason = CardPayments::Reason.InsufficientFunds; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; CardPayments::CardDeclineVerification expectedVerification = new() { @@ -40229,6 +45530,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Null(deserialized.RealTimeDecisionID); Assert.Null(deserialized.RealTimeDecisionReason); Assert.Equal(expectedReason, deserialized.Reason); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedVerification, deserialized.Verification); } @@ -40297,6 +45603,18 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -40388,6 +45706,18 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = CardPayments::Reason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -42839,6 +48169,310 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardDeclineSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardDeclineSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardDeclineSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardDeclineSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardDeclineSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardDeclineSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardDeclineSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardDeclineSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardDeclineSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardDeclineSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardDeclineSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardDeclineSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardDeclineSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardDeclineSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardDeclineSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardDeclineSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardDeclineSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardDeclineSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardDeclineSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardDeclineSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardDeclineVerificationTest : TestBase { [Fact] @@ -43539,6 +49173,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -43621,6 +49268,18 @@ public void FieldRoundtrip_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = @@ -43670,6 +49329,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, model.ProcessingCategory); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); @@ -43736,6 +49400,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -43831,6 +49508,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -43920,6 +49610,18 @@ public void FieldRoundtripThroughSerialization_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = @@ -43969,6 +49671,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, deserialized.ProcessingCategory); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); @@ -44035,6 +49742,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -44124,6 +49844,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = CardPayments::CardFinancialProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardFinancialType.CardFinancial, @@ -46463,6 +52196,314 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardFinancialSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardFinancialSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardFinancialSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardFinancialSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardFinancialSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardFinancialSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardFinancialSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardFinancialSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFinancialSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardFinancialSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardFinancialSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardFinancialSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardFinancialSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardFinancialSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardFinancialSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardFinancialSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardFinancialSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData( + CardPayments::CardFinancialSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardFinancialSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardFinancialSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardFinancialTypeTest : TestBase { [Theory] @@ -47176,6 +53217,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -47194,6 +53248,19 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }; string expectedPendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4"; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; ApiEnum expectedType = CardPayments::CardFuelConfirmationType.CardFuelConfirmation; long expectedUpdatedAuthorizationAmount = 120; @@ -47204,6 +53271,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedNetwork, model.Network); Assert.Equal(expectedNetworkIdentifiers, model.NetworkIdentifiers); Assert.Equal(expectedPendingTransactionID, model.PendingTransactionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedType, model.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, model.UpdatedAuthorizationAmount); } @@ -47225,6 +53297,19 @@ public void SerializationRoundtrip_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -47255,6 +53340,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -47280,6 +53378,19 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }; string expectedPendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4"; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; ApiEnum expectedType = CardPayments::CardFuelConfirmationType.CardFuelConfirmation; long expectedUpdatedAuthorizationAmount = 120; @@ -47290,6 +53401,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedNetwork, deserialized.Network); Assert.Equal(expectedNetworkIdentifiers, deserialized.NetworkIdentifiers); Assert.Equal(expectedPendingTransactionID, deserialized.PendingTransactionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, deserialized.UpdatedAuthorizationAmount); } @@ -47311,6 +53427,19 @@ public void Validation_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -47335,6 +53464,19 @@ public void CopyConstructor_Works() TransactionID = "627199945183184", }, PendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4", + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardFuelConfirmationType.CardFuelConfirmation, UpdatedAuthorizationAmount = 120, }; @@ -47555,6 +53697,342 @@ public void CopyConstructor_Works() } } +public class CardFuelConfirmationSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardFuelConfirmationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardFuelConfirmationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardFuelConfirmationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardFuelConfirmationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardFuelConfirmationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardFuelConfirmationSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardFuelConfirmationSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardFuelConfirmationSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works( + CardPayments::CardFuelConfirmationSchemeFeeCurrency rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardFuelConfirmationSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationInternational + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardFuelConfirmationSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationInternational + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardFuelConfirmationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardFuelConfirmationSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works( + CardPayments::CardFuelConfirmationSchemeFeeFeeType rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardFuelConfirmationTypeTest : TestBase { [Theory] @@ -47645,6 +54123,19 @@ public void FieldRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -47682,6 +54173,18 @@ public void FieldRoundtrip_Works() string expectedPendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4"; long expectedPresentmentAmount = 20; string expectedPresentmentCurrency = "USD"; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; ApiEnum expectedType = CardPayments::CardIncrementType.CardIncrement; long expectedUpdatedAuthorizationAmount = 120; @@ -47699,6 +54202,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedType, model.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, model.UpdatedAuthorizationAmount); } @@ -47739,6 +54247,19 @@ public void SerializationRoundtrip_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -47788,6 +54309,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -47832,6 +54366,18 @@ public void FieldRoundtripThroughSerialization_Works() string expectedPendingTransactionID = "pending_transaction_k1sfetcau2qbvjbzgju4"; long expectedPresentmentAmount = 20; string expectedPresentmentCurrency = "USD"; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; ApiEnum expectedType = CardPayments::CardIncrementType.CardIncrement; long expectedUpdatedAuthorizationAmount = 120; @@ -47849,6 +54395,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentAmount, deserialized.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, deserialized.UpdatedAuthorizationAmount); } @@ -47889,6 +54440,19 @@ public void Validation_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -47932,6 +54496,19 @@ public void CopyConstructor_Works() PresentmentAmount = 20, PresentmentCurrency = "USD", RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Type = CardPayments::CardIncrementType.CardIncrement, UpdatedAuthorizationAmount = 120, }; @@ -49328,6 +55905,314 @@ public void CopyConstructor_Works() } } +public class CardIncrementSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardIncrementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardIncrementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardIncrementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardIncrementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardIncrementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardIncrementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardIncrementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardIncrementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardIncrementSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardIncrementSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardIncrementSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardIncrementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardIncrementSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardIncrementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardIncrementSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardIncrementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData( + CardPayments::CardIncrementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardIncrementSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardIncrementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardIncrementTypeTest : TestBase { [Theory] @@ -49505,6 +56390,18 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -49629,6 +56526,18 @@ public void FieldRoundtrip_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = CardPayments::CardRefundType.CardRefund; @@ -49650,6 +56559,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, model.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); } @@ -49775,6 +56689,18 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -49909,6 +56835,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -50040,6 +56978,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = CardPayments::CardRefundType.CardRefund; @@ -50061,6 +57011,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentAmount, deserialized.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, deserialized.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); } @@ -50186,6 +57141,18 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -50314,6 +57281,18 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardRefundType.CardRefund, }; @@ -53356,6 +60335,306 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardRefundSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardRefundSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardRefundSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardRefundSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardRefundSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardRefundSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardRefundSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardRefundSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardRefundSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardRefundSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardRefundSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardRefundSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardRefundSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardRefundSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardRefundTypeTest : TestBase { [Theory] @@ -53440,6 +60719,18 @@ public void FieldRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -53472,6 +60763,18 @@ public void FieldRoundtrip_Works() long expectedReversalPresentmentAmount = 20; ApiEnum expectedReversalReason = CardPayments::ReversalReason.ReversedByCustomer; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardReversalType.CardReversal; @@ -53495,6 +60798,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedReversalAmount, model.ReversalAmount); Assert.Equal(expectedReversalPresentmentAmount, model.ReversalPresentmentAmount); Assert.Equal(expectedReversalReason, model.ReversalReason); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedType, model.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, model.UpdatedAuthorizationAmount); @@ -53532,6 +60840,18 @@ public void SerializationRoundtrip_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -53575,6 +60895,18 @@ public void FieldRoundtripThroughSerialization_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -53614,6 +60946,18 @@ public void FieldRoundtripThroughSerialization_Works() long expectedReversalPresentmentAmount = 20; ApiEnum expectedReversalReason = CardPayments::ReversalReason.ReversedByCustomer; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardReversalType.CardReversal; @@ -53637,6 +60981,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedReversalAmount, deserialized.ReversalAmount); Assert.Equal(expectedReversalPresentmentAmount, deserialized.ReversalPresentmentAmount); Assert.Equal(expectedReversalReason, deserialized.ReversalReason); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedUpdatedAuthorizationAmount, deserialized.UpdatedAuthorizationAmount); @@ -53674,6 +61023,18 @@ public void Validation_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -53711,6 +61072,18 @@ public void CopyConstructor_Works() ReversalAmount = 20, ReversalPresentmentAmount = 20, ReversalReason = CardPayments::ReversalReason.ReversedByCustomer, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardReversalType.CardReversal, UpdatedAuthorizationAmount = 80, @@ -53995,6 +61368,310 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardReversalSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardReversalSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardReversalSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardReversalSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardReversalSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardReversalSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardReversalSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardReversalSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardReversalSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardReversalSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardReversalSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardReversalSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardReversalSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardReversalSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardReversalSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardReversalSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardReversalSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardReversalSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(CardPayments::CardReversalSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardReversalSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardReversalTypeTest : TestBase { [Theory] @@ -54189,6 +61866,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -54327,6 +62017,18 @@ public void FieldRoundtrip_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; CardPayments::CardSettlementSurcharge expectedSurcharge = new() { Amount = 0, @@ -54356,6 +62058,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, model.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedSurcharge, model.Surcharge); Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); @@ -54499,6 +62206,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -54651,6 +62371,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -54796,6 +62529,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; CardPayments::CardSettlementSurcharge expectedSurcharge = new() { Amount = 0, @@ -54825,6 +62570,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentAmount, deserialized.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, deserialized.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedSurcharge, deserialized.Surcharge); Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); @@ -54968,6 +62718,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -55114,6 +62877,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = CardPayments::CardSettlementType.CardSettlement, @@ -58656,6 +66432,322 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardSettlementSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardSettlementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardSettlementSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardSettlementSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardSettlementSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardSettlementSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardSettlementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardSettlementSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardSettlementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardSettlementSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardSettlementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardSettlementSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardSettlementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardSettlementSurchargeTest : TestBase { [Fact] @@ -58833,6 +66925,19 @@ public void FieldRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -58907,6 +67012,18 @@ public void FieldRoundtrip_Works() TransactionID = "627199945183184", }; long expectedNetworkRiskScore = 10; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardValidationType.InboundCardValidation; @@ -58950,6 +67067,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedNetworkRiskScore, model.NetworkRiskScore); Assert.Null(model.PhysicalCardID); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedType, model.Type); Assert.Equal(expectedVerification, model.Verification); @@ -59010,6 +67132,19 @@ public void SerializationRoundtrip_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -59099,6 +67234,19 @@ public void FieldRoundtripThroughSerialization_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -59180,6 +67328,18 @@ public void FieldRoundtripThroughSerialization_Works() TransactionID = "627199945183184", }; long expectedNetworkRiskScore = 10; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = CardPayments::CardValidationType.InboundCardValidation; @@ -59223,6 +67383,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedNetworkRiskScore, deserialized.NetworkRiskScore); Assert.Null(deserialized.PhysicalCardID); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedVerification, deserialized.Verification); @@ -59283,6 +67448,19 @@ public void Validation_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -59366,6 +67544,19 @@ public void CopyConstructor_Works() NetworkRiskScore = 10, PhysicalCardID = null, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = CardPayments::CardValidationType.InboundCardValidation, Verification = new() @@ -61586,6 +69777,322 @@ public void CopyConstructor_Works() } } +public class CardValidationSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new CardPayments::CardValidationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardValidationSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new CardPayments::CardValidationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new CardPayments::CardValidationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + CardPayments::CardValidationSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new CardPayments::CardValidationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new CardPayments::CardValidationSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = CardPayments::CardValidationSchemeFeeCurrency.Usd, + FeeType = CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + CardPayments::CardValidationSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardValidationSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(CardPayments::CardValidationSchemeFeeCurrency.Usd)] + public void Validation_Works(CardPayments::CardValidationSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(CardPayments::CardValidationSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(CardPayments::CardValidationSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardValidationSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(CardPayments::CardValidationSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + CardPayments::CardValidationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(CardPayments::CardValidationSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(CardPayments::CardValidationSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardValidationTypeTest : TestBase { [Theory] @@ -62334,296 +70841,6 @@ public void CopyConstructor_Works() } } -public class SchemeFeeTest : TestBase -{ - [Fact] - public void FieldRoundtrip_Works() - { - var model = new CardPayments::SchemeFee - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }; - - string expectedAmount = "0.137465"; - DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); - ApiEnum expectedCurrency = - CardPayments::SchemeFeeCurrency.Usd; - ApiEnum expectedFeeType = - CardPayments::FeeType.VisaCorporateAcceptanceFee; - string expectedVariableRate = "0.0002"; - - Assert.Equal(expectedAmount, model.Amount); - Assert.Equal(expectedCreatedAt, model.CreatedAt); - Assert.Equal(expectedCurrency, model.Currency); - Assert.Equal(expectedFeeType, model.FeeType); - Assert.Null(model.FixedComponent); - Assert.Equal(expectedVariableRate, model.VariableRate); - } - - [Fact] - public void SerializationRoundtrip_Works() - { - var model = new CardPayments::SchemeFee - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }; - - string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(model, deserialized); - } - - [Fact] - public void FieldRoundtripThroughSerialization_Works() - { - var model = new CardPayments::SchemeFee - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }; - - string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize( - element, - ModelBase.SerializerOptions - ); - Assert.NotNull(deserialized); - - string expectedAmount = "0.137465"; - DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); - ApiEnum expectedCurrency = - CardPayments::SchemeFeeCurrency.Usd; - ApiEnum expectedFeeType = - CardPayments::FeeType.VisaCorporateAcceptanceFee; - string expectedVariableRate = "0.0002"; - - Assert.Equal(expectedAmount, deserialized.Amount); - Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); - Assert.Equal(expectedCurrency, deserialized.Currency); - Assert.Equal(expectedFeeType, deserialized.FeeType); - Assert.Null(deserialized.FixedComponent); - Assert.Equal(expectedVariableRate, deserialized.VariableRate); - } - - [Fact] - public void Validation_Works() - { - var model = new CardPayments::SchemeFee - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }; - - model.Validate(); - } - - [Fact] - public void CopyConstructor_Works() - { - var model = new CardPayments::SchemeFee - { - Amount = "0.137465", - CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), - Currency = CardPayments::SchemeFeeCurrency.Usd, - FeeType = CardPayments::FeeType.VisaCorporateAcceptanceFee, - FixedComponent = null, - VariableRate = "0.0002", - }; - - CardPayments::SchemeFee copied = new(model); - - Assert.Equal(model, copied); - } -} - -public class SchemeFeeCurrencyTest : TestBase -{ - [Theory] - [InlineData(CardPayments::SchemeFeeCurrency.Usd)] - public void Validation_Works(CardPayments::SchemeFeeCurrency rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - value.Validate(); - } - - [Fact] - public void InvalidEnumValidationThrows_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - - Assert.NotNull(value); - Assert.Throws(() => value.Validate()); - } - - [Theory] - [InlineData(CardPayments::SchemeFeeCurrency.Usd)] - public void SerializationRoundtrip_Works(CardPayments::SchemeFeeCurrency rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize< - ApiEnum - >(json, ModelBase.SerializerOptions); - - Assert.Equal(value, deserialized); - } - - [Fact] - public void InvalidEnumSerializationRoundtrip_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize< - ApiEnum - >(json, ModelBase.SerializerOptions); - - Assert.Equal(value, deserialized); - } -} - -public class FeeTypeTest : TestBase -{ - [Theory] - [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] - [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] - [InlineData(CardPayments::FeeType.VisaAuthorizationDomesticPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationInternationalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationCanadaPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationReversalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationAddressVerificationService)] - [InlineData(CardPayments::FeeType.VisaAdvancedAuthorization)] - [InlineData(CardPayments::FeeType.VisaMessageTransmission)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationDomestic)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationInternational)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationCanada)] - [InlineData(CardPayments::FeeType.VisaCorporateAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaConsumerDebitAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaBusinessDebitAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaPurchasingAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaPurchaseDomestic)] - [InlineData(CardPayments::FeeType.VisaPurchaseInternational)] - [InlineData(CardPayments::FeeType.VisaCreditPurchaseToken)] - [InlineData(CardPayments::FeeType.VisaDebitPurchaseToken)] - [InlineData(CardPayments::FeeType.VisaClearingTransmission)] - [InlineData(CardPayments::FeeType.VisaDirectAuthorization)] - [InlineData(CardPayments::FeeType.VisaDirectTransactionDomestic)] - [InlineData(CardPayments::FeeType.VisaServiceCommercialCredit)] - [InlineData(CardPayments::FeeType.VisaAdvertisingServiceCommercialCredit)] - [InlineData(CardPayments::FeeType.VisaCommunityGrowthAccelerationProgram)] - [InlineData(CardPayments::FeeType.VisaProcessingGuaranteeCommercialCredit)] - [InlineData(CardPayments::FeeType.PulseSwitchFee)] - public void Validation_Works(CardPayments::FeeType rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - value.Validate(); - } - - [Fact] - public void InvalidEnumValidationThrows_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - - Assert.NotNull(value); - Assert.Throws(() => value.Validate()); - } - - [Theory] - [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] - [InlineData(CardPayments::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] - [InlineData(CardPayments::FeeType.VisaAuthorizationDomesticPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationInternationalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationCanadaPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationReversalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] - [InlineData(CardPayments::FeeType.VisaAuthorizationAddressVerificationService)] - [InlineData(CardPayments::FeeType.VisaAdvancedAuthorization)] - [InlineData(CardPayments::FeeType.VisaMessageTransmission)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationDomestic)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationInternational)] - [InlineData(CardPayments::FeeType.VisaAccountVerificationCanada)] - [InlineData(CardPayments::FeeType.VisaCorporateAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaConsumerDebitAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaBusinessDebitAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaPurchasingAcceptanceFee)] - [InlineData(CardPayments::FeeType.VisaPurchaseDomestic)] - [InlineData(CardPayments::FeeType.VisaPurchaseInternational)] - [InlineData(CardPayments::FeeType.VisaCreditPurchaseToken)] - [InlineData(CardPayments::FeeType.VisaDebitPurchaseToken)] - [InlineData(CardPayments::FeeType.VisaClearingTransmission)] - [InlineData(CardPayments::FeeType.VisaDirectAuthorization)] - [InlineData(CardPayments::FeeType.VisaDirectTransactionDomestic)] - [InlineData(CardPayments::FeeType.VisaServiceCommercialCredit)] - [InlineData(CardPayments::FeeType.VisaAdvertisingServiceCommercialCredit)] - [InlineData(CardPayments::FeeType.VisaCommunityGrowthAccelerationProgram)] - [InlineData(CardPayments::FeeType.VisaProcessingGuaranteeCommercialCredit)] - [InlineData(CardPayments::FeeType.PulseSwitchFee)] - public void SerializationRoundtrip_Works(CardPayments::FeeType rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } - - [Fact] - public void InvalidEnumSerializationRoundtrip_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } -} - public class StateTest : TestBase { [Fact] diff --git a/src/Increase.Api.Tests/Models/CardPushTransfers/CardPushTransferCreateParamsTest.cs b/src/Increase.Api.Tests/Models/CardPushTransfers/CardPushTransferCreateParamsTest.cs index 778ed11..8bd7199 100644 --- a/src/Increase.Api.Tests/Models/CardPushTransfers/CardPushTransferCreateParamsTest.cs +++ b/src/Increase.Api.Tests/Models/CardPushTransfers/CardPushTransferCreateParamsTest.cs @@ -29,6 +29,12 @@ public void FieldRoundtrip_Works() SenderAddressState = "NY", SenderName = "Ian Crease", SourceAccountNumberID = "account_number_v18nkfqm6afpsrvy82b2", + MerchantLegalBusinessName = "x", + MerchantStreetAddress = "x", + RecipientAddressCity = "x", + RecipientAddressLine1 = "x", + RecipientAddressPostalCode = "x", + RecipientAddressState = "x", RequireApproval = true, }; @@ -53,6 +59,12 @@ public void FieldRoundtrip_Works() string expectedSenderAddressState = "NY"; string expectedSenderName = "Ian Crease"; string expectedSourceAccountNumberID = "account_number_v18nkfqm6afpsrvy82b2"; + string expectedMerchantLegalBusinessName = "x"; + string expectedMerchantStreetAddress = "x"; + string expectedRecipientAddressCity = "x"; + string expectedRecipientAddressLine1 = "x"; + string expectedRecipientAddressPostalCode = "x"; + string expectedRecipientAddressState = "x"; bool expectedRequireApproval = true; Assert.Equal( @@ -74,6 +86,12 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedSenderAddressState, parameters.SenderAddressState); Assert.Equal(expectedSenderName, parameters.SenderName); Assert.Equal(expectedSourceAccountNumberID, parameters.SourceAccountNumberID); + Assert.Equal(expectedMerchantLegalBusinessName, parameters.MerchantLegalBusinessName); + Assert.Equal(expectedMerchantStreetAddress, parameters.MerchantStreetAddress); + Assert.Equal(expectedRecipientAddressCity, parameters.RecipientAddressCity); + Assert.Equal(expectedRecipientAddressLine1, parameters.RecipientAddressLine1); + Assert.Equal(expectedRecipientAddressPostalCode, parameters.RecipientAddressPostalCode); + Assert.Equal(expectedRecipientAddressState, parameters.RecipientAddressState); Assert.Equal(expectedRequireApproval, parameters.RequireApproval); } @@ -100,6 +118,18 @@ public void OptionalNonNullableParamsUnsetAreNotSet_Works() SourceAccountNumberID = "account_number_v18nkfqm6afpsrvy82b2", }; + Assert.Null(parameters.MerchantLegalBusinessName); + Assert.False(parameters.RawBodyData.ContainsKey("merchant_legal_business_name")); + Assert.Null(parameters.MerchantStreetAddress); + Assert.False(parameters.RawBodyData.ContainsKey("merchant_street_address")); + Assert.Null(parameters.RecipientAddressCity); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_city")); + Assert.Null(parameters.RecipientAddressLine1); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_line1")); + Assert.Null(parameters.RecipientAddressPostalCode); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_postal_code")); + Assert.Null(parameters.RecipientAddressState); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_state")); Assert.Null(parameters.RequireApproval); Assert.False(parameters.RawBodyData.ContainsKey("require_approval")); } @@ -127,9 +157,27 @@ public void OptionalNonNullableParamsSetToNullAreNotSet_Works() SourceAccountNumberID = "account_number_v18nkfqm6afpsrvy82b2", // Null should be interpreted as omitted for these properties + MerchantLegalBusinessName = null, + MerchantStreetAddress = null, + RecipientAddressCity = null, + RecipientAddressLine1 = null, + RecipientAddressPostalCode = null, + RecipientAddressState = null, RequireApproval = null, }; + Assert.Null(parameters.MerchantLegalBusinessName); + Assert.False(parameters.RawBodyData.ContainsKey("merchant_legal_business_name")); + Assert.Null(parameters.MerchantStreetAddress); + Assert.False(parameters.RawBodyData.ContainsKey("merchant_street_address")); + Assert.Null(parameters.RecipientAddressCity); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_city")); + Assert.Null(parameters.RecipientAddressLine1); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_line1")); + Assert.Null(parameters.RecipientAddressPostalCode); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_postal_code")); + Assert.Null(parameters.RecipientAddressState); + Assert.False(parameters.RawBodyData.ContainsKey("recipient_address_state")); Assert.Null(parameters.RequireApproval); Assert.False(parameters.RawBodyData.ContainsKey("require_approval")); } @@ -183,6 +231,12 @@ public void CopyConstructor_Works() SenderAddressState = "NY", SenderName = "Ian Crease", SourceAccountNumberID = "account_number_v18nkfqm6afpsrvy82b2", + MerchantLegalBusinessName = "x", + MerchantStreetAddress = "x", + RecipientAddressCity = "x", + RecipientAddressLine1 = "x", + RecipientAddressPostalCode = "x", + RecipientAddressState = "x", RequireApproval = true, }; diff --git a/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositListPageResponseTest.cs b/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositListPageResponseTest.cs index 3fe2724..6bd0ad2 100644 --- a/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositListPageResponseTest.cs @@ -38,7 +38,7 @@ public void FieldRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -116,7 +116,7 @@ public void FieldRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -206,7 +206,7 @@ public void SerializationRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -298,7 +298,7 @@ public void FieldRoundtripThroughSerialization_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -383,7 +383,7 @@ public void FieldRoundtripThroughSerialization_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -473,7 +473,7 @@ public void Validation_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -559,7 +559,7 @@ public void CopyConstructor_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], diff --git a/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositTest.cs b/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositTest.cs index 1f14b83..82053da 100644 --- a/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositTest.cs +++ b/src/Increase.Api.Tests/Models/CheckDeposits/CheckDepositTest.cs @@ -35,7 +35,7 @@ public void FieldRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -106,7 +106,7 @@ public void FieldRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ]; @@ -204,7 +204,7 @@ public void SerializationRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -289,7 +289,7 @@ public void FieldRoundtripThroughSerialization_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -367,7 +367,7 @@ public void FieldRoundtripThroughSerialization_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ]; @@ -465,7 +465,7 @@ public void Validation_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -544,7 +544,7 @@ public void CopyConstructor_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }, ], @@ -794,13 +794,14 @@ public void FieldRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }; DateTimeOffset expectedAdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); long expectedAmount = 1750; - ApiEnum expectedReason = CheckDeposits::Reason.LateReturn; + ApiEnum expectedReason = + CheckDeposits::Reason.AdjustedAmount; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; Assert.Equal(expectedAdjustedAt, model.AdjustedAt); @@ -816,7 +817,7 @@ public void SerializationRoundtrip_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }; @@ -836,7 +837,7 @@ public void FieldRoundtripThroughSerialization_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }; @@ -849,7 +850,8 @@ public void FieldRoundtripThroughSerialization_Works() DateTimeOffset expectedAdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); long expectedAmount = 1750; - ApiEnum expectedReason = CheckDeposits::Reason.LateReturn; + ApiEnum expectedReason = + CheckDeposits::Reason.AdjustedAmount; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; Assert.Equal(expectedAdjustedAt, deserialized.AdjustedAt); @@ -865,7 +867,7 @@ public void Validation_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }; @@ -879,7 +881,7 @@ public void CopyConstructor_Works() { AdjustedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Amount = 1750, - Reason = CheckDeposits::Reason.LateReturn, + Reason = CheckDeposits::Reason.AdjustedAmount, TransactionID = "transaction_uyrp7fld2ium70oa7oi", }; @@ -892,8 +894,6 @@ public void CopyConstructor_Works() public class ReasonTest : TestBase { [Theory] - [InlineData(CheckDeposits::Reason.LateReturn)] - [InlineData(CheckDeposits::Reason.WrongPayeeCredit)] [InlineData(CheckDeposits::Reason.AdjustedAmount)] [InlineData(CheckDeposits::Reason.NonConformingItem)] [InlineData(CheckDeposits::Reason.Paid)] @@ -917,8 +917,6 @@ public void InvalidEnumValidationThrows_Works() } [Theory] - [InlineData(CheckDeposits::Reason.LateReturn)] - [InlineData(CheckDeposits::Reason.WrongPayeeCredit)] [InlineData(CheckDeposits::Reason.AdjustedAmount)] [InlineData(CheckDeposits::Reason.NonConformingItem)] [InlineData(CheckDeposits::Reason.Paid)] diff --git a/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionListPageResponseTest.cs b/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionListPageResponseTest.cs index 2ae2f7b..5157458 100644 --- a/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionListPageResponseTest.cs @@ -104,6 +104,19 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -270,6 +283,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -447,6 +472,19 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -628,6 +666,19 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -802,6 +853,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -979,6 +1042,19 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1153,6 +1229,19 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { diff --git a/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionTest.cs b/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionTest.cs index 4ded7f3..8d98fa2 100644 --- a/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionTest.cs +++ b/src/Increase.Api.Tests/Models/DeclinedTransactions/DeclinedTransactionTest.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; using System.Text.Json; using Increase.Api.Core; using Increase.Api.Exceptions; @@ -100,6 +101,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -260,6 +273,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -434,6 +459,18 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -606,6 +643,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -773,6 +822,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -947,6 +1008,18 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1113,6 +1186,18 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1386,6 +1471,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1531,6 +1628,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1696,6 +1805,18 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1855,6 +1976,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2007,6 +2140,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2175,6 +2320,18 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2420,6 +2577,18 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2745,9 +2914,9 @@ public class ReasonTest : TestBase [InlineData(DeclinedTransactions::Reason.EntityNotActive)] [InlineData(DeclinedTransactions::Reason.GroupLocked)] [InlineData(DeclinedTransactions::Reason.TransactionNotAllowed)] + [InlineData(DeclinedTransactions::Reason.ReturnedPerOdfiRequest)] [InlineData(DeclinedTransactions::Reason.UserInitiated)] [InlineData(DeclinedTransactions::Reason.InsufficientFunds)] - [InlineData(DeclinedTransactions::Reason.ReturnedPerOdfiRequest)] [InlineData(DeclinedTransactions::Reason.AuthorizationRevokedByCustomer)] [InlineData(DeclinedTransactions::Reason.PaymentStopped)] [InlineData( @@ -2786,9 +2955,9 @@ public void InvalidEnumValidationThrows_Works() [InlineData(DeclinedTransactions::Reason.EntityNotActive)] [InlineData(DeclinedTransactions::Reason.GroupLocked)] [InlineData(DeclinedTransactions::Reason.TransactionNotAllowed)] + [InlineData(DeclinedTransactions::Reason.ReturnedPerOdfiRequest)] [InlineData(DeclinedTransactions::Reason.UserInitiated)] [InlineData(DeclinedTransactions::Reason.InsufficientFunds)] - [InlineData(DeclinedTransactions::Reason.ReturnedPerOdfiRequest)] [InlineData(DeclinedTransactions::Reason.AuthorizationRevokedByCustomer)] [InlineData(DeclinedTransactions::Reason.PaymentStopped)] [InlineData( @@ -2951,6 +3120,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3030,6 +3211,18 @@ public void FieldRoundtrip_Works() DeclinedTransactions::ProcessingCategory.Purchase; ApiEnum expectedReason = DeclinedTransactions::CardDeclineReason.InsufficientFunds; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; DeclinedTransactions::Verification expectedVerification = new() { @@ -3078,6 +3271,11 @@ public void FieldRoundtrip_Works() Assert.Null(model.RealTimeDecisionID); Assert.Null(model.RealTimeDecisionReason); Assert.Equal(expectedReason, model.Reason); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedVerification, model.Verification); } @@ -3145,6 +3343,18 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3239,6 +3449,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3325,6 +3547,18 @@ public void FieldRoundtripThroughSerialization_Works() DeclinedTransactions::ProcessingCategory.Purchase; ApiEnum expectedReason = DeclinedTransactions::CardDeclineReason.InsufficientFunds; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; DeclinedTransactions::Verification expectedVerification = new() { @@ -3373,6 +3607,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Null(deserialized.RealTimeDecisionID); Assert.Null(deserialized.RealTimeDecisionReason); Assert.Equal(expectedReason, deserialized.Reason); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedVerification, deserialized.Verification); } @@ -3440,6 +3679,18 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -3528,6 +3779,18 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -5583,6 +5846,292 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class SchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new DeclinedTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + DeclinedTransactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new DeclinedTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new DeclinedTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + DeclinedTransactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new DeclinedTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new DeclinedTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + DeclinedTransactions::SchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class SchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(DeclinedTransactions::SchemeFeeCurrency.Usd)] + public void Validation_Works(DeclinedTransactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(DeclinedTransactions::SchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(DeclinedTransactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class FeeTypeTest : TestBase +{ + [Theory] + [InlineData(DeclinedTransactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(DeclinedTransactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(DeclinedTransactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(DeclinedTransactions::FeeType.VisaMessageTransmission)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchaseDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchaseInternational)] + [InlineData(DeclinedTransactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(DeclinedTransactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(DeclinedTransactions::FeeType.VisaClearingTransmission)] + [InlineData(DeclinedTransactions::FeeType.VisaDirectAuthorization)] + [InlineData(DeclinedTransactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(DeclinedTransactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.PulseSwitchFee)] + public void Validation_Works(DeclinedTransactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(DeclinedTransactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(DeclinedTransactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(DeclinedTransactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(DeclinedTransactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(DeclinedTransactions::FeeType.VisaMessageTransmission)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(DeclinedTransactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchaseDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaPurchaseInternational)] + [InlineData(DeclinedTransactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(DeclinedTransactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(DeclinedTransactions::FeeType.VisaClearingTransmission)] + [InlineData(DeclinedTransactions::FeeType.VisaDirectAuthorization)] + [InlineData(DeclinedTransactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(DeclinedTransactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(DeclinedTransactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(DeclinedTransactions::FeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(DeclinedTransactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class VerificationTest : TestBase { [Fact] diff --git a/src/Increase.Api.Tests/Models/Entities/EntityCreateParamsTest.cs b/src/Increase.Api.Tests/Models/Entities/EntityCreateParamsTest.cs index 765b1f5..1b03f22 100644 --- a/src/Increase.Api.Tests/Models/Entities/EntityCreateParamsTest.cs +++ b/src/Increase.Api.Tests/Models/Entities/EntityCreateParamsTest.cs @@ -20,10 +20,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "x", Line1 = "33 Liberty Street", + Line2 = "x", State = "NY", Zip = "10045", - Line2 = "x", }, BeneficialOwners = [ @@ -74,8 +75,12 @@ public void FieldRoundtrip_Works() CompanyTitle = "CEO", }, ], + LegalIdentifier = new() + { + Value = "602214076", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -95,7 +100,7 @@ public void FieldRoundtrip_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -107,10 +112,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -149,10 +155,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -222,10 +229,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -266,10 +274,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -311,10 +320,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "x", Line1 = "33 Liberty Street", + Line2 = "x", State = "NY", Zip = "10045", - Line2 = "x", }, BeneficialOwners = [ @@ -365,8 +375,12 @@ public void FieldRoundtrip_Works() CompanyTitle = "CEO", }, ], + LegalIdentifier = new() + { + Value = "602214076", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -386,7 +400,7 @@ public void FieldRoundtrip_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -398,10 +412,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -440,10 +455,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -520,10 +536,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -564,10 +581,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -715,10 +733,11 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "x", Line1 = "33 Liberty Street", + Line2 = "x", State = "NY", Zip = "10045", - Line2 = "x", }, BeneficialOwners = [ @@ -769,8 +788,12 @@ public void CopyConstructor_Works() CompanyTitle = "CEO", }, ], + LegalIdentifier = new() + { + Value = "602214076", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -790,7 +813,7 @@ public void CopyConstructor_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -802,10 +825,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -844,10 +868,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -917,10 +942,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -961,10 +987,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -1080,10 +1107,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1134,8 +1162,12 @@ public void FieldRoundtrip_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -1147,10 +1179,11 @@ public void FieldRoundtrip_Works() Address expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; List expectedBeneficialOwners = [ @@ -1201,8 +1234,12 @@ public void FieldRoundtrip_Works() CompanyTitle = "x", }, ]; + LegalIdentifier expectedLegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; string expectedName = "x"; - string expectedTaxIdentifier = "x"; ApiEnum< string, BeneficialOwnershipExemptionReason @@ -1219,8 +1256,8 @@ public void FieldRoundtrip_Works() { Assert.Equal(expectedBeneficialOwners[i], model.BeneficialOwners[i]); } + Assert.Equal(expectedLegalIdentifier, model.LegalIdentifier); Assert.Equal(expectedName, model.Name); - Assert.Equal(expectedTaxIdentifier, model.TaxIdentifier); Assert.Equal( expectedBeneficialOwnershipExemptionReason, model.BeneficialOwnershipExemptionReason @@ -1239,10 +1276,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1293,8 +1331,12 @@ public void SerializationRoundtrip_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -1320,10 +1362,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1374,8 +1417,12 @@ public void FieldRoundtripThroughSerialization_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -1394,10 +1441,11 @@ public void FieldRoundtripThroughSerialization_Works() Address expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; List expectedBeneficialOwners = [ @@ -1448,8 +1496,12 @@ public void FieldRoundtripThroughSerialization_Works() CompanyTitle = "x", }, ]; + LegalIdentifier expectedLegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; string expectedName = "x"; - string expectedTaxIdentifier = "x"; ApiEnum< string, BeneficialOwnershipExemptionReason @@ -1466,8 +1518,8 @@ public void FieldRoundtripThroughSerialization_Works() { Assert.Equal(expectedBeneficialOwners[i], deserialized.BeneficialOwners[i]); } + Assert.Equal(expectedLegalIdentifier, deserialized.LegalIdentifier); Assert.Equal(expectedName, deserialized.Name); - Assert.Equal(expectedTaxIdentifier, deserialized.TaxIdentifier); Assert.Equal( expectedBeneficialOwnershipExemptionReason, deserialized.BeneficialOwnershipExemptionReason @@ -1486,10 +1538,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1540,8 +1593,12 @@ public void Validation_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -1561,10 +1618,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1615,8 +1673,12 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; Assert.Null(model.BeneficialOwnershipExemptionReason); @@ -1639,10 +1701,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1693,8 +1756,12 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; model.Validate(); @@ -1708,10 +1775,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1762,8 +1830,12 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", // Null should be interpreted as omitted for these properties BeneficialOwnershipExemptionReason = null, @@ -1793,10 +1865,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1847,8 +1920,12 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", // Null should be interpreted as omitted for these properties BeneficialOwnershipExemptionReason = null, @@ -1869,10 +1946,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, BeneficialOwners = [ @@ -1923,8 +2001,12 @@ public void CopyConstructor_Works() CompanyTitle = "x", }, ], + LegalIdentifier = new() + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", BeneficialOwnershipExemptionReason = BeneficialOwnershipExemptionReason.RegulatedFinancialInstitution, Email = "dev@stainless.com", @@ -1947,23 +2029,26 @@ public void FieldRoundtrip_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -1972,10 +2057,11 @@ public void SerializationRoundtrip_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -1990,10 +2076,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -2004,16 +2091,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -2022,10 +2111,11 @@ public void Validation_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -2037,13 +2127,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -2052,9 +2145,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -2066,16 +2158,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -2084,12 +2181,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -2101,10 +2199,11 @@ public void CopyConstructor_Works() var model = new Address { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; Address copied = new(model); @@ -4296,6 +4395,196 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class LegalIdentifierTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new LegalIdentifier + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; + + string expectedValue = "x"; + ApiEnum expectedCategory = Category.UsEmployerIdentificationNumber; + + Assert.Equal(expectedValue, model.Value); + Assert.Equal(expectedCategory, model.Category); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new LegalIdentifier + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new LegalIdentifier + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedValue = "x"; + ApiEnum expectedCategory = Category.UsEmployerIdentificationNumber; + + Assert.Equal(expectedValue, deserialized.Value); + Assert.Equal(expectedCategory, deserialized.Category); + } + + [Fact] + public void Validation_Works() + { + var model = new LegalIdentifier + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; + + model.Validate(); + } + + [Fact] + public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() + { + var model = new LegalIdentifier { Value = "x" }; + + Assert.Null(model.Category); + Assert.False(model.RawData.ContainsKey("category")); + } + + [Fact] + public void OptionalNonNullablePropertiesUnsetValidation_Works() + { + var model = new LegalIdentifier { Value = "x" }; + + model.Validate(); + } + + [Fact] + public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() + { + var model = new LegalIdentifier + { + Value = "x", + + // Null should be interpreted as omitted for these properties + Category = null, + }; + + Assert.Null(model.Category); + Assert.False(model.RawData.ContainsKey("category")); + } + + [Fact] + public void OptionalNonNullablePropertiesSetToNullValidation_Works() + { + var model = new LegalIdentifier + { + Value = "x", + + // Null should be interpreted as omitted for these properties + Category = null, + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new LegalIdentifier + { + Value = "x", + Category = Category.UsEmployerIdentificationNumber, + }; + + LegalIdentifier copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CategoryTest : TestBase +{ + [Theory] + [InlineData(Category.UsEmployerIdentificationNumber)] + [InlineData(Category.Other)] + public void Validation_Works(Category rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Category.UsEmployerIdentificationNumber)] + [InlineData(Category.Other)] + public void SerializationRoundtrip_Works(Category rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } +} + public class BeneficialOwnershipExemptionReasonTest : TestBase { [Theory] @@ -4372,7 +4661,7 @@ public void FieldRoundtrip_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -4387,7 +4676,8 @@ public void FieldRoundtrip_Works() Line2 = "x", }; List expectedAuthorizedPersons = [new("x")]; - ApiEnum expectedCategory = Category.Municipality; + ApiEnum expectedCategory = + GovernmentAuthorityCategory.Municipality; string expectedName = "x"; string expectedTaxIdentifier = "x"; string expectedWebsite = "website"; @@ -4418,7 +4708,7 @@ public void SerializationRoundtrip_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -4447,7 +4737,7 @@ public void FieldRoundtripThroughSerialization_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -4469,7 +4759,8 @@ public void FieldRoundtripThroughSerialization_Works() Line2 = "x", }; List expectedAuthorizedPersons = [new("x")]; - ApiEnum expectedCategory = Category.Municipality; + ApiEnum expectedCategory = + GovernmentAuthorityCategory.Municipality; string expectedName = "x"; string expectedTaxIdentifier = "x"; string expectedWebsite = "website"; @@ -4500,7 +4791,7 @@ public void Validation_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -4523,7 +4814,7 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", }; @@ -4546,7 +4837,7 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", }; @@ -4568,7 +4859,7 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", @@ -4594,7 +4885,7 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", @@ -4619,7 +4910,7 @@ public void CopyConstructor_Works() Line2 = "x", }, AuthorizedPersons = [new("x")], - Category = Category.Municipality, + Category = GovernmentAuthorityCategory.Municipality, Name = "x", TaxIdentifier = "x", Website = "website", @@ -4870,24 +5161,24 @@ public void CopyConstructor_Works() } } -public class CategoryTest : TestBase +public class GovernmentAuthorityCategoryTest : TestBase { [Theory] - [InlineData(Category.Municipality)] - [InlineData(Category.StateAgency)] - [InlineData(Category.StateGovernment)] - [InlineData(Category.FederalAgency)] - public void Validation_Works(Category rawValue) + [InlineData(GovernmentAuthorityCategory.Municipality)] + [InlineData(GovernmentAuthorityCategory.StateAgency)] + [InlineData(GovernmentAuthorityCategory.StateGovernment)] + [InlineData(GovernmentAuthorityCategory.FederalAgency)] + public void Validation_Works(GovernmentAuthorityCategory rawValue) { // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; + ApiEnum value = rawValue; value.Validate(); } [Fact] public void InvalidEnumValidationThrows_Works() { - var value = JsonSerializer.Deserialize>( + var value = JsonSerializer.Deserialize>( JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions ); @@ -4897,17 +5188,17 @@ public void InvalidEnumValidationThrows_Works() } [Theory] - [InlineData(Category.Municipality)] - [InlineData(Category.StateAgency)] - [InlineData(Category.StateGovernment)] - [InlineData(Category.FederalAgency)] - public void SerializationRoundtrip_Works(Category rawValue) + [InlineData(GovernmentAuthorityCategory.Municipality)] + [InlineData(GovernmentAuthorityCategory.StateAgency)] + [InlineData(GovernmentAuthorityCategory.StateGovernment)] + [InlineData(GovernmentAuthorityCategory.FederalAgency)] + public void SerializationRoundtrip_Works(GovernmentAuthorityCategory rawValue) { // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; + ApiEnum value = rawValue; string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( + var deserialized = JsonSerializer.Deserialize>( json, ModelBase.SerializerOptions ); @@ -4918,12 +5209,12 @@ public void SerializationRoundtrip_Works(Category rawValue) [Fact] public void InvalidEnumSerializationRoundtrip_Works() { - var value = JsonSerializer.Deserialize>( + var value = JsonSerializer.Deserialize>( JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions ); string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( + var deserialized = JsonSerializer.Deserialize>( json, ModelBase.SerializerOptions ); @@ -4946,10 +5237,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -4991,10 +5283,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5047,10 +5340,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5103,10 +5397,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5152,10 +5447,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5208,10 +5504,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5261,10 +5558,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5315,10 +5613,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5354,10 +5653,11 @@ public void FieldRoundtrip_Works() JointIndividualAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; JointIndividualIdentification expectedIdentification = new() @@ -5404,10 +5704,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5457,10 +5758,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5503,10 +5805,11 @@ public void FieldRoundtripThroughSerialization_Works() JointIndividualAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; JointIndividualIdentification expectedIdentification = new() @@ -5553,10 +5856,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5600,10 +5904,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5647,10 +5952,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5693,10 +5999,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5743,10 +6050,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5792,10 +6100,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -5842,23 +6151,26 @@ public void FieldRoundtrip_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -5867,10 +6179,11 @@ public void SerializationRoundtrip_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -5888,10 +6201,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -5902,16 +6216,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -5920,10 +6236,11 @@ public void Validation_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -5935,13 +6252,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -5950,9 +6270,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -5964,16 +6283,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -5982,12 +6306,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -5999,10 +6324,11 @@ public void CopyConstructor_Works() var model = new JointIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; JointIndividualAddress copied = new(model); @@ -6828,10 +7154,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -6867,10 +7194,11 @@ public void FieldRoundtrip_Works() NaturalPersonAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; NaturalPersonIdentification expectedIdentification = new() @@ -6917,10 +7245,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -6970,10 +7299,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7016,10 +7346,11 @@ public void FieldRoundtripThroughSerialization_Works() NaturalPersonAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; NaturalPersonIdentification expectedIdentification = new() @@ -7066,10 +7397,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7113,10 +7445,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7160,10 +7493,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7206,10 +7540,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7256,10 +7591,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7305,10 +7641,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -7355,23 +7692,26 @@ public void FieldRoundtrip_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -7380,10 +7720,11 @@ public void SerializationRoundtrip_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -7401,10 +7742,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -7415,16 +7757,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -7433,10 +7777,11 @@ public void Validation_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -7448,13 +7793,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -7463,9 +7811,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -7477,16 +7824,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -7495,12 +7847,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -7512,10 +7865,11 @@ public void CopyConstructor_Works() var model = new NaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; NaturalPersonAddress copied = new(model); @@ -8793,10 +9147,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -8837,10 +9192,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -8895,10 +9251,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -8939,10 +9296,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9015,10 +9373,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9059,10 +9418,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9128,10 +9488,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9172,10 +9533,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9234,10 +9596,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9278,10 +9641,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9354,10 +9718,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9398,10 +9763,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9464,10 +9830,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9538,10 +9905,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9605,10 +9973,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9685,10 +10054,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9758,10 +10128,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -9802,10 +10173,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10094,10 +10466,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10137,10 +10510,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10188,10 +10562,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10242,10 +10617,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10292,10 +10668,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10343,10 +10720,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10440,10 +10818,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10549,10 +10928,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10588,10 +10968,11 @@ public void FieldRoundtrip_Works() TrusteeIndividualAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; TrusteeIndividualIdentification expectedIdentification = new() @@ -10638,10 +11019,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10691,10 +11073,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10737,10 +11120,11 @@ public void FieldRoundtripThroughSerialization_Works() TrusteeIndividualAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; TrusteeIndividualIdentification expectedIdentification = new() @@ -10787,10 +11171,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10834,10 +11219,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10881,10 +11267,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10927,10 +11314,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -10977,10 +11365,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -11026,10 +11415,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -11076,23 +11466,26 @@ public void FieldRoundtrip_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -11101,10 +11494,11 @@ public void SerializationRoundtrip_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -11122,10 +11516,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -11136,16 +11531,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -11154,10 +11551,11 @@ public void Validation_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -11169,13 +11567,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -11184,9 +11585,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -11198,16 +11598,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -11216,12 +11621,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -11233,10 +11639,11 @@ public void CopyConstructor_Works() var model = new TrusteeIndividualAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; TrusteeIndividualAddress copied = new(model); @@ -12064,10 +12471,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12103,10 +12511,11 @@ public void FieldRoundtrip_Works() GrantorAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; GrantorIdentification expectedIdentification = new() @@ -12153,10 +12562,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12203,10 +12613,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12249,10 +12660,11 @@ public void FieldRoundtripThroughSerialization_Works() GrantorAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedDateOfBirth = "2019-12-27"; GrantorIdentification expectedIdentification = new() @@ -12299,10 +12711,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12346,10 +12759,11 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12393,10 +12807,11 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12439,10 +12854,11 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12489,10 +12905,11 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12538,10 +12955,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, DateOfBirth = "2019-12-27", Identification = new() @@ -12588,23 +13006,26 @@ public void FieldRoundtrip_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -12613,10 +13034,11 @@ public void SerializationRoundtrip_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -12634,10 +13056,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -12648,16 +13071,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -12666,10 +13091,11 @@ public void Validation_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -12681,13 +13107,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -12696,9 +13125,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -12710,16 +13138,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -12728,12 +13161,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -12745,10 +13179,11 @@ public void CopyConstructor_Works() var model = new GrantorAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; GrantorAddress copied = new(model); diff --git a/src/Increase.Api.Tests/Models/Entities/EntityListPageResponseTest.cs b/src/Increase.Api.Tests/Models/Entities/EntityListPageResponseTest.cs index 7f71a98..bd01b0d 100644 --- a/src/Increase.Api.Tests/Models/Entities/EntityListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/Entities/EntityListPageResponseTest.cs @@ -24,6 +24,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -65,8 +66,13 @@ public void FieldRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -77,6 +83,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -101,6 +108,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -123,6 +131,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -174,6 +183,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -187,6 +197,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -212,6 +223,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -265,6 +277,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -306,8 +319,13 @@ public void FieldRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -318,6 +336,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -342,6 +361,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -364,6 +384,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -415,6 +436,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -428,6 +450,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -453,6 +476,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -518,6 +542,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -559,8 +584,13 @@ public void SerializationRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -571,6 +601,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -595,6 +626,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -617,6 +649,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -668,6 +701,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -681,6 +715,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -706,6 +741,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -773,6 +809,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -814,8 +851,13 @@ public void FieldRoundtripThroughSerialization_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -826,6 +868,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -850,6 +893,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -872,6 +916,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -923,6 +968,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -936,6 +982,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -961,6 +1008,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1021,6 +1069,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1062,8 +1111,13 @@ public void FieldRoundtripThroughSerialization_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -1074,6 +1128,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1098,6 +1153,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1120,6 +1176,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1171,6 +1228,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1184,6 +1242,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1209,6 +1268,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1274,6 +1334,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1315,8 +1376,13 @@ public void Validation_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -1327,6 +1393,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1351,6 +1418,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1373,6 +1441,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1424,6 +1493,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1437,6 +1507,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1462,6 +1533,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1523,6 +1595,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1564,8 +1637,13 @@ public void CopyConstructor_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -1576,6 +1654,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1600,6 +1679,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1622,6 +1702,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1673,6 +1754,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1686,6 +1768,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1711,6 +1794,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", diff --git a/src/Increase.Api.Tests/Models/Entities/EntityTest.cs b/src/Increase.Api.Tests/Models/Entities/EntityTest.cs index 10fee25..d59f674 100644 --- a/src/Increase.Api.Tests/Models/Entities/EntityTest.cs +++ b/src/Increase.Api.Tests/Models/Entities/EntityTest.cs @@ -21,6 +21,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -62,8 +63,13 @@ public void FieldRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -74,6 +80,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -98,6 +105,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -120,6 +128,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -170,6 +179,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -183,6 +193,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -208,6 +219,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -254,6 +266,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -295,8 +308,13 @@ public void FieldRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }; DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); @@ -305,6 +323,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -328,6 +347,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -350,6 +370,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -401,6 +422,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -414,6 +436,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -438,6 +461,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -516,6 +540,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -557,8 +582,13 @@ public void SerializationRoundtrip_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -569,6 +599,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -593,6 +624,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -615,6 +647,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -665,6 +698,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -678,6 +712,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -703,6 +738,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -763,6 +799,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -804,8 +841,13 @@ public void FieldRoundtripThroughSerialization_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -816,6 +858,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -840,6 +883,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -862,6 +906,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -912,6 +957,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -925,6 +971,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -950,6 +997,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1003,6 +1051,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1044,8 +1093,13 @@ public void FieldRoundtripThroughSerialization_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }; DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); @@ -1054,6 +1108,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1077,6 +1132,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1099,6 +1155,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1150,6 +1207,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1163,6 +1221,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1187,6 +1246,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1265,6 +1325,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1306,8 +1367,13 @@ public void Validation_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -1318,6 +1384,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1342,6 +1409,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1364,6 +1432,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1414,6 +1483,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1427,6 +1497,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1452,6 +1523,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1506,6 +1578,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1547,8 +1620,13 @@ public void CopyConstructor_Works() Email = null, IncorporationState = "NY", IndustryCode = null, + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "602214076", + }, Name = "National Phonograph Company", - TaxIdentifier = "602214076", Website = "https://example.com", }, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), @@ -1559,6 +1637,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1583,6 +1662,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1605,6 +1685,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1655,6 +1736,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1668,6 +1750,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1693,6 +1776,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1749,6 +1833,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1790,14 +1875,20 @@ public void FieldRoundtrip_Works() Email = "email", IncorporationState = "incorporation_state", IndustryCode = "industry_code", + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }, Name = "name", - TaxIdentifier = "tax_identifier", Website = "website", }; Entities::EntityCorporationAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1839,8 +1930,13 @@ public void FieldRoundtrip_Works() string expectedEmail = "email"; string expectedIncorporationState = "incorporation_state"; string expectedIndustryCode = "industry_code"; + Entities::EntityCorporationLegalIdentifier expectedLegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; string expectedName = "name"; - string expectedTaxIdentifier = "tax_identifier"; string expectedWebsite = "website"; Assert.Equal(expectedAddress, model.Address); @@ -1852,8 +1948,8 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedEmail, model.Email); Assert.Equal(expectedIncorporationState, model.IncorporationState); Assert.Equal(expectedIndustryCode, model.IndustryCode); + Assert.Equal(expectedLegalIdentifier, model.LegalIdentifier); Assert.Equal(expectedName, model.Name); - Assert.Equal(expectedTaxIdentifier, model.TaxIdentifier); Assert.Equal(expectedWebsite, model.Website); } @@ -1865,6 +1961,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1906,8 +2003,13 @@ public void SerializationRoundtrip_Works() Email = "email", IncorporationState = "incorporation_state", IndustryCode = "industry_code", + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }, Name = "name", - TaxIdentifier = "tax_identifier", Website = "website", }; @@ -1928,6 +2030,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -1969,8 +2072,13 @@ public void FieldRoundtripThroughSerialization_Works() Email = "email", IncorporationState = "incorporation_state", IndustryCode = "industry_code", + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }, Name = "name", - TaxIdentifier = "tax_identifier", Website = "website", }; @@ -1984,6 +2092,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityCorporationAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2025,8 +2134,13 @@ public void FieldRoundtripThroughSerialization_Works() string expectedEmail = "email"; string expectedIncorporationState = "incorporation_state"; string expectedIndustryCode = "industry_code"; + Entities::EntityCorporationLegalIdentifier expectedLegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; string expectedName = "name"; - string expectedTaxIdentifier = "tax_identifier"; string expectedWebsite = "website"; Assert.Equal(expectedAddress, deserialized.Address); @@ -2038,8 +2152,8 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedEmail, deserialized.Email); Assert.Equal(expectedIncorporationState, deserialized.IncorporationState); Assert.Equal(expectedIndustryCode, deserialized.IndustryCode); + Assert.Equal(expectedLegalIdentifier, deserialized.LegalIdentifier); Assert.Equal(expectedName, deserialized.Name); - Assert.Equal(expectedTaxIdentifier, deserialized.TaxIdentifier); Assert.Equal(expectedWebsite, deserialized.Website); } @@ -2051,6 +2165,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2092,8 +2207,13 @@ public void Validation_Works() Email = "email", IncorporationState = "incorporation_state", IndustryCode = "industry_code", + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }, Name = "name", - TaxIdentifier = "tax_identifier", Website = "website", }; @@ -2108,6 +2228,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2149,8 +2270,13 @@ public void CopyConstructor_Works() Email = "email", IncorporationState = "incorporation_state", IndustryCode = "industry_code", + LegalIdentifier = new() + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }, Name = "name", - TaxIdentifier = "tax_identifier", Website = "website", }; @@ -2168,6 +2294,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityCorporationAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2175,11 +2302,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -2192,6 +2321,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityCorporationAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2213,6 +2343,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityCorporationAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2227,11 +2358,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -2244,6 +2377,7 @@ public void Validation_Works() var model = new Entities::EntityCorporationAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -2259,6 +2393,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityCorporationAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3116,6 +3251,155 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class EntityCorporationLegalIdentifierTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new Entities::EntityCorporationLegalIdentifier + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; + + ApiEnum expectedCategory = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber; + string expectedValue = "value"; + + Assert.Equal(expectedCategory, model.Category); + Assert.Equal(expectedValue, model.Value); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new Entities::EntityCorporationLegalIdentifier + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new Entities::EntityCorporationLegalIdentifier + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + ApiEnum expectedCategory = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber; + string expectedValue = "value"; + + Assert.Equal(expectedCategory, deserialized.Category); + Assert.Equal(expectedValue, deserialized.Value); + } + + [Fact] + public void Validation_Works() + { + var model = new Entities::EntityCorporationLegalIdentifier + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new Entities::EntityCorporationLegalIdentifier + { + Category = + Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + Value = "value", + }; + + Entities::EntityCorporationLegalIdentifier copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class EntityCorporationLegalIdentifierCategoryTest : TestBase +{ + [Theory] + [InlineData(Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber)] + [InlineData(Entities::EntityCorporationLegalIdentifierCategory.Other)] + public void Validation_Works(Entities::EntityCorporationLegalIdentifierCategory rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Entities::EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber)] + [InlineData(Entities::EntityCorporationLegalIdentifierCategory.Other)] + public void SerializationRoundtrip_Works( + Entities::EntityCorporationLegalIdentifierCategory rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class EntityGovernmentAuthorityTest : TestBase { [Fact] @@ -3126,6 +3410,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3144,6 +3429,7 @@ public void FieldRoundtrip_Works() Entities::EntityGovernmentAuthorityAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3179,6 +3465,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3211,6 +3498,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3236,6 +3524,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityGovernmentAuthorityAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3271,6 +3560,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3297,6 +3587,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3326,6 +3617,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityGovernmentAuthorityAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3333,11 +3625,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -3350,6 +3644,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityGovernmentAuthorityAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3371,6 +3666,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityGovernmentAuthorityAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3385,11 +3681,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -3402,6 +3700,7 @@ public void Validation_Works() var model = new Entities::EntityGovernmentAuthorityAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3417,6 +3716,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityGovernmentAuthorityAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3589,6 +3889,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3614,6 +3915,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3651,6 +3953,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3690,6 +3993,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3722,6 +4026,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3759,6 +4064,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3792,6 +4098,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3826,6 +4133,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3843,6 +4151,7 @@ public void FieldRoundtrip_Works() Entities::EntityJointIndividualAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3870,6 +4179,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3901,6 +4211,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3925,6 +4236,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityJointIndividualAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3952,6 +4264,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -3977,6 +4290,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4005,6 +4319,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityJointIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4012,11 +4327,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -4029,6 +4346,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityJointIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4050,6 +4368,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityJointIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4064,11 +4383,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -4081,6 +4402,7 @@ public void Validation_Works() var model = new Entities::EntityJointIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4096,6 +4418,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityJointIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4274,6 +4597,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4291,6 +4615,7 @@ public void FieldRoundtrip_Works() Entities::EntityNaturalPersonAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4318,6 +4643,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4349,6 +4675,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4373,6 +4700,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityNaturalPersonAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4400,6 +4728,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4425,6 +4754,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4453,6 +4783,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityNaturalPersonAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4460,11 +4791,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -4477,6 +4810,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityNaturalPersonAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4498,6 +4832,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityNaturalPersonAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4512,11 +4847,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -4529,6 +4866,7 @@ public void Validation_Works() var model = new Entities::EntityNaturalPersonAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -4544,6 +4882,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityNaturalPersonAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5233,6 +5572,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5246,6 +5586,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5270,6 +5611,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5292,6 +5634,7 @@ public void FieldRoundtrip_Works() Entities::EntityTrustAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5306,6 +5649,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5330,6 +5674,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5370,6 +5715,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5383,6 +5729,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5407,6 +5754,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5443,6 +5791,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5456,6 +5805,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5480,6 +5830,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5509,6 +5860,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityTrustAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5523,6 +5875,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5547,6 +5900,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5587,6 +5941,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5600,6 +5955,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5624,6 +5980,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5654,6 +6011,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5667,6 +6025,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5691,6 +6050,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5724,6 +6084,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityTrustAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5731,11 +6092,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -5748,6 +6111,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityTrustAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5769,6 +6133,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityTrustAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5783,11 +6148,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -5800,6 +6167,7 @@ public void Validation_Works() var model = new Entities::EntityTrustAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5815,6 +6183,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityTrustAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5893,6 +6262,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5910,6 +6280,7 @@ public void FieldRoundtrip_Works() Entities::EntityTrustGrantorAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5937,6 +6308,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5968,6 +6340,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -5992,6 +6365,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityTrustGrantorAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6019,6 +6393,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6044,6 +6419,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6072,6 +6448,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityTrustGrantorAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6079,11 +6456,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -6096,6 +6475,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityTrustGrantorAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6117,6 +6497,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityTrustGrantorAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6131,11 +6512,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -6148,6 +6531,7 @@ public void Validation_Works() var model = new Entities::EntityTrustGrantorAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6163,6 +6547,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityTrustGrantorAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6341,6 +6726,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6363,6 +6749,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6394,6 +6781,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6430,6 +6818,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6459,6 +6848,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6490,6 +6880,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6520,6 +6911,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6553,6 +6945,7 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6571,6 +6964,7 @@ public void FieldRoundtrip_Works() Entities::EntityTrustTrusteeIndividualAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6599,6 +6993,7 @@ public void SerializationRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6631,6 +7026,7 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6656,6 +7052,7 @@ public void FieldRoundtripThroughSerialization_Works() Entities::EntityTrustTrusteeIndividualAddress expectedAddress = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6684,6 +7081,7 @@ public void Validation_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6710,6 +7108,7 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6739,6 +7138,7 @@ public void FieldRoundtrip_Works() var model = new Entities::EntityTrustTrusteeIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6746,11 +7146,13 @@ public void FieldRoundtrip_Works() }; string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); Assert.Null(model.Line2); Assert.Equal(expectedState, model.State); @@ -6763,6 +7165,7 @@ public void SerializationRoundtrip_Works() var model = new Entities::EntityTrustTrusteeIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6785,6 +7188,7 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Entities::EntityTrustTrusteeIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6800,11 +7204,13 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "New York"; + string expectedCountry = "US"; string expectedLine1 = "33 Liberty Street"; string expectedState = "NY"; string expectedZip = "10045"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); Assert.Null(deserialized.Line2); Assert.Equal(expectedState, deserialized.State); @@ -6817,6 +7223,7 @@ public void Validation_Works() var model = new Entities::EntityTrustTrusteeIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", @@ -6832,6 +7239,7 @@ public void CopyConstructor_Works() var model = new Entities::EntityTrustTrusteeIndividualAddress { City = "New York", + Country = "US", Line1 = "33 Liberty Street", Line2 = null, State = "NY", diff --git a/src/Increase.Api.Tests/Models/Entities/EntityUpdateParamsTest.cs b/src/Increase.Api.Tests/Models/Entities/EntityUpdateParamsTest.cs index bc06dd8..3383ca8 100644 --- a/src/Increase.Api.Tests/Models/Entities/EntityUpdateParamsTest.cs +++ b/src/Increase.Api.Tests/Models/Entities/EntityUpdateParamsTest.cs @@ -19,16 +19,22 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", + Line2 = "Unit 2", State = "NY", Zip = "10045", - Line2 = "Unit 2", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }, DetailsConfirmedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"), GovernmentAuthority = new() @@ -48,10 +54,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }, @@ -85,16 +92,22 @@ public void FieldRoundtrip_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", + Line2 = "Unit 2", State = "NY", Zip = "10045", - Line2 = "Unit 2", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; DateTimeOffset expectedDetailsConfirmedAt = DateTimeOffset.Parse( "2019-12-27T18:11:19.117Z" @@ -116,10 +129,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -231,16 +245,22 @@ public void CopyConstructor_Works() Address = new() { City = "New York", + Country = "US", Line1 = "33 Liberty Street", + Line2 = "Unit 2", State = "NY", Zip = "10045", - Line2 = "Unit 2", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }, DetailsConfirmedAt = DateTimeOffset.Parse("2019-12-27T18:11:19.117Z"), GovernmentAuthority = new() @@ -260,10 +280,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }, @@ -307,38 +328,50 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; EntityUpdateParamsCorporationAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedEmail = "dev@stainless.com"; string expectedIncorporationState = "x"; string expectedIndustryCode = "x"; + EntityUpdateParamsCorporationLegalIdentifier expectedLegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; string expectedName = "x"; - string expectedTaxIdentifier = "x"; Assert.Equal(expectedAddress, model.Address); Assert.Equal(expectedEmail, model.Email); Assert.Equal(expectedIncorporationState, model.IncorporationState); Assert.Equal(expectedIndustryCode, model.IndustryCode); + Assert.Equal(expectedLegalIdentifier, model.LegalIdentifier); Assert.Equal(expectedName, model.Name); - Assert.Equal(expectedTaxIdentifier, model.TaxIdentifier); } [Fact] @@ -349,16 +382,22 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -378,16 +417,22 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -400,23 +445,29 @@ public void FieldRoundtripThroughSerialization_Works() EntityUpdateParamsCorporationAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedEmail = "dev@stainless.com"; string expectedIncorporationState = "x"; string expectedIndustryCode = "x"; + EntityUpdateParamsCorporationLegalIdentifier expectedLegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; string expectedName = "x"; - string expectedTaxIdentifier = "x"; Assert.Equal(expectedAddress, deserialized.Address); Assert.Equal(expectedEmail, deserialized.Email); Assert.Equal(expectedIncorporationState, deserialized.IncorporationState); Assert.Equal(expectedIndustryCode, deserialized.IndustryCode); + Assert.Equal(expectedLegalIdentifier, deserialized.LegalIdentifier); Assert.Equal(expectedName, deserialized.Name); - Assert.Equal(expectedTaxIdentifier, deserialized.TaxIdentifier); } [Fact] @@ -427,16 +478,22 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; model.Validate(); @@ -455,10 +512,10 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() Assert.False(model.RawData.ContainsKey("incorporation_state")); Assert.Null(model.IndustryCode); Assert.False(model.RawData.ContainsKey("industry_code")); + Assert.Null(model.LegalIdentifier); + Assert.False(model.RawData.ContainsKey("legal_identifier")); Assert.Null(model.Name); Assert.False(model.RawData.ContainsKey("name")); - Assert.Null(model.TaxIdentifier); - Assert.False(model.RawData.ContainsKey("tax_identifier")); } [Fact] @@ -479,8 +536,8 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Email = null, IncorporationState = null, IndustryCode = null, + LegalIdentifier = null, Name = null, - TaxIdentifier = null, }; Assert.Null(model.Address); @@ -491,10 +548,10 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() Assert.False(model.RawData.ContainsKey("incorporation_state")); Assert.Null(model.IndustryCode); Assert.False(model.RawData.ContainsKey("industry_code")); + Assert.Null(model.LegalIdentifier); + Assert.False(model.RawData.ContainsKey("legal_identifier")); Assert.Null(model.Name); Assert.False(model.RawData.ContainsKey("name")); - Assert.Null(model.TaxIdentifier); - Assert.False(model.RawData.ContainsKey("tax_identifier")); } [Fact] @@ -507,8 +564,8 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() Email = null, IncorporationState = null, IndustryCode = null, + LegalIdentifier = null, Name = null, - TaxIdentifier = null, }; model.Validate(); @@ -522,16 +579,22 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Email = "dev@stainless.com", IncorporationState = "x", IndustryCode = "x", + LegalIdentifier = new() + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }, Name = "x", - TaxIdentifier = "x", }; EntityUpdateParamsCorporation copied = new(model); @@ -548,23 +611,26 @@ public void FieldRoundtrip_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -573,10 +639,11 @@ public void SerializationRoundtrip_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -594,10 +661,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -608,16 +676,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -626,10 +696,11 @@ public void Validation_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -641,13 +712,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -656,9 +730,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -670,16 +743,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -688,12 +766,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -705,10 +784,11 @@ public void CopyConstructor_Works() var model = new EntityUpdateParamsCorporationAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; EntityUpdateParamsCorporationAddress copied = new(model); @@ -717,6 +797,205 @@ public void CopyConstructor_Works() } } +public class EntityUpdateParamsCorporationLegalIdentifierTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; + + string expectedValue = "x"; + ApiEnum expectedCategory = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber; + + Assert.Equal(expectedValue, model.Value); + Assert.Equal(expectedCategory, model.Category); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedValue = "x"; + ApiEnum expectedCategory = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber; + + Assert.Equal(expectedValue, deserialized.Value); + Assert.Equal(expectedCategory, deserialized.Category); + } + + [Fact] + public void Validation_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; + + model.Validate(); + } + + [Fact] + public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier { Value = "x" }; + + Assert.Null(model.Category); + Assert.False(model.RawData.ContainsKey("category")); + } + + [Fact] + public void OptionalNonNullablePropertiesUnsetValidation_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier { Value = "x" }; + + model.Validate(); + } + + [Fact] + public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + + // Null should be interpreted as omitted for these properties + Category = null, + }; + + Assert.Null(model.Category); + Assert.False(model.RawData.ContainsKey("category")); + } + + [Fact] + public void OptionalNonNullablePropertiesSetToNullValidation_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + + // Null should be interpreted as omitted for these properties + Category = null, + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new EntityUpdateParamsCorporationLegalIdentifier + { + Value = "x", + Category = + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + }; + + EntityUpdateParamsCorporationLegalIdentifier copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class EntityUpdateParamsCorporationLegalIdentifierCategoryTest : TestBase +{ + [Theory] + [InlineData( + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber + )] + [InlineData(EntityUpdateParamsCorporationLegalIdentifierCategory.Other)] + public void Validation_Works(EntityUpdateParamsCorporationLegalIdentifierCategory rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber + )] + [InlineData(EntityUpdateParamsCorporationLegalIdentifierCategory.Other)] + public void SerializationRoundtrip_Works( + EntityUpdateParamsCorporationLegalIdentifierCategory rawValue + ) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class EntityUpdateParamsGovernmentAuthorityTest : TestBase { [Fact] @@ -1087,10 +1366,11 @@ public void FieldRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -1098,10 +1378,11 @@ public void FieldRoundtrip_Works() EntityUpdateParamsNaturalPersonAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedName = "x"; @@ -1117,10 +1398,11 @@ public void SerializationRoundtrip_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -1142,10 +1424,11 @@ public void FieldRoundtripThroughSerialization_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -1160,10 +1443,11 @@ public void FieldRoundtripThroughSerialization_Works() EntityUpdateParamsNaturalPersonAddress expectedAddress = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedName = "x"; @@ -1179,10 +1463,11 @@ public void Validation_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -1246,10 +1531,11 @@ public void CopyConstructor_Works() Address = new() { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }, Name = "x", }; @@ -1268,23 +1554,26 @@ public void FieldRoundtrip_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, model.City); + Assert.Equal(expectedCountry, model.Country); Assert.Equal(expectedLine1, model.Line1); + Assert.Equal(expectedLine2, model.Line2); Assert.Equal(expectedState, model.State); Assert.Equal(expectedZip, model.Zip); - Assert.Equal(expectedLine2, model.Line2); } [Fact] @@ -1293,10 +1582,11 @@ public void SerializationRoundtrip_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -1314,10 +1604,11 @@ public void FieldRoundtripThroughSerialization_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); @@ -1328,16 +1619,18 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedCity = "x"; + string expectedCountry = "x"; string expectedLine1 = "x"; + string expectedLine2 = "x"; string expectedState = "x"; string expectedZip = "x"; - string expectedLine2 = "x"; Assert.Equal(expectedCity, deserialized.City); + Assert.Equal(expectedCountry, deserialized.Country); Assert.Equal(expectedLine1, deserialized.Line1); + Assert.Equal(expectedLine2, deserialized.Line2); Assert.Equal(expectedState, deserialized.State); Assert.Equal(expectedZip, deserialized.Zip); - Assert.Equal(expectedLine2, deserialized.Line2); } [Fact] @@ -1346,10 +1639,11 @@ public void Validation_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; model.Validate(); @@ -1361,13 +1655,16 @@ public void OptionalNonNullablePropertiesUnsetAreNotSet_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -1376,9 +1673,8 @@ public void OptionalNonNullablePropertiesUnsetValidation_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", }; model.Validate(); @@ -1390,16 +1686,21 @@ public void OptionalNonNullablePropertiesSetToNullAreNotSet_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; Assert.Null(model.Line2); Assert.False(model.RawData.ContainsKey("line2")); + Assert.Null(model.State); + Assert.False(model.RawData.ContainsKey("state")); + Assert.Null(model.Zip); + Assert.False(model.RawData.ContainsKey("zip")); } [Fact] @@ -1408,12 +1709,13 @@ public void OptionalNonNullablePropertiesSetToNullValidation_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", - State = "x", - Zip = "x", // Null should be interpreted as omitted for these properties Line2 = null, + State = null, + Zip = null, }; model.Validate(); @@ -1425,10 +1727,11 @@ public void CopyConstructor_Works() var model = new EntityUpdateParamsNaturalPersonAddress { City = "x", + Country = "x", Line1 = "x", + Line2 = "x", State = "x", Zip = "x", - Line2 = "x", }; EntityUpdateParamsNaturalPersonAddress copied = new(model); diff --git a/src/Increase.Api.Tests/Models/Groups/GroupTest.cs b/src/Increase.Api.Tests/Models/Groups/GroupTest.cs index 5401ddc..cad2bfb 100644 --- a/src/Increase.Api.Tests/Models/Groups/GroupTest.cs +++ b/src/Increase.Api.Tests/Models/Groups/GroupTest.cs @@ -14,23 +14,15 @@ public void FieldRoundtrip_Works() var model = new Groups::Group { ID = "group_1g4mhziu6kvrs3vz35um", - AchDebitStatus = Groups::AchDebitStatus.Disabled, - ActivationStatus = Groups::ActivationStatus.Activated, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Type = Groups::Type.Group, }; string expectedID = "group_1g4mhziu6kvrs3vz35um"; - ApiEnum expectedAchDebitStatus = - Groups::AchDebitStatus.Disabled; - ApiEnum expectedActivationStatus = - Groups::ActivationStatus.Activated; DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); ApiEnum expectedType = Groups::Type.Group; Assert.Equal(expectedID, model.ID); - Assert.Equal(expectedAchDebitStatus, model.AchDebitStatus); - Assert.Equal(expectedActivationStatus, model.ActivationStatus); Assert.Equal(expectedCreatedAt, model.CreatedAt); Assert.Equal(expectedType, model.Type); } @@ -41,8 +33,6 @@ public void SerializationRoundtrip_Works() var model = new Groups::Group { ID = "group_1g4mhziu6kvrs3vz35um", - AchDebitStatus = Groups::AchDebitStatus.Disabled, - ActivationStatus = Groups::ActivationStatus.Activated, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Type = Groups::Type.Group, }; @@ -62,8 +52,6 @@ public void FieldRoundtripThroughSerialization_Works() var model = new Groups::Group { ID = "group_1g4mhziu6kvrs3vz35um", - AchDebitStatus = Groups::AchDebitStatus.Disabled, - ActivationStatus = Groups::ActivationStatus.Activated, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Type = Groups::Type.Group, }; @@ -76,16 +64,10 @@ public void FieldRoundtripThroughSerialization_Works() Assert.NotNull(deserialized); string expectedID = "group_1g4mhziu6kvrs3vz35um"; - ApiEnum expectedAchDebitStatus = - Groups::AchDebitStatus.Disabled; - ApiEnum expectedActivationStatus = - Groups::ActivationStatus.Activated; DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); ApiEnum expectedType = Groups::Type.Group; Assert.Equal(expectedID, deserialized.ID); - Assert.Equal(expectedAchDebitStatus, deserialized.AchDebitStatus); - Assert.Equal(expectedActivationStatus, deserialized.ActivationStatus); Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); Assert.Equal(expectedType, deserialized.Type); } @@ -96,8 +78,6 @@ public void Validation_Works() var model = new Groups::Group { ID = "group_1g4mhziu6kvrs3vz35um", - AchDebitStatus = Groups::AchDebitStatus.Disabled, - ActivationStatus = Groups::ActivationStatus.Activated, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Type = Groups::Type.Group, }; @@ -111,8 +91,6 @@ public void CopyConstructor_Works() var model = new Groups::Group { ID = "group_1g4mhziu6kvrs3vz35um", - AchDebitStatus = Groups::AchDebitStatus.Disabled, - ActivationStatus = Groups::ActivationStatus.Activated, CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), Type = Groups::Type.Group, }; @@ -123,122 +101,6 @@ public void CopyConstructor_Works() } } -public class AchDebitStatusTest : TestBase -{ - [Theory] - [InlineData(Groups::AchDebitStatus.Disabled)] - [InlineData(Groups::AchDebitStatus.Enabled)] - public void Validation_Works(Groups::AchDebitStatus rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - value.Validate(); - } - - [Fact] - public void InvalidEnumValidationThrows_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - - Assert.NotNull(value); - Assert.Throws(() => value.Validate()); - } - - [Theory] - [InlineData(Groups::AchDebitStatus.Disabled)] - [InlineData(Groups::AchDebitStatus.Enabled)] - public void SerializationRoundtrip_Works(Groups::AchDebitStatus rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } - - [Fact] - public void InvalidEnumSerializationRoundtrip_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } -} - -public class ActivationStatusTest : TestBase -{ - [Theory] - [InlineData(Groups::ActivationStatus.Unactivated)] - [InlineData(Groups::ActivationStatus.Activated)] - public void Validation_Works(Groups::ActivationStatus rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - value.Validate(); - } - - [Fact] - public void InvalidEnumValidationThrows_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - - Assert.NotNull(value); - Assert.Throws(() => value.Validate()); - } - - [Theory] - [InlineData(Groups::ActivationStatus.Unactivated)] - [InlineData(Groups::ActivationStatus.Activated)] - public void SerializationRoundtrip_Works(Groups::ActivationStatus rawValue) - { - // force implicit conversion because Theory can't do that for us - ApiEnum value = rawValue; - - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } - - [Fact] - public void InvalidEnumSerializationRoundtrip_Works() - { - var value = JsonSerializer.Deserialize>( - JsonSerializer.SerializeToElement("invalid value"), - ModelBase.SerializerOptions - ); - string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); - - Assert.Equal(value, deserialized); - } -} - public class TypeTest : TestBase { [Theory] diff --git a/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferDeclineParamsTest.cs b/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferDeclineParamsTest.cs index f75b5eb..766a1d4 100644 --- a/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferDeclineParamsTest.cs +++ b/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferDeclineParamsTest.cs @@ -88,7 +88,6 @@ public class ReasonTest : TestBase { [Theory] [InlineData(Reason.InsufficientFunds)] - [InlineData(Reason.ReturnedPerOdfiRequest)] [InlineData(Reason.AuthorizationRevokedByCustomer)] [InlineData(Reason.PaymentStopped)] [InlineData(Reason.CustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete)] @@ -118,7 +117,6 @@ public void InvalidEnumValidationThrows_Works() [Theory] [InlineData(Reason.InsufficientFunds)] - [InlineData(Reason.ReturnedPerOdfiRequest)] [InlineData(Reason.AuthorizationRevokedByCustomer)] [InlineData(Reason.PaymentStopped)] [InlineData(Reason.CustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete)] diff --git a/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferTest.cs b/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferTest.cs index f82411e..358dd8d 100644 --- a/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferTest.cs +++ b/src/Increase.Api.Tests/Models/InboundAchTransfers/InboundAchTransferTest.cs @@ -1308,9 +1308,9 @@ public class DeclineReasonTest : TestBase [InlineData(InboundAchTransfers::DeclineReason.EntityNotActive)] [InlineData(InboundAchTransfers::DeclineReason.GroupLocked)] [InlineData(InboundAchTransfers::DeclineReason.TransactionNotAllowed)] + [InlineData(InboundAchTransfers::DeclineReason.ReturnedPerOdfiRequest)] [InlineData(InboundAchTransfers::DeclineReason.UserInitiated)] [InlineData(InboundAchTransfers::DeclineReason.InsufficientFunds)] - [InlineData(InboundAchTransfers::DeclineReason.ReturnedPerOdfiRequest)] [InlineData(InboundAchTransfers::DeclineReason.AuthorizationRevokedByCustomer)] [InlineData(InboundAchTransfers::DeclineReason.PaymentStopped)] [InlineData( @@ -1349,9 +1349,9 @@ public void InvalidEnumValidationThrows_Works() [InlineData(InboundAchTransfers::DeclineReason.EntityNotActive)] [InlineData(InboundAchTransfers::DeclineReason.GroupLocked)] [InlineData(InboundAchTransfers::DeclineReason.TransactionNotAllowed)] + [InlineData(InboundAchTransfers::DeclineReason.ReturnedPerOdfiRequest)] [InlineData(InboundAchTransfers::DeclineReason.UserInitiated)] [InlineData(InboundAchTransfers::DeclineReason.InsufficientFunds)] - [InlineData(InboundAchTransfers::DeclineReason.ReturnedPerOdfiRequest)] [InlineData(InboundAchTransfers::DeclineReason.AuthorizationRevokedByCustomer)] [InlineData(InboundAchTransfers::DeclineReason.PaymentStopped)] [InlineData( diff --git a/src/Increase.Api.Tests/Models/InboundCheckDeposits/InboundCheckDepositTest.cs b/src/Increase.Api.Tests/Models/InboundCheckDeposits/InboundCheckDepositTest.cs index 71ac1bd..f1d2290 100644 --- a/src/Increase.Api.Tests/Models/InboundCheckDeposits/InboundCheckDepositTest.cs +++ b/src/Increase.Api.Tests/Models/InboundCheckDeposits/InboundCheckDepositTest.cs @@ -482,9 +482,6 @@ public class AdjustmentReasonTest : TestBase [Theory] [InlineData(InboundCheckDeposits::AdjustmentReason.LateReturn)] [InlineData(InboundCheckDeposits::AdjustmentReason.WrongPayeeCredit)] - [InlineData(InboundCheckDeposits::AdjustmentReason.AdjustedAmount)] - [InlineData(InboundCheckDeposits::AdjustmentReason.NonConformingItem)] - [InlineData(InboundCheckDeposits::AdjustmentReason.Paid)] public void Validation_Works(InboundCheckDeposits::AdjustmentReason rawValue) { // force implicit conversion because Theory can't do that for us @@ -506,9 +503,6 @@ public void InvalidEnumValidationThrows_Works() [Theory] [InlineData(InboundCheckDeposits::AdjustmentReason.LateReturn)] [InlineData(InboundCheckDeposits::AdjustmentReason.WrongPayeeCredit)] - [InlineData(InboundCheckDeposits::AdjustmentReason.AdjustedAmount)] - [InlineData(InboundCheckDeposits::AdjustmentReason.NonConformingItem)] - [InlineData(InboundCheckDeposits::AdjustmentReason.Paid)] public void SerializationRoundtrip_Works(InboundCheckDeposits::AdjustmentReason rawValue) { // force implicit conversion because Theory can't do that for us diff --git a/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionListPageResponseTest.cs b/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionListPageResponseTest.cs index bf88873..a911300 100644 --- a/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionListPageResponseTest.cs @@ -112,6 +112,19 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -294,6 +307,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -487,6 +512,19 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -685,6 +723,19 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -875,6 +926,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1068,6 +1131,19 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1259,6 +1335,19 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() diff --git a/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionTest.cs b/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionTest.cs index 6a93c7a..17ef90b 100644 --- a/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionTest.cs +++ b/src/Increase.Api.Tests/Models/PendingTransactions/PendingTransactionTest.cs @@ -108,6 +108,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -282,6 +294,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -476,6 +500,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -663,6 +699,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -844,6 +892,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1038,6 +1098,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1219,6 +1291,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1505,6 +1589,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1665,6 +1761,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1865,6 +1973,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -2037,6 +2157,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -2204,6 +2336,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -2404,6 +2548,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -2710,6 +2866,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -3364,6 +3532,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -3443,6 +3623,18 @@ public void FieldRoundtrip_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = PendingTransactions::ProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = PendingTransactions::Type.CardAuthorization; @@ -3490,6 +3682,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, model.ProcessingCategory); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedType, model.Type); Assert.Equal(expectedVerification, model.Verification); @@ -3556,6 +3753,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -3649,6 +3858,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -3735,6 +3956,18 @@ public void FieldRoundtripThroughSerialization_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = PendingTransactions::ProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; ApiEnum expectedType = PendingTransactions::Type.CardAuthorization; @@ -3782,6 +4015,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, deserialized.ProcessingCategory); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedType, deserialized.Type); Assert.Equal(expectedVerification, deserialized.Verification); @@ -3848,6 +4086,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -3935,6 +4185,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -5839,6 +6101,292 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class SchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new PendingTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + PendingTransactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new PendingTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new PendingTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + PendingTransactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + PendingTransactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new PendingTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new PendingTransactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + PendingTransactions::SchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class SchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(PendingTransactions::SchemeFeeCurrency.Usd)] + public void Validation_Works(PendingTransactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(PendingTransactions::SchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(PendingTransactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class FeeTypeTest : TestBase +{ + [Theory] + [InlineData(PendingTransactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(PendingTransactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(PendingTransactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(PendingTransactions::FeeType.VisaMessageTransmission)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(PendingTransactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaPurchaseDomestic)] + [InlineData(PendingTransactions::FeeType.VisaPurchaseInternational)] + [InlineData(PendingTransactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(PendingTransactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(PendingTransactions::FeeType.VisaClearingTransmission)] + [InlineData(PendingTransactions::FeeType.VisaDirectAuthorization)] + [InlineData(PendingTransactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(PendingTransactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(PendingTransactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(PendingTransactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(PendingTransactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(PendingTransactions::FeeType.PulseSwitchFee)] + public void Validation_Works(PendingTransactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(PendingTransactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(PendingTransactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(PendingTransactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(PendingTransactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(PendingTransactions::FeeType.VisaMessageTransmission)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(PendingTransactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(PendingTransactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(PendingTransactions::FeeType.VisaPurchaseDomestic)] + [InlineData(PendingTransactions::FeeType.VisaPurchaseInternational)] + [InlineData(PendingTransactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(PendingTransactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(PendingTransactions::FeeType.VisaClearingTransmission)] + [InlineData(PendingTransactions::FeeType.VisaDirectAuthorization)] + [InlineData(PendingTransactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(PendingTransactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(PendingTransactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(PendingTransactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(PendingTransactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(PendingTransactions::FeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(PendingTransactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class TypeTest : TestBase { [Theory] diff --git a/src/Increase.Api.Tests/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParamsTest.cs b/src/Increase.Api.Tests/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParamsTest.cs index 17de44f..64678f1 100644 --- a/src/Increase.Api.Tests/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParamsTest.cs +++ b/src/Increase.Api.Tests/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParamsTest.cs @@ -16,8 +16,6 @@ public void FieldRoundtrip_Works() UnstructuredRemittanceInformation = "Invoice 29582", AccountNumber = "987654321", DebtorName = "x", - DestinationAccountNumber = "x", - DestinationRoutingNumber = "xxxxxxxxx", ExternalAccountID = "external_account_id", RequireApproval = true, RoutingNumber = "101050001", @@ -31,8 +29,6 @@ public void FieldRoundtrip_Works() string expectedUnstructuredRemittanceInformation = "Invoice 29582"; string expectedAccountNumber = "987654321"; string expectedDebtorName = "x"; - string expectedDestinationAccountNumber = "x"; - string expectedDestinationRoutingNumber = "xxxxxxxxx"; string expectedExternalAccountID = "external_account_id"; bool expectedRequireApproval = true; string expectedRoutingNumber = "101050001"; @@ -48,8 +44,6 @@ public void FieldRoundtrip_Works() ); Assert.Equal(expectedAccountNumber, parameters.AccountNumber); Assert.Equal(expectedDebtorName, parameters.DebtorName); - Assert.Equal(expectedDestinationAccountNumber, parameters.DestinationAccountNumber); - Assert.Equal(expectedDestinationRoutingNumber, parameters.DestinationRoutingNumber); Assert.Equal(expectedExternalAccountID, parameters.ExternalAccountID); Assert.Equal(expectedRequireApproval, parameters.RequireApproval); Assert.Equal(expectedRoutingNumber, parameters.RoutingNumber); @@ -72,10 +66,6 @@ public void OptionalNonNullableParamsUnsetAreNotSet_Works() Assert.False(parameters.RawBodyData.ContainsKey("account_number")); Assert.Null(parameters.DebtorName); Assert.False(parameters.RawBodyData.ContainsKey("debtor_name")); - Assert.Null(parameters.DestinationAccountNumber); - Assert.False(parameters.RawBodyData.ContainsKey("destination_account_number")); - Assert.Null(parameters.DestinationRoutingNumber); - Assert.False(parameters.RawBodyData.ContainsKey("destination_routing_number")); Assert.Null(parameters.ExternalAccountID); Assert.False(parameters.RawBodyData.ContainsKey("external_account_id")); Assert.Null(parameters.RequireApproval); @@ -101,8 +91,6 @@ public void OptionalNonNullableParamsSetToNullAreNotSet_Works() // Null should be interpreted as omitted for these properties AccountNumber = null, DebtorName = null, - DestinationAccountNumber = null, - DestinationRoutingNumber = null, ExternalAccountID = null, RequireApproval = null, RoutingNumber = null, @@ -114,10 +102,6 @@ public void OptionalNonNullableParamsSetToNullAreNotSet_Works() Assert.False(parameters.RawBodyData.ContainsKey("account_number")); Assert.Null(parameters.DebtorName); Assert.False(parameters.RawBodyData.ContainsKey("debtor_name")); - Assert.Null(parameters.DestinationAccountNumber); - Assert.False(parameters.RawBodyData.ContainsKey("destination_account_number")); - Assert.Null(parameters.DestinationRoutingNumber); - Assert.False(parameters.RawBodyData.ContainsKey("destination_routing_number")); Assert.Null(parameters.ExternalAccountID); Assert.False(parameters.RawBodyData.ContainsKey("external_account_id")); Assert.Null(parameters.RequireApproval); @@ -157,8 +141,6 @@ public void CopyConstructor_Works() UnstructuredRemittanceInformation = "Invoice 29582", AccountNumber = "987654321", DebtorName = "x", - DestinationAccountNumber = "x", - DestinationRoutingNumber = "xxxxxxxxx", ExternalAccountID = "external_account_id", RequireApproval = true, RoutingNumber = "101050001", diff --git a/src/Increase.Api.Tests/Models/Simulations/CardAuthorizations/CardAuthorizationCreateResponseTest.cs b/src/Increase.Api.Tests/Models/Simulations/CardAuthorizations/CardAuthorizationCreateResponseTest.cs index 24fce7d..22e6c20 100644 --- a/src/Increase.Api.Tests/Models/Simulations/CardAuthorizations/CardAuthorizationCreateResponseTest.cs +++ b/src/Increase.Api.Tests/Models/Simulations/CardAuthorizations/CardAuthorizationCreateResponseTest.cs @@ -105,6 +105,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -271,6 +283,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -441,6 +465,18 @@ public void FieldRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -607,6 +643,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -787,6 +835,18 @@ public void SerializationRoundtrip_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -953,6 +1013,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1138,6 +1210,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1304,6 +1388,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1482,6 +1578,18 @@ public void FieldRoundtripThroughSerialization_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1648,6 +1756,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -1828,6 +1948,18 @@ public void Validation_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -1994,6 +2126,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() @@ -2172,6 +2316,18 @@ public void CopyConstructor_Works() RealTimeDecisionID = null, RealTimeDecisionReason = null, Reason = DeclinedTransactions::CardDeclineReason.InsufficientFunds, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = DeclinedTransactions::SchemeFeeCurrency.Usd, + FeeType = DeclinedTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Verification = new() { @@ -2338,6 +2494,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = PendingTransactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = PendingTransactions::SchemeFeeCurrency.Usd, + FeeType = PendingTransactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", Type = PendingTransactions::Type.CardAuthorization, Verification = new() diff --git a/src/Increase.Api.Tests/Models/Transactions/TransactionListPageResponseTest.cs b/src/Increase.Api.Tests/Models/Transactions/TransactionListPageResponseTest.cs index 7cca5b3..d980681 100644 --- a/src/Increase.Api.Tests/Models/Transactions/TransactionListPageResponseTest.cs +++ b/src/Increase.Api.Tests/Models/Transactions/TransactionListPageResponseTest.cs @@ -146,6 +146,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -305,6 +317,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -456,6 +481,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -768,6 +806,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -923,6 +973,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -1071,6 +1134,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -1393,6 +1469,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -1552,6 +1640,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -1703,6 +1804,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -2029,6 +2143,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -2188,6 +2314,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -2339,6 +2478,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -2658,6 +2810,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -2813,6 +2977,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -2961,6 +3138,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -3283,6 +3473,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -3442,6 +3644,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -3593,6 +3808,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -3913,6 +4141,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -4072,6 +4312,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -4223,6 +4476,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, diff --git a/src/Increase.Api.Tests/Models/Transactions/TransactionTest.cs b/src/Increase.Api.Tests/Models/Transactions/TransactionTest.cs index b9b6282..c04902e 100644 --- a/src/Increase.Api.Tests/Models/Transactions/TransactionTest.cs +++ b/src/Increase.Api.Tests/Models/Transactions/TransactionTest.cs @@ -142,6 +142,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -295,6 +307,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -441,6 +466,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -744,6 +782,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -894,6 +944,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -1040,6 +1103,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -1354,6 +1430,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -1507,6 +1595,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -1653,6 +1754,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -1969,6 +2083,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -2122,6 +2248,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -2268,6 +2407,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -2578,6 +2730,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -2728,6 +2892,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -2874,6 +3051,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -3188,6 +3378,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -3341,6 +3543,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -3487,6 +3702,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -3797,6 +4025,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -3950,6 +4190,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -4096,6 +4349,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -4517,6 +4783,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -4667,6 +4945,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -4813,6 +5104,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -5102,6 +5406,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -5247,6 +5563,18 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -5393,6 +5721,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -5757,6 +6098,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -5907,6 +6260,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -6053,6 +6419,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -6352,6 +6731,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -6502,6 +6893,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -6648,6 +7052,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -6944,6 +7361,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -7089,6 +7518,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -7235,6 +7676,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -7602,6 +8056,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -7752,6 +8218,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -7898,6 +8377,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -8463,6 +8955,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -8613,6 +9117,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }, @@ -8759,6 +9276,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -10580,6 +11110,18 @@ public void FieldRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -10656,12 +11198,24 @@ public void FieldRoundtrip_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = Transactions::ProcessingCategory.Purchase; - string expectedTerminalID = "RCN5VNXS"; - string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; - ApiEnum expectedType = Transactions::Type.CardFinancial; - Transactions::Verification expectedVerification = new() - { - CardVerificationCode = new(Transactions::Result.Match), + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; + string expectedTerminalID = "RCN5VNXS"; + string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; + ApiEnum expectedType = Transactions::Type.CardFinancial; + Transactions::Verification expectedVerification = new() + { + CardVerificationCode = new(Transactions::Result.Match), CardholderAddress = new() { ActualLine1 = "33 Liberty Street", @@ -10701,6 +11255,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, model.ProcessingCategory); Assert.Null(model.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, model.TerminalID); Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); @@ -10765,6 +11324,18 @@ public void SerializationRoundtrip_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -10855,6 +11426,18 @@ public void FieldRoundtripThroughSerialization_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -10938,6 +11521,18 @@ public void FieldRoundtripThroughSerialization_Works() string expectedPresentmentCurrency = "USD"; ApiEnum expectedProcessingCategory = Transactions::ProcessingCategory.Purchase; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTerminalID = "RCN5VNXS"; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = Transactions::Type.CardFinancial; @@ -10983,6 +11578,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedProcessingCategory, deserialized.ProcessingCategory); Assert.Null(deserialized.RealTimeDecisionID); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTerminalID, deserialized.TerminalID); Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); @@ -11047,6 +11647,18 @@ public void Validation_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -11131,6 +11743,18 @@ public void CopyConstructor_Works() PresentmentCurrency = "USD", ProcessingCategory = Transactions::ProcessingCategory.Purchase, RealTimeDecisionID = null, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TerminalID = "RCN5VNXS", TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::Type.CardFinancial, @@ -12996,6 +13620,296 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class SchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new Transactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new Transactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new Transactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::SchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::FeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new Transactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new Transactions::SchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::SchemeFeeCurrency.Usd, + FeeType = Transactions::FeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + Transactions::SchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class SchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(Transactions::SchemeFeeCurrency.Usd)] + public void Validation_Works(Transactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Transactions::SchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(Transactions::SchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class FeeTypeTest : TestBase +{ + [Theory] + [InlineData(Transactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(Transactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(Transactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(Transactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::FeeType.VisaMessageTransmission)] + [InlineData(Transactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::FeeType.VisaPurchaseInternational)] + [InlineData(Transactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::FeeType.VisaClearingTransmission)] + [InlineData(Transactions::FeeType.VisaDirectAuthorization)] + [InlineData(Transactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(Transactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(Transactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(Transactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(Transactions::FeeType.PulseSwitchFee)] + public void Validation_Works(Transactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Transactions::FeeType.VisaInternationalServiceAssessmentSingleCurrency)] + [InlineData(Transactions::FeeType.VisaInternationalServiceAssessmentCrossCurrency)] + [InlineData(Transactions::FeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationReversalInternationalPointOfSale)] + [InlineData(Transactions::FeeType.VisaAuthorizationAddressVerificationService)] + [InlineData(Transactions::FeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::FeeType.VisaMessageTransmission)] + [InlineData(Transactions::FeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::FeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::FeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::FeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::FeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::FeeType.VisaPurchaseInternational)] + [InlineData(Transactions::FeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::FeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::FeeType.VisaClearingTransmission)] + [InlineData(Transactions::FeeType.VisaDirectAuthorization)] + [InlineData(Transactions::FeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::FeeType.VisaServiceCommercialCredit)] + [InlineData(Transactions::FeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(Transactions::FeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(Transactions::FeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(Transactions::FeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(Transactions::FeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize>( + JsonSerializer.SerializeToElement("invalid value"), + ModelBase.SerializerOptions + ); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } +} + public class TypeTest : TestBase { [Theory] @@ -13853,6 +14767,18 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -13977,6 +14903,18 @@ public void FieldRoundtrip_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = Transactions::CardRefundType.CardRefund; @@ -13998,6 +14936,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, model.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); } @@ -14123,6 +15066,18 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -14257,6 +15212,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -14388,6 +15355,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; string expectedTransactionID = "transaction_uyrp7fld2ium70oa7oi"; ApiEnum expectedType = Transactions::CardRefundType.CardRefund; @@ -14409,6 +15388,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentAmount, deserialized.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, deserialized.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); } @@ -14534,6 +15518,18 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -14662,6 +15658,18 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardRefundType.CardRefund, }; @@ -17695,10 +18703,310 @@ public void InvalidEnumSerializationRoundtrip_Works() ModelBase.SerializerOptions ); string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); - var deserialized = JsonSerializer.Deserialize>( - json, - ModelBase.SerializerOptions - ); + var deserialized = JsonSerializer.Deserialize>( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(value, deserialized); + } +} + +public class CardRefundSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new Transactions::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::CardRefundSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new Transactions::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new Transactions::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::CardRefundSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new Transactions::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new Transactions::CardRefundSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardRefundSchemeFeeCurrency.Usd, + FeeType = Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + Transactions::CardRefundSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardRefundSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(Transactions::CardRefundSchemeFeeCurrency.Usd)] + public void Validation_Works(Transactions::CardRefundSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Transactions::CardRefundSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(Transactions::CardRefundSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardRefundSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(Transactions::CardRefundSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + Transactions::CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit)] + [InlineData(Transactions::CardRefundSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(Transactions::CardRefundSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); Assert.Equal(value, deserialized); } @@ -18065,6 +19373,19 @@ public void FieldRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -18203,6 +19524,18 @@ public void FieldRoundtrip_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; Transactions::CardSettlementSurcharge expectedSurcharge = new() { Amount = 0, @@ -18232,6 +19565,11 @@ public void FieldRoundtrip_Works() Assert.Equal(expectedPresentmentAmount, model.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, model.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, model.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, model.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], model.SchemeFees[i]); + } Assert.Equal(expectedSurcharge, model.Surcharge); Assert.Equal(expectedTransactionID, model.TransactionID); Assert.Equal(expectedType, model.Type); @@ -18375,6 +19713,19 @@ public void SerializationRoundtrip_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -18527,6 +19878,19 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -18672,6 +20036,18 @@ public void FieldRoundtripThroughSerialization_Works() ], }, }; + List expectedSchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ]; Transactions::CardSettlementSurcharge expectedSurcharge = new() { Amount = 0, @@ -18701,6 +20077,11 @@ public void FieldRoundtripThroughSerialization_Works() Assert.Equal(expectedPresentmentAmount, deserialized.PresentmentAmount); Assert.Equal(expectedPresentmentCurrency, deserialized.PresentmentCurrency); Assert.Equal(expectedPurchaseDetails, deserialized.PurchaseDetails); + Assert.Equal(expectedSchemeFees.Count, deserialized.SchemeFees.Count); + for (int i = 0; i < expectedSchemeFees.Count; i++) + { + Assert.Equal(expectedSchemeFees[i], deserialized.SchemeFees[i]); + } Assert.Equal(expectedSurcharge, deserialized.Surcharge); Assert.Equal(expectedTransactionID, deserialized.TransactionID); Assert.Equal(expectedType, deserialized.Type); @@ -18844,6 +20225,19 @@ public void Validation_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -18990,6 +20384,19 @@ public void CopyConstructor_Works() ], }, }, + SchemeFees = + [ + new() + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }, + ], Surcharge = new() { Amount = 0, PresentmentAmount = 0 }, TransactionID = "transaction_uyrp7fld2ium70oa7oi", Type = Transactions::CardSettlementType.CardSettlement, @@ -22532,6 +23939,322 @@ public void InvalidEnumSerializationRoundtrip_Works() } } +public class CardSettlementSchemeFeeTest : TestBase +{ + [Fact] + public void FieldRoundtrip_Works() + { + var model = new Transactions::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::CardSettlementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, model.Amount); + Assert.Equal(expectedCreatedAt, model.CreatedAt); + Assert.Equal(expectedCurrency, model.Currency); + Assert.Equal(expectedFeeType, model.FeeType); + Assert.Null(model.FixedComponent); + Assert.Equal(expectedVariableRate, model.VariableRate); + } + + [Fact] + public void SerializationRoundtrip_Works() + { + var model = new Transactions::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string json = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + json, + ModelBase.SerializerOptions + ); + + Assert.Equal(model, deserialized); + } + + [Fact] + public void FieldRoundtripThroughSerialization_Works() + { + var model = new Transactions::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + string element = JsonSerializer.Serialize(model, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize( + element, + ModelBase.SerializerOptions + ); + Assert.NotNull(deserialized); + + string expectedAmount = "0.137465"; + DateTimeOffset expectedCreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"); + ApiEnum expectedCurrency = + Transactions::CardSettlementSchemeFeeCurrency.Usd; + ApiEnum expectedFeeType = + Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee; + string expectedVariableRate = "0.0002"; + + Assert.Equal(expectedAmount, deserialized.Amount); + Assert.Equal(expectedCreatedAt, deserialized.CreatedAt); + Assert.Equal(expectedCurrency, deserialized.Currency); + Assert.Equal(expectedFeeType, deserialized.FeeType); + Assert.Null(deserialized.FixedComponent); + Assert.Equal(expectedVariableRate, deserialized.VariableRate); + } + + [Fact] + public void Validation_Works() + { + var model = new Transactions::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + model.Validate(); + } + + [Fact] + public void CopyConstructor_Works() + { + var model = new Transactions::CardSettlementSchemeFee + { + Amount = "0.137465", + CreatedAt = DateTimeOffset.Parse("2020-01-31T23:59:59Z"), + Currency = Transactions::CardSettlementSchemeFeeCurrency.Usd, + FeeType = Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + FixedComponent = null, + VariableRate = "0.0002", + }; + + Transactions::CardSettlementSchemeFee copied = new(model); + + Assert.Equal(model, copied); + } +} + +public class CardSettlementSchemeFeeCurrencyTest : TestBase +{ + [Theory] + [InlineData(Transactions::CardSettlementSchemeFeeCurrency.Usd)] + public void Validation_Works(Transactions::CardSettlementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData(Transactions::CardSettlementSchemeFeeCurrency.Usd)] + public void SerializationRoundtrip_Works(Transactions::CardSettlementSchemeFeeCurrency rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + +public class CardSettlementSchemeFeeFeeTypeTest : TestBase +{ + [Theory] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.PulseSwitchFee)] + public void Validation_Works(Transactions::CardSettlementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + value.Validate(); + } + + [Fact] + public void InvalidEnumValidationThrows_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + + Assert.NotNull(value); + Assert.Throws(() => value.Validate()); + } + + [Theory] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaMessageTransmission)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaPurchaseInternational)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaClearingTransmission)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDirectAuthorization)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic)] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit)] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram + )] + [InlineData( + Transactions::CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit + )] + [InlineData(Transactions::CardSettlementSchemeFeeFeeType.PulseSwitchFee)] + public void SerializationRoundtrip_Works(Transactions::CardSettlementSchemeFeeFeeType rawValue) + { + // force implicit conversion because Theory can't do that for us + ApiEnum value = rawValue; + + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } + + [Fact] + public void InvalidEnumSerializationRoundtrip_Works() + { + var value = JsonSerializer.Deserialize< + ApiEnum + >(JsonSerializer.SerializeToElement("invalid value"), ModelBase.SerializerOptions); + string json = JsonSerializer.Serialize(value, ModelBase.SerializerOptions); + var deserialized = JsonSerializer.Deserialize< + ApiEnum + >(json, ModelBase.SerializerOptions); + + Assert.Equal(value, deserialized); + } +} + public class CardSettlementSurchargeTest : TestBase { [Fact] diff --git a/src/Increase.Api/Core/ClientOptions.cs b/src/Increase.Api/Core/ClientOptions.cs index 6b1fa67..ebbfaef 100644 --- a/src/Increase.Api/Core/ClientOptions.cs +++ b/src/Increase.Api/Core/ClientOptions.cs @@ -22,7 +22,8 @@ public record struct ClientOptions() /// /// The HTTP client to use for making requests in the SDK. /// - public HttpClient HttpClient { get; set; } = new(); + public HttpClient HttpClient { get; set; } = + new(new HttpClientHandler() { AutomaticDecompression = DecompressionMethods.Available }); Lazy _baseUrl = new(() => Environment.GetEnvironmentVariable("INCREASE_BASE_URL") ?? EnvironmentUrl.Production diff --git a/src/Increase.Api/Core/DecompressionMethods.cs b/src/Increase.Api/Core/DecompressionMethods.cs new file mode 100644 index 0000000..f2c370f --- /dev/null +++ b/src/Increase.Api/Core/DecompressionMethods.cs @@ -0,0 +1,49 @@ +using System.IO; +using System.IO.Compression; +using Net = System.Net; + +namespace Increase.Api.Core; + +static class DecompressionMethods +{ + internal static readonly Net::DecompressionMethods Available; + + static DecompressionMethods() + { + try + { + // Minimal valid GZip payload (empty body). + var gzipPayload = new byte[] + { + 0x1f, + 0x8b, + 0x08, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x03, + 0x03, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + 0x00, + }; + using var memoryStream = new MemoryStream(gzipPayload); + using var gzipStream = new GZipStream(memoryStream, CompressionMode.Decompress); + gzipStream.CopyTo(Stream.Null); + Available = Net::DecompressionMethods.GZip; + } + catch + { + Available = Net::DecompressionMethods.None; + } + } +} diff --git a/src/Increase.Api/Core/HttpResponse.cs b/src/Increase.Api/Core/HttpResponse.cs index f77dec8..02e0009 100644 --- a/src/Increase.Api/Core/HttpResponse.cs +++ b/src/Increase.Api/Core/HttpResponse.cs @@ -5,6 +5,7 @@ using System.Linq; using System.Net; using System.Net.Http; +using System.Runtime.CompilerServices; using System.Text.Json; using System.Threading.Tasks; using Increase.Api.Exceptions; @@ -176,12 +177,17 @@ internal StreamingHttpResponse( this.CancellationToken = response.CancellationToken; } - public IAsyncEnumerable Enumerate(Threading::CancellationToken cancellationToken = default) + public async IAsyncEnumerable Enumerate( + [EnumeratorCancellationAttribute] Threading::CancellationToken cancellationToken = default + ) { using var cts = Threading::CancellationTokenSource.CreateLinkedTokenSource( this.CancellationToken, cancellationToken ); - return this._enumerate(cts.Token); + await foreach (var item in this._enumerate(cts.Token)) + { + yield return item; + } } } diff --git a/src/Increase.Api/Core/ModelBase.cs b/src/Increase.Api/Core/ModelBase.cs index bfa7b09..62b9451 100644 --- a/src/Increase.Api/Core/ModelBase.cs +++ b/src/Increase.Api/Core/ModelBase.cs @@ -150,6 +150,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -174,6 +176,8 @@ protected ModelBase(ModelBase modelBase) string, CardPayments::CardBalanceInquiryNetworkDetailsVisaTerminalEntryCapability >(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter< string, @@ -206,6 +210,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter< string, CardPayments::CardDeclineVerificationCardVerificationCodeResult @@ -235,6 +241,8 @@ protected ModelBase(ModelBase modelBase) CardPayments::CardFinancialNetworkDetailsVisaTerminalEntryCapability >(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter< string, @@ -246,10 +254,14 @@ protected ModelBase(ModelBase modelBase) >(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -265,10 +277,14 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -318,6 +334,8 @@ protected ModelBase(ModelBase modelBase) string, CardPayments::CardSettlementPurchaseDetailsTravelTripLegStopOverCode >(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -338,6 +356,8 @@ protected ModelBase(ModelBase modelBase) string, CardPayments::CardValidationNetworkDetailsVisaTerminalEntryCapability >(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter< string, @@ -347,8 +367,6 @@ protected ModelBase(ModelBase modelBase) string, CardPayments::CardValidationVerificationCardholderAddressResult >(), - new ApiEnumConverter(), - new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -912,6 +930,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -929,6 +949,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -979,6 +1001,8 @@ protected ModelBase(ModelBase modelBase) string, Transactions::CardSettlementPurchaseDetailsTravelTripLegStopOverCode >(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -1010,6 +1034,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -1038,6 +1064,8 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -1243,6 +1271,7 @@ protected ModelBase(ModelBase modelBase) Entities::EntityCorporationBeneficialOwnerIndividualIdentificationMethod >(), new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -1265,8 +1294,9 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), - new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter(), + new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), @@ -1275,6 +1305,10 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), + new ApiEnumConverter< + string, + Entities::EntityUpdateParamsCorporationLegalIdentifierCategory + >(), new ApiEnumConverter(), new ApiEnumConverter< string, @@ -1423,8 +1457,6 @@ protected ModelBase(ModelBase modelBase) new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), - new ApiEnumConverter(), - new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), new ApiEnumConverter(), diff --git a/src/Increase.Api/Increase.Api.csproj b/src/Increase.Api/Increase.Api.csproj index 2d528f5..da9ef5e 100644 --- a/src/Increase.Api/Increase.Api.csproj +++ b/src/Increase.Api/Increase.Api.csproj @@ -3,18 +3,18 @@ Increase C# Increase.Api - 0.0.1 + 0.1.0 The official .NET library for the Increase API. Library README.md - - - - + + + + - + \ No newline at end of file diff --git a/src/Increase.Api/Models/CardPayments/CardPayment.cs b/src/Increase.Api/Models/CardPayments/CardPayment.cs index 35ec8ff..72af443 100644 --- a/src/Increase.Api/Models/CardPayments/CardPayment.cs +++ b/src/Increase.Api/Models/CardPayments/CardPayment.cs @@ -115,25 +115,6 @@ public required string? PhysicalCardID init { this._rawData.Set("physical_card_id", value); } } - /// - /// The scheme fees associated with this card payment. - /// - public required IReadOnlyList SchemeFees - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct>("scheme_fees"); - } - init - { - this._rawData.Set>( - "scheme_fees", - ImmutableArray.ToImmutableArray(value) - ); - } - } - /// /// The summarized state of this card payment. /// @@ -174,10 +155,6 @@ public override void Validate() item.Validate(); } _ = this.PhysicalCardID; - foreach (var item in this.SchemeFees) - { - item.Validate(); - } this.State.Validate(); this.Type.Validate(); } @@ -3312,6 +3289,25 @@ public required string? RealTimeDecisionID init { this._rawData.Set("real_time_decision_id", value); } } + /// + /// The scheme fees associated with this card authorization. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>("scheme_fees"); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The terminal identifier (commonly abbreviated as TID) of the terminal the /// card is transacting with. @@ -3381,6 +3377,10 @@ public override void Validate() _ = this.PresentmentCurrency; this.ProcessingCategory.Validate(); _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TerminalID; this.Type.Validate(); this.Verification.Validate(); @@ -5517,236 +5517,151 @@ JsonSerializerOptions options } } -/// -/// A constant representing the object's type. For this resource it will always be `card_authorization`. -/// -[JsonConverter(typeof(CardAuthorizationTypeConverter))] -public enum CardAuthorizationType -{ - CardAuthorization, -} - -sealed class CardAuthorizationTypeConverter : JsonConverter +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class SchemeFee : JsonModel { - public override CardAuthorizationType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "card_authorization" => CardAuthorizationType.CardAuthorization, - _ => (CardAuthorizationType)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardAuthorizationType value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardAuthorizationType.CardAuthorization => "card_authorization", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } } -} -/// -/// Fields related to verification of cardholder-provided values. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Verification : JsonModel -{ /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required CardVerificationCode CardVerificationCode + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_verification_code"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("card_verification_code", value); } + init { this._rawData.Set("created_at", value); } } /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required CardholderAddress CardholderAddress + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("cardholder_address"); + return this._rawData.GetNotNullClass>("currency"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("currency", value); } } /// - /// Cardholder name provided in the authorization request. + /// The type of fee being assessed. /// - public required CardholderName? CardholderName + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("cardholder_name"); + return this._rawData.GetNotNullClass>("fee_type"); } - init { this._rawData.Set("cardholder_name", value); } - } - - /// - public override void Validate() - { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); - } - - public Verification() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Verification(Verification verification) - : base(verification) { } -#pragma warning restore CS8618 - - public Verification(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Verification(FrozenDictionary rawData) - { - this._rawData = new(rawData); + init { this._rawData.Set("fee_type", value); } } -#pragma warning restore CS8618 - /// - public static Verification FromRawUnchecked(IReadOnlyDictionary rawData) + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } } -} - -class VerificationFromRaw : IFromRawJson -{ - /// - public Verification FromRawUnchecked(IReadOnlyDictionary rawData) => - Verification.FromRawUnchecked(rawData); -} -/// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardVerificationCode : JsonModel -{ /// - /// The result of verifying the Card Verification Code. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required ApiEnum Result + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("result"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - this.Result.Validate(); + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardVerificationCode() { } + public SchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardVerificationCode(CardVerificationCode cardVerificationCode) - : base(cardVerificationCode) { } + public SchemeFee(SchemeFee schemeFee) + : base(schemeFee) { } #pragma warning restore CS8618 - public CardVerificationCode(IReadOnlyDictionary rawData) + public SchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardVerificationCode(FrozenDictionary rawData) + SchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - - [SetsRequiredMembers] - public CardVerificationCode(ApiEnum result) - : this() - { - this.Result = result; - } } -class CardVerificationCodeFromRaw : IFromRawJson +class SchemeFeeFromRaw : IFromRawJson { /// - public CardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardVerificationCode.FromRawUnchecked(rawData); + public SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + SchemeFee.FromRawUnchecked(rawData); } /// -/// The result of verifying the Card Verification Code. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(ResultConverter))] -public enum Result +[JsonConverter(typeof(SchemeFeeCurrencyConverter))] +public enum SchemeFeeCurrency { /// - /// No card verification code was provided in the authorization request. - /// - NotChecked, - - /// - /// The card verification code matched the one on file. - /// - Match, - - /// - /// The card verification code did not match the one on file. + /// US Dollar (USD) /// - NoMatch, + Usd, } -sealed class ResultConverter : JsonConverter +sealed class SchemeFeeCurrencyConverter : JsonConverter { - public override Result Read( + public override SchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -5754,22 +5669,22 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => Result.NotChecked, - "match" => Result.Match, - "no_match" => Result.NoMatch, - _ => (Result)(-1), + "USD" => SchemeFeeCurrency.Usd, + _ => (SchemeFeeCurrency)(-1), }; } - public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + SchemeFeeCurrency value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize( writer, value switch { - Result.NotChecked => "not_checked", - Result.Match => "match", - Result.NoMatch => "no_match", + SchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -5780,205 +5695,295 @@ public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOp } /// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. +/// The type of fee being assessed. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardholderAddress : JsonModel +[JsonConverter(typeof(FeeTypeConverter))] +public enum FeeType { /// - /// Line 1 of the address on file for the cardholder. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required string? ActualLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); - } - init { this._rawData.Set("actual_line1", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The postal code of the address on file for the cardholder. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required string? ActualPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); - } - init { this._rawData.Set("actual_postal_code", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, /// - /// The cardholder address line 1 provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? ProvidedLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); - } - init { this._rawData.Set("provided_line1", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// The postal code provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string? ProvidedPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); - } - init { this._rawData.Set("provided_postal_code", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// The address verification result returned to the card network. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required ApiEnum Result - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "result" - ); - } - init { this._rawData.Set("result", value); } - } + VisaAuthorizationCanadaPointOfSale, - /// - public override void Validate() - { - _ = this.ActualLine1; - _ = this.ActualPostalCode; - _ = this.ProvidedLine1; - _ = this.ProvidedPostalCode; - this.Result.Validate(); - } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, - public CardholderAddress() { } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardholderAddress(CardholderAddress cardholderAddress) - : base(cardholderAddress) { } -#pragma warning restore CS8618 + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, - public CardholderAddress(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardholderAddress(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, - /// - public static CardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, -class CardholderAddressFromRaw : IFromRawJson -{ - /// - public CardholderAddress FromRawUnchecked(IReadOnlyDictionary rawData) => - CardholderAddress.FromRawUnchecked(rawData); -} + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, -/// -/// The address verification result returned to the card network. -/// -[JsonConverter(typeof(CardholderAddressResultConverter))] -public enum CardholderAddressResult -{ /// - /// No address information was provided in the authorization request. + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. /// - NotChecked, + VisaAccountVerificationCanada, /// - /// Postal code matches, but the street address does not match or was not provided. + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. /// - PostalCodeMatchAddressNoMatch, + VisaCorporateAcceptanceFee, /// - /// Postal code does not match, but the street address matches or was not provided. + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. /// - PostalCodeNoMatchAddressMatch, + VisaConsumerDebitAcceptanceFee, /// - /// Postal code and street address match. + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. /// - Match, + VisaBusinessDebitAcceptanceFee, /// - /// Postal code and street address do not match. + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. /// - NoMatch, + VisaPurchasingAcceptanceFee, /// - /// Postal code matches, but the street address was not verified. (deprecated) + /// Activity and fees for the processing of a sales draft original for a purchase transaction. /// - PostalCodeMatchAddressNotChecked, -} + VisaPurchaseDomestic, -sealed class CardholderAddressResultConverter : JsonConverter -{ - public override CardholderAddressResult Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_checked" => CardholderAddressResult.NotChecked, - "postal_code_match_address_no_match" => - CardholderAddressResult.PostalCodeMatchAddressNoMatch, - "postal_code_no_match_address_match" => - CardholderAddressResult.PostalCodeNoMatchAddressMatch, - "match" => CardholderAddressResult.Match, - "no_match" => CardholderAddressResult.NoMatch, - "postal_code_match_address_not_checked" => - CardholderAddressResult.PostalCodeMatchAddressNotChecked, - _ => (CardholderAddressResult)(-1), - }; - } + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, - public override void Write( - Utf8JsonWriter writer, - CardholderAddressResult value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardholderAddressResult.NotChecked => "not_checked", - CardholderAddressResult.PostalCodeMatchAddressNoMatch => - "postal_code_match_address_no_match", - CardholderAddressResult.PostalCodeNoMatchAddressMatch => - "postal_code_no_match_address_match", - CardholderAddressResult.Match => "match", - CardholderAddressResult.NoMatch => "no_match", - CardholderAddressResult.PostalCodeMatchAddressNotChecked => - "postal_code_match_address_not_checked", + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class FeeTypeConverter : JsonConverter +{ + public override FeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + FeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + FeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + FeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + FeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => FeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + FeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + FeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + FeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => FeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => FeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => FeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + FeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => FeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => FeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => FeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => FeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => FeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => FeeType.VisaPurchaseDomestic, + "visa_purchase_international" => FeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => FeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => FeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => FeeType.VisaClearingTransmission, + "visa_direct_authorization" => FeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => FeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => FeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + FeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + FeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + FeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => FeeType.PulseSwitchFee, + _ => (FeeType)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + FeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + FeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + FeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + FeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + FeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + FeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + FeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + FeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + FeeType.VisaAdvancedAuthorization => "visa_advanced_authorization", + FeeType.VisaMessageTransmission => "visa_message_transmission", + FeeType.VisaAccountVerificationDomestic => "visa_account_verification_domestic", + FeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + FeeType.VisaAccountVerificationCanada => "visa_account_verification_canada", + FeeType.VisaCorporateAcceptanceFee => "visa_corporate_acceptance_fee", + FeeType.VisaConsumerDebitAcceptanceFee => "visa_consumer_debit_acceptance_fee", + FeeType.VisaBusinessDebitAcceptanceFee => "visa_business_debit_acceptance_fee", + FeeType.VisaPurchasingAcceptanceFee => "visa_purchasing_acceptance_fee", + FeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + FeeType.VisaPurchaseInternational => "visa_purchase_international", + FeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + FeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + FeeType.VisaClearingTransmission => "visa_clearing_transmission", + FeeType.VisaDirectAuthorization => "visa_direct_authorization", + FeeType.VisaDirectTransactionDomestic => "visa_direct_transaction_domestic", + FeeType.VisaServiceCommercialCredit => "visa_service_commercial_credit", + FeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + FeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + FeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + FeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -5989,222 +5994,374 @@ JsonSerializerOptions options } /// -/// Cardholder name provided in the authorization request. +/// A constant representing the object's type. For this resource it will always be `card_authorization`. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardholderName : JsonModel +[JsonConverter(typeof(CardAuthorizationTypeConverter))] +public enum CardAuthorizationType +{ + CardAuthorization, +} + +sealed class CardAuthorizationTypeConverter : JsonConverter +{ + public override CardAuthorizationType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "card_authorization" => CardAuthorizationType.CardAuthorization, + _ => (CardAuthorizationType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardAuthorizationType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardAuthorizationType.CardAuthorization => "card_authorization", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields related to verification of cardholder-provided values. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Verification : JsonModel { /// - /// The first name provided for verification in the authorization request. + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. /// - public required string? ProvidedFirstName + public required CardVerificationCode CardVerificationCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_first_name"); + return this._rawData.GetNotNullClass("card_verification_code"); } - init { this._rawData.Set("provided_first_name", value); } + init { this._rawData.Set("card_verification_code", value); } } /// - /// The last name provided for verification in the authorization request. + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. /// - public required string? ProvidedLastName + public required CardholderAddress CardholderAddress { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_last_name"); + return this._rawData.GetNotNullClass("cardholder_address"); } - init { this._rawData.Set("provided_last_name", value); } + init { this._rawData.Set("cardholder_address", value); } } /// - /// The middle name provided for verification in the authorization request. + /// Cardholder name provided in the authorization request. /// - public required string? ProvidedMiddleName + public required CardholderName? CardholderName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_middle_name"); + return this._rawData.GetNullableClass("cardholder_name"); } - init { this._rawData.Set("provided_middle_name", value); } + init { this._rawData.Set("cardholder_name", value); } } /// public override void Validate() { - _ = this.ProvidedFirstName; - _ = this.ProvidedLastName; - _ = this.ProvidedMiddleName; + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); } - public CardholderName() { } + public Verification() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardholderName(CardholderName cardholderName) - : base(cardholderName) { } + public Verification(Verification verification) + : base(verification) { } #pragma warning restore CS8618 - public CardholderName(IReadOnlyDictionary rawData) + public Verification(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardholderName(FrozenDictionary rawData) + Verification(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardholderName FromRawUnchecked(IReadOnlyDictionary rawData) - { + /// + public static Verification FromRawUnchecked(IReadOnlyDictionary rawData) + { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardholderNameFromRaw : IFromRawJson +class VerificationFromRaw : IFromRawJson { /// - public CardholderName FromRawUnchecked(IReadOnlyDictionary rawData) => - CardholderName.FromRawUnchecked(rawData); + public Verification FromRawUnchecked(IReadOnlyDictionary rawData) => + Verification.FromRawUnchecked(rawData); } /// -/// A Card Authorization Expiration object. This field will be present in the JSON -/// response if and only if `category` is equal to `card_authorization_expiration`. -/// Card Authorization Expirations are cancellations of authorizations that were -/// never settled by the acquirer. +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. /// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardAuthorizationExpiration : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardVerificationCode : JsonModel { /// - /// The Card Authorization Expiration identifier. + /// The result of verifying the Card Verification Code. /// - public required string ID + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); + return this._rawData.GetNotNullClass>("result"); } - init { this._rawData.Set("id", value); } + init { this._rawData.Set("result", value); } + } + + /// + public override void Validate() + { + this.Result.Validate(); + } + + public CardVerificationCode() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardVerificationCode(CardVerificationCode cardVerificationCode) + : base(cardVerificationCode) { } +#pragma warning restore CS8618 + + public CardVerificationCode(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardVerificationCode(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } + [SetsRequiredMembers] + public CardVerificationCode(ApiEnum result) + : this() + { + this.Result = result; + } +} + +class CardVerificationCodeFromRaw : IFromRawJson +{ + /// + public CardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardVerificationCode.FromRawUnchecked(rawData); +} + +/// +/// The result of verifying the Card Verification Code. +/// +[JsonConverter(typeof(ResultConverter))] +public enum Result +{ /// - /// The identifier for the Card Authorization this reverses. + /// No card verification code was provided in the authorization request. /// - public required string CardAuthorizationID + NotChecked, + + /// + /// The card verification code matched the one on file. + /// + Match, + + /// + /// The card verification code did not match the one on file. + /// + NoMatch, +} + +sealed class ResultConverter : JsonConverter +{ + public override Result Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => Result.NotChecked, + "match" => Result.Match, + "no_match" => Result.NoMatch, + _ => (Result)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + Result.NotChecked => "not_checked", + Result.Match => "match", + Result.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardholderAddress : JsonModel +{ + /// + /// Line 1 of the address on file for the cardholder. + /// + public required string? ActualLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_authorization_id"); + return this._rawData.GetNullableClass("actual_line1"); } - init { this._rawData.Set("card_authorization_id", value); } + init { this._rawData.Set("actual_line1", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. + /// The postal code of the address on file for the cardholder. /// - public required ApiEnum Currency + public required string? ActualPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("currency"); + return this._rawData.GetNullableClass("actual_postal_code"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("actual_postal_code", value); } } /// - /// The amount of this authorization expiration in the minor unit of the transaction's - /// currency. For dollars, for example, this is cents. + /// The cardholder address line 1 provided for verification in the authorization request. /// - public required long ExpiredAmount + public required string? ProvidedLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("expired_amount"); + return this._rawData.GetNullableClass("provided_line1"); } - init { this._rawData.Set("expired_amount", value); } + init { this._rawData.Set("provided_line1", value); } } /// - /// The card network used to process this card authorization. + /// The postal code provided for verification in the authorization request. /// - public required ApiEnum Network + public required string? ProvidedPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("network"); + return this._rawData.GetNullableClass("provided_postal_code"); } - init { this._rawData.Set("network", value); } + init { this._rawData.Set("provided_postal_code", value); } } /// - /// A constant representing the object's type. For this resource it will always - /// be `card_authorization_expiration`. + /// The address verification result returned to the card network. /// - public required ApiEnum Type + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "type" + return this._rawData.GetNotNullClass>( + "result" ); } - init { this._rawData.Set("type", value); } + init { this._rawData.Set("result", value); } } /// public override void Validate() { - _ = this.ID; - _ = this.CardAuthorizationID; - this.Currency.Validate(); - _ = this.ExpiredAmount; - this.Network.Validate(); - this.Type.Validate(); + _ = this.ActualLine1; + _ = this.ActualPostalCode; + _ = this.ProvidedLine1; + _ = this.ProvidedPostalCode; + this.Result.Validate(); } - public CardAuthorizationExpiration() { } + public CardholderAddress() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardAuthorizationExpiration(CardAuthorizationExpiration cardAuthorizationExpiration) - : base(cardAuthorizationExpiration) { } + public CardholderAddress(CardholderAddress cardholderAddress) + : base(cardholderAddress) { } #pragma warning restore CS8618 - public CardAuthorizationExpiration(IReadOnlyDictionary rawData) + public CardholderAddress(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardAuthorizationExpiration(FrozenDictionary rawData) + CardholderAddress(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardAuthorizationExpiration FromRawUnchecked( + /// + public static CardholderAddress FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -6212,125 +6369,53 @@ IReadOnlyDictionary rawData } } -class CardAuthorizationExpirationFromRaw : IFromRawJson +class CardholderAddressFromRaw : IFromRawJson { /// - public CardAuthorizationExpiration FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardAuthorizationExpiration.FromRawUnchecked(rawData); + public CardholderAddress FromRawUnchecked(IReadOnlyDictionary rawData) => + CardholderAddress.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. +/// The address verification result returned to the card network. /// -[JsonConverter(typeof(CardAuthorizationExpirationCurrencyConverter))] -public enum CardAuthorizationExpirationCurrency +[JsonConverter(typeof(CardholderAddressResultConverter))] +public enum CardholderAddressResult { /// - /// US Dollar (USD) + /// No address information was provided in the authorization request. /// - Usd, -} + NotChecked, -sealed class CardAuthorizationExpirationCurrencyConverter - : JsonConverter -{ - public override CardAuthorizationExpirationCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "USD" => CardAuthorizationExpirationCurrency.Usd, - _ => (CardAuthorizationExpirationCurrency)(-1), - }; - } + /// + /// Postal code matches, but the street address does not match or was not provided. + /// + PostalCodeMatchAddressNoMatch, - public override void Write( - Utf8JsonWriter writer, - CardAuthorizationExpirationCurrency value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardAuthorizationExpirationCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// The card network used to process this card authorization. -/// -[JsonConverter(typeof(NetworkConverter))] -public enum Network -{ /// - /// Visa + /// Postal code does not match, but the street address matches or was not provided. /// - Visa, + PostalCodeNoMatchAddressMatch, /// - /// Pulse + /// Postal code and street address match. /// - Pulse, -} - -sealed class NetworkConverter : JsonConverter -{ - public override Network Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "visa" => Network.Visa, - "pulse" => Network.Pulse, - _ => (Network)(-1), - }; - } + Match, - public override void Write(Utf8JsonWriter writer, Network value, JsonSerializerOptions options) - { - JsonSerializer.Serialize( - writer, - value switch - { - Network.Visa => "visa", - Network.Pulse => "pulse", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} + /// + /// Postal code and street address do not match. + /// + NoMatch, -/// -/// A constant representing the object's type. For this resource it will always be `card_authorization_expiration`. -/// -[JsonConverter(typeof(CardAuthorizationExpirationTypeConverter))] -public enum CardAuthorizationExpirationType -{ - CardAuthorizationExpiration, + /// + /// Postal code matches, but the street address was not verified. (deprecated) + /// + PostalCodeMatchAddressNotChecked, } -sealed class CardAuthorizationExpirationTypeConverter - : JsonConverter +sealed class CardholderAddressResultConverter : JsonConverter { - public override CardAuthorizationExpirationType Read( + public override CardholderAddressResult Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -6338,15 +6423,22 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "card_authorization_expiration" => - CardAuthorizationExpirationType.CardAuthorizationExpiration, - _ => (CardAuthorizationExpirationType)(-1), + "not_checked" => CardholderAddressResult.NotChecked, + "postal_code_match_address_no_match" => + CardholderAddressResult.PostalCodeMatchAddressNoMatch, + "postal_code_no_match_address_match" => + CardholderAddressResult.PostalCodeNoMatchAddressMatch, + "match" => CardholderAddressResult.Match, + "no_match" => CardholderAddressResult.NoMatch, + "postal_code_match_address_not_checked" => + CardholderAddressResult.PostalCodeMatchAddressNotChecked, + _ => (CardholderAddressResult)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardAuthorizationExpirationType value, + CardholderAddressResult value, JsonSerializerOptions options ) { @@ -6354,8 +6446,15 @@ JsonSerializerOptions options writer, value switch { - CardAuthorizationExpirationType.CardAuthorizationExpiration => - "card_authorization_expiration", + CardholderAddressResult.NotChecked => "not_checked", + CardholderAddressResult.PostalCodeMatchAddressNoMatch => + "postal_code_match_address_no_match", + CardholderAddressResult.PostalCodeNoMatchAddressMatch => + "postal_code_no_match_address_match", + CardholderAddressResult.Match => "match", + CardholderAddressResult.NoMatch => "no_match", + CardholderAddressResult.PostalCodeMatchAddressNotChecked => + "postal_code_match_address_not_checked", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -6366,236 +6465,613 @@ JsonSerializerOptions options } /// -/// A Card Balance Inquiry object. This field will be present in the JSON response -/// if and only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries -/// are transactions that allow merchants to check the available balance on a card -/// without placing a hold on funds, commonly used when a customer requests their -/// balance at an ATM. +/// Cardholder name provided in the authorization request. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardBalanceInquiry : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardholderName : JsonModel { /// - /// The Card Balance Inquiry identifier. + /// The first name provided for verification in the authorization request. /// - public required string ID + public required string? ProvidedFirstName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); + return this._rawData.GetNullableClass("provided_first_name"); } - init { this._rawData.Set("id", value); } + init { this._rawData.Set("provided_first_name", value); } } /// - /// Additional amounts associated with the card authorization, such as ATM surcharges - /// fees. These are usually a subset of the `amount` field and are used to provide - /// more detailed information about the transaction. + /// The last name provided for verification in the authorization request. /// - public required CardBalanceInquiryAdditionalAmounts AdditionalAmounts + public required string? ProvidedLastName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "additional_amounts" - ); + return this._rawData.GetNullableClass("provided_last_name"); } - init { this._rawData.Set("additional_amounts", value); } + init { this._rawData.Set("provided_last_name", value); } } /// - /// The balance amount in the minor unit of the account's currency. For dollars, - /// for example, this is cents. + /// The middle name provided for verification in the authorization request. /// - public required long Balance + public required string? ProvidedMiddleName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("balance"); + return this._rawData.GetNullableClass("provided_middle_name"); } - init { this._rawData.Set("balance", value); } + init { this._rawData.Set("provided_middle_name", value); } + } + + /// + public override void Validate() + { + _ = this.ProvidedFirstName; + _ = this.ProvidedLastName; + _ = this.ProvidedMiddleName; + } + + public CardholderName() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardholderName(CardholderName cardholderName) + : base(cardholderName) { } +#pragma warning restore CS8618 + + public CardholderName(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardholderName(FrozenDictionary rawData) + { + this._rawData = new(rawData); } +#pragma warning restore CS8618 + + /// + public static CardholderName FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} +class CardholderNameFromRaw : IFromRawJson +{ + /// + public CardholderName FromRawUnchecked(IReadOnlyDictionary rawData) => + CardholderName.FromRawUnchecked(rawData); +} + +/// +/// A Card Authorization Expiration object. This field will be present in the JSON +/// response if and only if `category` is equal to `card_authorization_expiration`. +/// Card Authorization Expirations are cancellations of authorizations that were +/// never settled by the acquirer. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardAuthorizationExpiration : JsonModel +{ /// - /// The ID of the Card Payment this transaction belongs to. + /// The Card Authorization Expiration identifier. /// - public required string CardPaymentID + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("card_payment_id", value); } + init { this._rawData.Set("id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the account's currency. + /// The identifier for the Card Authorization this reverses. /// - public required ApiEnum Currency + public required string CardAuthorizationID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); + return this._rawData.GetNotNullClass("card_authorization_id"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("card_authorization_id", value); } } /// - /// If the authorization was made via a Digital Wallet Token (such as an Apple - /// Pay purchase), the identifier of the token that was used. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. /// - public required string? DigitalWalletTokenID + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("digital_wallet_token_id"); + return this._rawData.GetNotNullClass< + ApiEnum + >("currency"); } - init { this._rawData.Set("digital_wallet_token_id", value); } + init { this._rawData.Set("currency", value); } } /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. + /// The amount of this authorization expiration in the minor unit of the transaction's + /// currency. For dollars, for example, this is cents. /// - public required string MerchantAcceptorID + public required long ExpiredAmount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); + return this._rawData.GetNotNullStruct("expired_amount"); } - init { this._rawData.Set("merchant_acceptor_id", value); } + init { this._rawData.Set("expired_amount", value); } } /// - /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - /// card is transacting with. + /// The card network used to process this card authorization. /// - public required string MerchantCategoryCode + public required ApiEnum Network { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); + return this._rawData.GetNotNullClass>("network"); } - init { this._rawData.Set("merchant_category_code", value); } + init { this._rawData.Set("network", value); } } /// - /// The city the merchant resides in. + /// A constant representing the object's type. For this resource it will always + /// be `card_authorization_expiration`. /// - public required string? MerchantCity + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_city"); + return this._rawData.GetNotNullClass>( + "type" + ); } - init { this._rawData.Set("merchant_city", value); } + init { this._rawData.Set("type", value); } + } + + /// + public override void Validate() + { + _ = this.ID; + _ = this.CardAuthorizationID; + this.Currency.Validate(); + _ = this.ExpiredAmount; + this.Network.Validate(); + this.Type.Validate(); + } + + public CardAuthorizationExpiration() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardAuthorizationExpiration(CardAuthorizationExpiration cardAuthorizationExpiration) + : base(cardAuthorizationExpiration) { } +#pragma warning restore CS8618 + + public CardAuthorizationExpiration(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardAuthorizationExpiration(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardAuthorizationExpiration FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardAuthorizationExpirationFromRaw : IFromRawJson +{ + /// + public CardAuthorizationExpiration FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardAuthorizationExpiration.FromRawUnchecked(rawData); +} +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. +/// +[JsonConverter(typeof(CardAuthorizationExpirationCurrencyConverter))] +public enum CardAuthorizationExpirationCurrency +{ /// - /// The country the merchant resides in. + /// US Dollar (USD) /// - public required string MerchantCountry + Usd, +} + +sealed class CardAuthorizationExpirationCurrencyConverter + : JsonConverter +{ + public override CardAuthorizationExpirationCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); - } - init { this._rawData.Set("merchant_country", value); } + "USD" => CardAuthorizationExpirationCurrency.Usd, + _ => (CardAuthorizationExpirationCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardAuthorizationExpirationCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardAuthorizationExpirationCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// The card network used to process this card authorization. +/// +[JsonConverter(typeof(NetworkConverter))] +public enum Network +{ /// - /// The merchant descriptor of the merchant the card is transacting with. + /// Visa /// - public required string MerchantDescriptor + Visa, + + /// + /// Pulse + /// + Pulse, +} + +sealed class NetworkConverter : JsonConverter +{ + public override Network Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_descriptor"); - } - init { this._rawData.Set("merchant_descriptor", value); } + "visa" => Network.Visa, + "pulse" => Network.Pulse, + _ => (Network)(-1), + }; } - /// - /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit - /// ZIP code, where the first 5 and last 4 are separated by a dash. - /// - public required string? MerchantPostalCode + public override void Write(Utf8JsonWriter writer, Network value, JsonSerializerOptions options) { - get + JsonSerializer.Serialize( + writer, + value switch + { + Network.Visa => "visa", + Network.Pulse => "pulse", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// A constant representing the object's type. For this resource it will always be `card_authorization_expiration`. +/// +[JsonConverter(typeof(CardAuthorizationExpirationTypeConverter))] +public enum CardAuthorizationExpirationType +{ + CardAuthorizationExpiration, +} + +sealed class CardAuthorizationExpirationTypeConverter + : JsonConverter +{ + public override CardAuthorizationExpirationType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } + "card_authorization_expiration" => + CardAuthorizationExpirationType.CardAuthorizationExpiration, + _ => (CardAuthorizationExpirationType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardAuthorizationExpirationType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardAuthorizationExpirationType.CardAuthorizationExpiration => + "card_authorization_expiration", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// A Card Balance Inquiry object. This field will be present in the JSON response +/// if and only if `category` is equal to `card_balance_inquiry`. Card Balance Inquiries +/// are transactions that allow merchants to check the available balance on a card +/// without placing a hold on funds, commonly used when a customer requests their +/// balance at an ATM. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardBalanceInquiry : JsonModel +{ /// - /// The state the merchant resides in. + /// The Card Balance Inquiry identifier. /// - public required string? MerchantState + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("merchant_state", value); } + init { this._rawData.Set("id", value); } } /// - /// Fields specific to the `network`. + /// Additional amounts associated with the card authorization, such as ATM surcharges + /// fees. These are usually a subset of the `amount` field and are used to provide + /// more detailed information about the transaction. /// - public required CardBalanceInquiryNetworkDetails NetworkDetails + public required CardBalanceInquiryAdditionalAmounts AdditionalAmounts { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_details" + return this._rawData.GetNotNullClass( + "additional_amounts" ); } - init { this._rawData.Set("network_details", value); } + init { this._rawData.Set("additional_amounts", value); } } /// - /// Network-specific identifiers for a specific request or transaction. + /// The balance amount in the minor unit of the account's currency. For dollars, + /// for example, this is cents. /// - public required CardBalanceInquiryNetworkIdentifiers NetworkIdentifiers + public required long Balance { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); + return this._rawData.GetNotNullStruct("balance"); } - init { this._rawData.Set("network_identifiers", value); } + init { this._rawData.Set("balance", value); } } /// - /// The risk score generated by the card network. For Visa this is the Visa Advanced - /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse - /// the score is from 0 to 999, where 999 is the riskiest. + /// The ID of the Card Payment this transaction belongs to. /// - public required long? NetworkRiskScore + public required string CardPaymentID { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("network_risk_score"); + return this._rawData.GetNotNullClass("card_payment_id"); + } + init { this._rawData.Set("card_payment_id", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the account's currency. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// If the authorization was made via a Digital Wallet Token (such as an Apple + /// Pay purchase), the identifier of the token that was used. + /// + public required string? DigitalWalletTokenID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("digital_wallet_token_id"); + } + init { this._rawData.Set("digital_wallet_token_id", value); } + } + + /// + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. + /// + public required string MerchantAcceptorID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); + } + init { this._rawData.Set("merchant_acceptor_id", value); } + } + + /// + /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + /// card is transacting with. + /// + public required string MerchantCategoryCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_category_code"); + } + init { this._rawData.Set("merchant_category_code", value); } + } + + /// + /// The city the merchant resides in. + /// + public required string? MerchantCity + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_city"); + } + init { this._rawData.Set("merchant_city", value); } + } + + /// + /// The country the merchant resides in. + /// + public required string MerchantCountry + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_country"); + } + init { this._rawData.Set("merchant_country", value); } + } + + /// + /// The merchant descriptor of the merchant the card is transacting with. + /// + public required string MerchantDescriptor + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_descriptor"); + } + init { this._rawData.Set("merchant_descriptor", value); } + } + + /// + /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// + public required string? MerchantPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } + } + + /// + /// The state the merchant resides in. + /// + public required string? MerchantState + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_state"); + } + init { this._rawData.Set("merchant_state", value); } + } + + /// + /// Fields specific to the `network`. + /// + public required CardBalanceInquiryNetworkDetails NetworkDetails + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "network_details" + ); + } + init { this._rawData.Set("network_details", value); } + } + + /// + /// Network-specific identifiers for a specific request or transaction. + /// + public required CardBalanceInquiryNetworkIdentifiers NetworkIdentifiers + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); + } + init { this._rawData.Set("network_identifiers", value); } + } + + /// + /// The risk score generated by the card network. For Visa this is the Visa Advanced + /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse + /// the score is from 0 to 999, where 999 is the riskiest. + /// + public required long? NetworkRiskScore + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("network_risk_score"); } init { this._rawData.Set("network_risk_score", value); } } @@ -6627,6 +7103,27 @@ public required string? RealTimeDecisionID init { this._rawData.Set("real_time_decision_id", value); } } + /// + /// The scheme fees associated with this card balance inquiry. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The terminal identifier (commonly abbreviated as TID) of the terminal the /// card is transacting with. @@ -6689,6 +7186,10 @@ public override void Validate() _ = this.NetworkRiskScore; _ = this.PhysicalCardID; _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TerminalID; this.Type.Validate(); this.Verification.Validate(); @@ -8862,269 +9363,161 @@ IReadOnlyDictionary rawData ) => CardBalanceInquiryNetworkIdentifiers.FromRawUnchecked(rawData); } -/// -/// A constant representing the object's type. For this resource it will always be `card_balance_inquiry`. -/// -[JsonConverter(typeof(CardBalanceInquiryTypeConverter))] -public enum CardBalanceInquiryType -{ - CardBalanceInquiry, -} - -sealed class CardBalanceInquiryTypeConverter : JsonConverter -{ - public override CardBalanceInquiryType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "card_balance_inquiry" => CardBalanceInquiryType.CardBalanceInquiry, - _ => (CardBalanceInquiryType)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardBalanceInquiryType value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardBalanceInquiryType.CardBalanceInquiry => "card_balance_inquiry", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// Fields related to verification of cardholder-provided values. -/// [JsonConverter( - typeof(JsonModelConverter< - CardBalanceInquiryVerification, - CardBalanceInquiryVerificationFromRaw - >) + typeof(JsonModelConverter) )] -public sealed record class CardBalanceInquiryVerification : JsonModel +public sealed record class CardBalanceInquirySchemeFee : JsonModel { /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. + /// The fee amount given as a string containing a decimal number. /// - public required CardBalanceInquiryVerificationCardVerificationCode CardVerificationCode + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "card_verification_code" - ); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("card_verification_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required CardBalanceInquiryVerificationCardholderAddress CardholderAddress + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "cardholder_address" - ); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("created_at", value); } } /// - /// Cardholder name provided in the authorization request. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required CardBalanceInquiryVerificationCardholderName? CardholderName + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "cardholder_name" - ); + return this._rawData.GetNotNullClass< + ApiEnum + >("currency"); } - init { this._rawData.Set("cardholder_name", value); } - } - - /// - public override void Validate() - { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); - } - - public CardBalanceInquiryVerification() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardBalanceInquiryVerification( - CardBalanceInquiryVerification cardBalanceInquiryVerification - ) - : base(cardBalanceInquiryVerification) { } -#pragma warning restore CS8618 - - public CardBalanceInquiryVerification(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); + init { this._rawData.Set("currency", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardBalanceInquiryVerification(FrozenDictionary rawData) + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("fee_type"); + } + init { this._rawData.Set("fee_type", value); } } -#pragma warning restore CS8618 - /// - public static CardBalanceInquiryVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } } -} - -class CardBalanceInquiryVerificationFromRaw : IFromRawJson -{ - /// - public CardBalanceInquiryVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardBalanceInquiryVerification.FromRawUnchecked(rawData); -} -/// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardBalanceInquiryVerificationCardVerificationCode, - CardBalanceInquiryVerificationCardVerificationCodeFromRaw - >) -)] -public sealed record class CardBalanceInquiryVerificationCardVerificationCode : JsonModel -{ /// - /// The result of verifying the Card Verification Code. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required ApiEnum Result + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - this.Result.Validate(); + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardBalanceInquiryVerificationCardVerificationCode() { } + public CardBalanceInquirySchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardBalanceInquiryVerificationCardVerificationCode( - CardBalanceInquiryVerificationCardVerificationCode cardBalanceInquiryVerificationCardVerificationCode - ) - : base(cardBalanceInquiryVerificationCardVerificationCode) { } + public CardBalanceInquirySchemeFee(CardBalanceInquirySchemeFee cardBalanceInquirySchemeFee) + : base(cardBalanceInquirySchemeFee) { } #pragma warning restore CS8618 - public CardBalanceInquiryVerificationCardVerificationCode( - IReadOnlyDictionary rawData - ) + public CardBalanceInquirySchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardBalanceInquiryVerificationCardVerificationCode( - FrozenDictionary rawData - ) + CardBalanceInquirySchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardBalanceInquiryVerificationCardVerificationCode FromRawUnchecked( + /// + public static CardBalanceInquirySchemeFee FromRawUnchecked( IReadOnlyDictionary rawData ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - - [SetsRequiredMembers] - public CardBalanceInquiryVerificationCardVerificationCode( - ApiEnum result - ) - : this() - { - this.Result = result; - } } -class CardBalanceInquiryVerificationCardVerificationCodeFromRaw - : IFromRawJson +class CardBalanceInquirySchemeFeeFromRaw : IFromRawJson { /// - public CardBalanceInquiryVerificationCardVerificationCode FromRawUnchecked( + public CardBalanceInquirySchemeFee FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardBalanceInquiryVerificationCardVerificationCode.FromRawUnchecked(rawData); + ) => CardBalanceInquirySchemeFee.FromRawUnchecked(rawData); } /// -/// The result of verifying the Card Verification Code. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(CardBalanceInquiryVerificationCardVerificationCodeResultConverter))] -public enum CardBalanceInquiryVerificationCardVerificationCodeResult +[JsonConverter(typeof(CardBalanceInquirySchemeFeeCurrencyConverter))] +public enum CardBalanceInquirySchemeFeeCurrency { /// - /// No card verification code was provided in the authorization request. - /// - NotChecked, - - /// - /// The card verification code matched the one on file. - /// - Match, - - /// - /// The card verification code did not match the one on file. + /// US Dollar (USD) /// - NoMatch, + Usd, } -sealed class CardBalanceInquiryVerificationCardVerificationCodeResultConverter - : JsonConverter +sealed class CardBalanceInquirySchemeFeeCurrencyConverter + : JsonConverter { - public override CardBalanceInquiryVerificationCardVerificationCodeResult Read( + public override CardBalanceInquirySchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -9132,16 +9525,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => CardBalanceInquiryVerificationCardVerificationCodeResult.NotChecked, - "match" => CardBalanceInquiryVerificationCardVerificationCodeResult.Match, - "no_match" => CardBalanceInquiryVerificationCardVerificationCodeResult.NoMatch, - _ => (CardBalanceInquiryVerificationCardVerificationCodeResult)(-1), + "USD" => CardBalanceInquirySchemeFeeCurrency.Usd, + _ => (CardBalanceInquirySchemeFeeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardBalanceInquiryVerificationCardVerificationCodeResult value, + CardBalanceInquirySchemeFeeCurrency value, JsonSerializerOptions options ) { @@ -9149,10 +9540,7 @@ JsonSerializerOptions options writer, value switch { - CardBalanceInquiryVerificationCardVerificationCodeResult.NotChecked => - "not_checked", - CardBalanceInquiryVerificationCardVerificationCodeResult.Match => "match", - CardBalanceInquiryVerificationCardVerificationCodeResult.NoMatch => "no_match", + CardBalanceInquirySchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -9163,178 +9551,198 @@ JsonSerializerOptions options } /// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. +/// The type of fee being assessed. /// -[JsonConverter( - typeof(JsonModelConverter< - CardBalanceInquiryVerificationCardholderAddress, - CardBalanceInquiryVerificationCardholderAddressFromRaw - >) -)] -public sealed record class CardBalanceInquiryVerificationCardholderAddress : JsonModel +[JsonConverter(typeof(CardBalanceInquirySchemeFeeFeeTypeConverter))] +public enum CardBalanceInquirySchemeFeeFeeType { /// - /// Line 1 of the address on file for the cardholder. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required string? ActualLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); - } - init { this._rawData.Set("actual_line1", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The postal code of the address on file for the cardholder. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required string? ActualPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); - } - init { this._rawData.Set("actual_postal_code", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, /// - /// The cardholder address line 1 provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? ProvidedLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); - } - init { this._rawData.Set("provided_line1", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// The postal code provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string? ProvidedPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); - } - init { this._rawData.Set("provided_postal_code", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// The address verification result returned to the card network. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required ApiEnum Result - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); - } - init { this._rawData.Set("result", value); } - } + VisaAuthorizationCanadaPointOfSale, - /// - public override void Validate() - { - _ = this.ActualLine1; - _ = this.ActualPostalCode; - _ = this.ProvidedLine1; - _ = this.ProvidedPostalCode; - this.Result.Validate(); - } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, - public CardBalanceInquiryVerificationCardholderAddress() { } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardBalanceInquiryVerificationCardholderAddress( - CardBalanceInquiryVerificationCardholderAddress cardBalanceInquiryVerificationCardholderAddress - ) - : base(cardBalanceInquiryVerificationCardholderAddress) { } -#pragma warning restore CS8618 + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, - public CardBalanceInquiryVerificationCardholderAddress( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardBalanceInquiryVerificationCardholderAddress(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, - /// - public static CardBalanceInquiryVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, -class CardBalanceInquiryVerificationCardholderAddressFromRaw - : IFromRawJson -{ - /// - public CardBalanceInquiryVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardBalanceInquiryVerificationCardholderAddress.FromRawUnchecked(rawData); -} + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, -/// -/// The address verification result returned to the card network. -/// -[JsonConverter(typeof(CardBalanceInquiryVerificationCardholderAddressResultConverter))] -public enum CardBalanceInquiryVerificationCardholderAddressResult -{ /// - /// No address information was provided in the authorization request. + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. /// - NotChecked, + VisaAccountVerificationCanada, /// - /// Postal code matches, but the street address does not match or was not provided. + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. /// - PostalCodeMatchAddressNoMatch, + VisaCorporateAcceptanceFee, /// - /// Postal code does not match, but the street address matches or was not provided. + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. /// - PostalCodeNoMatchAddressMatch, + VisaConsumerDebitAcceptanceFee, /// - /// Postal code and street address match. + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. /// - Match, + VisaBusinessDebitAcceptanceFee, /// - /// Postal code and street address do not match. + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. /// - NoMatch, + VisaPurchasingAcceptanceFee, /// - /// Postal code matches, but the street address was not verified. (deprecated) + /// Activity and fees for the processing of a sales draft original for a purchase transaction. /// - PostalCodeMatchAddressNotChecked, + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class CardBalanceInquiryVerificationCardholderAddressResultConverter - : JsonConverter +sealed class CardBalanceInquirySchemeFeeFeeTypeConverter + : JsonConverter { - public override CardBalanceInquiryVerificationCardholderAddressResult Read( + public override CardBalanceInquirySchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -9342,22 +9750,69 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => CardBalanceInquiryVerificationCardholderAddressResult.NotChecked, - "postal_code_match_address_no_match" => - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, - "postal_code_no_match_address_match" => - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, - "match" => CardBalanceInquiryVerificationCardholderAddressResult.Match, - "no_match" => CardBalanceInquiryVerificationCardholderAddressResult.NoMatch, - "postal_code_match_address_not_checked" => - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, - _ => (CardBalanceInquiryVerificationCardholderAddressResult)(-1), + "visa_international_service_assessment_single_currency" => + CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardBalanceInquirySchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => + CardBalanceInquirySchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardBalanceInquirySchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardBalanceInquirySchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardBalanceInquirySchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardBalanceInquirySchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardBalanceInquirySchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => + CardBalanceInquirySchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => + CardBalanceInquirySchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => + CardBalanceInquirySchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => + CardBalanceInquirySchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardBalanceInquirySchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardBalanceInquirySchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardBalanceInquirySchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardBalanceInquirySchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardBalanceInquirySchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardBalanceInquirySchemeFeeFeeType.PulseSwitchFee, + _ => (CardBalanceInquirySchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardBalanceInquiryVerificationCardholderAddressResult value, + CardBalanceInquirySchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -9365,15 +9820,62 @@ JsonSerializerOptions options writer, value switch { - CardBalanceInquiryVerificationCardholderAddressResult.NotChecked => "not_checked", - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => - "postal_code_match_address_no_match", - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => - "postal_code_no_match_address_match", - CardBalanceInquiryVerificationCardholderAddressResult.Match => "match", - CardBalanceInquiryVerificationCardholderAddressResult.NoMatch => "no_match", - CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => - "postal_code_match_address_not_checked", + CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardBalanceInquirySchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardBalanceInquirySchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardBalanceInquirySchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardBalanceInquirySchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardBalanceInquirySchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardBalanceInquirySchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardBalanceInquirySchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardBalanceInquirySchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardBalanceInquirySchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardBalanceInquirySchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardBalanceInquirySchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardBalanceInquirySchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardBalanceInquirySchemeFeeFeeType.VisaDebitPurchaseToken => + "visa_debit_purchase_token", + CardBalanceInquirySchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardBalanceInquirySchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardBalanceInquirySchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardBalanceInquirySchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardBalanceInquirySchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardBalanceInquirySchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardBalanceInquirySchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardBalanceInquirySchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -9384,90 +9886,140 @@ JsonSerializerOptions options } /// -/// Cardholder name provided in the authorization request. +/// A constant representing the object's type. For this resource it will always be `card_balance_inquiry`. /// -[JsonConverter( - typeof(JsonModelConverter< - CardBalanceInquiryVerificationCardholderName, - CardBalanceInquiryVerificationCardholderNameFromRaw - >) -)] -public sealed record class CardBalanceInquiryVerificationCardholderName : JsonModel +[JsonConverter(typeof(CardBalanceInquiryTypeConverter))] +public enum CardBalanceInquiryType { - /// - /// The first name provided for verification in the authorization request. - /// - public required string? ProvidedFirstName + CardBalanceInquiry, +} + +sealed class CardBalanceInquiryTypeConverter : JsonConverter +{ + public override CardBalanceInquiryType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_first_name"); - } - init { this._rawData.Set("provided_first_name", value); } - } - + "card_balance_inquiry" => CardBalanceInquiryType.CardBalanceInquiry, + _ => (CardBalanceInquiryType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardBalanceInquiryType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardBalanceInquiryType.CardBalanceInquiry => "card_balance_inquiry", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields related to verification of cardholder-provided values. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardBalanceInquiryVerification, + CardBalanceInquiryVerificationFromRaw + >) +)] +public sealed record class CardBalanceInquiryVerification : JsonModel +{ /// - /// The last name provided for verification in the authorization request. + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. /// - public required string? ProvidedLastName + public required CardBalanceInquiryVerificationCardVerificationCode CardVerificationCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_last_name"); + return this._rawData.GetNotNullClass( + "card_verification_code" + ); } - init { this._rawData.Set("provided_last_name", value); } + init { this._rawData.Set("card_verification_code", value); } } /// - /// The middle name provided for verification in the authorization request. + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. /// - public required string? ProvidedMiddleName + public required CardBalanceInquiryVerificationCardholderAddress CardholderAddress { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_middle_name"); + return this._rawData.GetNotNullClass( + "cardholder_address" + ); } - init { this._rawData.Set("provided_middle_name", value); } + init { this._rawData.Set("cardholder_address", value); } + } + + /// + /// Cardholder name provided in the authorization request. + /// + public required CardBalanceInquiryVerificationCardholderName? CardholderName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "cardholder_name" + ); + } + init { this._rawData.Set("cardholder_name", value); } } /// public override void Validate() { - _ = this.ProvidedFirstName; - _ = this.ProvidedLastName; - _ = this.ProvidedMiddleName; + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); } - public CardBalanceInquiryVerificationCardholderName() { } + public CardBalanceInquiryVerification() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardBalanceInquiryVerificationCardholderName( - CardBalanceInquiryVerificationCardholderName cardBalanceInquiryVerificationCardholderName + public CardBalanceInquiryVerification( + CardBalanceInquiryVerification cardBalanceInquiryVerification ) - : base(cardBalanceInquiryVerificationCardholderName) { } + : base(cardBalanceInquiryVerification) { } #pragma warning restore CS8618 - public CardBalanceInquiryVerificationCardholderName( - IReadOnlyDictionary rawData - ) + public CardBalanceInquiryVerification(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardBalanceInquiryVerificationCardholderName(FrozenDictionary rawData) + CardBalanceInquiryVerification(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardBalanceInquiryVerificationCardholderName FromRawUnchecked( + /// + public static CardBalanceInquiryVerification FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -9475,1093 +10027,1238 @@ IReadOnlyDictionary rawData } } -class CardBalanceInquiryVerificationCardholderNameFromRaw - : IFromRawJson +class CardBalanceInquiryVerificationFromRaw : IFromRawJson { /// - public CardBalanceInquiryVerificationCardholderName FromRawUnchecked( + public CardBalanceInquiryVerification FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardBalanceInquiryVerificationCardholderName.FromRawUnchecked(rawData); + ) => CardBalanceInquiryVerification.FromRawUnchecked(rawData); } /// -/// A Card Decline object. This field will be present in the JSON response if and -/// only if `category` is equal to `card_decline`. +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardDecline : JsonModel +[JsonConverter( + typeof(JsonModelConverter< + CardBalanceInquiryVerificationCardVerificationCode, + CardBalanceInquiryVerificationCardVerificationCodeFromRaw + >) +)] +public sealed record class CardBalanceInquiryVerificationCardVerificationCode : JsonModel { /// - /// The Card Decline identifier. + /// The result of verifying the Card Verification Code. /// - public required string ID + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("id", value); } + init { this._rawData.Set("result", value); } } - /// - /// Whether this authorization was approved by Increase, the card network through - /// stand-in processing, or the user through a real-time decision. - /// - public required ApiEnum Actioner + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("actioner"); - } - init { this._rawData.Set("actioner", value); } + this.Result.Validate(); } - /// - /// Additional amounts associated with the card authorization, such as ATM surcharges - /// fees. These are usually a subset of the `amount` field and are used to provide - /// more detailed information about the transaction. - /// - public required CardDeclineAdditionalAmounts AdditionalAmounts + public CardBalanceInquiryVerificationCardVerificationCode() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardBalanceInquiryVerificationCardVerificationCode( + CardBalanceInquiryVerificationCardVerificationCode cardBalanceInquiryVerificationCardVerificationCode + ) + : base(cardBalanceInquiryVerificationCardVerificationCode) { } +#pragma warning restore CS8618 + + public CardBalanceInquiryVerificationCardVerificationCode( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "additional_amounts" - ); - } - init { this._rawData.Set("additional_amounts", value); } + this._rawData = new(rawData); } - /// - /// The declined amount in the minor unit of the destination account currency. - /// For dollars, for example, this is cents. - /// - public required long Amount +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardBalanceInquiryVerificationCardVerificationCode( + FrozenDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// The ID of the Card Payment this transaction belongs to. - /// - public required string CardPaymentID + /// + public static CardBalanceInquiryVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); - } - init { this._rawData.Set("card_payment_id", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination - /// account currency. - /// - public required ApiEnum Currency + [SetsRequiredMembers] + public CardBalanceInquiryVerificationCardVerificationCode( + ApiEnum result + ) + : this() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); - } - init { this._rawData.Set("currency", value); } + this.Result = result; } +} + +class CardBalanceInquiryVerificationCardVerificationCodeFromRaw + : IFromRawJson +{ + /// + public CardBalanceInquiryVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardBalanceInquiryVerificationCardVerificationCode.FromRawUnchecked(rawData); +} +/// +/// The result of verifying the Card Verification Code. +/// +[JsonConverter(typeof(CardBalanceInquiryVerificationCardVerificationCodeResultConverter))] +public enum CardBalanceInquiryVerificationCardVerificationCodeResult +{ /// - /// The identifier of the declined transaction created for this Card Decline. + /// No card verification code was provided in the authorization request. /// - public required string DeclinedTransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("declined_transaction_id"); - } - init { this._rawData.Set("declined_transaction_id", value); } - } + NotChecked, /// - /// If the authorization was made via a Digital Wallet Token (such as an Apple - /// Pay purchase), the identifier of the token that was used. + /// The card verification code matched the one on file. /// - public required string? DigitalWalletTokenID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("digital_wallet_token_id"); - } - init { this._rawData.Set("digital_wallet_token_id", value); } - } + Match, /// - /// The direction describes the direction the funds will move, either from the - /// cardholder to the merchant or from the merchant to the cardholder. + /// The card verification code did not match the one on file. /// - public required ApiEnum Direction + NoMatch, +} + +sealed class CardBalanceInquiryVerificationCardVerificationCodeResultConverter + : JsonConverter +{ + public override CardBalanceInquiryVerificationCardVerificationCodeResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "direction" - ); - } - init { this._rawData.Set("direction", value); } + "not_checked" => CardBalanceInquiryVerificationCardVerificationCodeResult.NotChecked, + "match" => CardBalanceInquiryVerificationCardVerificationCodeResult.Match, + "no_match" => CardBalanceInquiryVerificationCardVerificationCodeResult.NoMatch, + _ => (CardBalanceInquiryVerificationCardVerificationCodeResult)(-1), + }; } - /// - /// The identifier of the card authorization this request attempted to incrementally authorize. - /// - public required string? IncrementedCardAuthorizationID + public override void Write( + Utf8JsonWriter writer, + CardBalanceInquiryVerificationCardVerificationCodeResult value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("incremented_card_authorization_id"); - } - init { this._rawData.Set("incremented_card_authorization_id", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CardBalanceInquiryVerificationCardVerificationCodeResult.NotChecked => + "not_checked", + CardBalanceInquiryVerificationCardVerificationCodeResult.Match => "match", + CardBalanceInquiryVerificationCardVerificationCodeResult.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardBalanceInquiryVerificationCardholderAddress, + CardBalanceInquiryVerificationCardholderAddressFromRaw + >) +)] +public sealed record class CardBalanceInquiryVerificationCardholderAddress : JsonModel +{ /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. + /// Line 1 of the address on file for the cardholder. /// - public required string MerchantAcceptorID + public required string? ActualLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); + return this._rawData.GetNullableClass("actual_line1"); } - init { this._rawData.Set("merchant_acceptor_id", value); } + init { this._rawData.Set("actual_line1", value); } } /// - /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - /// card is transacting with. + /// The postal code of the address on file for the cardholder. /// - public required string MerchantCategoryCode + public required string? ActualPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); + return this._rawData.GetNullableClass("actual_postal_code"); } - init { this._rawData.Set("merchant_category_code", value); } + init { this._rawData.Set("actual_postal_code", value); } } /// - /// The city the merchant resides in. + /// The cardholder address line 1 provided for verification in the authorization request. /// - public required string? MerchantCity + public required string? ProvidedLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_city"); + return this._rawData.GetNullableClass("provided_line1"); } - init { this._rawData.Set("merchant_city", value); } + init { this._rawData.Set("provided_line1", value); } } /// - /// The country the merchant resides in. + /// The postal code provided for verification in the authorization request. /// - public required string MerchantCountry + public required string? ProvidedPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); + return this._rawData.GetNullableClass("provided_postal_code"); } - init { this._rawData.Set("merchant_country", value); } + init { this._rawData.Set("provided_postal_code", value); } } /// - /// The merchant descriptor of the merchant the card is transacting with. + /// The address verification result returned to the card network. /// - public required string MerchantDescriptor + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_descriptor"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("merchant_descriptor", value); } + init { this._rawData.Set("result", value); } } - /// - /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit - /// ZIP code, where the first 5 and last 4 are separated by a dash. - /// - public required string? MerchantPostalCode + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } + _ = this.ActualLine1; + _ = this.ActualPostalCode; + _ = this.ProvidedLine1; + _ = this.ProvidedPostalCode; + this.Result.Validate(); } - /// - /// The state the merchant resides in. - /// - public required string? MerchantState + public CardBalanceInquiryVerificationCardholderAddress() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardBalanceInquiryVerificationCardholderAddress( + CardBalanceInquiryVerificationCardholderAddress cardBalanceInquiryVerificationCardholderAddress + ) + : base(cardBalanceInquiryVerificationCardholderAddress) { } +#pragma warning restore CS8618 + + public CardBalanceInquiryVerificationCardholderAddress( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } + this._rawData = new(rawData); } - /// - /// Fields specific to the `network`. - /// - public required CardDeclineNetworkDetails NetworkDetails +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardBalanceInquiryVerificationCardholderAddress(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("network_details"); - } - init { this._rawData.Set("network_details", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Network-specific identifiers for a specific request or transaction. - /// - public required CardDeclineNetworkIdentifiers NetworkIdentifiers + /// + public static CardBalanceInquiryVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardBalanceInquiryVerificationCardholderAddressFromRaw + : IFromRawJson +{ + /// + public CardBalanceInquiryVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardBalanceInquiryVerificationCardholderAddress.FromRawUnchecked(rawData); +} +/// +/// The address verification result returned to the card network. +/// +[JsonConverter(typeof(CardBalanceInquiryVerificationCardholderAddressResultConverter))] +public enum CardBalanceInquiryVerificationCardholderAddressResult +{ /// - /// The risk score generated by the card network. For Visa this is the Visa Advanced - /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse - /// the score is from 0 to 999, where 999 is the riskiest. + /// No address information was provided in the authorization request. /// - public required long? NetworkRiskScore - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("network_risk_score"); - } - init { this._rawData.Set("network_risk_score", value); } - } + NotChecked, /// - /// If the authorization was made in-person with a physical card, the Physical - /// Card that was used. + /// Postal code matches, but the street address does not match or was not provided. /// - public required string? PhysicalCardID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("physical_card_id"); - } - init { this._rawData.Set("physical_card_id", value); } - } + PostalCodeMatchAddressNoMatch, /// - /// The declined amount in the minor unit of the transaction's presentment currency. + /// Postal code does not match, but the street address matches or was not provided. /// - public required long PresentmentAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); - } - init { this._rawData.Set("presentment_amount", value); } - } + PostalCodeNoMatchAddressMatch, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// presentment currency. + /// Postal code and street address match. /// - public required string PresentmentCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); - } - init { this._rawData.Set("presentment_currency", value); } - } + Match, /// - /// The processing category describes the intent behind the authorization, such - /// as whether it was used for bill payments or an automatic fuel dispenser. + /// Postal code and street address do not match. /// - public required ApiEnum ProcessingCategory - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "processing_category" - ); - } - init { this._rawData.Set("processing_category", value); } - } + NoMatch, /// - /// The identifier of the Real-Time Decision sent to approve or decline this transaction. + /// Postal code matches, but the street address was not verified. (deprecated) /// - public required string? RealTimeDecisionID + PostalCodeMatchAddressNotChecked, +} + +sealed class CardBalanceInquiryVerificationCardholderAddressResultConverter + : JsonConverter +{ + public override CardBalanceInquiryVerificationCardholderAddressResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("real_time_decision_id"); - } - init { this._rawData.Set("real_time_decision_id", value); } + "not_checked" => CardBalanceInquiryVerificationCardholderAddressResult.NotChecked, + "postal_code_match_address_no_match" => + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, + "postal_code_no_match_address_match" => + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, + "match" => CardBalanceInquiryVerificationCardholderAddressResult.Match, + "no_match" => CardBalanceInquiryVerificationCardholderAddressResult.NoMatch, + "postal_code_match_address_not_checked" => + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, + _ => (CardBalanceInquiryVerificationCardholderAddressResult)(-1), + }; } - /// - /// This is present if a specific decline reason was given in the real-time decision. - /// - public required ApiEnum? RealTimeDecisionReason + public override void Write( + Utf8JsonWriter writer, + CardBalanceInquiryVerificationCardholderAddressResult value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "real_time_decision_reason" - ); - } - init { this._rawData.Set("real_time_decision_reason", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CardBalanceInquiryVerificationCardholderAddressResult.NotChecked => "not_checked", + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => + "postal_code_match_address_no_match", + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => + "postal_code_no_match_address_match", + CardBalanceInquiryVerificationCardholderAddressResult.Match => "match", + CardBalanceInquiryVerificationCardholderAddressResult.NoMatch => "no_match", + CardBalanceInquiryVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => + "postal_code_match_address_not_checked", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Cardholder name provided in the authorization request. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardBalanceInquiryVerificationCardholderName, + CardBalanceInquiryVerificationCardholderNameFromRaw + >) +)] +public sealed record class CardBalanceInquiryVerificationCardholderName : JsonModel +{ /// - /// Why the transaction was declined. + /// The first name provided for verification in the authorization request. /// - public required ApiEnum Reason + public required string? ProvidedFirstName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("reason"); + return this._rawData.GetNullableClass("provided_first_name"); } - init { this._rawData.Set("reason", value); } + init { this._rawData.Set("provided_first_name", value); } } /// - /// The terminal identifier (commonly abbreviated as TID) of the terminal the - /// card is transacting with. + /// The last name provided for verification in the authorization request. /// - public required string? TerminalID + public required string? ProvidedLastName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("terminal_id"); + return this._rawData.GetNullableClass("provided_last_name"); } - init { this._rawData.Set("terminal_id", value); } + init { this._rawData.Set("provided_last_name", value); } } /// - /// Fields related to verification of cardholder-provided values. + /// The middle name provided for verification in the authorization request. /// - public required CardDeclineVerification Verification + public required string? ProvidedMiddleName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("verification"); + return this._rawData.GetNullableClass("provided_middle_name"); } - init { this._rawData.Set("verification", value); } + init { this._rawData.Set("provided_middle_name", value); } } /// public override void Validate() { - _ = this.ID; - this.Actioner.Validate(); - this.AdditionalAmounts.Validate(); - _ = this.Amount; - _ = this.CardPaymentID; - this.Currency.Validate(); - _ = this.DeclinedTransactionID; - _ = this.DigitalWalletTokenID; - this.Direction.Validate(); - _ = this.IncrementedCardAuthorizationID; - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantDescriptor; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.NetworkDetails.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.NetworkRiskScore; - _ = this.PhysicalCardID; - _ = this.PresentmentAmount; - _ = this.PresentmentCurrency; - this.ProcessingCategory.Validate(); - _ = this.RealTimeDecisionID; - this.RealTimeDecisionReason?.Validate(); - this.Reason.Validate(); - _ = this.TerminalID; - this.Verification.Validate(); + _ = this.ProvidedFirstName; + _ = this.ProvidedLastName; + _ = this.ProvidedMiddleName; } - public CardDecline() { } + public CardBalanceInquiryVerificationCardholderName() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDecline(CardDecline cardDecline) - : base(cardDecline) { } + public CardBalanceInquiryVerificationCardholderName( + CardBalanceInquiryVerificationCardholderName cardBalanceInquiryVerificationCardholderName + ) + : base(cardBalanceInquiryVerificationCardholderName) { } #pragma warning restore CS8618 - public CardDecline(IReadOnlyDictionary rawData) + public CardBalanceInquiryVerificationCardholderName( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDecline(FrozenDictionary rawData) + CardBalanceInquiryVerificationCardholderName(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDecline FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardBalanceInquiryVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardDeclineFromRaw : IFromRawJson +class CardBalanceInquiryVerificationCardholderNameFromRaw + : IFromRawJson { /// - public CardDecline FromRawUnchecked(IReadOnlyDictionary rawData) => - CardDecline.FromRawUnchecked(rawData); + public CardBalanceInquiryVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardBalanceInquiryVerificationCardholderName.FromRawUnchecked(rawData); } /// -/// Whether this authorization was approved by Increase, the card network through -/// stand-in processing, or the user through a real-time decision. +/// A Card Decline object. This field will be present in the JSON response if and +/// only if `category` is equal to `card_decline`. /// -[JsonConverter(typeof(CardDeclineActionerConverter))] -public enum CardDeclineActioner +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardDecline : JsonModel { /// - /// This object was actioned by the user through a real-time decision. + /// The Card Decline identifier. /// - User, + public required string ID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("id"); + } + init { this._rawData.Set("id", value); } + } /// - /// This object was actioned by Increase without user intervention. + /// Whether this authorization was approved by Increase, the card network through + /// stand-in processing, or the user through a real-time decision. /// - Increase, + public required ApiEnum Actioner + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("actioner"); + } + init { this._rawData.Set("actioner", value); } + } /// - /// This object was actioned by the network, through stand-in processing. + /// Additional amounts associated with the card authorization, such as ATM surcharges + /// fees. These are usually a subset of the `amount` field and are used to provide + /// more detailed information about the transaction. /// - Network, -} - -sealed class CardDeclineActionerConverter : JsonConverter -{ - public override CardDeclineActioner Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required CardDeclineAdditionalAmounts AdditionalAmounts { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "user" => CardDeclineActioner.User, - "increase" => CardDeclineActioner.Increase, - "network" => CardDeclineActioner.Network, - _ => (CardDeclineActioner)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "additional_amounts" + ); + } + init { this._rawData.Set("additional_amounts", value); } } - public override void Write( - Utf8JsonWriter writer, - CardDeclineActioner value, - JsonSerializerOptions options - ) + /// + /// The declined amount in the minor unit of the destination account currency. + /// For dollars, for example, this is cents. + /// + public required long Amount { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineActioner.User => "user", - CardDeclineActioner.Increase => "increase", - CardDeclineActioner.Network => "network", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } } -} -/// -/// Additional amounts associated with the card authorization, such as ATM surcharges -/// fees. These are usually a subset of the `amount` field and are used to provide -/// more detailed information about the transaction. -/// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardDeclineAdditionalAmounts : JsonModel -{ /// - /// The part of this transaction amount that was for clinic-related services. + /// The ID of the Card Payment this transaction belongs to. /// - public required CardDeclineAdditionalAmountsClinic? Clinic + public required string CardPaymentID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("clinic"); + return this._rawData.GetNotNullClass("card_payment_id"); } - init { this._rawData.Set("clinic", value); } + init { this._rawData.Set("card_payment_id", value); } } /// - /// The part of this transaction amount that was for dental-related services. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination + /// account currency. /// - public required CardDeclineAdditionalAmountsDental? Dental + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("dental"); + return this._rawData.GetNotNullClass>("currency"); } - init { this._rawData.Set("dental", value); } + init { this._rawData.Set("currency", value); } } /// - /// The original pre-authorized amount. + /// The identifier of the declined transaction created for this Card Decline. /// - public required CardDeclineAdditionalAmountsOriginal? Original + public required string DeclinedTransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("original"); + return this._rawData.GetNotNullClass("declined_transaction_id"); } - init { this._rawData.Set("original", value); } + init { this._rawData.Set("declined_transaction_id", value); } } /// - /// The part of this transaction amount that was for healthcare prescriptions. + /// If the authorization was made via a Digital Wallet Token (such as an Apple + /// Pay purchase), the identifier of the token that was used. /// - public required CardDeclineAdditionalAmountsPrescription? Prescription + public required string? DigitalWalletTokenID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "prescription" - ); + return this._rawData.GetNullableClass("digital_wallet_token_id"); } - init { this._rawData.Set("prescription", value); } + init { this._rawData.Set("digital_wallet_token_id", value); } } /// - /// The surcharge amount charged for this transaction by the merchant. + /// The direction describes the direction the funds will move, either from the + /// cardholder to the merchant or from the merchant to the cardholder. /// - public required CardDeclineAdditionalAmountsSurcharge? Surcharge + public required ApiEnum Direction { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "surcharge" + return this._rawData.GetNotNullClass>( + "direction" ); } - init { this._rawData.Set("surcharge", value); } + init { this._rawData.Set("direction", value); } } /// - /// The total amount of a series of incremental authorizations, optionally provided. + /// The identifier of the card authorization this request attempted to incrementally authorize. /// - public required CardDeclineAdditionalAmountsTotalCumulative? TotalCumulative + public required string? IncrementedCardAuthorizationID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_cumulative" - ); + return this._rawData.GetNullableClass("incremented_card_authorization_id"); } - init { this._rawData.Set("total_cumulative", value); } + init { this._rawData.Set("incremented_card_authorization_id", value); } } /// - /// The total amount of healthcare-related additional amounts. + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. /// - public required CardDeclineAdditionalAmountsTotalHealthcare? TotalHealthcare + public required string MerchantAcceptorID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_healthcare" - ); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); } - init { this._rawData.Set("total_healthcare", value); } + init { this._rawData.Set("merchant_acceptor_id", value); } } /// - /// The part of this transaction amount that was for transit-related services. + /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + /// card is transacting with. /// - public required CardDeclineAdditionalAmountsTransit? Transit + public required string MerchantCategoryCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("transit"); + return this._rawData.GetNotNullClass("merchant_category_code"); } - init { this._rawData.Set("transit", value); } + init { this._rawData.Set("merchant_category_code", value); } } /// - /// An unknown additional amount. + /// The city the merchant resides in. /// - public required CardDeclineAdditionalAmountsUnknown? Unknown + public required string? MerchantCity { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("unknown"); + return this._rawData.GetNullableClass("merchant_city"); } - init { this._rawData.Set("unknown", value); } + init { this._rawData.Set("merchant_city", value); } } /// - /// The part of this transaction amount that was for vision-related services. + /// The country the merchant resides in. /// - public required CardDeclineAdditionalAmountsVision? Vision + public required string MerchantCountry { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("vision"); + return this._rawData.GetNotNullClass("merchant_country"); } - init { this._rawData.Set("vision", value); } + init { this._rawData.Set("merchant_country", value); } } - /// - public override void Validate() + /// + /// The merchant descriptor of the merchant the card is transacting with. + /// + public required string MerchantDescriptor { - this.Clinic?.Validate(); - this.Dental?.Validate(); - this.Original?.Validate(); - this.Prescription?.Validate(); - this.Surcharge?.Validate(); - this.TotalCumulative?.Validate(); - this.TotalHealthcare?.Validate(); - this.Transit?.Validate(); - this.Unknown?.Validate(); - this.Vision?.Validate(); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_descriptor"); + } + init { this._rawData.Set("merchant_descriptor", value); } } - public CardDeclineAdditionalAmounts() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineAdditionalAmounts(CardDeclineAdditionalAmounts cardDeclineAdditionalAmounts) - : base(cardDeclineAdditionalAmounts) { } -#pragma warning restore CS8618 - - public CardDeclineAdditionalAmounts(IReadOnlyDictionary rawData) + /// + /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// + public required string? MerchantPostalCode { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineAdditionalAmounts(FrozenDictionary rawData) + /// + /// The state the merchant resides in. + /// + public required string? MerchantState { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_state"); + } + init { this._rawData.Set("merchant_state", value); } } -#pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// Fields specific to the `network`. + /// + public required CardDeclineNetworkDetails NetworkDetails { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("network_details"); + } + init { this._rawData.Set("network_details", value); } } -} - -class CardDeclineAdditionalAmountsFromRaw : IFromRawJson -{ - /// - public CardDeclineAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmounts.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for clinic-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineAdditionalAmountsClinic, - CardDeclineAdditionalAmountsClinicFromRaw - >) -)] -public sealed record class CardDeclineAdditionalAmountsClinic : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Network-specific identifiers for a specific request or transaction. /// - public required long Amount + public required CardDeclineNetworkIdentifiers NetworkIdentifiers { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("network_identifiers", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The risk score generated by the card network. For Visa this is the Visa Advanced + /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse + /// the score is from 0 to 999, where 999 is the riskiest. /// - public required string Currency + public required long? NetworkRiskScore { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableStruct("network_risk_score"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("network_risk_score", value); } } - /// - public override void Validate() + /// + /// If the authorization was made in-person with a physical card, the Physical + /// Card that was used. + /// + public required string? PhysicalCardID { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("physical_card_id"); + } + init { this._rawData.Set("physical_card_id", value); } } - public CardDeclineAdditionalAmountsClinic() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineAdditionalAmountsClinic( - CardDeclineAdditionalAmountsClinic cardDeclineAdditionalAmountsClinic - ) - : base(cardDeclineAdditionalAmountsClinic) { } -#pragma warning restore CS8618 - - public CardDeclineAdditionalAmountsClinic(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineAdditionalAmountsClinic(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardDeclineAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The declined amount in the minor unit of the transaction's presentment currency. + /// + public required long PresentmentAmount { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("presentment_amount"); + } + init { this._rawData.Set("presentment_amount", value); } } -} - -class CardDeclineAdditionalAmountsClinicFromRaw : IFromRawJson -{ - /// - public CardDeclineAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsClinic.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for dental-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineAdditionalAmountsDental, - CardDeclineAdditionalAmountsDentalFromRaw - >) -)] -public sealed record class CardDeclineAdditionalAmountsDental : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// presentment currency. /// - public required long Amount + public required string PresentmentCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("presentment_currency"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("presentment_currency", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The processing category describes the intent behind the authorization, such + /// as whether it was used for bill payments or an automatic fuel dispenser. /// - public required string Currency + public required ApiEnum ProcessingCategory { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass>( + "processing_category" + ); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("processing_category", value); } } - /// - public override void Validate() + /// + /// The identifier of the Real-Time Decision sent to approve or decline this transaction. + /// + public required string? RealTimeDecisionID { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("real_time_decision_id"); + } + init { this._rawData.Set("real_time_decision_id", value); } } - public CardDeclineAdditionalAmountsDental() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineAdditionalAmountsDental( - CardDeclineAdditionalAmountsDental cardDeclineAdditionalAmountsDental - ) - : base(cardDeclineAdditionalAmountsDental) { } -#pragma warning restore CS8618 - - public CardDeclineAdditionalAmountsDental(IReadOnlyDictionary rawData) + /// + /// This is present if a specific decline reason was given in the real-time decision. + /// + public required ApiEnum? RealTimeDecisionReason { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>( + "real_time_decision_reason" + ); + } + init { this._rawData.Set("real_time_decision_reason", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineAdditionalAmountsDental(FrozenDictionary rawData) + /// + /// Why the transaction was declined. + /// + public required ApiEnum Reason { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("reason"); + } + init { this._rawData.Set("reason", value); } } -#pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The scheme fees associated with this card decline. + /// + public required IReadOnlyList SchemeFees { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } } -} - -class CardDeclineAdditionalAmountsDentalFromRaw : IFromRawJson -{ - /// - public CardDeclineAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsDental.FromRawUnchecked(rawData); -} -/// -/// The original pre-authorized amount. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineAdditionalAmountsOriginal, - CardDeclineAdditionalAmountsOriginalFromRaw - >) -)] -public sealed record class CardDeclineAdditionalAmountsOriginal : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The terminal identifier (commonly abbreviated as TID) of the terminal the + /// card is transacting with. /// - public required long Amount + public required string? TerminalID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("terminal_id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("terminal_id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Fields related to verification of cardholder-provided values. /// - public required string Currency + public required CardDeclineVerification Verification { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass("verification"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("verification", value); } } /// public override void Validate() { + _ = this.ID; + this.Actioner.Validate(); + this.AdditionalAmounts.Validate(); _ = this.Amount; - _ = this.Currency; + _ = this.CardPaymentID; + this.Currency.Validate(); + _ = this.DeclinedTransactionID; + _ = this.DigitalWalletTokenID; + this.Direction.Validate(); + _ = this.IncrementedCardAuthorizationID; + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantDescriptor; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.NetworkDetails.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.NetworkRiskScore; + _ = this.PhysicalCardID; + _ = this.PresentmentAmount; + _ = this.PresentmentCurrency; + this.ProcessingCategory.Validate(); + _ = this.RealTimeDecisionID; + this.RealTimeDecisionReason?.Validate(); + this.Reason.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + _ = this.TerminalID; + this.Verification.Validate(); } - public CardDeclineAdditionalAmountsOriginal() { } + public CardDecline() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsOriginal( - CardDeclineAdditionalAmountsOriginal cardDeclineAdditionalAmountsOriginal - ) - : base(cardDeclineAdditionalAmountsOriginal) { } + public CardDecline(CardDecline cardDecline) + : base(cardDecline) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsOriginal(IReadOnlyDictionary rawData) + public CardDecline(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsOriginal(FrozenDictionary rawData) + CardDecline(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static CardDecline FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardDeclineAdditionalAmountsOriginalFromRaw - : IFromRawJson +class CardDeclineFromRaw : IFromRawJson { /// - public CardDeclineAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsOriginal.FromRawUnchecked(rawData); + public CardDecline FromRawUnchecked(IReadOnlyDictionary rawData) => + CardDecline.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for healthcare prescriptions. +/// Whether this authorization was approved by Increase, the card network through +/// stand-in processing, or the user through a real-time decision. /// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineAdditionalAmountsPrescription, - CardDeclineAdditionalAmountsPrescriptionFromRaw - >) -)] -public sealed record class CardDeclineAdditionalAmountsPrescription : JsonModel +[JsonConverter(typeof(CardDeclineActionerConverter))] +public enum CardDeclineActioner { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// This object was actioned by the user through a real-time decision. /// - public required long Amount + User, + + /// + /// This object was actioned by Increase without user intervention. + /// + Increase, + + /// + /// This object was actioned by the network, through stand-in processing. + /// + Network, +} + +sealed class CardDeclineActionerConverter : JsonConverter +{ + public override CardDeclineActioner Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "user" => CardDeclineActioner.User, + "increase" => CardDeclineActioner.Increase, + "network" => CardDeclineActioner.Network, + _ => (CardDeclineActioner)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardDeclineActioner value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineActioner.User => "user", + CardDeclineActioner.Increase => "increase", + CardDeclineActioner.Network => "network", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Additional amounts associated with the card authorization, such as ATM surcharges +/// fees. These are usually a subset of the `amount` field and are used to provide +/// more detailed information about the transaction. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardDeclineAdditionalAmounts : JsonModel +{ + /// + /// The part of this transaction amount that was for clinic-related services. + /// + public required CardDeclineAdditionalAmountsClinic? Clinic { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("clinic"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("clinic", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The part of this transaction amount that was for dental-related services. /// - public required string Currency + public required CardDeclineAdditionalAmountsDental? Dental { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("dental"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("dental", value); } + } + + /// + /// The original pre-authorized amount. + /// + public required CardDeclineAdditionalAmountsOriginal? Original + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("original"); + } + init { this._rawData.Set("original", value); } + } + + /// + /// The part of this transaction amount that was for healthcare prescriptions. + /// + public required CardDeclineAdditionalAmountsPrescription? Prescription + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "prescription" + ); + } + init { this._rawData.Set("prescription", value); } + } + + /// + /// The surcharge amount charged for this transaction by the merchant. + /// + public required CardDeclineAdditionalAmountsSurcharge? Surcharge + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "surcharge" + ); + } + init { this._rawData.Set("surcharge", value); } + } + + /// + /// The total amount of a series of incremental authorizations, optionally provided. + /// + public required CardDeclineAdditionalAmountsTotalCumulative? TotalCumulative + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_cumulative" + ); + } + init { this._rawData.Set("total_cumulative", value); } + } + + /// + /// The total amount of healthcare-related additional amounts. + /// + public required CardDeclineAdditionalAmountsTotalHealthcare? TotalHealthcare + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_healthcare" + ); + } + init { this._rawData.Set("total_healthcare", value); } + } + + /// + /// The part of this transaction amount that was for transit-related services. + /// + public required CardDeclineAdditionalAmountsTransit? Transit + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("transit"); + } + init { this._rawData.Set("transit", value); } + } + + /// + /// An unknown additional amount. + /// + public required CardDeclineAdditionalAmountsUnknown? Unknown + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("unknown"); + } + init { this._rawData.Set("unknown", value); } + } + + /// + /// The part of this transaction amount that was for vision-related services. + /// + public required CardDeclineAdditionalAmountsVision? Vision + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("vision"); + } + init { this._rawData.Set("vision", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Currency; + this.Clinic?.Validate(); + this.Dental?.Validate(); + this.Original?.Validate(); + this.Prescription?.Validate(); + this.Surcharge?.Validate(); + this.TotalCumulative?.Validate(); + this.TotalHealthcare?.Validate(); + this.Transit?.Validate(); + this.Unknown?.Validate(); + this.Vision?.Validate(); } - public CardDeclineAdditionalAmountsPrescription() { } + public CardDeclineAdditionalAmounts() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsPrescription( - CardDeclineAdditionalAmountsPrescription cardDeclineAdditionalAmountsPrescription - ) - : base(cardDeclineAdditionalAmountsPrescription) { } + public CardDeclineAdditionalAmounts(CardDeclineAdditionalAmounts cardDeclineAdditionalAmounts) + : base(cardDeclineAdditionalAmounts) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsPrescription( - IReadOnlyDictionary rawData - ) + public CardDeclineAdditionalAmounts(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsPrescription(FrozenDictionary rawData) + CardDeclineAdditionalAmounts(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsPrescription FromRawUnchecked( + /// + public static CardDeclineAdditionalAmounts FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -10569,25 +11266,24 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsPrescriptionFromRaw - : IFromRawJson +class CardDeclineAdditionalAmountsFromRaw : IFromRawJson { /// - public CardDeclineAdditionalAmountsPrescription FromRawUnchecked( + public CardDeclineAdditionalAmounts FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsPrescription.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmounts.FromRawUnchecked(rawData); } /// -/// The surcharge amount charged for this transaction by the merchant. +/// The part of this transaction amount that was for clinic-related services. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsSurcharge, - CardDeclineAdditionalAmountsSurchargeFromRaw + CardDeclineAdditionalAmountsClinic, + CardDeclineAdditionalAmountsClinicFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsSurcharge : JsonModel +public sealed record class CardDeclineAdditionalAmountsClinic : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -10625,31 +11321,31 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsSurcharge() { } + public CardDeclineAdditionalAmountsClinic() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsSurcharge( - CardDeclineAdditionalAmountsSurcharge cardDeclineAdditionalAmountsSurcharge + public CardDeclineAdditionalAmountsClinic( + CardDeclineAdditionalAmountsClinic cardDeclineAdditionalAmountsClinic ) - : base(cardDeclineAdditionalAmountsSurcharge) { } + : base(cardDeclineAdditionalAmountsClinic) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsClinic(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsSurcharge(FrozenDictionary rawData) + CardDeclineAdditionalAmountsClinic(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsSurcharge FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsClinic FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -10657,25 +11353,24 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsSurchargeFromRaw - : IFromRawJson +class CardDeclineAdditionalAmountsClinicFromRaw : IFromRawJson { /// - public CardDeclineAdditionalAmountsSurcharge FromRawUnchecked( + public CardDeclineAdditionalAmountsClinic FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsSurcharge.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsClinic.FromRawUnchecked(rawData); } /// -/// The total amount of a series of incremental authorizations, optionally provided. +/// The part of this transaction amount that was for dental-related services. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsTotalCumulative, - CardDeclineAdditionalAmountsTotalCumulativeFromRaw + CardDeclineAdditionalAmountsDental, + CardDeclineAdditionalAmountsDentalFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsTotalCumulative : JsonModel +public sealed record class CardDeclineAdditionalAmountsDental : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -10713,33 +11408,31 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsTotalCumulative() { } + public CardDeclineAdditionalAmountsDental() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsTotalCumulative( - CardDeclineAdditionalAmountsTotalCumulative cardDeclineAdditionalAmountsTotalCumulative + public CardDeclineAdditionalAmountsDental( + CardDeclineAdditionalAmountsDental cardDeclineAdditionalAmountsDental ) - : base(cardDeclineAdditionalAmountsTotalCumulative) { } + : base(cardDeclineAdditionalAmountsDental) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsTotalCumulative( - IReadOnlyDictionary rawData - ) + public CardDeclineAdditionalAmountsDental(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsTotalCumulative(FrozenDictionary rawData) + CardDeclineAdditionalAmountsDental(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsTotalCumulative FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsDental FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -10747,25 +11440,24 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsTotalCumulativeFromRaw - : IFromRawJson +class CardDeclineAdditionalAmountsDentalFromRaw : IFromRawJson { /// - public CardDeclineAdditionalAmountsTotalCumulative FromRawUnchecked( + public CardDeclineAdditionalAmountsDental FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsDental.FromRawUnchecked(rawData); } /// -/// The total amount of healthcare-related additional amounts. +/// The original pre-authorized amount. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsTotalHealthcare, - CardDeclineAdditionalAmountsTotalHealthcareFromRaw + CardDeclineAdditionalAmountsOriginal, + CardDeclineAdditionalAmountsOriginalFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsTotalHealthcare : JsonModel +public sealed record class CardDeclineAdditionalAmountsOriginal : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -10803,33 +11495,31 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsTotalHealthcare() { } + public CardDeclineAdditionalAmountsOriginal() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsTotalHealthcare( - CardDeclineAdditionalAmountsTotalHealthcare cardDeclineAdditionalAmountsTotalHealthcare + public CardDeclineAdditionalAmountsOriginal( + CardDeclineAdditionalAmountsOriginal cardDeclineAdditionalAmountsOriginal ) - : base(cardDeclineAdditionalAmountsTotalHealthcare) { } + : base(cardDeclineAdditionalAmountsOriginal) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsTotalHealthcare( - IReadOnlyDictionary rawData - ) + public CardDeclineAdditionalAmountsOriginal(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) + CardDeclineAdditionalAmountsOriginal(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsTotalHealthcare FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsOriginal FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -10837,25 +11527,25 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsTotalHealthcareFromRaw - : IFromRawJson +class CardDeclineAdditionalAmountsOriginalFromRaw + : IFromRawJson { /// - public CardDeclineAdditionalAmountsTotalHealthcare FromRawUnchecked( + public CardDeclineAdditionalAmountsOriginal FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsOriginal.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for transit-related services. +/// The part of this transaction amount that was for healthcare prescriptions. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsTransit, - CardDeclineAdditionalAmountsTransitFromRaw + CardDeclineAdditionalAmountsPrescription, + CardDeclineAdditionalAmountsPrescriptionFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsTransit : JsonModel +public sealed record class CardDeclineAdditionalAmountsPrescription : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -10893,31 +11583,33 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsTransit() { } + public CardDeclineAdditionalAmountsPrescription() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsTransit( - CardDeclineAdditionalAmountsTransit cardDeclineAdditionalAmountsTransit + public CardDeclineAdditionalAmountsPrescription( + CardDeclineAdditionalAmountsPrescription cardDeclineAdditionalAmountsPrescription ) - : base(cardDeclineAdditionalAmountsTransit) { } + : base(cardDeclineAdditionalAmountsPrescription) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsTransit(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsPrescription( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsTransit(FrozenDictionary rawData) + CardDeclineAdditionalAmountsPrescription(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsTransit FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsPrescription FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -10925,24 +11617,25 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsTransitFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsPrescriptionFromRaw + : IFromRawJson { /// - public CardDeclineAdditionalAmountsTransit FromRawUnchecked( + public CardDeclineAdditionalAmountsPrescription FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsTransit.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsPrescription.FromRawUnchecked(rawData); } /// -/// An unknown additional amount. +/// The surcharge amount charged for this transaction by the merchant. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsUnknown, - CardDeclineAdditionalAmountsUnknownFromRaw + CardDeclineAdditionalAmountsSurcharge, + CardDeclineAdditionalAmountsSurchargeFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsUnknown : JsonModel +public sealed record class CardDeclineAdditionalAmountsSurcharge : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -10980,31 +11673,31 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsUnknown() { } + public CardDeclineAdditionalAmountsSurcharge() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsUnknown( - CardDeclineAdditionalAmountsUnknown cardDeclineAdditionalAmountsUnknown + public CardDeclineAdditionalAmountsSurcharge( + CardDeclineAdditionalAmountsSurcharge cardDeclineAdditionalAmountsSurcharge ) - : base(cardDeclineAdditionalAmountsUnknown) { } + : base(cardDeclineAdditionalAmountsSurcharge) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsUnknown(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsUnknown(FrozenDictionary rawData) + CardDeclineAdditionalAmountsSurcharge(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsUnknown FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsSurcharge FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -11012,24 +11705,25 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsUnknownFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsSurchargeFromRaw + : IFromRawJson { /// - public CardDeclineAdditionalAmountsUnknown FromRawUnchecked( + public CardDeclineAdditionalAmountsSurcharge FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsUnknown.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsSurcharge.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for vision-related services. +/// The total amount of a series of incremental authorizations, optionally provided. /// [JsonConverter( typeof(JsonModelConverter< - CardDeclineAdditionalAmountsVision, - CardDeclineAdditionalAmountsVisionFromRaw + CardDeclineAdditionalAmountsTotalCumulative, + CardDeclineAdditionalAmountsTotalCumulativeFromRaw >) )] -public sealed record class CardDeclineAdditionalAmountsVision : JsonModel +public sealed record class CardDeclineAdditionalAmountsTotalCumulative : JsonModel { /// /// The amount in minor units of the `currency` field. The amount is positive @@ -11067,31 +11761,33 @@ public override void Validate() _ = this.Currency; } - public CardDeclineAdditionalAmountsVision() { } + public CardDeclineAdditionalAmountsTotalCumulative() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineAdditionalAmountsVision( - CardDeclineAdditionalAmountsVision cardDeclineAdditionalAmountsVision + public CardDeclineAdditionalAmountsTotalCumulative( + CardDeclineAdditionalAmountsTotalCumulative cardDeclineAdditionalAmountsTotalCumulative ) - : base(cardDeclineAdditionalAmountsVision) { } + : base(cardDeclineAdditionalAmountsTotalCumulative) { } #pragma warning restore CS8618 - public CardDeclineAdditionalAmountsVision(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsTotalCumulative( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineAdditionalAmountsVision(FrozenDictionary rawData) + CardDeclineAdditionalAmountsTotalCumulative(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineAdditionalAmountsVision FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsTotalCumulative FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -11099,198 +11795,177 @@ IReadOnlyDictionary rawData } } -class CardDeclineAdditionalAmountsVisionFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsTotalCumulativeFromRaw + : IFromRawJson { /// - public CardDeclineAdditionalAmountsVision FromRawUnchecked( + public CardDeclineAdditionalAmountsTotalCumulative FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineAdditionalAmountsVision.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination -/// account currency. +/// The total amount of healthcare-related additional amounts. /// -[JsonConverter(typeof(CardDeclineCurrencyConverter))] -public enum CardDeclineCurrency +[JsonConverter( + typeof(JsonModelConverter< + CardDeclineAdditionalAmountsTotalHealthcare, + CardDeclineAdditionalAmountsTotalHealthcareFromRaw + >) +)] +public sealed record class CardDeclineAdditionalAmountsTotalHealthcare : JsonModel { /// - /// US Dollar (USD) + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - Usd, -} + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } -sealed class CardDeclineCurrencyConverter : JsonConverter -{ - public override CardDeclineCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "USD" => CardDeclineCurrency.Usd, - _ => (CardDeclineCurrency)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } } - public override void Write( - Utf8JsonWriter writer, - CardDeclineCurrency value, - JsonSerializerOptions options - ) + /// + public override void Validate() { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + _ = this.Amount; + _ = this.Currency; } -} -/// -/// The direction describes the direction the funds will move, either from the cardholder -/// to the merchant or from the merchant to the cardholder. -/// -[JsonConverter(typeof(CardDeclineDirectionConverter))] -public enum CardDeclineDirection -{ - /// - /// A regular card authorization where funds are debited from the cardholder. - /// - Settlement, + public CardDeclineAdditionalAmountsTotalHealthcare() { } - /// - /// A refund card authorization, sometimes referred to as a credit voucher authorization, - /// where funds are credited to the cardholder. - /// - Refund, -} +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardDeclineAdditionalAmountsTotalHealthcare( + CardDeclineAdditionalAmountsTotalHealthcare cardDeclineAdditionalAmountsTotalHealthcare + ) + : base(cardDeclineAdditionalAmountsTotalHealthcare) { } +#pragma warning restore CS8618 -sealed class CardDeclineDirectionConverter : JsonConverter -{ - public override CardDeclineDirection Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options + public CardDeclineAdditionalAmountsTotalHealthcare( + IReadOnlyDictionary rawData ) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "settlement" => CardDeclineDirection.Settlement, - "refund" => CardDeclineDirection.Refund, - _ => (CardDeclineDirection)(-1), - }; + this._rawData = new(rawData); } - public override void Write( - Utf8JsonWriter writer, - CardDeclineDirection value, - JsonSerializerOptions options +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardDeclineAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardDeclineAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineDirection.Settlement => "settlement", - CardDeclineDirection.Refund => "refund", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardDeclineAdditionalAmountsTotalHealthcareFromRaw + : IFromRawJson +{ + /// + public CardDeclineAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardDeclineAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); +} + /// -/// Fields specific to the `network`. +/// The part of this transaction amount that was for transit-related services. /// [JsonConverter( - typeof(JsonModelConverter) + typeof(JsonModelConverter< + CardDeclineAdditionalAmountsTransit, + CardDeclineAdditionalAmountsTransitFromRaw + >) )] -public sealed record class CardDeclineNetworkDetails : JsonModel +public sealed record class CardDeclineAdditionalAmountsTransit : JsonModel { /// - /// The payment network used to process this card authorization. - /// - public required ApiEnum Category - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("category"); - } - init { this._rawData.Set("category", value); } - } - - /// - /// Fields specific to the `pulse` network. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required CardDeclineNetworkDetailsPulse? Pulse + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("pulse"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("pulse", value); } + init { this._rawData.Set("amount", value); } } /// - /// Fields specific to the `visa` network. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required CardDeclineNetworkDetailsVisa? Visa + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("visa"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("visa", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - this.Category.Validate(); - this.Pulse?.Validate(); - this.Visa?.Validate(); + _ = this.Amount; + _ = this.Currency; } - public CardDeclineNetworkDetails() { } + public CardDeclineAdditionalAmountsTransit() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineNetworkDetails(CardDeclineNetworkDetails cardDeclineNetworkDetails) - : base(cardDeclineNetworkDetails) { } + public CardDeclineAdditionalAmountsTransit( + CardDeclineAdditionalAmountsTransit cardDeclineAdditionalAmountsTransit + ) + : base(cardDeclineAdditionalAmountsTransit) { } #pragma warning restore CS8618 - public CardDeclineNetworkDetails(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsTransit(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineNetworkDetails(FrozenDictionary rawData) + CardDeclineAdditionalAmountsTransit(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineNetworkDetails FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsTransit FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -11298,108 +11973,86 @@ IReadOnlyDictionary rawData } } -class CardDeclineNetworkDetailsFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsTransitFromRaw : IFromRawJson { /// - public CardDeclineNetworkDetails FromRawUnchecked( + public CardDeclineAdditionalAmountsTransit FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineNetworkDetails.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsTransit.FromRawUnchecked(rawData); } /// -/// The payment network used to process this card authorization. +/// An unknown additional amount. /// -[JsonConverter(typeof(CardDeclineNetworkDetailsCategoryConverter))] -public enum CardDeclineNetworkDetailsCategory +[JsonConverter( + typeof(JsonModelConverter< + CardDeclineAdditionalAmountsUnknown, + CardDeclineAdditionalAmountsUnknownFromRaw + >) +)] +public sealed record class CardDeclineAdditionalAmountsUnknown : JsonModel { /// - /// Visa + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - Visa, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Pulse + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - Pulse, -} - -sealed class CardDeclineNetworkDetailsCategoryConverter - : JsonConverter -{ - public override CardDeclineNetworkDetailsCategory Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string Currency { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "visa" => CardDeclineNetworkDetailsCategory.Visa, - "pulse" => CardDeclineNetworkDetailsCategory.Pulse, - _ => (CardDeclineNetworkDetailsCategory)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } } - public override void Write( - Utf8JsonWriter writer, - CardDeclineNetworkDetailsCategory value, - JsonSerializerOptions options - ) + /// + public override void Validate() { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineNetworkDetailsCategory.Visa => "visa", - CardDeclineNetworkDetailsCategory.Pulse => "pulse", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + _ = this.Amount; + _ = this.Currency; } -} - -/// -/// Fields specific to the `pulse` network. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineNetworkDetailsPulse, - CardDeclineNetworkDetailsPulseFromRaw - >) -)] -public sealed record class CardDeclineNetworkDetailsPulse : JsonModel -{ - /// - public override void Validate() { } - public CardDeclineNetworkDetailsPulse() { } + public CardDeclineAdditionalAmountsUnknown() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineNetworkDetailsPulse( - CardDeclineNetworkDetailsPulse cardDeclineNetworkDetailsPulse + public CardDeclineAdditionalAmountsUnknown( + CardDeclineAdditionalAmountsUnknown cardDeclineAdditionalAmountsUnknown ) - : base(cardDeclineNetworkDetailsPulse) { } + : base(cardDeclineAdditionalAmountsUnknown) { } #pragma warning restore CS8618 - public CardDeclineNetworkDetailsPulse(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsUnknown(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineNetworkDetailsPulse(FrozenDictionary rawData) + CardDeclineAdditionalAmountsUnknown(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineNetworkDetailsPulse FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsUnknown FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -11407,136 +12060,86 @@ IReadOnlyDictionary rawData } } -class CardDeclineNetworkDetailsPulseFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsUnknownFromRaw : IFromRawJson { /// - public CardDeclineNetworkDetailsPulse FromRawUnchecked( + public CardDeclineAdditionalAmountsUnknown FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineNetworkDetailsPulse.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsUnknown.FromRawUnchecked(rawData); } /// -/// Fields specific to the `visa` network. +/// The part of this transaction amount that was for vision-related services. /// [JsonConverter( - typeof(JsonModelConverter) + typeof(JsonModelConverter< + CardDeclineAdditionalAmountsVision, + CardDeclineAdditionalAmountsVisionFromRaw + >) )] -public sealed record class CardDeclineNetworkDetailsVisa : JsonModel +public sealed record class CardDeclineAdditionalAmountsVision : JsonModel { /// - /// For electronic commerce transactions, this identifies the level of security - /// used in obtaining the customer's payment credential. For mail or telephone - /// order transactions, identifies the type of mail or telephone order. - /// - public required ApiEnum< - string, - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator - >? ElectronicCommerceIndicator - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("electronic_commerce_indicator"); - } - init { this._rawData.Set("electronic_commerce_indicator", value); } - } - - /// - /// The method used to enter the cardholder's primary account number and card - /// expiration date. - /// - public required ApiEnum< - string, - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode - >? PointOfServiceEntryMode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("point_of_service_entry_mode"); - } - init { this._rawData.Set("point_of_service_entry_mode", value); } - } - - /// - /// Only present when `actioner: network`. Describes why a card authorization - /// was approved or declined by Visa through stand-in processing. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required ApiEnum< - string, - CardDeclineNetworkDetailsVisaStandInProcessingReason - >? StandInProcessingReason + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("stand_in_processing_reason"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("stand_in_processing_reason", value); } + init { this._rawData.Set("amount", value); } } /// - /// The capability of the terminal being used to read the card. Shows whether - /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe - /// reads. This reflects the highest capability of the terminal — for example, - /// a terminal that supports both chip and magnetic stripe will be identified - /// as chip-capable. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required ApiEnum< - string, - CardDeclineNetworkDetailsVisaTerminalEntryCapability - >? TerminalEntryCapability + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("terminal_entry_capability"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("terminal_entry_capability", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - this.ElectronicCommerceIndicator?.Validate(); - this.PointOfServiceEntryMode?.Validate(); - this.StandInProcessingReason?.Validate(); - this.TerminalEntryCapability?.Validate(); + _ = this.Amount; + _ = this.Currency; } - public CardDeclineNetworkDetailsVisa() { } + public CardDeclineAdditionalAmountsVision() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineNetworkDetailsVisa( - CardDeclineNetworkDetailsVisa cardDeclineNetworkDetailsVisa + public CardDeclineAdditionalAmountsVision( + CardDeclineAdditionalAmountsVision cardDeclineAdditionalAmountsVision ) - : base(cardDeclineNetworkDetailsVisa) { } + : base(cardDeclineAdditionalAmountsVision) { } #pragma warning restore CS8618 - public CardDeclineNetworkDetailsVisa(IReadOnlyDictionary rawData) + public CardDeclineAdditionalAmountsVision(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineNetworkDetailsVisa(FrozenDictionary rawData) + CardDeclineAdditionalAmountsVision(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineNetworkDetailsVisa FromRawUnchecked( + /// + public static CardDeclineAdditionalAmountsVision FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -11544,84 +12147,84 @@ IReadOnlyDictionary rawData } } -class CardDeclineNetworkDetailsVisaFromRaw : IFromRawJson +class CardDeclineAdditionalAmountsVisionFromRaw : IFromRawJson { /// - public CardDeclineNetworkDetailsVisa FromRawUnchecked( + public CardDeclineAdditionalAmountsVision FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineNetworkDetailsVisa.FromRawUnchecked(rawData); + ) => CardDeclineAdditionalAmountsVision.FromRawUnchecked(rawData); } /// -/// For electronic commerce transactions, this identifies the level of security used -/// in obtaining the customer's payment credential. For mail or telephone order transactions, -/// identifies the type of mail or telephone order. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the destination +/// account currency. /// -[JsonConverter(typeof(CardDeclineNetworkDetailsVisaElectronicCommerceIndicatorConverter))] -public enum CardDeclineNetworkDetailsVisaElectronicCommerceIndicator +[JsonConverter(typeof(CardDeclineCurrencyConverter))] +public enum CardDeclineCurrency { /// - /// Single transaction of a mail/phone order: Use to indicate that the transaction - /// is a mail/phone order purchase, not a recurring transaction or installment - /// payment. For domestic transactions in the US region, this value may also indicate - /// one bill payment transaction in the card-present or card-absent environments. - /// - MailPhoneOrder, - - /// - /// Recurring transaction: Payment indicator used to indicate a recurring transaction - /// that originates from an acquirer in the US region. - /// - Recurring, - - /// - /// Installment payment: Payment indicator used to indicate one purchase of goods - /// or services that is billed to the account in multiple charges over a period - /// of time agreed upon by the cardholder and merchant from transactions that - /// originate from an acquirer in the US region. - /// - Installment, - - /// - /// Unknown classification: other mail order: Use to indicate that the type of - /// mail/telephone order is unknown. + /// US Dollar (USD) /// - UnknownMailPhoneOrder, + Usd, +} - /// - /// Secure electronic commerce transaction: Use to indicate that the electronic - /// commerce transaction has been authenticated using e.g., 3-D Secure - /// - SecureElectronicCommerce, +sealed class CardDeclineCurrencyConverter : JsonConverter +{ + public override CardDeclineCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardDeclineCurrency.Usd, + _ => (CardDeclineCurrency)(-1), + }; + } - /// - /// Non-authenticated security transaction at a 3-D Secure-capable merchant, - /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use - /// to identify an electronic commerce transaction where the merchant attempted - /// to authenticate the cardholder using 3-D Secure, but was unable to complete - /// the authentication because the issuer or cardholder does not participate in - /// the 3-D Secure program. - /// - NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + public override void Write( + Utf8JsonWriter writer, + CardDeclineCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// The direction describes the direction the funds will move, either from the cardholder +/// to the merchant or from the merchant to the cardholder. +/// +[JsonConverter(typeof(CardDeclineDirectionConverter))] +public enum CardDeclineDirection +{ /// - /// Non-authenticated security transaction: Use to identify an electronic commerce - /// transaction that uses data encryption for security however, cardholder authentication - /// is not performed using 3-D Secure. + /// A regular card authorization where funds are debited from the cardholder. /// - NonAuthenticatedSecurityTransaction, + Settlement, /// - /// Non-secure transaction: Use to identify an electronic commerce transaction - /// that has no data protection. + /// A refund card authorization, sometimes referred to as a credit voucher authorization, + /// where funds are credited to the cardholder. /// - NonSecureTransaction, + Refund, } -sealed class CardDeclineNetworkDetailsVisaElectronicCommerceIndicatorConverter - : JsonConverter +sealed class CardDeclineDirectionConverter : JsonConverter { - public override CardDeclineNetworkDetailsVisaElectronicCommerceIndicator Read( + public override CardDeclineDirection Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -11629,27 +12232,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "mail_phone_order" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, - "recurring" => CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Recurring, - "installment" => CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Installment, - "unknown_mail_phone_order" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, - "secure_electronic_commerce" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, - "non_authenticated_security_transaction_at_3ds_capable_merchant" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, - "non_authenticated_security_transaction" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, - "non_secure_transaction" => - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, - _ => (CardDeclineNetworkDetailsVisaElectronicCommerceIndicator)(-1), + "settlement" => CardDeclineDirection.Settlement, + "refund" => CardDeclineDirection.Refund, + _ => (CardDeclineDirection)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator value, + CardDeclineDirection value, JsonSerializerOptions options ) { @@ -11657,21 +12248,8 @@ JsonSerializerOptions options writer, value switch { - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => - "mail_phone_order", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Recurring => "recurring", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Installment => - "installment", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => - "unknown_mail_phone_order", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => - "secure_electronic_commerce", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => - "non_authenticated_security_transaction_at_3ds_capable_merchant", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => - "non_authenticated_security_transaction", - CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => - "non_secure_transaction", + CardDeclineDirection.Settlement => "settlement", + CardDeclineDirection.Refund => "refund", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -11682,186 +12260,121 @@ JsonSerializerOptions options } /// -/// The method used to enter the cardholder's primary account number and card expiration date. +/// Fields specific to the `network`. /// -[JsonConverter(typeof(CardDeclineNetworkDetailsVisaPointOfServiceEntryModeConverter))] -public enum CardDeclineNetworkDetailsVisaPointOfServiceEntryMode +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardDeclineNetworkDetails : JsonModel { /// - /// Unknown + /// The payment network used to process this card authorization. /// - Unknown, - - /// - /// Manual key entry - /// - Manual, - - /// - /// Magnetic stripe read, without card verification value - /// - MagneticStripeNoCvv, - - /// - /// Optical code - /// - OpticalCode, + public required ApiEnum Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("category"); + } + init { this._rawData.Set("category", value); } + } /// - /// Contact chip card + /// Fields specific to the `pulse` network. /// - IntegratedCircuitCard, + public required CardDeclineNetworkDetailsPulse? Pulse + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("pulse"); + } + init { this._rawData.Set("pulse", value); } + } /// - /// Contactless read of chip card + /// Fields specific to the `visa` network. /// - Contactless, + public required CardDeclineNetworkDetailsVisa? Visa + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("visa"); + } + init { this._rawData.Set("visa", value); } + } - /// - /// Transaction initiated using a credential that has previously been stored - /// on file - /// - CredentialOnFile, + /// + public override void Validate() + { + this.Category.Validate(); + this.Pulse?.Validate(); + this.Visa?.Validate(); + } - /// - /// Magnetic stripe read - /// - MagneticStripe, + public CardDeclineNetworkDetails() { } - /// - /// Contactless read of magnetic stripe data - /// - ContactlessMagneticStripe, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardDeclineNetworkDetails(CardDeclineNetworkDetails cardDeclineNetworkDetails) + : base(cardDeclineNetworkDetails) { } +#pragma warning restore CS8618 - /// - /// Contact chip card, without card verification value - /// - IntegratedCircuitCardNoCvv, -} + public CardDeclineNetworkDetails(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } -sealed class CardDeclineNetworkDetailsVisaPointOfServiceEntryModeConverter - : JsonConverter -{ - public override CardDeclineNetworkDetailsVisaPointOfServiceEntryMode Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardDeclineNetworkDetails(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "unknown" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Unknown, - "manual" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Manual, - "magnetic_stripe_no_cvv" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, - "optical_code" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, - "integrated_circuit_card" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, - "contactless" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Contactless, - "credential_on_file" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, - "magnetic_stripe" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, - "contactless_magnetic_stripe" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, - "integrated_circuit_card_no_cvv" => - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, - _ => (CardDeclineNetworkDetailsVisaPointOfServiceEntryMode)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode value, - JsonSerializerOptions options + /// + public static CardDeclineNetworkDetails FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => - "magnetic_stripe_no_cvv", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => "optical_code", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => - "integrated_circuit_card", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Contactless => "contactless", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => - "credential_on_file", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => - "magnetic_stripe", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => - "contactless_magnetic_stripe", - CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => - "integrated_circuit_card_no_cvv", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardDeclineNetworkDetailsFromRaw : IFromRawJson +{ + /// + public CardDeclineNetworkDetails FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardDeclineNetworkDetails.FromRawUnchecked(rawData); +} + /// -/// Only present when `actioner: network`. Describes why a card authorization was -/// approved or declined by Visa through stand-in processing. +/// The payment network used to process this card authorization. /// -[JsonConverter(typeof(CardDeclineNetworkDetailsVisaStandInProcessingReasonConverter))] -public enum CardDeclineNetworkDetailsVisaStandInProcessingReason +[JsonConverter(typeof(CardDeclineNetworkDetailsCategoryConverter))] +public enum CardDeclineNetworkDetailsCategory { /// - /// Increase failed to process the authorization in a timely manner. - /// - IssuerError, - - /// - /// The physical card read had an invalid CVV or dCVV. - /// - InvalidPhysicalCard, - - /// - /// The card's authorization request cryptogram was invalid. The cryptogram can - /// be from a physical card or a Digital Wallet Token purchase. - /// - InvalidCryptogram, - - /// - /// The 3DS cardholder authentication verification value was invalid. - /// - InvalidCardholderAuthenticationVerificationValue, - - /// - /// An internal Visa error occurred. Visa uses this reason code for certain expected - /// occurrences as well, such as Application Transaction Counter (ATC) replays. - /// - InternalVisaError, - - /// - /// The merchant has enabled Visa's Transaction Advisory Service and requires - /// further authentication to perform the transaction. In practice this is often - /// utilized at fuel pumps to tell the cardholder to see the cashier. - /// - MerchantTransactionAdvisoryServiceAuthenticationRequired, - - /// - /// The transaction was blocked by Visa's Payment Fraud Disruption service due - /// to fraudulent Acquirer behavior, such as card testing. + /// Visa /// - PaymentFraudDisruptionAcquirerBlock, + Visa, /// - /// An unspecific reason for stand-in processing. + /// Pulse /// - Other, + Pulse, } -sealed class CardDeclineNetworkDetailsVisaStandInProcessingReasonConverter - : JsonConverter +sealed class CardDeclineNetworkDetailsCategoryConverter + : JsonConverter { - public override CardDeclineNetworkDetailsVisaStandInProcessingReason Read( + public override CardDeclineNetworkDetailsCategory Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -11869,27 +12382,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "issuer_error" => CardDeclineNetworkDetailsVisaStandInProcessingReason.IssuerError, - "invalid_physical_card" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, - "invalid_cryptogram" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, - "invalid_cardholder_authentication_verification_value" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, - "internal_visa_error" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.InternalVisaError, - "merchant_transaction_advisory_service_authentication_required" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, - "payment_fraud_disruption_acquirer_block" => - CardDeclineNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, - "other" => CardDeclineNetworkDetailsVisaStandInProcessingReason.Other, - _ => (CardDeclineNetworkDetailsVisaStandInProcessingReason)(-1), + "visa" => CardDeclineNetworkDetailsCategory.Visa, + "pulse" => CardDeclineNetworkDetailsCategory.Pulse, + _ => (CardDeclineNetworkDetailsCategory)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardDeclineNetworkDetailsVisaStandInProcessingReason value, + CardDeclineNetworkDetailsCategory value, JsonSerializerOptions options ) { @@ -11897,20 +12398,8 @@ JsonSerializerOptions options writer, value switch { - CardDeclineNetworkDetailsVisaStandInProcessingReason.IssuerError => "issuer_error", - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => - "invalid_physical_card", - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => - "invalid_cryptogram", - CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => - "invalid_cardholder_authentication_verification_value", - CardDeclineNetworkDetailsVisaStandInProcessingReason.InternalVisaError => - "internal_visa_error", - CardDeclineNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => - "merchant_transaction_advisory_service_authentication_required", - CardDeclineNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => - "payment_fraud_disruption_acquirer_block", - CardDeclineNetworkDetailsVisaStandInProcessingReason.Other => "other", + CardDeclineNetworkDetailsCategory.Visa => "visa", + CardDeclineNetworkDetailsCategory.Pulse => "pulse", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -11921,219 +12410,181 @@ JsonSerializerOptions options } /// -/// The capability of the terminal being used to read the card. Shows whether a terminal -/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This -/// reflects the highest capability of the terminal — for example, a terminal that -/// supports both chip and magnetic stripe will be identified as chip-capable. +/// Fields specific to the `pulse` network. /// -[JsonConverter(typeof(CardDeclineNetworkDetailsVisaTerminalEntryCapabilityConverter))] -public enum CardDeclineNetworkDetailsVisaTerminalEntryCapability +[JsonConverter( + typeof(JsonModelConverter< + CardDeclineNetworkDetailsPulse, + CardDeclineNetworkDetailsPulseFromRaw + >) +)] +public sealed record class CardDeclineNetworkDetailsPulse : JsonModel { - /// - /// Unknown - /// - Unknown, - - /// - /// No terminal was used for this transaction. - /// - TerminalNotUsed, - - /// - /// The terminal can only read magnetic stripes and does not have chip or contactless - /// reading capability. - /// - MagneticStripe, - - /// - /// The terminal can only read barcodes. - /// - Barcode, - - /// - /// The terminal can only read cards via Optical Character Recognition. - /// - OpticalCharacterRecognition, + /// + public override void Validate() { } - /// - /// The terminal supports contact chip cards and can also read the magnetic stripe. - /// If contact chip is supported, this value is used regardless of whether contactless - /// is also supported. - /// - ChipOrContactless, + public CardDeclineNetworkDetailsPulse() { } - /// - /// The terminal supports contactless reads but does not support contact chip. - /// Only used when the terminal lacks contact chip capability. - /// - ContactlessOnly, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardDeclineNetworkDetailsPulse( + CardDeclineNetworkDetailsPulse cardDeclineNetworkDetailsPulse + ) + : base(cardDeclineNetworkDetailsPulse) { } +#pragma warning restore CS8618 - /// - /// The terminal has no card reading capability. - /// - NoCapability, -} + public CardDeclineNetworkDetailsPulse(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } -sealed class CardDeclineNetworkDetailsVisaTerminalEntryCapabilityConverter - : JsonConverter -{ - public override CardDeclineNetworkDetailsVisaTerminalEntryCapability Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardDeclineNetworkDetailsPulse(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "unknown" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.Unknown, - "terminal_not_used" => - CardDeclineNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, - "magnetic_stripe" => - CardDeclineNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, - "barcode" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.Barcode, - "optical_character_recognition" => - CardDeclineNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, - "chip_or_contactless" => - CardDeclineNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, - "contactless_only" => - CardDeclineNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, - "no_capability" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.NoCapability, - _ => (CardDeclineNetworkDetailsVisaTerminalEntryCapability)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - CardDeclineNetworkDetailsVisaTerminalEntryCapability value, - JsonSerializerOptions options + /// + public static CardDeclineNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardDeclineNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => - "terminal_not_used", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => - "magnetic_stripe", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => - "optical_character_recognition", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => - "chip_or_contactless", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => - "contactless_only", - CardDeclineNetworkDetailsVisaTerminalEntryCapability.NoCapability => - "no_capability", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardDeclineNetworkDetailsPulseFromRaw : IFromRawJson +{ + /// + public CardDeclineNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardDeclineNetworkDetailsPulse.FromRawUnchecked(rawData); +} + /// -/// Network-specific identifiers for a specific request or transaction. +/// Fields specific to the `visa` network. /// [JsonConverter( - typeof(JsonModelConverter) + typeof(JsonModelConverter) )] -public sealed record class CardDeclineNetworkIdentifiers : JsonModel +public sealed record class CardDeclineNetworkDetailsVisa : JsonModel { /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. + /// For electronic commerce transactions, this identifies the level of security + /// used in obtaining the customer's payment credential. For mail or telephone + /// order transactions, identifies the type of mail or telephone order. /// - public required string? AuthorizationIdentificationResponse + public required ApiEnum< + string, + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator + >? ElectronicCommerceIndicator { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); + return this._rawData.GetNullableClass< + ApiEnum + >("electronic_commerce_indicator"); } - init { this._rawData.Set("authorization_identification_response", value); } + init { this._rawData.Set("electronic_commerce_indicator", value); } } /// - /// A life-cycle identifier used across e.g., an authorization and a reversal. - /// Expected to be unique per acquirer within a window of time. For some card - /// networks the retrieval reference number includes the trace counter. + /// The method used to enter the cardholder's primary account number and card + /// expiration date. /// - public required string? RetrievalReferenceNumber + public required ApiEnum< + string, + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode + >? PointOfServiceEntryMode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("retrieval_reference_number"); + return this._rawData.GetNullableClass< + ApiEnum + >("point_of_service_entry_mode"); } - init { this._rawData.Set("retrieval_reference_number", value); } + init { this._rawData.Set("point_of_service_entry_mode", value); } } /// - /// A counter used to verify an individual authorization. Expected to be unique - /// per acquirer within a window of time. + /// Only present when `actioner: network`. Describes why a card authorization + /// was approved or declined by Visa through stand-in processing. /// - public required string? TraceNumber + public required ApiEnum< + string, + CardDeclineNetworkDetailsVisaStandInProcessingReason + >? StandInProcessingReason { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("trace_number"); + return this._rawData.GetNullableClass< + ApiEnum + >("stand_in_processing_reason"); } - init { this._rawData.Set("trace_number", value); } + init { this._rawData.Set("stand_in_processing_reason", value); } } /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. + /// The capability of the terminal being used to read the card. Shows whether + /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe + /// reads. This reflects the highest capability of the terminal — for example, + /// a terminal that supports both chip and magnetic stripe will be identified + /// as chip-capable. /// - public required string? TransactionID + public required ApiEnum< + string, + CardDeclineNetworkDetailsVisaTerminalEntryCapability + >? TerminalEntryCapability { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); + return this._rawData.GetNullableClass< + ApiEnum + >("terminal_entry_capability"); } - init { this._rawData.Set("transaction_id", value); } + init { this._rawData.Set("terminal_entry_capability", value); } } /// public override void Validate() { - _ = this.AuthorizationIdentificationResponse; - _ = this.RetrievalReferenceNumber; - _ = this.TraceNumber; - _ = this.TransactionID; + this.ElectronicCommerceIndicator?.Validate(); + this.PointOfServiceEntryMode?.Validate(); + this.StandInProcessingReason?.Validate(); + this.TerminalEntryCapability?.Validate(); } - public CardDeclineNetworkIdentifiers() { } + public CardDeclineNetworkDetailsVisa() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineNetworkIdentifiers( - CardDeclineNetworkIdentifiers cardDeclineNetworkIdentifiers + public CardDeclineNetworkDetailsVisa( + CardDeclineNetworkDetailsVisa cardDeclineNetworkDetailsVisa ) - : base(cardDeclineNetworkIdentifiers) { } + : base(cardDeclineNetworkDetailsVisa) { } #pragma warning restore CS8618 - public CardDeclineNetworkIdentifiers(IReadOnlyDictionary rawData) + public CardDeclineNetworkDetailsVisa(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineNetworkIdentifiers(FrozenDictionary rawData) + CardDeclineNetworkDetailsVisa(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineNetworkIdentifiers FromRawUnchecked( + /// + public static CardDeclineNetworkDetailsVisa FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -12141,82 +12592,84 @@ IReadOnlyDictionary rawData } } -class CardDeclineNetworkIdentifiersFromRaw : IFromRawJson +class CardDeclineNetworkDetailsVisaFromRaw : IFromRawJson { /// - public CardDeclineNetworkIdentifiers FromRawUnchecked( + public CardDeclineNetworkDetailsVisa FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineNetworkIdentifiers.FromRawUnchecked(rawData); + ) => CardDeclineNetworkDetailsVisa.FromRawUnchecked(rawData); } /// -/// The processing category describes the intent behind the authorization, such as -/// whether it was used for bill payments or an automatic fuel dispenser. +/// For electronic commerce transactions, this identifies the level of security used +/// in obtaining the customer's payment credential. For mail or telephone order transactions, +/// identifies the type of mail or telephone order. /// -[JsonConverter(typeof(CardDeclineProcessingCategoryConverter))] -public enum CardDeclineProcessingCategory +[JsonConverter(typeof(CardDeclineNetworkDetailsVisaElectronicCommerceIndicatorConverter))] +public enum CardDeclineNetworkDetailsVisaElectronicCommerceIndicator { /// - /// Account funding transactions are transactions used to e.g., fund an account - /// or transfer funds between accounts. + /// Single transaction of a mail/phone order: Use to indicate that the transaction + /// is a mail/phone order purchase, not a recurring transaction or installment + /// payment. For domestic transactions in the US region, this value may also indicate + /// one bill payment transaction in the card-present or card-absent environments. /// - AccountFunding, + MailPhoneOrder, /// - /// Automatic fuel dispenser authorizations occur when a card is used at a gas - /// pump, prior to the actual transaction amount being known. They are followed - /// by an advice message that updates the amount of the pending transaction. + /// Recurring transaction: Payment indicator used to indicate a recurring transaction + /// that originates from an acquirer in the US region. /// - AutomaticFuelDispenser, - - /// - /// A transaction used to pay a bill. - /// - BillPayment, - - /// - /// Original credit transactions are used to send money to a cardholder. - /// - OriginalCredit, + Recurring, /// - /// A regular purchase. + /// Installment payment: Payment indicator used to indicate one purchase of goods + /// or services that is billed to the account in multiple charges over a period + /// of time agreed upon by the cardholder and merchant from transactions that + /// originate from an acquirer in the US region. /// - Purchase, + Installment, /// - /// Quasi-cash transactions represent purchases of items which may be convertible - /// to cash. + /// Unknown classification: other mail order: Use to indicate that the type of + /// mail/telephone order is unknown. /// - QuasiCash, + UnknownMailPhoneOrder, /// - /// A refund card authorization, sometimes referred to as a credit voucher authorization, - /// where funds are credited to the cardholder. + /// Secure electronic commerce transaction: Use to indicate that the electronic + /// commerce transaction has been authenticated using e.g., 3-D Secure /// - Refund, + SecureElectronicCommerce, /// - /// Cash disbursement transactions are used to withdraw cash from an ATM or a - /// point of sale. + /// Non-authenticated security transaction at a 3-D Secure-capable merchant, + /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use + /// to identify an electronic commerce transaction where the merchant attempted + /// to authenticate the cardholder using 3-D Secure, but was unable to complete + /// the authentication because the issuer or cardholder does not participate in + /// the 3-D Secure program. /// - CashDisbursement, + NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, /// - /// A balance inquiry transaction is used to check the balance of an account associated - /// with a card. + /// Non-authenticated security transaction: Use to identify an electronic commerce + /// transaction that uses data encryption for security however, cardholder authentication + /// is not performed using 3-D Secure. /// - BalanceInquiry, + NonAuthenticatedSecurityTransaction, /// - /// The processing category is unknown. + /// Non-secure transaction: Use to identify an electronic commerce transaction + /// that has no data protection. /// - Unknown, + NonSecureTransaction, } -sealed class CardDeclineProcessingCategoryConverter : JsonConverter +sealed class CardDeclineNetworkDetailsVisaElectronicCommerceIndicatorConverter + : JsonConverter { - public override CardDeclineProcessingCategory Read( + public override CardDeclineNetworkDetailsVisaElectronicCommerceIndicator Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12224,23 +12677,27 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "account_funding" => CardDeclineProcessingCategory.AccountFunding, - "automatic_fuel_dispenser" => CardDeclineProcessingCategory.AutomaticFuelDispenser, - "bill_payment" => CardDeclineProcessingCategory.BillPayment, - "original_credit" => CardDeclineProcessingCategory.OriginalCredit, - "purchase" => CardDeclineProcessingCategory.Purchase, - "quasi_cash" => CardDeclineProcessingCategory.QuasiCash, - "refund" => CardDeclineProcessingCategory.Refund, - "cash_disbursement" => CardDeclineProcessingCategory.CashDisbursement, - "balance_inquiry" => CardDeclineProcessingCategory.BalanceInquiry, - "unknown" => CardDeclineProcessingCategory.Unknown, - _ => (CardDeclineProcessingCategory)(-1), + "mail_phone_order" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, + "recurring" => CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Recurring, + "installment" => CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Installment, + "unknown_mail_phone_order" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, + "secure_electronic_commerce" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, + "non_authenticated_security_transaction_at_3ds_capable_merchant" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + "non_authenticated_security_transaction" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, + "non_secure_transaction" => + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, + _ => (CardDeclineNetworkDetailsVisaElectronicCommerceIndicator)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardDeclineProcessingCategory value, + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator value, JsonSerializerOptions options ) { @@ -12248,16 +12705,21 @@ JsonSerializerOptions options writer, value switch { - CardDeclineProcessingCategory.AccountFunding => "account_funding", - CardDeclineProcessingCategory.AutomaticFuelDispenser => "automatic_fuel_dispenser", - CardDeclineProcessingCategory.BillPayment => "bill_payment", - CardDeclineProcessingCategory.OriginalCredit => "original_credit", - CardDeclineProcessingCategory.Purchase => "purchase", - CardDeclineProcessingCategory.QuasiCash => "quasi_cash", - CardDeclineProcessingCategory.Refund => "refund", - CardDeclineProcessingCategory.CashDisbursement => "cash_disbursement", - CardDeclineProcessingCategory.BalanceInquiry => "balance_inquiry", - CardDeclineProcessingCategory.Unknown => "unknown", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => + "mail_phone_order", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Recurring => "recurring", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.Installment => + "installment", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => + "unknown_mail_phone_order", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => + "secure_electronic_commerce", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => + "non_authenticated_security_transaction_at_3ds_capable_merchant", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => + "non_authenticated_security_transaction", + CardDeclineNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => + "non_secure_transaction", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -12268,51 +12730,67 @@ JsonSerializerOptions options } /// -/// This is present if a specific decline reason was given in the real-time decision. +/// The method used to enter the cardholder's primary account number and card expiration date. /// -[JsonConverter(typeof(RealTimeDecisionReasonConverter))] -public enum RealTimeDecisionReason +[JsonConverter(typeof(CardDeclineNetworkDetailsVisaPointOfServiceEntryModeConverter))] +public enum CardDeclineNetworkDetailsVisaPointOfServiceEntryMode { /// - /// The cardholder does not have sufficient funds to cover the transaction. The - /// merchant may attempt to process the transaction again. + /// Unknown /// - InsufficientFunds, + Unknown, /// - /// This type of transaction is not allowed for this card. This transaction should - /// not be retried. + /// Manual key entry /// - TransactionNeverAllowed, + Manual, /// - /// The transaction amount exceeds the cardholder's approval limit. The merchant - /// may attempt to process the transaction again. + /// Magnetic stripe read, without card verification value /// - ExceedsApprovalLimit, + MagneticStripeNoCvv, /// - /// The card has been temporarily disabled or not yet activated. The merchant - /// may attempt to process the transaction again. + /// Optical code /// - CardTemporarilyDisabled, + OpticalCode, /// - /// The transaction is suspected to be fraudulent. The merchant may attempt to - /// process the transaction again. + /// Contact chip card /// - SuspectedFraud, + IntegratedCircuitCard, /// - /// The transaction was declined for another reason. The merchant may attempt - /// to process the transaction again. This should be used sparingly. + /// Contactless read of chip card /// - Other, + Contactless, + + /// + /// Transaction initiated using a credential that has previously been stored + /// on file + /// + CredentialOnFile, + + /// + /// Magnetic stripe read + /// + MagneticStripe, + + /// + /// Contactless read of magnetic stripe data + /// + ContactlessMagneticStripe, + + /// + /// Contact chip card, without card verification value + /// + IntegratedCircuitCardNoCvv, } -sealed class RealTimeDecisionReasonConverter : JsonConverter +sealed class CardDeclineNetworkDetailsVisaPointOfServiceEntryModeConverter + : JsonConverter { - public override RealTimeDecisionReason Read( + public override CardDeclineNetworkDetailsVisaPointOfServiceEntryMode Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12320,19 +12798,29 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "insufficient_funds" => RealTimeDecisionReason.InsufficientFunds, - "transaction_never_allowed" => RealTimeDecisionReason.TransactionNeverAllowed, - "exceeds_approval_limit" => RealTimeDecisionReason.ExceedsApprovalLimit, - "card_temporarily_disabled" => RealTimeDecisionReason.CardTemporarilyDisabled, - "suspected_fraud" => RealTimeDecisionReason.SuspectedFraud, - "other" => RealTimeDecisionReason.Other, - _ => (RealTimeDecisionReason)(-1), + "unknown" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Unknown, + "manual" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Manual, + "magnetic_stripe_no_cvv" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, + "optical_code" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, + "integrated_circuit_card" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, + "contactless" => CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Contactless, + "credential_on_file" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, + "magnetic_stripe" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, + "contactless_magnetic_stripe" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, + "integrated_circuit_card_no_cvv" => + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, + _ => (CardDeclineNetworkDetailsVisaPointOfServiceEntryMode)(-1), }; } public override void Write( Utf8JsonWriter writer, - RealTimeDecisionReason value, + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode value, JsonSerializerOptions options ) { @@ -12340,12 +12828,22 @@ JsonSerializerOptions options writer, value switch { - RealTimeDecisionReason.InsufficientFunds => "insufficient_funds", - RealTimeDecisionReason.TransactionNeverAllowed => "transaction_never_allowed", - RealTimeDecisionReason.ExceedsApprovalLimit => "exceeds_approval_limit", - RealTimeDecisionReason.CardTemporarilyDisabled => "card_temporarily_disabled", - RealTimeDecisionReason.SuspectedFraud => "suspected_fraud", - RealTimeDecisionReason.Other => "other", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => + "magnetic_stripe_no_cvv", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => "optical_code", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => + "integrated_circuit_card", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.Contactless => "contactless", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => + "credential_on_file", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => + "magnetic_stripe", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => + "contactless_magnetic_stripe", + CardDeclineNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => + "integrated_circuit_card_no_cvv", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -12356,124 +12854,178 @@ JsonSerializerOptions options } /// -/// Why the transaction was declined. +/// Only present when `actioner: network`. Describes why a card authorization was +/// approved or declined by Visa through stand-in processing. /// -[JsonConverter(typeof(ReasonConverter))] -public enum Reason +[JsonConverter(typeof(CardDeclineNetworkDetailsVisaStandInProcessingReasonConverter))] +public enum CardDeclineNetworkDetailsVisaStandInProcessingReason { /// - /// The account has been closed. + /// Increase failed to process the authorization in a timely manner. /// - AccountClosed, + IssuerError, /// - /// The Card was not active. + /// The physical card read had an invalid CVV or dCVV. /// - CardNotActive, + InvalidPhysicalCard, /// - /// The Card has been canceled. + /// The card's authorization request cryptogram was invalid. The cryptogram can + /// be from a physical card or a Digital Wallet Token purchase. /// - CardCanceled, + InvalidCryptogram, /// - /// The Physical Card was not active. + /// The 3DS cardholder authentication verification value was invalid. /// - PhysicalCardNotActive, + InvalidCardholderAuthenticationVerificationValue, /// - /// The account's entity was not active. + /// An internal Visa error occurred. Visa uses this reason code for certain expected + /// occurrences as well, such as Application Transaction Counter (ATC) replays. /// - EntityNotActive, + InternalVisaError, /// - /// The account was inactive. + /// The merchant has enabled Visa's Transaction Advisory Service and requires + /// further authentication to perform the transaction. In practice this is often + /// utilized at fuel pumps to tell the cardholder to see the cashier. /// - GroupLocked, + MerchantTransactionAdvisoryServiceAuthenticationRequired, /// - /// The Card's Account did not have a sufficient available balance. - /// - InsufficientFunds, - - /// - /// The given CVV2 did not match the card's value. - /// - Cvv2Mismatch, - - /// - /// The given PIN did not match the card's value. - /// - PinMismatch, - - /// - /// The given expiration date did not match the card's value. Only applies when - /// a CVV2 is present. + /// The transaction was blocked by Visa's Payment Fraud Disruption service due + /// to fraudulent Acquirer behavior, such as card testing. /// - CardExpirationMismatch, + PaymentFraudDisruptionAcquirerBlock, /// - /// The attempted card transaction is not allowed per Increase's terms. + /// An unspecific reason for stand-in processing. /// - TransactionNotAllowed, + Other, +} - /// - /// The transaction was blocked by a Limit. - /// - BreachesLimit, +sealed class CardDeclineNetworkDetailsVisaStandInProcessingReasonConverter + : JsonConverter +{ + public override CardDeclineNetworkDetailsVisaStandInProcessingReason Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "issuer_error" => CardDeclineNetworkDetailsVisaStandInProcessingReason.IssuerError, + "invalid_physical_card" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, + "invalid_cryptogram" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, + "invalid_cardholder_authentication_verification_value" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, + "internal_visa_error" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.InternalVisaError, + "merchant_transaction_advisory_service_authentication_required" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, + "payment_fraud_disruption_acquirer_block" => + CardDeclineNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, + "other" => CardDeclineNetworkDetailsVisaStandInProcessingReason.Other, + _ => (CardDeclineNetworkDetailsVisaStandInProcessingReason)(-1), + }; + } - /// - /// Your application declined the transaction via webhook. - /// - WebhookDeclined, + public override void Write( + Utf8JsonWriter writer, + CardDeclineNetworkDetailsVisaStandInProcessingReason value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineNetworkDetailsVisaStandInProcessingReason.IssuerError => "issuer_error", + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => + "invalid_physical_card", + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => + "invalid_cryptogram", + CardDeclineNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => + "invalid_cardholder_authentication_verification_value", + CardDeclineNetworkDetailsVisaStandInProcessingReason.InternalVisaError => + "internal_visa_error", + CardDeclineNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => + "merchant_transaction_advisory_service_authentication_required", + CardDeclineNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => + "payment_fraud_disruption_acquirer_block", + CardDeclineNetworkDetailsVisaStandInProcessingReason.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// The capability of the terminal being used to read the card. Shows whether a terminal +/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This +/// reflects the highest capability of the terminal — for example, a terminal that +/// supports both chip and magnetic stripe will be identified as chip-capable. +/// +[JsonConverter(typeof(CardDeclineNetworkDetailsVisaTerminalEntryCapabilityConverter))] +public enum CardDeclineNetworkDetailsVisaTerminalEntryCapability +{ /// - /// Your application webhook did not respond without the required timeout. + /// Unknown /// - WebhookTimedOut, + Unknown, /// - /// Declined by stand-in processing. + /// No terminal was used for this transaction. /// - DeclinedByStandInProcessing, + TerminalNotUsed, /// - /// The card read had an invalid CVV or dCVV. + /// The terminal can only read magnetic stripes and does not have chip or contactless + /// reading capability. /// - InvalidPhysicalCard, + MagneticStripe, /// - /// The original card authorization for this incremental authorization does not exist. + /// The terminal can only read barcodes. /// - MissingOriginalAuthorization, + Barcode, /// - /// The card's authorization request cryptogram was invalid. The cryptogram can - /// be from a physical card or a Digital Wallet Token purchase. + /// The terminal can only read cards via Optical Character Recognition. /// - InvalidCryptogram, + OpticalCharacterRecognition, /// - /// The transaction was declined because the 3DS authentication failed. + /// The terminal supports contact chip cards and can also read the magnetic stripe. + /// If contact chip is supported, this value is used regardless of whether contactless + /// is also supported. /// - Failed3dsAuthentication, + ChipOrContactless, /// - /// The transaction was suspected to be used by a card tester to test for valid - /// card numbers. + /// The terminal supports contactless reads but does not support contact chip. + /// Only used when the terminal lacks contact chip capability. /// - SuspectedCardTesting, + ContactlessOnly, /// - /// The transaction was suspected to be fraudulent. Please reach out to support@increase.com - /// for more information. + /// The terminal has no card reading capability. /// - SuspectedFraud, + NoCapability, } -sealed class ReasonConverter : JsonConverter +sealed class CardDeclineNetworkDetailsVisaTerminalEntryCapabilityConverter + : JsonConverter { - public override Reason Read( + public override CardDeclineNetworkDetailsVisaTerminalEntryCapability Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12481,58 +13033,47 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "account_closed" => Reason.AccountClosed, - "card_not_active" => Reason.CardNotActive, - "card_canceled" => Reason.CardCanceled, - "physical_card_not_active" => Reason.PhysicalCardNotActive, - "entity_not_active" => Reason.EntityNotActive, - "group_locked" => Reason.GroupLocked, - "insufficient_funds" => Reason.InsufficientFunds, - "cvv2_mismatch" => Reason.Cvv2Mismatch, - "pin_mismatch" => Reason.PinMismatch, - "card_expiration_mismatch" => Reason.CardExpirationMismatch, - "transaction_not_allowed" => Reason.TransactionNotAllowed, - "breaches_limit" => Reason.BreachesLimit, - "webhook_declined" => Reason.WebhookDeclined, - "webhook_timed_out" => Reason.WebhookTimedOut, - "declined_by_stand_in_processing" => Reason.DeclinedByStandInProcessing, - "invalid_physical_card" => Reason.InvalidPhysicalCard, - "missing_original_authorization" => Reason.MissingOriginalAuthorization, - "invalid_cryptogram" => Reason.InvalidCryptogram, - "failed_3ds_authentication" => Reason.Failed3dsAuthentication, - "suspected_card_testing" => Reason.SuspectedCardTesting, - "suspected_fraud" => Reason.SuspectedFraud, - _ => (Reason)(-1), + "unknown" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.Unknown, + "terminal_not_used" => + CardDeclineNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, + "magnetic_stripe" => + CardDeclineNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, + "barcode" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.Barcode, + "optical_character_recognition" => + CardDeclineNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, + "chip_or_contactless" => + CardDeclineNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, + "contactless_only" => + CardDeclineNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, + "no_capability" => CardDeclineNetworkDetailsVisaTerminalEntryCapability.NoCapability, + _ => (CardDeclineNetworkDetailsVisaTerminalEntryCapability)(-1), }; } - public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + CardDeclineNetworkDetailsVisaTerminalEntryCapability value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize( writer, value switch { - Reason.AccountClosed => "account_closed", - Reason.CardNotActive => "card_not_active", - Reason.CardCanceled => "card_canceled", - Reason.PhysicalCardNotActive => "physical_card_not_active", - Reason.EntityNotActive => "entity_not_active", - Reason.GroupLocked => "group_locked", - Reason.InsufficientFunds => "insufficient_funds", - Reason.Cvv2Mismatch => "cvv2_mismatch", - Reason.PinMismatch => "pin_mismatch", - Reason.CardExpirationMismatch => "card_expiration_mismatch", - Reason.TransactionNotAllowed => "transaction_not_allowed", - Reason.BreachesLimit => "breaches_limit", - Reason.WebhookDeclined => "webhook_declined", - Reason.WebhookTimedOut => "webhook_timed_out", - Reason.DeclinedByStandInProcessing => "declined_by_stand_in_processing", - Reason.InvalidPhysicalCard => "invalid_physical_card", - Reason.MissingOriginalAuthorization => "missing_original_authorization", - Reason.InvalidCryptogram => "invalid_cryptogram", - Reason.Failed3dsAuthentication => "failed_3ds_authentication", - Reason.SuspectedCardTesting => "suspected_card_testing", - Reason.SuspectedFraud => "suspected_fraud", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => + "terminal_not_used", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => + "magnetic_stripe", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => + "optical_character_recognition", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => + "chip_or_contactless", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => + "contactless_only", + CardDeclineNetworkDetailsVisaTerminalEntryCapability.NoCapability => + "no_capability", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -12543,215 +13084,187 @@ public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOp } /// -/// Fields related to verification of cardholder-provided values. +/// Network-specific identifiers for a specific request or transaction. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardDeclineVerification : JsonModel +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardDeclineNetworkIdentifiers : JsonModel { /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. /// - public required CardDeclineVerificationCardVerificationCode CardVerificationCode + public required string? AuthorizationIdentificationResponse { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "card_verification_code" - ); + return this._rawData.GetNullableClass("authorization_identification_response"); } - init { this._rawData.Set("card_verification_code", value); } + init { this._rawData.Set("authorization_identification_response", value); } } /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// A life-cycle identifier used across e.g., an authorization and a reversal. + /// Expected to be unique per acquirer within a window of time. For some card + /// networks the retrieval reference number includes the trace counter. /// - public required CardDeclineVerificationCardholderAddress CardholderAddress + public required string? RetrievalReferenceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "cardholder_address" - ); + return this._rawData.GetNullableClass("retrieval_reference_number"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("retrieval_reference_number", value); } } /// - /// Cardholder name provided in the authorization request. + /// A counter used to verify an individual authorization. Expected to be unique + /// per acquirer within a window of time. /// - public required CardDeclineVerificationCardholderName? CardholderName + public required string? TraceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "cardholder_name" - ); + return this._rawData.GetNullableClass("trace_number"); } - init { this._rawData.Set("cardholder_name", value); } - } - - /// - public override void Validate() - { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); - } - - public CardDeclineVerification() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineVerification(CardDeclineVerification cardDeclineVerification) - : base(cardDeclineVerification) { } -#pragma warning restore CS8618 - - public CardDeclineVerification(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineVerification(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardDeclineVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + init { this._rawData.Set("trace_number", value); } } -} - -class CardDeclineVerificationFromRaw : IFromRawJson -{ - /// - public CardDeclineVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineVerification.FromRawUnchecked(rawData); -} -/// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineVerificationCardVerificationCode, - CardDeclineVerificationCardVerificationCodeFromRaw - >) -)] -public sealed record class CardDeclineVerificationCardVerificationCode : JsonModel -{ /// - /// The result of verifying the Card Verification Code. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - public required ApiEnum Result + public required string? TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNullableClass("transaction_id"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("transaction_id", value); } } /// public override void Validate() { - this.Result.Validate(); + _ = this.AuthorizationIdentificationResponse; + _ = this.RetrievalReferenceNumber; + _ = this.TraceNumber; + _ = this.TransactionID; } - public CardDeclineVerificationCardVerificationCode() { } + public CardDeclineNetworkIdentifiers() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardDeclineVerificationCardVerificationCode( - CardDeclineVerificationCardVerificationCode cardDeclineVerificationCardVerificationCode + public CardDeclineNetworkIdentifiers( + CardDeclineNetworkIdentifiers cardDeclineNetworkIdentifiers ) - : base(cardDeclineVerificationCardVerificationCode) { } + : base(cardDeclineNetworkIdentifiers) { } #pragma warning restore CS8618 - public CardDeclineVerificationCardVerificationCode( - IReadOnlyDictionary rawData - ) + public CardDeclineNetworkIdentifiers(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardDeclineVerificationCardVerificationCode(FrozenDictionary rawData) + CardDeclineNetworkIdentifiers(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardDeclineVerificationCardVerificationCode FromRawUnchecked( + /// + public static CardDeclineNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - - [SetsRequiredMembers] - public CardDeclineVerificationCardVerificationCode( - ApiEnum result - ) - : this() - { - this.Result = result; - } } -class CardDeclineVerificationCardVerificationCodeFromRaw - : IFromRawJson +class CardDeclineNetworkIdentifiersFromRaw : IFromRawJson { /// - public CardDeclineVerificationCardVerificationCode FromRawUnchecked( + public CardDeclineNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardDeclineVerificationCardVerificationCode.FromRawUnchecked(rawData); + ) => CardDeclineNetworkIdentifiers.FromRawUnchecked(rawData); } /// -/// The result of verifying the Card Verification Code. +/// The processing category describes the intent behind the authorization, such as +/// whether it was used for bill payments or an automatic fuel dispenser. /// -[JsonConverter(typeof(CardDeclineVerificationCardVerificationCodeResultConverter))] -public enum CardDeclineVerificationCardVerificationCodeResult +[JsonConverter(typeof(CardDeclineProcessingCategoryConverter))] +public enum CardDeclineProcessingCategory { /// - /// No card verification code was provided in the authorization request. + /// Account funding transactions are transactions used to e.g., fund an account + /// or transfer funds between accounts. /// - NotChecked, + AccountFunding, /// - /// The card verification code matched the one on file. + /// Automatic fuel dispenser authorizations occur when a card is used at a gas + /// pump, prior to the actual transaction amount being known. They are followed + /// by an advice message that updates the amount of the pending transaction. /// - Match, + AutomaticFuelDispenser, /// - /// The card verification code did not match the one on file. + /// A transaction used to pay a bill. /// - NoMatch, + BillPayment, + + /// + /// Original credit transactions are used to send money to a cardholder. + /// + OriginalCredit, + + /// + /// A regular purchase. + /// + Purchase, + + /// + /// Quasi-cash transactions represent purchases of items which may be convertible + /// to cash. + /// + QuasiCash, + + /// + /// A refund card authorization, sometimes referred to as a credit voucher authorization, + /// where funds are credited to the cardholder. + /// + Refund, + + /// + /// Cash disbursement transactions are used to withdraw cash from an ATM or a + /// point of sale. + /// + CashDisbursement, + + /// + /// A balance inquiry transaction is used to check the balance of an account associated + /// with a card. + /// + BalanceInquiry, + + /// + /// The processing category is unknown. + /// + Unknown, } -sealed class CardDeclineVerificationCardVerificationCodeResultConverter - : JsonConverter +sealed class CardDeclineProcessingCategoryConverter : JsonConverter { - public override CardDeclineVerificationCardVerificationCodeResult Read( + public override CardDeclineProcessingCategory Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12759,16 +13272,23 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => CardDeclineVerificationCardVerificationCodeResult.NotChecked, - "match" => CardDeclineVerificationCardVerificationCodeResult.Match, - "no_match" => CardDeclineVerificationCardVerificationCodeResult.NoMatch, - _ => (CardDeclineVerificationCardVerificationCodeResult)(-1), + "account_funding" => CardDeclineProcessingCategory.AccountFunding, + "automatic_fuel_dispenser" => CardDeclineProcessingCategory.AutomaticFuelDispenser, + "bill_payment" => CardDeclineProcessingCategory.BillPayment, + "original_credit" => CardDeclineProcessingCategory.OriginalCredit, + "purchase" => CardDeclineProcessingCategory.Purchase, + "quasi_cash" => CardDeclineProcessingCategory.QuasiCash, + "refund" => CardDeclineProcessingCategory.Refund, + "cash_disbursement" => CardDeclineProcessingCategory.CashDisbursement, + "balance_inquiry" => CardDeclineProcessingCategory.BalanceInquiry, + "unknown" => CardDeclineProcessingCategory.Unknown, + _ => (CardDeclineProcessingCategory)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardDeclineVerificationCardVerificationCodeResult value, + CardDeclineProcessingCategory value, JsonSerializerOptions options ) { @@ -12776,9 +13296,16 @@ JsonSerializerOptions options writer, value switch { - CardDeclineVerificationCardVerificationCodeResult.NotChecked => "not_checked", - CardDeclineVerificationCardVerificationCodeResult.Match => "match", - CardDeclineVerificationCardVerificationCodeResult.NoMatch => "no_match", + CardDeclineProcessingCategory.AccountFunding => "account_funding", + CardDeclineProcessingCategory.AutomaticFuelDispenser => "automatic_fuel_dispenser", + CardDeclineProcessingCategory.BillPayment => "bill_payment", + CardDeclineProcessingCategory.OriginalCredit => "original_credit", + CardDeclineProcessingCategory.Purchase => "purchase", + CardDeclineProcessingCategory.QuasiCash => "quasi_cash", + CardDeclineProcessingCategory.Refund => "refund", + CardDeclineProcessingCategory.CashDisbursement => "cash_disbursement", + CardDeclineProcessingCategory.BalanceInquiry => "balance_inquiry", + CardDeclineProcessingCategory.Unknown => "unknown", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -12789,178 +13316,51 @@ JsonSerializerOptions options } /// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. +/// This is present if a specific decline reason was given in the real-time decision. /// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineVerificationCardholderAddress, - CardDeclineVerificationCardholderAddressFromRaw - >) -)] -public sealed record class CardDeclineVerificationCardholderAddress : JsonModel +[JsonConverter(typeof(RealTimeDecisionReasonConverter))] +public enum RealTimeDecisionReason { /// - /// Line 1 of the address on file for the cardholder. + /// The cardholder does not have sufficient funds to cover the transaction. The + /// merchant may attempt to process the transaction again. /// - public required string? ActualLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); - } - init { this._rawData.Set("actual_line1", value); } - } + InsufficientFunds, /// - /// The postal code of the address on file for the cardholder. + /// This type of transaction is not allowed for this card. This transaction should + /// not be retried. /// - public required string? ActualPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); - } - init { this._rawData.Set("actual_postal_code", value); } - } + TransactionNeverAllowed, /// - /// The cardholder address line 1 provided for verification in the authorization request. + /// The transaction amount exceeds the cardholder's approval limit. The merchant + /// may attempt to process the transaction again. /// - public required string? ProvidedLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); - } - init { this._rawData.Set("provided_line1", value); } - } - - /// - /// The postal code provided for verification in the authorization request. - /// - public required string? ProvidedPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); - } - init { this._rawData.Set("provided_postal_code", value); } - } - - /// - /// The address verification result returned to the card network. - /// - public required ApiEnum Result - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); - } - init { this._rawData.Set("result", value); } - } - - /// - public override void Validate() - { - _ = this.ActualLine1; - _ = this.ActualPostalCode; - _ = this.ProvidedLine1; - _ = this.ProvidedPostalCode; - this.Result.Validate(); - } - - public CardDeclineVerificationCardholderAddress() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineVerificationCardholderAddress( - CardDeclineVerificationCardholderAddress cardDeclineVerificationCardholderAddress - ) - : base(cardDeclineVerificationCardholderAddress) { } -#pragma warning restore CS8618 - - public CardDeclineVerificationCardholderAddress( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineVerificationCardholderAddress(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardDeclineVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardDeclineVerificationCardholderAddressFromRaw - : IFromRawJson -{ - /// - public CardDeclineVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineVerificationCardholderAddress.FromRawUnchecked(rawData); -} - -/// -/// The address verification result returned to the card network. -/// -[JsonConverter(typeof(CardDeclineVerificationCardholderAddressResultConverter))] -public enum CardDeclineVerificationCardholderAddressResult -{ - /// - /// No address information was provided in the authorization request. - /// - NotChecked, - - /// - /// Postal code matches, but the street address does not match or was not provided. - /// - PostalCodeMatchAddressNoMatch, - - /// - /// Postal code does not match, but the street address matches or was not provided. - /// - PostalCodeNoMatchAddressMatch, + ExceedsApprovalLimit, /// - /// Postal code and street address match. + /// The card has been temporarily disabled or not yet activated. The merchant + /// may attempt to process the transaction again. /// - Match, + CardTemporarilyDisabled, /// - /// Postal code and street address do not match. + /// The transaction is suspected to be fraudulent. The merchant may attempt to + /// process the transaction again. /// - NoMatch, + SuspectedFraud, /// - /// Postal code matches, but the street address was not verified. (deprecated) + /// The transaction was declined for another reason. The merchant may attempt + /// to process the transaction again. This should be used sparingly. /// - PostalCodeMatchAddressNotChecked, + Other, } -sealed class CardDeclineVerificationCardholderAddressResultConverter - : JsonConverter +sealed class RealTimeDecisionReasonConverter : JsonConverter { - public override CardDeclineVerificationCardholderAddressResult Read( + public override RealTimeDecisionReason Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12968,22 +13368,19 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => CardDeclineVerificationCardholderAddressResult.NotChecked, - "postal_code_match_address_no_match" => - CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, - "postal_code_no_match_address_match" => - CardDeclineVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, - "match" => CardDeclineVerificationCardholderAddressResult.Match, - "no_match" => CardDeclineVerificationCardholderAddressResult.NoMatch, - "postal_code_match_address_not_checked" => - CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, - _ => (CardDeclineVerificationCardholderAddressResult)(-1), + "insufficient_funds" => RealTimeDecisionReason.InsufficientFunds, + "transaction_never_allowed" => RealTimeDecisionReason.TransactionNeverAllowed, + "exceeds_approval_limit" => RealTimeDecisionReason.ExceedsApprovalLimit, + "card_temporarily_disabled" => RealTimeDecisionReason.CardTemporarilyDisabled, + "suspected_fraud" => RealTimeDecisionReason.SuspectedFraud, + "other" => RealTimeDecisionReason.Other, + _ => (RealTimeDecisionReason)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardDeclineVerificationCardholderAddressResult value, + RealTimeDecisionReason value, JsonSerializerOptions options ) { @@ -12991,15 +13388,12 @@ JsonSerializerOptions options writer, value switch { - CardDeclineVerificationCardholderAddressResult.NotChecked => "not_checked", - CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => - "postal_code_match_address_no_match", - CardDeclineVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => - "postal_code_no_match_address_match", - CardDeclineVerificationCardholderAddressResult.Match => "match", - CardDeclineVerificationCardholderAddressResult.NoMatch => "no_match", - CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => - "postal_code_match_address_not_checked", + RealTimeDecisionReason.InsufficientFunds => "insufficient_funds", + RealTimeDecisionReason.TransactionNeverAllowed => "transaction_never_allowed", + RealTimeDecisionReason.ExceedsApprovalLimit => "exceeds_approval_limit", + RealTimeDecisionReason.CardTemporarilyDisabled => "card_temporarily_disabled", + RealTimeDecisionReason.SuspectedFraud => "suspected_fraud", + RealTimeDecisionReason.Other => "other", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -13010,194 +13404,231 @@ JsonSerializerOptions options } /// -/// Cardholder name provided in the authorization request. +/// Why the transaction was declined. /// -[JsonConverter( - typeof(JsonModelConverter< - CardDeclineVerificationCardholderName, - CardDeclineVerificationCardholderNameFromRaw - >) -)] -public sealed record class CardDeclineVerificationCardholderName : JsonModel +[JsonConverter(typeof(ReasonConverter))] +public enum Reason { /// - /// The first name provided for verification in the authorization request. + /// The account has been closed. /// - public required string? ProvidedFirstName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_first_name"); - } - init { this._rawData.Set("provided_first_name", value); } - } + AccountClosed, /// - /// The last name provided for verification in the authorization request. + /// The Card was not active. /// - public required string? ProvidedLastName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_last_name"); - } - init { this._rawData.Set("provided_last_name", value); } - } + CardNotActive, /// - /// The middle name provided for verification in the authorization request. + /// The Card has been canceled. /// - public required string? ProvidedMiddleName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_middle_name"); - } - init { this._rawData.Set("provided_middle_name", value); } - } - - /// - public override void Validate() - { - _ = this.ProvidedFirstName; - _ = this.ProvidedLastName; - _ = this.ProvidedMiddleName; - } + CardCanceled, - public CardDeclineVerificationCardholderName() { } + /// + /// The Physical Card was not active. + /// + PhysicalCardNotActive, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardDeclineVerificationCardholderName( - CardDeclineVerificationCardholderName cardDeclineVerificationCardholderName - ) - : base(cardDeclineVerificationCardholderName) { } -#pragma warning restore CS8618 + /// + /// The account's entity was not active. + /// + EntityNotActive, - public CardDeclineVerificationCardholderName(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// The account was inactive. + /// + GroupLocked, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardDeclineVerificationCardholderName(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// The Card's Account did not have a sufficient available balance. + /// + InsufficientFunds, - /// - public static CardDeclineVerificationCardholderName FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// The given CVV2 did not match the card's value. + /// + Cvv2Mismatch, -class CardDeclineVerificationCardholderNameFromRaw - : IFromRawJson -{ - /// - public CardDeclineVerificationCardholderName FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardDeclineVerificationCardholderName.FromRawUnchecked(rawData); -} + /// + /// The given PIN did not match the card's value. + /// + PinMismatch, -/// -/// A Card Financial object. This field will be present in the JSON response if and -/// only if `category` is equal to `card_financial`. Card Financials are temporary -/// holds placed on a customer's funds with the intent to later clear a transaction. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardFinancial : JsonModel -{ /// - /// The Card Financial identifier. + /// The given expiration date did not match the card's value. Only applies when + /// a CVV2 is present. /// - public required string ID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } - } + CardExpirationMismatch, /// - /// Whether this financial was approved by Increase, the card network through - /// stand-in processing, or the user through a real-time decision. + /// The attempted card transaction is not allowed per Increase's terms. /// - public required ApiEnum Actioner - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "actioner" - ); - } - init { this._rawData.Set("actioner", value); } - } + TransactionNotAllowed, /// - /// Additional amounts associated with the card authorization, such as ATM surcharges - /// fees. These are usually a subset of the `amount` field and are used to provide - /// more detailed information about the transaction. + /// The transaction was blocked by a Limit. /// - public required CardFinancialAdditionalAmounts AdditionalAmounts + BreachesLimit, + + /// + /// Your application declined the transaction via webhook. + /// + WebhookDeclined, + + /// + /// Your application webhook did not respond without the required timeout. + /// + WebhookTimedOut, + + /// + /// Declined by stand-in processing. + /// + DeclinedByStandInProcessing, + + /// + /// The card read had an invalid CVV or dCVV. + /// + InvalidPhysicalCard, + + /// + /// The original card authorization for this incremental authorization does not exist. + /// + MissingOriginalAuthorization, + + /// + /// The card's authorization request cryptogram was invalid. The cryptogram can + /// be from a physical card or a Digital Wallet Token purchase. + /// + InvalidCryptogram, + + /// + /// The transaction was declined because the 3DS authentication failed. + /// + Failed3dsAuthentication, + + /// + /// The transaction was suspected to be used by a card tester to test for valid + /// card numbers. + /// + SuspectedCardTesting, + + /// + /// The transaction was suspected to be fraudulent. Please reach out to support@increase.com + /// for more information. + /// + SuspectedFraud, +} + +sealed class ReasonConverter : JsonConverter +{ + public override Reason Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "additional_amounts" - ); - } - init { this._rawData.Set("additional_amounts", value); } + "account_closed" => Reason.AccountClosed, + "card_not_active" => Reason.CardNotActive, + "card_canceled" => Reason.CardCanceled, + "physical_card_not_active" => Reason.PhysicalCardNotActive, + "entity_not_active" => Reason.EntityNotActive, + "group_locked" => Reason.GroupLocked, + "insufficient_funds" => Reason.InsufficientFunds, + "cvv2_mismatch" => Reason.Cvv2Mismatch, + "pin_mismatch" => Reason.PinMismatch, + "card_expiration_mismatch" => Reason.CardExpirationMismatch, + "transaction_not_allowed" => Reason.TransactionNotAllowed, + "breaches_limit" => Reason.BreachesLimit, + "webhook_declined" => Reason.WebhookDeclined, + "webhook_timed_out" => Reason.WebhookTimedOut, + "declined_by_stand_in_processing" => Reason.DeclinedByStandInProcessing, + "invalid_physical_card" => Reason.InvalidPhysicalCard, + "missing_original_authorization" => Reason.MissingOriginalAuthorization, + "invalid_cryptogram" => Reason.InvalidCryptogram, + "failed_3ds_authentication" => Reason.Failed3dsAuthentication, + "suspected_card_testing" => Reason.SuspectedCardTesting, + "suspected_fraud" => Reason.SuspectedFraud, + _ => (Reason)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + Reason.AccountClosed => "account_closed", + Reason.CardNotActive => "card_not_active", + Reason.CardCanceled => "card_canceled", + Reason.PhysicalCardNotActive => "physical_card_not_active", + Reason.EntityNotActive => "entity_not_active", + Reason.GroupLocked => "group_locked", + Reason.InsufficientFunds => "insufficient_funds", + Reason.Cvv2Mismatch => "cvv2_mismatch", + Reason.PinMismatch => "pin_mismatch", + Reason.CardExpirationMismatch => "card_expiration_mismatch", + Reason.TransactionNotAllowed => "transaction_not_allowed", + Reason.BreachesLimit => "breaches_limit", + Reason.WebhookDeclined => "webhook_declined", + Reason.WebhookTimedOut => "webhook_timed_out", + Reason.DeclinedByStandInProcessing => "declined_by_stand_in_processing", + Reason.InvalidPhysicalCard => "invalid_physical_card", + Reason.MissingOriginalAuthorization => "missing_original_authorization", + Reason.InvalidCryptogram => "invalid_cryptogram", + Reason.Failed3dsAuthentication => "failed_3ds_authentication", + Reason.SuspectedCardTesting => "suspected_card_testing", + Reason.SuspectedFraud => "suspected_fraud", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardDeclineSchemeFee : JsonModel +{ /// - /// The pending amount in the minor unit of the transaction's currency. For dollars, - /// for example, this is cents. + /// The fee amount given as a string containing a decimal number. /// - public required long Amount + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("amount"); } init { this._rawData.Set("amount", value); } } /// - /// The ID of the Card Payment this transaction belongs to. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required string CardPaymentID + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("card_payment_id", value); } + init { this._rawData.Set("created_at", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required ApiEnum Currency + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( + return this._rawData.GetNotNullClass>( "currency" ); } @@ -13205,389 +13636,336 @@ public required ApiEnum Currency } /// - /// If the authorization was made via a Digital Wallet Token (such as an Apple - /// Pay purchase), the identifier of the token that was used. - /// - public required string? DigitalWalletTokenID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("digital_wallet_token_id"); - } - init { this._rawData.Set("digital_wallet_token_id", value); } - } - - /// - /// The direction describes the direction the funds will move, either from the - /// cardholder to the merchant or from the merchant to the cardholder. + /// The type of fee being assessed. /// - public required ApiEnum Direction + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "direction" + return this._rawData.GetNotNullClass>( + "fee_type" ); } - init { this._rawData.Set("direction", value); } + init { this._rawData.Set("fee_type", value); } } /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required string MerchantAcceptorID + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("merchant_acceptor_id", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - /// card is transacting with. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required string MerchantCategoryCode + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("merchant_category_code", value); } + init { this._rawData.Set("variable_rate", value); } } - /// - /// The city the merchant resides in. - /// - public required string? MerchantCity + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_city"); - } - init { this._rawData.Set("merchant_city", value); } + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - /// - /// The country the merchant resides in. - /// - public required string MerchantCountry + public CardDeclineSchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardDeclineSchemeFee(CardDeclineSchemeFee cardDeclineSchemeFee) + : base(cardDeclineSchemeFee) { } +#pragma warning restore CS8618 + + public CardDeclineSchemeFee(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); - } - init { this._rawData.Set("merchant_country", value); } + this._rawData = new(rawData); } - /// - /// The merchant descriptor of the merchant the card is transacting with. - /// - public required string MerchantDescriptor +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardDeclineSchemeFee(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_descriptor"); - } - init { this._rawData.Set("merchant_descriptor", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit - /// ZIP code, where the first 5 and last 4 are separated by a dash. - /// - public required string? MerchantPostalCode + /// + public static CardDeclineSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardDeclineSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardDeclineSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardDeclineSchemeFee.FromRawUnchecked(rawData); +} +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(CardDeclineSchemeFeeCurrencyConverter))] +public enum CardDeclineSchemeFeeCurrency +{ /// - /// The state the merchant resides in. + /// US Dollar (USD) /// - public required string? MerchantState + Usd, +} + +sealed class CardDeclineSchemeFeeCurrencyConverter : JsonConverter +{ + public override CardDeclineSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } + "USD" => CardDeclineSchemeFeeCurrency.Usd, + _ => (CardDeclineSchemeFeeCurrency)(-1), + }; } - /// - /// Fields specific to the `network`. - /// - public required CardFinancialNetworkDetails NetworkDetails + public override void Write( + Utf8JsonWriter writer, + CardDeclineSchemeFeeCurrency value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("network_details"); - } - init { this._rawData.Set("network_details", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(CardDeclineSchemeFeeFeeTypeConverter))] +public enum CardDeclineSchemeFeeFeeType +{ /// - /// Network-specific identifiers for a specific request or transaction. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required CardFinancialNetworkIdentifiers NetworkIdentifiers - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The risk score generated by the card network. For Visa this is the Visa Advanced - /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse - /// the score is from 0 to 999, where 999 is the riskiest. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required long? NetworkRiskScore - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("network_risk_score"); - } - init { this._rawData.Set("network_risk_score", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, /// - /// If the authorization was made in-person with a physical card, the Physical - /// Card that was used. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? PhysicalCardID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("physical_card_id"); - } - init { this._rawData.Set("physical_card_id", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// The pending amount in the minor unit of the transaction's presentment currency. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required long PresentmentAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); - } - init { this._rawData.Set("presentment_amount", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// presentment currency. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required string PresentmentCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); - } - init { this._rawData.Set("presentment_currency", value); } - } + VisaAuthorizationCanadaPointOfSale, /// - /// The processing category describes the intent behind the financial, such as - /// whether it was used for bill payments or an automatic fuel dispenser. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. /// - public required ApiEnum ProcessingCategory - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "processing_category" - ); - } - init { this._rawData.Set("processing_category", value); } - } + VisaAuthorizationReversalPointOfSale, /// - /// The identifier of the Real-Time Decision sent to approve or decline this transaction. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. /// - public required string? RealTimeDecisionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("real_time_decision_id"); - } - init { this._rawData.Set("real_time_decision_id", value); } - } + VisaAuthorizationReversalInternationalPointOfSale, /// - /// The terminal identifier (commonly abbreviated as TID) of the terminal the - /// card is transacting with. + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. /// - public required string? TerminalID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("terminal_id"); - } - init { this._rawData.Set("terminal_id", value); } - } + VisaAuthorizationAddressVerificationService, /// - /// The identifier of the Transaction associated with this Transaction. + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). /// - public required string TransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("transaction_id"); - } - init { this._rawData.Set("transaction_id", value); } - } + VisaAdvancedAuthorization, /// - /// A constant representing the object's type. For this resource it will always - /// be `card_financial`. - /// - public required ApiEnum Type - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } - } + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, /// - /// Fields related to verification of cardholder-provided values. + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. /// - public required CardFinancialVerification Verification - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("verification"); - } - init { this._rawData.Set("verification", value); } - } + VisaAccountVerificationDomestic, - /// - public override void Validate() - { - _ = this.ID; - this.Actioner.Validate(); - this.AdditionalAmounts.Validate(); - _ = this.Amount; - _ = this.CardPaymentID; - this.Currency.Validate(); - _ = this.DigitalWalletTokenID; - this.Direction.Validate(); - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantDescriptor; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.NetworkDetails.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.NetworkRiskScore; - _ = this.PhysicalCardID; - _ = this.PresentmentAmount; - _ = this.PresentmentCurrency; - this.ProcessingCategory.Validate(); - _ = this.RealTimeDecisionID; - _ = this.TerminalID; - _ = this.TransactionID; - this.Type.Validate(); - this.Verification.Validate(); - } + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, - public CardFinancial() { } + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancial(CardFinancial cardFinancial) - : base(cardFinancial) { } -#pragma warning restore CS8618 + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, - public CardFinancial(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancial(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, - /// - public static CardFinancial FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, -class CardFinancialFromRaw : IFromRawJson -{ - /// - public CardFinancial FromRawUnchecked(IReadOnlyDictionary rawData) => - CardFinancial.FromRawUnchecked(rawData); -} + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, -/// -/// Whether this financial was approved by Increase, the card network through stand-in -/// processing, or the user through a real-time decision. -/// -[JsonConverter(typeof(CardFinancialActionerConverter))] -public enum CardFinancialActioner -{ /// - /// This object was actioned by the user through a real-time decision. + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. /// - User, + VisaPurchaseInternational, /// - /// This object was actioned by Increase without user intervention. + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - Increase, + VisaCreditPurchaseToken, /// - /// This object was actioned by the network, through stand-in processing. + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - Network, + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class CardFinancialActionerConverter : JsonConverter +sealed class CardDeclineSchemeFeeFeeTypeConverter : JsonConverter { - public override CardFinancialActioner Read( + public override CardDeclineSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -13595,16 +13973,62 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "user" => CardFinancialActioner.User, - "increase" => CardFinancialActioner.Increase, - "network" => CardFinancialActioner.Network, - _ => (CardFinancialActioner)(-1), + "visa_international_service_assessment_single_currency" => + CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardDeclineSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => CardDeclineSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardDeclineSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardDeclineSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardDeclineSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardDeclineSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardDeclineSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardDeclineSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardDeclineSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardDeclineSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => CardDeclineSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardDeclineSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardDeclineSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardDeclineSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardDeclineSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardDeclineSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardDeclineSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardDeclineSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardDeclineSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardDeclineSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardDeclineSchemeFeeFeeType.PulseSwitchFee, + _ => (CardDeclineSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardFinancialActioner value, + CardDeclineSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -13612,9 +14036,58 @@ JsonSerializerOptions options writer, value switch { - CardFinancialActioner.User => "user", - CardFinancialActioner.Increase => "increase", - CardFinancialActioner.Network => "network", + CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardDeclineSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardDeclineSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardDeclineSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardDeclineSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardDeclineSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardDeclineSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardDeclineSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardDeclineSchemeFeeFeeType.VisaMessageTransmission => "visa_message_transmission", + CardDeclineSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardDeclineSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardDeclineSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardDeclineSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardDeclineSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardDeclineSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardDeclineSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardDeclineSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardDeclineSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardDeclineSchemeFeeFeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + CardDeclineSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardDeclineSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardDeclineSchemeFeeFeeType.VisaDirectAuthorization => "visa_direct_authorization", + CardDeclineSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardDeclineSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardDeclineSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardDeclineSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardDeclineSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardDeclineSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -13625,198 +14098,89 @@ JsonSerializerOptions options } /// -/// Additional amounts associated with the card authorization, such as ATM surcharges -/// fees. These are usually a subset of the `amount` field and are used to provide -/// more detailed information about the transaction. +/// Fields related to verification of cardholder-provided values. /// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmounts, - CardFinancialAdditionalAmountsFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmounts : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardDeclineVerification : JsonModel { /// - /// The part of this transaction amount that was for clinic-related services. + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. /// - public required CardFinancialAdditionalAmountsClinic? Clinic + public required CardDeclineVerificationCardVerificationCode CardVerificationCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("clinic"); + return this._rawData.GetNotNullClass( + "card_verification_code" + ); } - init { this._rawData.Set("clinic", value); } + init { this._rawData.Set("card_verification_code", value); } } /// - /// The part of this transaction amount that was for dental-related services. + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. /// - public required CardFinancialAdditionalAmountsDental? Dental + public required CardDeclineVerificationCardholderAddress CardholderAddress { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("dental"); + return this._rawData.GetNotNullClass( + "cardholder_address" + ); } - init { this._rawData.Set("dental", value); } - } - - /// - /// The original pre-authorized amount. - /// - public required CardFinancialAdditionalAmountsOriginal? Original - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "original" - ); - } - init { this._rawData.Set("original", value); } - } - - /// - /// The part of this transaction amount that was for healthcare prescriptions. - /// - public required CardFinancialAdditionalAmountsPrescription? Prescription - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "prescription" - ); - } - init { this._rawData.Set("prescription", value); } - } - - /// - /// The surcharge amount charged for this transaction by the merchant. - /// - public required CardFinancialAdditionalAmountsSurcharge? Surcharge - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "surcharge" - ); - } - init { this._rawData.Set("surcharge", value); } - } - - /// - /// The total amount of a series of incremental authorizations, optionally provided. - /// - public required CardFinancialAdditionalAmountsTotalCumulative? TotalCumulative - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_cumulative" - ); - } - init { this._rawData.Set("total_cumulative", value); } + init { this._rawData.Set("cardholder_address", value); } } /// - /// The total amount of healthcare-related additional amounts. + /// Cardholder name provided in the authorization request. /// - public required CardFinancialAdditionalAmountsTotalHealthcare? TotalHealthcare + public required CardDeclineVerificationCardholderName? CardholderName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_healthcare" + return this._rawData.GetNullableClass( + "cardholder_name" ); } - init { this._rawData.Set("total_healthcare", value); } - } - - /// - /// The part of this transaction amount that was for transit-related services. - /// - public required CardFinancialAdditionalAmountsTransit? Transit - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("transit"); - } - init { this._rawData.Set("transit", value); } - } - - /// - /// An unknown additional amount. - /// - public required CardFinancialAdditionalAmountsUnknown? Unknown - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("unknown"); - } - init { this._rawData.Set("unknown", value); } - } - - /// - /// The part of this transaction amount that was for vision-related services. - /// - public required CardFinancialAdditionalAmountsVision? Vision - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("vision"); - } - init { this._rawData.Set("vision", value); } + init { this._rawData.Set("cardholder_name", value); } } /// public override void Validate() { - this.Clinic?.Validate(); - this.Dental?.Validate(); - this.Original?.Validate(); - this.Prescription?.Validate(); - this.Surcharge?.Validate(); - this.TotalCumulative?.Validate(); - this.TotalHealthcare?.Validate(); - this.Transit?.Validate(); - this.Unknown?.Validate(); - this.Vision?.Validate(); + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); } - public CardFinancialAdditionalAmounts() { } + public CardDeclineVerification() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialAdditionalAmounts( - CardFinancialAdditionalAmounts cardFinancialAdditionalAmounts - ) - : base(cardFinancialAdditionalAmounts) { } + public CardDeclineVerification(CardDeclineVerification cardDeclineVerification) + : base(cardDeclineVerification) { } #pragma warning restore CS8618 - public CardFinancialAdditionalAmounts(IReadOnlyDictionary rawData) + public CardDeclineVerification(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialAdditionalAmounts(FrozenDictionary rawData) + CardDeclineVerification(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmounts FromRawUnchecked( + /// + public static CardDeclineVerification FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -13824,336 +14188,261 @@ IReadOnlyDictionary rawData } } -class CardFinancialAdditionalAmountsFromRaw : IFromRawJson +class CardDeclineVerificationFromRaw : IFromRawJson { /// - public CardFinancialAdditionalAmounts FromRawUnchecked( + public CardDeclineVerification FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmounts.FromRawUnchecked(rawData); + ) => CardDeclineVerification.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for clinic-related services. +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialAdditionalAmountsClinic, - CardFinancialAdditionalAmountsClinicFromRaw + CardDeclineVerificationCardVerificationCode, + CardDeclineVerificationCardVerificationCodeFromRaw >) )] -public sealed record class CardFinancialAdditionalAmountsClinic : JsonModel +public sealed record class CardDeclineVerificationCardVerificationCode : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). - /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The result of verifying the Card Verification Code. /// - public required string Currency + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("result", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Currency; + this.Result.Validate(); } - public CardFinancialAdditionalAmountsClinic() { } + public CardDeclineVerificationCardVerificationCode() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialAdditionalAmountsClinic( - CardFinancialAdditionalAmountsClinic cardFinancialAdditionalAmountsClinic + public CardDeclineVerificationCardVerificationCode( + CardDeclineVerificationCardVerificationCode cardDeclineVerificationCardVerificationCode ) - : base(cardFinancialAdditionalAmountsClinic) { } + : base(cardDeclineVerificationCardVerificationCode) { } #pragma warning restore CS8618 - public CardFinancialAdditionalAmountsClinic(IReadOnlyDictionary rawData) + public CardDeclineVerificationCardVerificationCode( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialAdditionalAmountsClinic(FrozenDictionary rawData) + CardDeclineVerificationCardVerificationCode(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsClinic FromRawUnchecked( + /// + public static CardDeclineVerificationCardVerificationCode FromRawUnchecked( IReadOnlyDictionary rawData ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } + + [SetsRequiredMembers] + public CardDeclineVerificationCardVerificationCode( + ApiEnum result + ) + : this() + { + this.Result = result; + } } -class CardFinancialAdditionalAmountsClinicFromRaw - : IFromRawJson +class CardDeclineVerificationCardVerificationCodeFromRaw + : IFromRawJson { /// - public CardFinancialAdditionalAmountsClinic FromRawUnchecked( + public CardDeclineVerificationCardVerificationCode FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsClinic.FromRawUnchecked(rawData); + ) => CardDeclineVerificationCardVerificationCode.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for dental-related services. +/// The result of verifying the Card Verification Code. /// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsDental, - CardFinancialAdditionalAmountsDentalFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsDental : JsonModel +[JsonConverter(typeof(CardDeclineVerificationCardVerificationCodeResultConverter))] +public enum CardDeclineVerificationCardVerificationCodeResult { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// No card verification code was provided in the authorization request. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + NotChecked, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The card verification code matched the one on file. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + Match, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardFinancialAdditionalAmountsDental() { } + /// + /// The card verification code did not match the one on file. + /// + NoMatch, +} -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsDental( - CardFinancialAdditionalAmountsDental cardFinancialAdditionalAmountsDental +sealed class CardDeclineVerificationCardVerificationCodeResultConverter + : JsonConverter +{ + public override CardDeclineVerificationCardVerificationCodeResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options ) - : base(cardFinancialAdditionalAmountsDental) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsDental(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsDental(FrozenDictionary rawData) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => CardDeclineVerificationCardVerificationCodeResult.NotChecked, + "match" => CardDeclineVerificationCardVerificationCodeResult.Match, + "no_match" => CardDeclineVerificationCardVerificationCodeResult.NoMatch, + _ => (CardDeclineVerificationCardVerificationCodeResult)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardDeclineVerificationCardVerificationCodeResult value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineVerificationCardVerificationCodeResult.NotChecked => "not_checked", + CardDeclineVerificationCardVerificationCodeResult.Match => "match", + CardDeclineVerificationCardVerificationCodeResult.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardFinancialAdditionalAmountsDentalFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsDental.FromRawUnchecked(rawData); -} - /// -/// The original pre-authorized amount. +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialAdditionalAmountsOriginal, - CardFinancialAdditionalAmountsOriginalFromRaw + CardDeclineVerificationCardholderAddress, + CardDeclineVerificationCardholderAddressFromRaw >) )] -public sealed record class CardFinancialAdditionalAmountsOriginal : JsonModel +public sealed record class CardDeclineVerificationCardholderAddress : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Line 1 of the address on file for the cardholder. /// - public required long Amount + public required string? ActualLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("actual_line1"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("actual_line1", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The postal code of the address on file for the cardholder. /// - public required string Currency + public required string? ActualPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("actual_postal_code"); } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardFinancialAdditionalAmountsOriginal() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsOriginal( - CardFinancialAdditionalAmountsOriginal cardFinancialAdditionalAmountsOriginal - ) - : base(cardFinancialAdditionalAmountsOriginal) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsOriginal(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsOriginal(FrozenDictionary rawData) - { - this._rawData = new(rawData); + init { this._rawData.Set("actual_postal_code", value); } } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The cardholder address line 1 provided for verification in the authorization request. + /// + public required string? ProvidedLine1 { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_line1"); + } + init { this._rawData.Set("provided_line1", value); } } -} - -class CardFinancialAdditionalAmountsOriginalFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsOriginal.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for healthcare prescriptions. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsPrescription, - CardFinancialAdditionalAmountsPrescriptionFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsPrescription : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The postal code provided for verification in the authorization request. /// - public required long Amount + public required string? ProvidedPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("provided_postal_code"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("provided_postal_code", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The address verification result returned to the card network. /// - public required string Currency + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("result", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Currency; + _ = this.ActualLine1; + _ = this.ActualPostalCode; + _ = this.ProvidedLine1; + _ = this.ProvidedPostalCode; + this.Result.Validate(); } - public CardFinancialAdditionalAmountsPrescription() { } + public CardDeclineVerificationCardholderAddress() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialAdditionalAmountsPrescription( - CardFinancialAdditionalAmountsPrescription cardFinancialAdditionalAmountsPrescription + public CardDeclineVerificationCardholderAddress( + CardDeclineVerificationCardholderAddress cardDeclineVerificationCardholderAddress ) - : base(cardFinancialAdditionalAmountsPrescription) { } + : base(cardDeclineVerificationCardholderAddress) { } #pragma warning restore CS8618 - public CardFinancialAdditionalAmountsPrescription( + public CardDeclineVerificationCardholderAddress( IReadOnlyDictionary rawData ) { @@ -14162,14 +14451,14 @@ IReadOnlyDictionary rawData #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialAdditionalAmountsPrescription(FrozenDictionary rawData) + CardDeclineVerificationCardholderAddress(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsPrescription FromRawUnchecked( + /// + public static CardDeclineVerificationCardholderAddress FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -14177,177 +14466,187 @@ IReadOnlyDictionary rawData } } -class CardFinancialAdditionalAmountsPrescriptionFromRaw - : IFromRawJson +class CardDeclineVerificationCardholderAddressFromRaw + : IFromRawJson { /// - public CardFinancialAdditionalAmountsPrescription FromRawUnchecked( + public CardDeclineVerificationCardholderAddress FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsPrescription.FromRawUnchecked(rawData); + ) => CardDeclineVerificationCardholderAddress.FromRawUnchecked(rawData); } /// -/// The surcharge amount charged for this transaction by the merchant. +/// The address verification result returned to the card network. /// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsSurcharge, - CardFinancialAdditionalAmountsSurchargeFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsSurcharge : JsonModel +[JsonConverter(typeof(CardDeclineVerificationCardholderAddressResultConverter))] +public enum CardDeclineVerificationCardholderAddressResult { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// No address information was provided in the authorization request. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + NotChecked, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Postal code matches, but the street address does not match or was not provided. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + PostalCodeMatchAddressNoMatch, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// Postal code does not match, but the street address matches or was not provided. + /// + PostalCodeNoMatchAddressMatch, - public CardFinancialAdditionalAmountsSurcharge() { } + /// + /// Postal code and street address match. + /// + Match, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsSurcharge( - CardFinancialAdditionalAmountsSurcharge cardFinancialAdditionalAmountsSurcharge - ) - : base(cardFinancialAdditionalAmountsSurcharge) { } -#pragma warning restore CS8618 + /// + /// Postal code and street address do not match. + /// + NoMatch, - public CardFinancialAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// Postal code matches, but the street address was not verified. (deprecated) + /// + PostalCodeMatchAddressNotChecked, +} -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsSurcharge(FrozenDictionary rawData) +sealed class CardDeclineVerificationCardholderAddressResultConverter + : JsonConverter +{ + public override CardDeclineVerificationCardholderAddressResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => CardDeclineVerificationCardholderAddressResult.NotChecked, + "postal_code_match_address_no_match" => + CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, + "postal_code_no_match_address_match" => + CardDeclineVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, + "match" => CardDeclineVerificationCardholderAddressResult.Match, + "no_match" => CardDeclineVerificationCardholderAddressResult.NoMatch, + "postal_code_match_address_not_checked" => + CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, + _ => (CardDeclineVerificationCardholderAddressResult)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardDeclineVerificationCardholderAddressResult value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardDeclineVerificationCardholderAddressResult.NotChecked => "not_checked", + CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => + "postal_code_match_address_no_match", + CardDeclineVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => + "postal_code_no_match_address_match", + CardDeclineVerificationCardholderAddressResult.Match => "match", + CardDeclineVerificationCardholderAddressResult.NoMatch => "no_match", + CardDeclineVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => + "postal_code_match_address_not_checked", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardFinancialAdditionalAmountsSurchargeFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsSurcharge.FromRawUnchecked(rawData); -} - /// -/// The total amount of a series of incremental authorizations, optionally provided. +/// Cardholder name provided in the authorization request. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialAdditionalAmountsTotalCumulative, - CardFinancialAdditionalAmountsTotalCumulativeFromRaw + CardDeclineVerificationCardholderName, + CardDeclineVerificationCardholderNameFromRaw >) )] -public sealed record class CardFinancialAdditionalAmountsTotalCumulative : JsonModel +public sealed record class CardDeclineVerificationCardholderName : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The first name provided for verification in the authorization request. /// - public required long Amount + public required string? ProvidedFirstName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("provided_first_name"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("provided_first_name", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The last name provided for verification in the authorization request. /// - public required string Currency + public required string? ProvidedLastName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("provided_last_name"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("provided_last_name", value); } + } + + /// + /// The middle name provided for verification in the authorization request. + /// + public required string? ProvidedMiddleName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_middle_name"); + } + init { this._rawData.Set("provided_middle_name", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Currency; + _ = this.ProvidedFirstName; + _ = this.ProvidedLastName; + _ = this.ProvidedMiddleName; } - public CardFinancialAdditionalAmountsTotalCumulative() { } + public CardDeclineVerificationCardholderName() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialAdditionalAmountsTotalCumulative( - CardFinancialAdditionalAmountsTotalCumulative cardFinancialAdditionalAmountsTotalCumulative + public CardDeclineVerificationCardholderName( + CardDeclineVerificationCardholderName cardDeclineVerificationCardholderName ) - : base(cardFinancialAdditionalAmountsTotalCumulative) { } + : base(cardDeclineVerificationCardholderName) { } #pragma warning restore CS8618 - public CardFinancialAdditionalAmountsTotalCumulative( - IReadOnlyDictionary rawData - ) + public CardDeclineVerificationCardholderName(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialAdditionalAmountsTotalCumulative(FrozenDictionary rawData) + CardDeclineVerificationCardholderName(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsTotalCumulative FromRawUnchecked( + /// + public static CardDeclineVerificationCardholderName FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -14355,588 +14654,520 @@ IReadOnlyDictionary rawData } } -class CardFinancialAdditionalAmountsTotalCumulativeFromRaw - : IFromRawJson +class CardDeclineVerificationCardholderNameFromRaw + : IFromRawJson { /// - public CardFinancialAdditionalAmountsTotalCumulative FromRawUnchecked( + public CardDeclineVerificationCardholderName FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); + ) => CardDeclineVerificationCardholderName.FromRawUnchecked(rawData); } /// -/// The total amount of healthcare-related additional amounts. +/// A Card Financial object. This field will be present in the JSON response if and +/// only if `category` is equal to `card_financial`. Card Financials are temporary +/// holds placed on a customer's funds with the intent to later clear a transaction. /// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsTotalHealthcare, - CardFinancialAdditionalAmountsTotalHealthcareFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsTotalHealthcare : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardFinancial : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The Card Financial identifier. /// - public required long Amount + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Whether this financial was approved by Increase, the card network through + /// stand-in processing, or the user through a real-time decision. /// - public required string Currency + public required ApiEnum Actioner { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass>( + "actioner" + ); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("actioner", value); } } - /// - public override void Validate() + /// + /// Additional amounts associated with the card authorization, such as ATM surcharges + /// fees. These are usually a subset of the `amount` field and are used to provide + /// more detailed information about the transaction. + /// + public required CardFinancialAdditionalAmounts AdditionalAmounts { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "additional_amounts" + ); + } + init { this._rawData.Set("additional_amounts", value); } } - public CardFinancialAdditionalAmountsTotalHealthcare() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsTotalHealthcare( - CardFinancialAdditionalAmountsTotalHealthcare cardFinancialAdditionalAmountsTotalHealthcare - ) - : base(cardFinancialAdditionalAmountsTotalHealthcare) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsTotalHealthcare( - IReadOnlyDictionary rawData - ) + /// + /// The pending amount in the minor unit of the transaction's currency. For dollars, + /// for example, this is cents. + /// + public required long Amount { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) + /// + /// The ID of the Card Payment this transaction belongs to. + /// + public required string CardPaymentID { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardFinancialAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("card_payment_id"); + } + init { this._rawData.Set("card_payment_id", value); } } -} -class CardFinancialAdditionalAmountsTotalHealthcareFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); -} - -/// -/// The part of this transaction amount that was for transit-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsTransit, - CardFinancialAdditionalAmountsTransitFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsTransit : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. /// - public required long Amount + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass>( + "currency" + ); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("currency", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// If the authorization was made via a Digital Wallet Token (such as an Apple + /// Pay purchase), the identifier of the token that was used. /// - public required string Currency + public required string? DigitalWalletTokenID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("digital_wallet_token_id"); } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardFinancialAdditionalAmountsTransit() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsTransit( - CardFinancialAdditionalAmountsTransit cardFinancialAdditionalAmountsTransit - ) - : base(cardFinancialAdditionalAmountsTransit) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsTransit(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsTransit(FrozenDictionary rawData) - { - this._rawData = new(rawData); + init { this._rawData.Set("digital_wallet_token_id", value); } } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsTransit FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The direction describes the direction the funds will move, either from the + /// cardholder to the merchant or from the merchant to the cardholder. + /// + public required ApiEnum Direction { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "direction" + ); + } + init { this._rawData.Set("direction", value); } } -} - -class CardFinancialAdditionalAmountsTransitFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsTransit FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsTransit.FromRawUnchecked(rawData); -} -/// -/// An unknown additional amount. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsUnknown, - CardFinancialAdditionalAmountsUnknownFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsUnknown : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. /// - public required long Amount + public required string MerchantAcceptorID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("merchant_acceptor_id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + /// card is transacting with. /// - public required string Currency + public required string MerchantCategoryCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass("merchant_category_code"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("merchant_category_code", value); } } - /// - public override void Validate() + /// + /// The city the merchant resides in. + /// + public required string? MerchantCity { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_city"); + } + init { this._rawData.Set("merchant_city", value); } } - public CardFinancialAdditionalAmountsUnknown() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsUnknown( - CardFinancialAdditionalAmountsUnknown cardFinancialAdditionalAmountsUnknown - ) - : base(cardFinancialAdditionalAmountsUnknown) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsUnknown(IReadOnlyDictionary rawData) + /// + /// The country the merchant resides in. + /// + public required string MerchantCountry { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_country"); + } + init { this._rawData.Set("merchant_country", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsUnknown(FrozenDictionary rawData) + /// + /// The merchant descriptor of the merchant the card is transacting with. + /// + public required string MerchantDescriptor { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_descriptor"); + } + init { this._rawData.Set("merchant_descriptor", value); } } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// + public required string? MerchantPostalCode { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } } -} - -class CardFinancialAdditionalAmountsUnknownFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsUnknown.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for vision-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialAdditionalAmountsVision, - CardFinancialAdditionalAmountsVisionFromRaw - >) -)] -public sealed record class CardFinancialAdditionalAmountsVision : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The state the merchant resides in. /// - public required long Amount + public required string? MerchantState { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("merchant_state"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("merchant_state", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Fields specific to the `network`. /// - public required string Currency + public required CardFinancialNetworkDetails NetworkDetails { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass("network_details"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("network_details", value); } } - /// - public override void Validate() + /// + /// Network-specific identifiers for a specific request or transaction. + /// + public required CardFinancialNetworkIdentifiers NetworkIdentifiers { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); + } + init { this._rawData.Set("network_identifiers", value); } } - public CardFinancialAdditionalAmountsVision() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialAdditionalAmountsVision( - CardFinancialAdditionalAmountsVision cardFinancialAdditionalAmountsVision - ) - : base(cardFinancialAdditionalAmountsVision) { } -#pragma warning restore CS8618 - - public CardFinancialAdditionalAmountsVision(IReadOnlyDictionary rawData) + /// + /// The risk score generated by the card network. For Visa this is the Visa Advanced + /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse + /// the score is from 0 to 999, where 999 is the riskiest. + /// + public required long? NetworkRiskScore { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("network_risk_score"); + } + init { this._rawData.Set("network_risk_score", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialAdditionalAmountsVision(FrozenDictionary rawData) + /// + /// If the authorization was made in-person with a physical card, the Physical + /// Card that was used. + /// + public required string? PhysicalCardID { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("physical_card_id"); + } + init { this._rawData.Set("physical_card_id", value); } } -#pragma warning restore CS8618 - /// - public static CardFinancialAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The pending amount in the minor unit of the transaction's presentment currency. + /// + public required long PresentmentAmount { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("presentment_amount"); + } + init { this._rawData.Set("presentment_amount", value); } } -} - -class CardFinancialAdditionalAmountsVisionFromRaw - : IFromRawJson -{ - /// - public CardFinancialAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialAdditionalAmountsVision.FromRawUnchecked(rawData); -} -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. -/// -[JsonConverter(typeof(CardFinancialCurrencyConverter))] -public enum CardFinancialCurrency -{ /// - /// US Dollar (USD) + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// presentment currency. /// - Usd, -} - -sealed class CardFinancialCurrencyConverter : JsonConverter -{ - public override CardFinancialCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string PresentmentCurrency { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "USD" => CardFinancialCurrency.Usd, - _ => (CardFinancialCurrency)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("presentment_currency"); + } + init { this._rawData.Set("presentment_currency", value); } } - public override void Write( - Utf8JsonWriter writer, - CardFinancialCurrency value, - JsonSerializerOptions options - ) + /// + /// The processing category describes the intent behind the financial, such as + /// whether it was used for bill payments or an automatic fuel dispenser. + /// + public required ApiEnum ProcessingCategory { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "processing_category" + ); + } + init { this._rawData.Set("processing_category", value); } } -} -/// -/// The direction describes the direction the funds will move, either from the cardholder -/// to the merchant or from the merchant to the cardholder. -/// -[JsonConverter(typeof(CardFinancialDirectionConverter))] -public enum CardFinancialDirection -{ /// - /// A regular card authorization where funds are debited from the cardholder. + /// The identifier of the Real-Time Decision sent to approve or decline this transaction. /// - Settlement, + public required string? RealTimeDecisionID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("real_time_decision_id"); + } + init { this._rawData.Set("real_time_decision_id", value); } + } /// - /// A refund card authorization, sometimes referred to as a credit voucher authorization, - /// where funds are credited to the cardholder. + /// The scheme fees associated with this card financial. /// - Refund, -} - -sealed class CardFinancialDirectionConverter : JsonConverter -{ - public override CardFinancialDirection Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required IReadOnlyList SchemeFees { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "settlement" => CardFinancialDirection.Settlement, - "refund" => CardFinancialDirection.Refund, - _ => (CardFinancialDirection)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } } - public override void Write( - Utf8JsonWriter writer, - CardFinancialDirection value, - JsonSerializerOptions options - ) + /// + /// The terminal identifier (commonly abbreviated as TID) of the terminal the + /// card is transacting with. + /// + public required string? TerminalID { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialDirection.Settlement => "settlement", - CardFinancialDirection.Refund => "refund", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("terminal_id"); + } + init { this._rawData.Set("terminal_id", value); } } -} -/// -/// Fields specific to the `network`. -/// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardFinancialNetworkDetails : JsonModel -{ /// - /// The payment network used to process this card authorization. + /// The identifier of the Transaction associated with this Transaction. /// - public required ApiEnum Category + public required string TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("category"); + return this._rawData.GetNotNullClass("transaction_id"); } - init { this._rawData.Set("category", value); } + init { this._rawData.Set("transaction_id", value); } } /// - /// Fields specific to the `pulse` network. + /// A constant representing the object's type. For this resource it will always + /// be `card_financial`. /// - public required CardFinancialNetworkDetailsPulse? Pulse + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("pulse"); + return this._rawData.GetNotNullClass>("type"); } - init { this._rawData.Set("pulse", value); } + init { this._rawData.Set("type", value); } } /// - /// Fields specific to the `visa` network. + /// Fields related to verification of cardholder-provided values. /// - public required CardFinancialNetworkDetailsVisa? Visa + public required CardFinancialVerification Verification { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("visa"); + return this._rawData.GetNotNullClass("verification"); } - init { this._rawData.Set("visa", value); } + init { this._rawData.Set("verification", value); } } /// public override void Validate() { - this.Category.Validate(); - this.Pulse?.Validate(); - this.Visa?.Validate(); - } - - public CardFinancialNetworkDetails() { } - + _ = this.ID; + this.Actioner.Validate(); + this.AdditionalAmounts.Validate(); + _ = this.Amount; + _ = this.CardPaymentID; + this.Currency.Validate(); + _ = this.DigitalWalletTokenID; + this.Direction.Validate(); + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantDescriptor; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.NetworkDetails.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.NetworkRiskScore; + _ = this.PhysicalCardID; + _ = this.PresentmentAmount; + _ = this.PresentmentCurrency; + this.ProcessingCategory.Validate(); + _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + _ = this.TerminalID; + _ = this.TransactionID; + this.Type.Validate(); + this.Verification.Validate(); + } + + public CardFinancial() { } + #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialNetworkDetails(CardFinancialNetworkDetails cardFinancialNetworkDetails) - : base(cardFinancialNetworkDetails) { } + public CardFinancial(CardFinancial cardFinancial) + : base(cardFinancial) { } #pragma warning restore CS8618 - public CardFinancialNetworkDetails(IReadOnlyDictionary rawData) + public CardFinancial(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialNetworkDetails(FrozenDictionary rawData) + CardFinancial(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialNetworkDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static CardFinancial FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardFinancialNetworkDetailsFromRaw : IFromRawJson +class CardFinancialFromRaw : IFromRawJson { /// - public CardFinancialNetworkDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialNetworkDetails.FromRawUnchecked(rawData); + public CardFinancial FromRawUnchecked(IReadOnlyDictionary rawData) => + CardFinancial.FromRawUnchecked(rawData); } /// -/// The payment network used to process this card authorization. +/// Whether this financial was approved by Increase, the card network through stand-in +/// processing, or the user through a real-time decision. /// -[JsonConverter(typeof(CardFinancialNetworkDetailsCategoryConverter))] -public enum CardFinancialNetworkDetailsCategory +[JsonConverter(typeof(CardFinancialActionerConverter))] +public enum CardFinancialActioner { /// - /// Visa + /// This object was actioned by the user through a real-time decision. /// - Visa, + User, /// - /// Pulse + /// This object was actioned by Increase without user intervention. /// - Pulse, + Increase, + + /// + /// This object was actioned by the network, through stand-in processing. + /// + Network, } -sealed class CardFinancialNetworkDetailsCategoryConverter - : JsonConverter +sealed class CardFinancialActionerConverter : JsonConverter { - public override CardFinancialNetworkDetailsCategory Read( + public override CardFinancialActioner Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -14944,15 +15175,16 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "visa" => CardFinancialNetworkDetailsCategory.Visa, - "pulse" => CardFinancialNetworkDetailsCategory.Pulse, - _ => (CardFinancialNetworkDetailsCategory)(-1), + "user" => CardFinancialActioner.User, + "increase" => CardFinancialActioner.Increase, + "network" => CardFinancialActioner.Network, + _ => (CardFinancialActioner)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardFinancialNetworkDetailsCategory value, + CardFinancialActioner value, JsonSerializerOptions options ) { @@ -14960,8 +15192,9 @@ JsonSerializerOptions options writer, value switch { - CardFinancialNetworkDetailsCategory.Visa => "visa", - CardFinancialNetworkDetailsCategory.Pulse => "pulse", + CardFinancialActioner.User => "user", + CardFinancialActioner.Increase => "increase", + CardFinancialActioner.Network => "network", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -14972,184 +15205,198 @@ JsonSerializerOptions options } /// -/// Fields specific to the `pulse` network. +/// Additional amounts associated with the card authorization, such as ATM surcharges +/// fees. These are usually a subset of the `amount` field and are used to provide +/// more detailed information about the transaction. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialNetworkDetailsPulse, - CardFinancialNetworkDetailsPulseFromRaw + CardFinancialAdditionalAmounts, + CardFinancialAdditionalAmountsFromRaw >) )] -public sealed record class CardFinancialNetworkDetailsPulse : JsonModel +public sealed record class CardFinancialAdditionalAmounts : JsonModel { - /// - public override void Validate() { } - - public CardFinancialNetworkDetailsPulse() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardFinancialNetworkDetailsPulse( - CardFinancialNetworkDetailsPulse cardFinancialNetworkDetailsPulse - ) - : base(cardFinancialNetworkDetailsPulse) { } -#pragma warning restore CS8618 - - public CardFinancialNetworkDetailsPulse(IReadOnlyDictionary rawData) + /// + /// The part of this transaction amount that was for clinic-related services. + /// + public required CardFinancialAdditionalAmountsClinic? Clinic { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("clinic"); + } + init { this._rawData.Set("clinic", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardFinancialNetworkDetailsPulse(FrozenDictionary rawData) + /// + /// The part of this transaction amount that was for dental-related services. + /// + public required CardFinancialAdditionalAmountsDental? Dental { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("dental"); + } + init { this._rawData.Set("dental", value); } } -#pragma warning restore CS8618 - /// - public static CardFinancialNetworkDetailsPulse FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The original pre-authorized amount. + /// + public required CardFinancialAdditionalAmountsOriginal? Original { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "original" + ); + } + init { this._rawData.Set("original", value); } } -} - -class CardFinancialNetworkDetailsPulseFromRaw : IFromRawJson -{ - /// - public CardFinancialNetworkDetailsPulse FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardFinancialNetworkDetailsPulse.FromRawUnchecked(rawData); -} -/// -/// Fields specific to the `visa` network. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardFinancialNetworkDetailsVisa, - CardFinancialNetworkDetailsVisaFromRaw - >) -)] -public sealed record class CardFinancialNetworkDetailsVisa : JsonModel -{ /// - /// For electronic commerce transactions, this identifies the level of security - /// used in obtaining the customer's payment credential. For mail or telephone - /// order transactions, identifies the type of mail or telephone order. + /// The part of this transaction amount that was for healthcare prescriptions. /// - public required ApiEnum< - string, - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator - >? ElectronicCommerceIndicator + public required CardFinancialAdditionalAmountsPrescription? Prescription { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("electronic_commerce_indicator"); + return this._rawData.GetNullableClass( + "prescription" + ); } - init { this._rawData.Set("electronic_commerce_indicator", value); } + init { this._rawData.Set("prescription", value); } } /// - /// The method used to enter the cardholder's primary account number and card - /// expiration date. + /// The surcharge amount charged for this transaction by the merchant. /// - public required ApiEnum< - string, - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode - >? PointOfServiceEntryMode + public required CardFinancialAdditionalAmountsSurcharge? Surcharge { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("point_of_service_entry_mode"); + return this._rawData.GetNullableClass( + "surcharge" + ); } - init { this._rawData.Set("point_of_service_entry_mode", value); } + init { this._rawData.Set("surcharge", value); } } /// - /// Only present when `actioner: network`. Describes why a card authorization - /// was approved or declined by Visa through stand-in processing. + /// The total amount of a series of incremental authorizations, optionally provided. /// - public required ApiEnum< - string, - CardFinancialNetworkDetailsVisaStandInProcessingReason - >? StandInProcessingReason + public required CardFinancialAdditionalAmountsTotalCumulative? TotalCumulative { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("stand_in_processing_reason"); + return this._rawData.GetNullableClass( + "total_cumulative" + ); } - init { this._rawData.Set("stand_in_processing_reason", value); } + init { this._rawData.Set("total_cumulative", value); } } /// - /// The capability of the terminal being used to read the card. Shows whether - /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe - /// reads. This reflects the highest capability of the terminal — for example, - /// a terminal that supports both chip and magnetic stripe will be identified - /// as chip-capable. + /// The total amount of healthcare-related additional amounts. /// - public required ApiEnum< - string, - CardFinancialNetworkDetailsVisaTerminalEntryCapability - >? TerminalEntryCapability + public required CardFinancialAdditionalAmountsTotalHealthcare? TotalHealthcare { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("terminal_entry_capability"); + return this._rawData.GetNullableClass( + "total_healthcare" + ); } - init { this._rawData.Set("terminal_entry_capability", value); } + init { this._rawData.Set("total_healthcare", value); } } - /// - public override void Validate() + /// + /// The part of this transaction amount that was for transit-related services. + /// + public required CardFinancialAdditionalAmountsTransit? Transit { - this.ElectronicCommerceIndicator?.Validate(); - this.PointOfServiceEntryMode?.Validate(); - this.StandInProcessingReason?.Validate(); - this.TerminalEntryCapability?.Validate(); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("transit"); + } + init { this._rawData.Set("transit", value); } } - public CardFinancialNetworkDetailsVisa() { } + /// + /// An unknown additional amount. + /// + public required CardFinancialAdditionalAmountsUnknown? Unknown + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("unknown"); + } + init { this._rawData.Set("unknown", value); } + } + + /// + /// The part of this transaction amount that was for vision-related services. + /// + public required CardFinancialAdditionalAmountsVision? Vision + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("vision"); + } + init { this._rawData.Set("vision", value); } + } + + /// + public override void Validate() + { + this.Clinic?.Validate(); + this.Dental?.Validate(); + this.Original?.Validate(); + this.Prescription?.Validate(); + this.Surcharge?.Validate(); + this.TotalCumulative?.Validate(); + this.TotalHealthcare?.Validate(); + this.Transit?.Validate(); + this.Unknown?.Validate(); + this.Vision?.Validate(); + } + + public CardFinancialAdditionalAmounts() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialNetworkDetailsVisa( - CardFinancialNetworkDetailsVisa cardFinancialNetworkDetailsVisa + public CardFinancialAdditionalAmounts( + CardFinancialAdditionalAmounts cardFinancialAdditionalAmounts ) - : base(cardFinancialNetworkDetailsVisa) { } + : base(cardFinancialAdditionalAmounts) { } #pragma warning restore CS8618 - public CardFinancialNetworkDetailsVisa(IReadOnlyDictionary rawData) + public CardFinancialAdditionalAmounts(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialNetworkDetailsVisa(FrozenDictionary rawData) + CardFinancialAdditionalAmounts(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialNetworkDetailsVisa FromRawUnchecked( + /// + public static CardFinancialAdditionalAmounts FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -15157,601 +15404,352 @@ IReadOnlyDictionary rawData } } -class CardFinancialNetworkDetailsVisaFromRaw : IFromRawJson +class CardFinancialAdditionalAmountsFromRaw : IFromRawJson { /// - public CardFinancialNetworkDetailsVisa FromRawUnchecked( + public CardFinancialAdditionalAmounts FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialNetworkDetailsVisa.FromRawUnchecked(rawData); + ) => CardFinancialAdditionalAmounts.FromRawUnchecked(rawData); } /// -/// For electronic commerce transactions, this identifies the level of security used -/// in obtaining the customer's payment credential. For mail or telephone order transactions, -/// identifies the type of mail or telephone order. +/// The part of this transaction amount that was for clinic-related services. /// -[JsonConverter(typeof(CardFinancialNetworkDetailsVisaElectronicCommerceIndicatorConverter))] -public enum CardFinancialNetworkDetailsVisaElectronicCommerceIndicator +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsClinic, + CardFinancialAdditionalAmountsClinicFromRaw + >) +)] +public sealed record class CardFinancialAdditionalAmountsClinic : JsonModel { /// - /// Single transaction of a mail/phone order: Use to indicate that the transaction - /// is a mail/phone order purchase, not a recurring transaction or installment - /// payment. For domestic transactions in the US region, this value may also indicate - /// one bill payment transaction in the card-present or card-absent environments. - /// - MailPhoneOrder, - - /// - /// Recurring transaction: Payment indicator used to indicate a recurring transaction - /// that originates from an acquirer in the US region. - /// - Recurring, - - /// - /// Installment payment: Payment indicator used to indicate one purchase of goods - /// or services that is billed to the account in multiple charges over a period - /// of time agreed upon by the cardholder and merchant from transactions that - /// originate from an acquirer in the US region. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - Installment, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Unknown classification: other mail order: Use to indicate that the type of - /// mail/telephone order is unknown. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - UnknownMailPhoneOrder, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Secure electronic commerce transaction: Use to indicate that the electronic - /// commerce transaction has been authenticated using e.g., 3-D Secure - /// - SecureElectronicCommerce, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// Non-authenticated security transaction at a 3-D Secure-capable merchant, - /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use - /// to identify an electronic commerce transaction where the merchant attempted - /// to authenticate the cardholder using 3-D Secure, but was unable to complete - /// the authentication because the issuer or cardholder does not participate in - /// the 3-D Secure program. - /// - NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + public CardFinancialAdditionalAmountsClinic() { } - /// - /// Non-authenticated security transaction: Use to identify an electronic commerce - /// transaction that uses data encryption for security however, cardholder authentication - /// is not performed using 3-D Secure. - /// - NonAuthenticatedSecurityTransaction, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialAdditionalAmountsClinic( + CardFinancialAdditionalAmountsClinic cardFinancialAdditionalAmountsClinic + ) + : base(cardFinancialAdditionalAmountsClinic) { } +#pragma warning restore CS8618 - /// - /// Non-secure transaction: Use to identify an electronic commerce transaction - /// that has no data protection. - /// - NonSecureTransaction, -} + public CardFinancialAdditionalAmountsClinic(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } -sealed class CardFinancialNetworkDetailsVisaElectronicCommerceIndicatorConverter - : JsonConverter -{ - public override CardFinancialNetworkDetailsVisaElectronicCommerceIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialAdditionalAmountsClinic(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "mail_phone_order" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, - "recurring" => CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Recurring, - "installment" => CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Installment, - "unknown_mail_phone_order" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, - "secure_electronic_commerce" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, - "non_authenticated_security_transaction_at_3ds_capable_merchant" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, - "non_authenticated_security_transaction" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, - "non_secure_transaction" => - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, - _ => (CardFinancialNetworkDetailsVisaElectronicCommerceIndicator)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator value, - JsonSerializerOptions options + /// + public static CardFinancialAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => - "mail_phone_order", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Recurring => "recurring", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Installment => - "installment", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => - "unknown_mail_phone_order", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => - "secure_electronic_commerce", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => - "non_authenticated_security_transaction_at_3ds_capable_merchant", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => - "non_authenticated_security_transaction", - CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => - "non_secure_transaction", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -/// -/// The method used to enter the cardholder's primary account number and card expiration date. -/// -[JsonConverter(typeof(CardFinancialNetworkDetailsVisaPointOfServiceEntryModeConverter))] -public enum CardFinancialNetworkDetailsVisaPointOfServiceEntryMode +class CardFinancialAdditionalAmountsClinicFromRaw + : IFromRawJson { - /// - /// Unknown - /// - Unknown, - - /// - /// Manual key entry - /// - Manual, - - /// - /// Magnetic stripe read, without card verification value - /// - MagneticStripeNoCvv, - - /// - /// Optical code - /// - OpticalCode, + /// + public CardFinancialAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialAdditionalAmountsClinic.FromRawUnchecked(rawData); +} +/// +/// The part of this transaction amount that was for dental-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsDental, + CardFinancialAdditionalAmountsDentalFromRaw + >) +)] +public sealed record class CardFinancialAdditionalAmountsDental : JsonModel +{ /// - /// Contact chip card + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - IntegratedCircuitCard, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Contactless read of chip card + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - Contactless, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Transaction initiated using a credential that has previously been stored - /// on file - /// - CredentialOnFile, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// Magnetic stripe read - /// - MagneticStripe, + public CardFinancialAdditionalAmountsDental() { } - /// - /// Contactless read of magnetic stripe data - /// - ContactlessMagneticStripe, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialAdditionalAmountsDental( + CardFinancialAdditionalAmountsDental cardFinancialAdditionalAmountsDental + ) + : base(cardFinancialAdditionalAmountsDental) { } +#pragma warning restore CS8618 - /// - /// Contact chip card, without card verification value - /// - IntegratedCircuitCardNoCvv, -} + public CardFinancialAdditionalAmountsDental(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } -sealed class CardFinancialNetworkDetailsVisaPointOfServiceEntryModeConverter - : JsonConverter -{ - public override CardFinancialNetworkDetailsVisaPointOfServiceEntryMode Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialAdditionalAmountsDental(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "unknown" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Unknown, - "manual" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Manual, - "magnetic_stripe_no_cvv" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, - "optical_code" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, - "integrated_circuit_card" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, - "contactless" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Contactless, - "credential_on_file" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, - "magnetic_stripe" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, - "contactless_magnetic_stripe" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, - "integrated_circuit_card_no_cvv" => - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, - _ => (CardFinancialNetworkDetailsVisaPointOfServiceEntryMode)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode value, - JsonSerializerOptions options + /// + public static CardFinancialAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => - "magnetic_stripe_no_cvv", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => - "optical_code", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => - "integrated_circuit_card", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Contactless => "contactless", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => - "credential_on_file", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => - "magnetic_stripe", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => - "contactless_magnetic_stripe", - CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => - "integrated_circuit_card_no_cvv", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardFinancialAdditionalAmountsDentalFromRaw + : IFromRawJson +{ + /// + public CardFinancialAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialAdditionalAmountsDental.FromRawUnchecked(rawData); +} + /// -/// Only present when `actioner: network`. Describes why a card authorization was -/// approved or declined by Visa through stand-in processing. +/// The original pre-authorized amount. /// -[JsonConverter(typeof(CardFinancialNetworkDetailsVisaStandInProcessingReasonConverter))] -public enum CardFinancialNetworkDetailsVisaStandInProcessingReason +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsOriginal, + CardFinancialAdditionalAmountsOriginalFromRaw + >) +)] +public sealed record class CardFinancialAdditionalAmountsOriginal : JsonModel { /// - /// Increase failed to process the authorization in a timely manner. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - IssuerError, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// The physical card read had an invalid CVV or dCVV. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - InvalidPhysicalCard, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// The card's authorization request cryptogram was invalid. The cryptogram can - /// be from a physical card or a Digital Wallet Token purchase. - /// - InvalidCryptogram, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// The 3DS cardholder authentication verification value was invalid. - /// - InvalidCardholderAuthenticationVerificationValue, + public CardFinancialAdditionalAmountsOriginal() { } - /// - /// An internal Visa error occurred. Visa uses this reason code for certain expected - /// occurrences as well, such as Application Transaction Counter (ATC) replays. - /// - InternalVisaError, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialAdditionalAmountsOriginal( + CardFinancialAdditionalAmountsOriginal cardFinancialAdditionalAmountsOriginal + ) + : base(cardFinancialAdditionalAmountsOriginal) { } +#pragma warning restore CS8618 - /// - /// The merchant has enabled Visa's Transaction Advisory Service and requires - /// further authentication to perform the transaction. In practice this is often - /// utilized at fuel pumps to tell the cardholder to see the cashier. - /// - MerchantTransactionAdvisoryServiceAuthenticationRequired, + public CardFinancialAdditionalAmountsOriginal(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } - /// - /// The transaction was blocked by Visa's Payment Fraud Disruption service due - /// to fraudulent Acquirer behavior, such as card testing. - /// - PaymentFraudDisruptionAcquirerBlock, +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialAdditionalAmountsOriginal(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 - /// - /// An unspecific reason for stand-in processing. - /// - Other, -} - -sealed class CardFinancialNetworkDetailsVisaStandInProcessingReasonConverter - : JsonConverter -{ - public override CardFinancialNetworkDetailsVisaStandInProcessingReason Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "issuer_error" => CardFinancialNetworkDetailsVisaStandInProcessingReason.IssuerError, - "invalid_physical_card" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, - "invalid_cryptogram" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, - "invalid_cardholder_authentication_verification_value" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, - "internal_visa_error" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.InternalVisaError, - "merchant_transaction_advisory_service_authentication_required" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, - "payment_fraud_disruption_acquirer_block" => - CardFinancialNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, - "other" => CardFinancialNetworkDetailsVisaStandInProcessingReason.Other, - _ => (CardFinancialNetworkDetailsVisaStandInProcessingReason)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardFinancialNetworkDetailsVisaStandInProcessingReason value, - JsonSerializerOptions options + /// + public static CardFinancialAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialNetworkDetailsVisaStandInProcessingReason.IssuerError => - "issuer_error", - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => - "invalid_physical_card", - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => - "invalid_cryptogram", - CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => - "invalid_cardholder_authentication_verification_value", - CardFinancialNetworkDetailsVisaStandInProcessingReason.InternalVisaError => - "internal_visa_error", - CardFinancialNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => - "merchant_transaction_advisory_service_authentication_required", - CardFinancialNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => - "payment_fraud_disruption_acquirer_block", - CardFinancialNetworkDetailsVisaStandInProcessingReason.Other => "other", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -/// -/// The capability of the terminal being used to read the card. Shows whether a terminal -/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This -/// reflects the highest capability of the terminal — for example, a terminal that -/// supports both chip and magnetic stripe will be identified as chip-capable. -/// -[JsonConverter(typeof(CardFinancialNetworkDetailsVisaTerminalEntryCapabilityConverter))] -public enum CardFinancialNetworkDetailsVisaTerminalEntryCapability -{ - /// - /// Unknown - /// - Unknown, - - /// - /// No terminal was used for this transaction. - /// - TerminalNotUsed, - - /// - /// The terminal can only read magnetic stripes and does not have chip or contactless - /// reading capability. - /// - MagneticStripe, - - /// - /// The terminal can only read barcodes. - /// - Barcode, - - /// - /// The terminal can only read cards via Optical Character Recognition. - /// - OpticalCharacterRecognition, - - /// - /// The terminal supports contact chip cards and can also read the magnetic stripe. - /// If contact chip is supported, this value is used regardless of whether contactless - /// is also supported. - /// - ChipOrContactless, - - /// - /// The terminal supports contactless reads but does not support contact chip. - /// Only used when the terminal lacks contact chip capability. - /// - ContactlessOnly, - - /// - /// The terminal has no card reading capability. - /// - NoCapability, -} - -sealed class CardFinancialNetworkDetailsVisaTerminalEntryCapabilityConverter - : JsonConverter +class CardFinancialAdditionalAmountsOriginalFromRaw + : IFromRawJson { - public override CardFinancialNetworkDetailsVisaTerminalEntryCapability Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "unknown" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.Unknown, - "terminal_not_used" => - CardFinancialNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, - "magnetic_stripe" => - CardFinancialNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, - "barcode" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.Barcode, - "optical_character_recognition" => - CardFinancialNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, - "chip_or_contactless" => - CardFinancialNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, - "contactless_only" => - CardFinancialNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, - "no_capability" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.NoCapability, - _ => (CardFinancialNetworkDetailsVisaTerminalEntryCapability)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardFinancialNetworkDetailsVisaTerminalEntryCapability value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => - "terminal_not_used", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => - "magnetic_stripe", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => - "optical_character_recognition", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => - "chip_or_contactless", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => - "contactless_only", - CardFinancialNetworkDetailsVisaTerminalEntryCapability.NoCapability => - "no_capability", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } + /// + public CardFinancialAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialAdditionalAmountsOriginal.FromRawUnchecked(rawData); } /// -/// Network-specific identifiers for a specific request or transaction. +/// The part of this transaction amount that was for healthcare prescriptions. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialNetworkIdentifiers, - CardFinancialNetworkIdentifiersFromRaw + CardFinancialAdditionalAmountsPrescription, + CardFinancialAdditionalAmountsPrescriptionFromRaw >) )] -public sealed record class CardFinancialNetworkIdentifiers : JsonModel +public sealed record class CardFinancialAdditionalAmountsPrescription : JsonModel { /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. - /// - public required string? AuthorizationIdentificationResponse - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); - } - init { this._rawData.Set("authorization_identification_response", value); } - } - - /// - /// A life-cycle identifier used across e.g., an authorization and a reversal. - /// Expected to be unique per acquirer within a window of time. For some card - /// networks the retrieval reference number includes the trace counter. - /// - public required string? RetrievalReferenceNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("retrieval_reference_number"); - } - init { this._rawData.Set("retrieval_reference_number", value); } - } - - /// - /// A counter used to verify an individual authorization. Expected to be unique - /// per acquirer within a window of time. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? TraceNumber + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("trace_number"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("trace_number", value); } + init { this._rawData.Set("amount", value); } } /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string? TransactionID + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("transaction_id", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.AuthorizationIdentificationResponse; - _ = this.RetrievalReferenceNumber; - _ = this.TraceNumber; - _ = this.TransactionID; + _ = this.Amount; + _ = this.Currency; } - public CardFinancialNetworkIdentifiers() { } + public CardFinancialAdditionalAmountsPrescription() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialNetworkIdentifiers( - CardFinancialNetworkIdentifiers cardFinancialNetworkIdentifiers + public CardFinancialAdditionalAmountsPrescription( + CardFinancialAdditionalAmountsPrescription cardFinancialAdditionalAmountsPrescription ) - : base(cardFinancialNetworkIdentifiers) { } + : base(cardFinancialAdditionalAmountsPrescription) { } #pragma warning restore CS8618 - public CardFinancialNetworkIdentifiers(IReadOnlyDictionary rawData) + public CardFinancialAdditionalAmountsPrescription( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialNetworkIdentifiers(FrozenDictionary rawData) + CardFinancialAdditionalAmountsPrescription(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialNetworkIdentifiers FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsPrescription FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -15759,264 +15757,87 @@ IReadOnlyDictionary rawData } } -class CardFinancialNetworkIdentifiersFromRaw : IFromRawJson +class CardFinancialAdditionalAmountsPrescriptionFromRaw + : IFromRawJson { /// - public CardFinancialNetworkIdentifiers FromRawUnchecked( + public CardFinancialAdditionalAmountsPrescription FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialNetworkIdentifiers.FromRawUnchecked(rawData); -} - -/// -/// The processing category describes the intent behind the financial, such as whether -/// it was used for bill payments or an automatic fuel dispenser. -/// -[JsonConverter(typeof(CardFinancialProcessingCategoryConverter))] -public enum CardFinancialProcessingCategory -{ - /// - /// Account funding transactions are transactions used to e.g., fund an account - /// or transfer funds between accounts. - /// - AccountFunding, - - /// - /// Automatic fuel dispenser authorizations occur when a card is used at a gas - /// pump, prior to the actual transaction amount being known. They are followed - /// by an advice message that updates the amount of the pending transaction. - /// - AutomaticFuelDispenser, - - /// - /// A transaction used to pay a bill. - /// - BillPayment, - - /// - /// Original credit transactions are used to send money to a cardholder. - /// - OriginalCredit, - - /// - /// A regular purchase. - /// - Purchase, - - /// - /// Quasi-cash transactions represent purchases of items which may be convertible - /// to cash. - /// - QuasiCash, - - /// - /// A refund card authorization, sometimes referred to as a credit voucher authorization, - /// where funds are credited to the cardholder. - /// - Refund, - - /// - /// Cash disbursement transactions are used to withdraw cash from an ATM or a - /// point of sale. - /// - CashDisbursement, - - /// - /// A balance inquiry transaction is used to check the balance of an account associated - /// with a card. - /// - BalanceInquiry, - - /// - /// The processing category is unknown. - /// - Unknown, -} - -sealed class CardFinancialProcessingCategoryConverter - : JsonConverter -{ - public override CardFinancialProcessingCategory Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "account_funding" => CardFinancialProcessingCategory.AccountFunding, - "automatic_fuel_dispenser" => CardFinancialProcessingCategory.AutomaticFuelDispenser, - "bill_payment" => CardFinancialProcessingCategory.BillPayment, - "original_credit" => CardFinancialProcessingCategory.OriginalCredit, - "purchase" => CardFinancialProcessingCategory.Purchase, - "quasi_cash" => CardFinancialProcessingCategory.QuasiCash, - "refund" => CardFinancialProcessingCategory.Refund, - "cash_disbursement" => CardFinancialProcessingCategory.CashDisbursement, - "balance_inquiry" => CardFinancialProcessingCategory.BalanceInquiry, - "unknown" => CardFinancialProcessingCategory.Unknown, - _ => (CardFinancialProcessingCategory)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardFinancialProcessingCategory value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialProcessingCategory.AccountFunding => "account_funding", - CardFinancialProcessingCategory.AutomaticFuelDispenser => - "automatic_fuel_dispenser", - CardFinancialProcessingCategory.BillPayment => "bill_payment", - CardFinancialProcessingCategory.OriginalCredit => "original_credit", - CardFinancialProcessingCategory.Purchase => "purchase", - CardFinancialProcessingCategory.QuasiCash => "quasi_cash", - CardFinancialProcessingCategory.Refund => "refund", - CardFinancialProcessingCategory.CashDisbursement => "cash_disbursement", - CardFinancialProcessingCategory.BalanceInquiry => "balance_inquiry", - CardFinancialProcessingCategory.Unknown => "unknown", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// A constant representing the object's type. For this resource it will always be `card_financial`. -/// -[JsonConverter(typeof(CardFinancialTypeConverter))] -public enum CardFinancialType -{ - CardFinancial, -} - -sealed class CardFinancialTypeConverter : JsonConverter -{ - public override CardFinancialType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "card_financial" => CardFinancialType.CardFinancial, - _ => (CardFinancialType)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardFinancialType value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialType.CardFinancial => "card_financial", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } + ) => CardFinancialAdditionalAmountsPrescription.FromRawUnchecked(rawData); } /// -/// Fields related to verification of cardholder-provided values. +/// The surcharge amount charged for this transaction by the merchant. /// [JsonConverter( - typeof(JsonModelConverter) + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsSurcharge, + CardFinancialAdditionalAmountsSurchargeFromRaw + >) )] -public sealed record class CardFinancialVerification : JsonModel +public sealed record class CardFinancialAdditionalAmountsSurcharge : JsonModel { /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. - /// - public required CardFinancialVerificationCardVerificationCode CardVerificationCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "card_verification_code" - ); - } - init { this._rawData.Set("card_verification_code", value); } - } - - /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required CardFinancialVerificationCardholderAddress CardholderAddress + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "cardholder_address" - ); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("amount", value); } } /// - /// Cardholder name provided in the authorization request. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required CardFinancialVerificationCardholderName? CardholderName + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "cardholder_name" - ); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("cardholder_name", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); + _ = this.Amount; + _ = this.Currency; } - public CardFinancialVerification() { } + public CardFinancialAdditionalAmountsSurcharge() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialVerification(CardFinancialVerification cardFinancialVerification) - : base(cardFinancialVerification) { } + public CardFinancialAdditionalAmountsSurcharge( + CardFinancialAdditionalAmountsSurcharge cardFinancialAdditionalAmountsSurcharge + ) + : base(cardFinancialAdditionalAmountsSurcharge) { } #pragma warning restore CS8618 - public CardFinancialVerification(IReadOnlyDictionary rawData) + public CardFinancialAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialVerification(FrozenDictionary rawData) + CardFinancialAdditionalAmountsSurcharge(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialVerification FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsSurcharge FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -16024,58 +15845,73 @@ IReadOnlyDictionary rawData } } -class CardFinancialVerificationFromRaw : IFromRawJson +class CardFinancialAdditionalAmountsSurchargeFromRaw + : IFromRawJson { /// - public CardFinancialVerification FromRawUnchecked( + public CardFinancialAdditionalAmountsSurcharge FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialVerification.FromRawUnchecked(rawData); + ) => CardFinancialAdditionalAmountsSurcharge.FromRawUnchecked(rawData); } /// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. +/// The total amount of a series of incremental authorizations, optionally provided. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialVerificationCardVerificationCode, - CardFinancialVerificationCardVerificationCodeFromRaw + CardFinancialAdditionalAmountsTotalCumulative, + CardFinancialAdditionalAmountsTotalCumulativeFromRaw >) )] -public sealed record class CardFinancialVerificationCardVerificationCode : JsonModel +public sealed record class CardFinancialAdditionalAmountsTotalCumulative : JsonModel { /// - /// The result of verifying the Card Verification Code. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required ApiEnum Result + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - this.Result.Validate(); + _ = this.Amount; + _ = this.Currency; } - public CardFinancialVerificationCardVerificationCode() { } + public CardFinancialAdditionalAmountsTotalCumulative() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialVerificationCardVerificationCode( - CardFinancialVerificationCardVerificationCode cardFinancialVerificationCardVerificationCode + public CardFinancialAdditionalAmountsTotalCumulative( + CardFinancialAdditionalAmountsTotalCumulative cardFinancialAdditionalAmountsTotalCumulative ) - : base(cardFinancialVerificationCardVerificationCode) { } + : base(cardFinancialAdditionalAmountsTotalCumulative) { } #pragma warning restore CS8618 - public CardFinancialVerificationCardVerificationCode( + public CardFinancialAdditionalAmountsTotalCumulative( IReadOnlyDictionary rawData ) { @@ -16084,201 +15920,88 @@ IReadOnlyDictionary rawData #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialVerificationCardVerificationCode(FrozenDictionary rawData) + CardFinancialAdditionalAmountsTotalCumulative(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialVerificationCardVerificationCode FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsTotalCumulative FromRawUnchecked( IReadOnlyDictionary rawData ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - - [SetsRequiredMembers] - public CardFinancialVerificationCardVerificationCode( - ApiEnum result - ) - : this() - { - this.Result = result; - } } -class CardFinancialVerificationCardVerificationCodeFromRaw - : IFromRawJson +class CardFinancialAdditionalAmountsTotalCumulativeFromRaw + : IFromRawJson { /// - public CardFinancialVerificationCardVerificationCode FromRawUnchecked( + public CardFinancialAdditionalAmountsTotalCumulative FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialVerificationCardVerificationCode.FromRawUnchecked(rawData); -} - -/// -/// The result of verifying the Card Verification Code. -/// -[JsonConverter(typeof(CardFinancialVerificationCardVerificationCodeResultConverter))] -public enum CardFinancialVerificationCardVerificationCodeResult -{ - /// - /// No card verification code was provided in the authorization request. - /// - NotChecked, - - /// - /// The card verification code matched the one on file. - /// - Match, - - /// - /// The card verification code did not match the one on file. - /// - NoMatch, -} - -sealed class CardFinancialVerificationCardVerificationCodeResultConverter - : JsonConverter -{ - public override CardFinancialVerificationCardVerificationCodeResult Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_checked" => CardFinancialVerificationCardVerificationCodeResult.NotChecked, - "match" => CardFinancialVerificationCardVerificationCodeResult.Match, - "no_match" => CardFinancialVerificationCardVerificationCodeResult.NoMatch, - _ => (CardFinancialVerificationCardVerificationCodeResult)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardFinancialVerificationCardVerificationCodeResult value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialVerificationCardVerificationCodeResult.NotChecked => "not_checked", - CardFinancialVerificationCardVerificationCodeResult.Match => "match", - CardFinancialVerificationCardVerificationCodeResult.NoMatch => "no_match", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } + ) => CardFinancialAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); } /// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. +/// The total amount of healthcare-related additional amounts. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialVerificationCardholderAddress, - CardFinancialVerificationCardholderAddressFromRaw + CardFinancialAdditionalAmountsTotalHealthcare, + CardFinancialAdditionalAmountsTotalHealthcareFromRaw >) )] -public sealed record class CardFinancialVerificationCardholderAddress : JsonModel +public sealed record class CardFinancialAdditionalAmountsTotalHealthcare : JsonModel { /// - /// Line 1 of the address on file for the cardholder. - /// - public required string? ActualLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); - } - init { this._rawData.Set("actual_line1", value); } - } - - /// - /// The postal code of the address on file for the cardholder. - /// - public required string? ActualPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); - } - init { this._rawData.Set("actual_postal_code", value); } - } - - /// - /// The cardholder address line 1 provided for verification in the authorization request. - /// - public required string? ProvidedLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); - } - init { this._rawData.Set("provided_line1", value); } - } - - /// - /// The postal code provided for verification in the authorization request. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? ProvidedPostalCode + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("provided_postal_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// The address verification result returned to the card network. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required ApiEnum Result + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.ActualLine1; - _ = this.ActualPostalCode; - _ = this.ProvidedLine1; - _ = this.ProvidedPostalCode; - this.Result.Validate(); + _ = this.Amount; + _ = this.Currency; } - public CardFinancialVerificationCardholderAddress() { } + public CardFinancialAdditionalAmountsTotalHealthcare() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialVerificationCardholderAddress( - CardFinancialVerificationCardholderAddress cardFinancialVerificationCardholderAddress + public CardFinancialAdditionalAmountsTotalHealthcare( + CardFinancialAdditionalAmountsTotalHealthcare cardFinancialAdditionalAmountsTotalHealthcare ) - : base(cardFinancialVerificationCardholderAddress) { } + : base(cardFinancialAdditionalAmountsTotalHealthcare) { } #pragma warning restore CS8618 - public CardFinancialVerificationCardholderAddress( + public CardFinancialAdditionalAmountsTotalHealthcare( IReadOnlyDictionary rawData ) { @@ -16287,14 +16010,14 @@ IReadOnlyDictionary rawData #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialVerificationCardholderAddress(FrozenDictionary rawData) + CardFinancialAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialVerificationCardholderAddress FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsTotalHealthcare FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -16302,187 +16025,175 @@ IReadOnlyDictionary rawData } } -class CardFinancialVerificationCardholderAddressFromRaw - : IFromRawJson +class CardFinancialAdditionalAmountsTotalHealthcareFromRaw + : IFromRawJson { /// - public CardFinancialVerificationCardholderAddress FromRawUnchecked( + public CardFinancialAdditionalAmountsTotalHealthcare FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialVerificationCardholderAddress.FromRawUnchecked(rawData); + ) => CardFinancialAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); } /// -/// The address verification result returned to the card network. +/// The part of this transaction amount that was for transit-related services. /// -[JsonConverter(typeof(CardFinancialVerificationCardholderAddressResultConverter))] -public enum CardFinancialVerificationCardholderAddressResult +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsTransit, + CardFinancialAdditionalAmountsTransitFromRaw + >) +)] +public sealed record class CardFinancialAdditionalAmountsTransit : JsonModel { /// - /// No address information was provided in the authorization request. - /// - NotChecked, - - /// - /// Postal code matches, but the street address does not match or was not provided. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - PostalCodeMatchAddressNoMatch, - - /// - /// Postal code does not match, but the street address matches or was not provided. - /// - PostalCodeNoMatchAddressMatch, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Postal code and street address match. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - Match, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Postal code and street address do not match. - /// - NoMatch, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// Postal code matches, but the street address was not verified. (deprecated) - /// - PostalCodeMatchAddressNotChecked, -} + public CardFinancialAdditionalAmountsTransit() { } -sealed class CardFinancialVerificationCardholderAddressResultConverter - : JsonConverter -{ - public override CardFinancialVerificationCardholderAddressResult Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialAdditionalAmountsTransit( + CardFinancialAdditionalAmountsTransit cardFinancialAdditionalAmountsTransit ) + : base(cardFinancialAdditionalAmountsTransit) { } +#pragma warning restore CS8618 + + public CardFinancialAdditionalAmountsTransit(IReadOnlyDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_checked" => CardFinancialVerificationCardholderAddressResult.NotChecked, - "postal_code_match_address_no_match" => - CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, - "postal_code_no_match_address_match" => - CardFinancialVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, - "match" => CardFinancialVerificationCardholderAddressResult.Match, - "no_match" => CardFinancialVerificationCardholderAddressResult.NoMatch, - "postal_code_match_address_not_checked" => - CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, - _ => (CardFinancialVerificationCardholderAddressResult)(-1), - }; + this._rawData = new(rawData); } - public override void Write( - Utf8JsonWriter writer, - CardFinancialVerificationCardholderAddressResult value, - JsonSerializerOptions options +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialAdditionalAmountsTransit(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardFinancialAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardFinancialVerificationCardholderAddressResult.NotChecked => "not_checked", - CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => - "postal_code_match_address_no_match", - CardFinancialVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => - "postal_code_no_match_address_match", - CardFinancialVerificationCardholderAddressResult.Match => "match", - CardFinancialVerificationCardholderAddressResult.NoMatch => "no_match", - CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => - "postal_code_match_address_not_checked", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardFinancialAdditionalAmountsTransitFromRaw + : IFromRawJson +{ + /// + public CardFinancialAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialAdditionalAmountsTransit.FromRawUnchecked(rawData); +} + /// -/// Cardholder name provided in the authorization request. +/// An unknown additional amount. /// [JsonConverter( typeof(JsonModelConverter< - CardFinancialVerificationCardholderName, - CardFinancialVerificationCardholderNameFromRaw + CardFinancialAdditionalAmountsUnknown, + CardFinancialAdditionalAmountsUnknownFromRaw >) )] -public sealed record class CardFinancialVerificationCardholderName : JsonModel +public sealed record class CardFinancialAdditionalAmountsUnknown : JsonModel { /// - /// The first name provided for verification in the authorization request. - /// - public required string? ProvidedFirstName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_first_name"); - } - init { this._rawData.Set("provided_first_name", value); } - } - - /// - /// The last name provided for verification in the authorization request. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? ProvidedLastName + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_last_name"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("provided_last_name", value); } + init { this._rawData.Set("amount", value); } } /// - /// The middle name provided for verification in the authorization request. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string? ProvidedMiddleName + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_middle_name"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("provided_middle_name", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.ProvidedFirstName; - _ = this.ProvidedLastName; - _ = this.ProvidedMiddleName; + _ = this.Amount; + _ = this.Currency; } - public CardFinancialVerificationCardholderName() { } + public CardFinancialAdditionalAmountsUnknown() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFinancialVerificationCardholderName( - CardFinancialVerificationCardholderName cardFinancialVerificationCardholderName + public CardFinancialAdditionalAmountsUnknown( + CardFinancialAdditionalAmountsUnknown cardFinancialAdditionalAmountsUnknown ) - : base(cardFinancialVerificationCardholderName) { } + : base(cardFinancialAdditionalAmountsUnknown) { } #pragma warning restore CS8618 - public CardFinancialVerificationCardholderName(IReadOnlyDictionary rawData) + public CardFinancialAdditionalAmountsUnknown(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFinancialVerificationCardholderName(FrozenDictionary rawData) + CardFinancialAdditionalAmountsUnknown(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFinancialVerificationCardholderName FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsUnknown FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -16490,171 +16201,87 @@ IReadOnlyDictionary rawData } } -class CardFinancialVerificationCardholderNameFromRaw - : IFromRawJson +class CardFinancialAdditionalAmountsUnknownFromRaw + : IFromRawJson { /// - public CardFinancialVerificationCardholderName FromRawUnchecked( + public CardFinancialAdditionalAmountsUnknown FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFinancialVerificationCardholderName.FromRawUnchecked(rawData); + ) => CardFinancialAdditionalAmountsUnknown.FromRawUnchecked(rawData); } /// -/// A Card Fuel Confirmation object. This field will be present in the JSON response -/// if and only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations -/// update the amount of a Card Authorization after a fuel pump transaction is completed. +/// The part of this transaction amount that was for vision-related services. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardFuelConfirmation : JsonModel +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialAdditionalAmountsVision, + CardFinancialAdditionalAmountsVisionFromRaw + >) +)] +public sealed record class CardFinancialAdditionalAmountsVision : JsonModel { /// - /// The Card Fuel Confirmation identifier. - /// - public required string ID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } - } - - /// - /// The identifier for the Card Authorization this updates. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string CardAuthorizationID + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_authorization_id"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("card_authorization_id", value); } + init { this._rawData.Set("amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required ApiEnum Currency + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); + return this._rawData.GetNotNullClass("currency"); } init { this._rawData.Set("currency", value); } } - /// - /// The card network used to process this card authorization. - /// - public required ApiEnum Network + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "network" - ); - } - init { this._rawData.Set("network", value); } + _ = this.Amount; + _ = this.Currency; } - /// - /// Network-specific identifiers for a specific request or transaction. - /// - public required CardFuelConfirmationNetworkIdentifiers NetworkIdentifiers - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } - } - - /// - /// The identifier of the Pending Transaction associated with this Card Fuel Confirmation. - /// - public required string? PendingTransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("pending_transaction_id"); - } - init { this._rawData.Set("pending_transaction_id", value); } - } - - /// - /// A constant representing the object's type. For this resource it will always - /// be `card_fuel_confirmation`. - /// - public required ApiEnum Type - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } - } - - /// - /// The updated authorization amount after this fuel confirmation, in the minor - /// unit of the transaction's currency. For dollars, for example, this is cents. - /// - public required long UpdatedAuthorizationAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("updated_authorization_amount"); - } - init { this._rawData.Set("updated_authorization_amount", value); } - } - - /// - public override void Validate() - { - _ = this.ID; - _ = this.CardAuthorizationID; - this.Currency.Validate(); - this.Network.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.PendingTransactionID; - this.Type.Validate(); - _ = this.UpdatedAuthorizationAmount; - } - - public CardFuelConfirmation() { } + public CardFinancialAdditionalAmountsVision() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFuelConfirmation(CardFuelConfirmation cardFuelConfirmation) - : base(cardFuelConfirmation) { } + public CardFinancialAdditionalAmountsVision( + CardFinancialAdditionalAmountsVision cardFinancialAdditionalAmountsVision + ) + : base(cardFinancialAdditionalAmountsVision) { } #pragma warning restore CS8618 - public CardFuelConfirmation(IReadOnlyDictionary rawData) + public CardFinancialAdditionalAmountsVision(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFuelConfirmation(FrozenDictionary rawData) + CardFinancialAdditionalAmountsVision(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFuelConfirmation FromRawUnchecked( + /// + public static CardFinancialAdditionalAmountsVision FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -16662,19 +16289,20 @@ IReadOnlyDictionary rawData } } -class CardFuelConfirmationFromRaw : IFromRawJson +class CardFinancialAdditionalAmountsVisionFromRaw + : IFromRawJson { /// - public CardFuelConfirmation FromRawUnchecked( + public CardFinancialAdditionalAmountsVision FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFuelConfirmation.FromRawUnchecked(rawData); + ) => CardFinancialAdditionalAmountsVision.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. /// -[JsonConverter(typeof(CardFuelConfirmationCurrencyConverter))] -public enum CardFuelConfirmationCurrency +[JsonConverter(typeof(CardFinancialCurrencyConverter))] +public enum CardFinancialCurrency { /// /// US Dollar (USD) @@ -16682,9 +16310,9 @@ public enum CardFuelConfirmationCurrency Usd, } -sealed class CardFuelConfirmationCurrencyConverter : JsonConverter +sealed class CardFinancialCurrencyConverter : JsonConverter { - public override CardFuelConfirmationCurrency Read( + public override CardFinancialCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -16692,14 +16320,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardFuelConfirmationCurrency.Usd, - _ => (CardFuelConfirmationCurrency)(-1), + "USD" => CardFinancialCurrency.Usd, + _ => (CardFinancialCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardFuelConfirmationCurrency value, + CardFinancialCurrency value, JsonSerializerOptions options ) { @@ -16707,7 +16335,7 @@ JsonSerializerOptions options writer, value switch { - CardFuelConfirmationCurrency.Usd => "USD", + CardFinancialCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -16718,25 +16346,27 @@ JsonSerializerOptions options } /// -/// The card network used to process this card authorization. +/// The direction describes the direction the funds will move, either from the cardholder +/// to the merchant or from the merchant to the cardholder. /// -[JsonConverter(typeof(CardFuelConfirmationNetworkConverter))] -public enum CardFuelConfirmationNetwork +[JsonConverter(typeof(CardFinancialDirectionConverter))] +public enum CardFinancialDirection { /// - /// Visa + /// A regular card authorization where funds are debited from the cardholder. /// - Visa, + Settlement, /// - /// Pulse + /// A refund card authorization, sometimes referred to as a credit voucher authorization, + /// where funds are credited to the cardholder. /// - Pulse, + Refund, } -sealed class CardFuelConfirmationNetworkConverter : JsonConverter +sealed class CardFinancialDirectionConverter : JsonConverter { - public override CardFuelConfirmationNetwork Read( + public override CardFinancialDirection Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -16744,15 +16374,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "visa" => CardFuelConfirmationNetwork.Visa, - "pulse" => CardFuelConfirmationNetwork.Pulse, - _ => (CardFuelConfirmationNetwork)(-1), + "settlement" => CardFinancialDirection.Settlement, + "refund" => CardFinancialDirection.Refund, + _ => (CardFinancialDirection)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardFuelConfirmationNetwork value, + CardFinancialDirection value, JsonSerializerOptions options ) { @@ -16760,8 +16390,8 @@ JsonSerializerOptions options writer, value switch { - CardFuelConfirmationNetwork.Visa => "visa", - CardFuelConfirmationNetwork.Pulse => "pulse", + CardFinancialDirection.Settlement => "settlement", + CardFinancialDirection.Refund => "refund", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -16772,107 +16402,85 @@ JsonSerializerOptions options } /// -/// Network-specific identifiers for a specific request or transaction. +/// Fields specific to the `network`. /// [JsonConverter( - typeof(JsonModelConverter< - CardFuelConfirmationNetworkIdentifiers, - CardFuelConfirmationNetworkIdentifiersFromRaw - >) + typeof(JsonModelConverter) )] -public sealed record class CardFuelConfirmationNetworkIdentifiers : JsonModel +public sealed record class CardFinancialNetworkDetails : JsonModel { /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. - /// - public required string? AuthorizationIdentificationResponse - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); - } - init { this._rawData.Set("authorization_identification_response", value); } - } - - /// - /// A life-cycle identifier used across e.g., an authorization and a reversal. - /// Expected to be unique per acquirer within a window of time. For some card - /// networks the retrieval reference number includes the trace counter. + /// The payment network used to process this card authorization. /// - public required string? RetrievalReferenceNumber + public required ApiEnum Category { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("retrieval_reference_number"); + return this._rawData.GetNotNullClass< + ApiEnum + >("category"); } - init { this._rawData.Set("retrieval_reference_number", value); } + init { this._rawData.Set("category", value); } } /// - /// A counter used to verify an individual authorization. Expected to be unique - /// per acquirer within a window of time. + /// Fields specific to the `pulse` network. /// - public required string? TraceNumber + public required CardFinancialNetworkDetailsPulse? Pulse { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("trace_number"); + return this._rawData.GetNullableClass("pulse"); } - init { this._rawData.Set("trace_number", value); } + init { this._rawData.Set("pulse", value); } } /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. + /// Fields specific to the `visa` network. /// - public required string? TransactionID + public required CardFinancialNetworkDetailsVisa? Visa { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); + return this._rawData.GetNullableClass("visa"); } - init { this._rawData.Set("transaction_id", value); } + init { this._rawData.Set("visa", value); } } /// public override void Validate() { - _ = this.AuthorizationIdentificationResponse; - _ = this.RetrievalReferenceNumber; - _ = this.TraceNumber; - _ = this.TransactionID; + this.Category.Validate(); + this.Pulse?.Validate(); + this.Visa?.Validate(); } - public CardFuelConfirmationNetworkIdentifiers() { } + public CardFinancialNetworkDetails() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardFuelConfirmationNetworkIdentifiers( - CardFuelConfirmationNetworkIdentifiers cardFuelConfirmationNetworkIdentifiers - ) - : base(cardFuelConfirmationNetworkIdentifiers) { } + public CardFinancialNetworkDetails(CardFinancialNetworkDetails cardFinancialNetworkDetails) + : base(cardFinancialNetworkDetails) { } #pragma warning restore CS8618 - public CardFuelConfirmationNetworkIdentifiers(IReadOnlyDictionary rawData) + public CardFinancialNetworkDetails(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardFuelConfirmationNetworkIdentifiers(FrozenDictionary rawData) + CardFinancialNetworkDetails(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardFuelConfirmationNetworkIdentifiers FromRawUnchecked( + /// + public static CardFinancialNetworkDetails FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -16880,27 +16488,35 @@ IReadOnlyDictionary rawData } } -class CardFuelConfirmationNetworkIdentifiersFromRaw - : IFromRawJson +class CardFinancialNetworkDetailsFromRaw : IFromRawJson { /// - public CardFuelConfirmationNetworkIdentifiers FromRawUnchecked( + public CardFinancialNetworkDetails FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardFuelConfirmationNetworkIdentifiers.FromRawUnchecked(rawData); + ) => CardFinancialNetworkDetails.FromRawUnchecked(rawData); } /// -/// A constant representing the object's type. For this resource it will always be `card_fuel_confirmation`. +/// The payment network used to process this card authorization. /// -[JsonConverter(typeof(CardFuelConfirmationTypeConverter))] -public enum CardFuelConfirmationType +[JsonConverter(typeof(CardFinancialNetworkDetailsCategoryConverter))] +public enum CardFinancialNetworkDetailsCategory { - CardFuelConfirmation, + /// + /// Visa + /// + Visa, + + /// + /// Pulse + /// + Pulse, } -sealed class CardFuelConfirmationTypeConverter : JsonConverter +sealed class CardFinancialNetworkDetailsCategoryConverter + : JsonConverter { - public override CardFuelConfirmationType Read( + public override CardFinancialNetworkDetailsCategory Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -16908,14 +16524,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "card_fuel_confirmation" => CardFuelConfirmationType.CardFuelConfirmation, - _ => (CardFuelConfirmationType)(-1), + "visa" => CardFinancialNetworkDetailsCategory.Visa, + "pulse" => CardFinancialNetworkDetailsCategory.Pulse, + _ => (CardFinancialNetworkDetailsCategory)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardFuelConfirmationType value, + CardFinancialNetworkDetailsCategory value, JsonSerializerOptions options ) { @@ -16923,7 +16540,8 @@ JsonSerializerOptions options writer, value switch { - CardFuelConfirmationType.CardFuelConfirmation => "card_fuel_confirmation", + CardFinancialNetworkDetailsCategory.Visa => "visa", + CardFinancialNetworkDetailsCategory.Pulse => "pulse", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -16934,306 +16552,269 @@ JsonSerializerOptions options } /// -/// A Card Increment object. This field will be present in the JSON response if and -/// only if `category` is equal to `card_increment`. Card Increments increase the -/// pending amount of an authorized transaction. +/// Fields specific to the `pulse` network. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardIncrement : JsonModel -{ - /// - /// The Card Increment identifier. - /// - public required string ID +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialNetworkDetailsPulse, + CardFinancialNetworkDetailsPulseFromRaw + >) +)] +public sealed record class CardFinancialNetworkDetailsPulse : JsonModel +{ + /// + public override void Validate() { } + + public CardFinancialNetworkDetailsPulse() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialNetworkDetailsPulse( + CardFinancialNetworkDetailsPulse cardFinancialNetworkDetailsPulse + ) + : base(cardFinancialNetworkDetailsPulse) { } +#pragma warning restore CS8618 + + public CardFinancialNetworkDetailsPulse(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } + this._rawData = new(rawData); } - /// - /// Whether this authorization was approved by Increase, the card network through - /// stand-in processing, or the user through a real-time decision. - /// - public required ApiEnum Actioner +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialNetworkDetailsPulse(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "actioner" - ); - } - init { this._rawData.Set("actioner", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Additional amounts associated with the card authorization, such as ATM surcharges - /// fees. These are usually a subset of the `amount` field and are used to provide - /// more detailed information about the transaction. - /// - public required CardIncrementAdditionalAmounts AdditionalAmounts + /// + public static CardFinancialNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "additional_amounts" - ); - } - init { this._rawData.Set("additional_amounts", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardFinancialNetworkDetailsPulseFromRaw : IFromRawJson +{ + /// + public CardFinancialNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialNetworkDetailsPulse.FromRawUnchecked(rawData); +} +/// +/// Fields specific to the `visa` network. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialNetworkDetailsVisa, + CardFinancialNetworkDetailsVisaFromRaw + >) +)] +public sealed record class CardFinancialNetworkDetailsVisa : JsonModel +{ /// - /// The amount of this increment in the minor unit of the transaction's currency. - /// For dollars, for example, this is cents. + /// For electronic commerce transactions, this identifies the level of security + /// used in obtaining the customer's payment credential. For mail or telephone + /// order transactions, identifies the type of mail or telephone order. /// - public required long Amount + public required ApiEnum< + string, + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator + >? ElectronicCommerceIndicator { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass< + ApiEnum + >("electronic_commerce_indicator"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("electronic_commerce_indicator", value); } } /// - /// The identifier for the Card Authorization this increments. + /// The method used to enter the cardholder's primary account number and card + /// expiration date. /// - public required string CardAuthorizationID + public required ApiEnum< + string, + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode + >? PointOfServiceEntryMode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_authorization_id"); + return this._rawData.GetNullableClass< + ApiEnum + >("point_of_service_entry_mode"); } - init { this._rawData.Set("card_authorization_id", value); } + init { this._rawData.Set("point_of_service_entry_mode", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. + /// Only present when `actioner: network`. Describes why a card authorization + /// was approved or declined by Visa through stand-in processing. /// - public required ApiEnum Currency + public required ApiEnum< + string, + CardFinancialNetworkDetailsVisaStandInProcessingReason + >? StandInProcessingReason { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); + return this._rawData.GetNullableClass< + ApiEnum + >("stand_in_processing_reason"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("stand_in_processing_reason", value); } } /// - /// The card network used to process this card authorization. + /// The capability of the terminal being used to read the card. Shows whether + /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe + /// reads. This reflects the highest capability of the terminal — for example, + /// a terminal that supports both chip and magnetic stripe will be identified + /// as chip-capable. /// - public required ApiEnum Network + public required ApiEnum< + string, + CardFinancialNetworkDetailsVisaTerminalEntryCapability + >? TerminalEntryCapability { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("network"); + return this._rawData.GetNullableClass< + ApiEnum + >("terminal_entry_capability"); } - init { this._rawData.Set("network", value); } + init { this._rawData.Set("terminal_entry_capability", value); } } - /// - /// Network-specific identifiers for a specific request or transaction. - /// - public required CardIncrementNetworkIdentifiers NetworkIdentifiers + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } + this.ElectronicCommerceIndicator?.Validate(); + this.PointOfServiceEntryMode?.Validate(); + this.StandInProcessingReason?.Validate(); + this.TerminalEntryCapability?.Validate(); } - /// - /// The risk score generated by the card network. For Visa this is the Visa Advanced - /// Authorization risk score, from 0 to 99, where 99 is the riskiest. - /// - public required long? NetworkRiskScore + public CardFinancialNetworkDetailsVisa() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialNetworkDetailsVisa( + CardFinancialNetworkDetailsVisa cardFinancialNetworkDetailsVisa + ) + : base(cardFinancialNetworkDetailsVisa) { } +#pragma warning restore CS8618 + + public CardFinancialNetworkDetailsVisa(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("network_risk_score"); - } - init { this._rawData.Set("network_risk_score", value); } + this._rawData = new(rawData); } - /// - /// The identifier of the Pending Transaction associated with this Card Increment. - /// - public required string? PendingTransactionID +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialNetworkDetailsVisa(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("pending_transaction_id"); - } - init { this._rawData.Set("pending_transaction_id", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// The amount of this increment in the minor unit of the transaction's presentment currency. - /// - public required long PresentmentAmount + /// + public static CardFinancialNetworkDetailsVisa FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); - } - init { this._rawData.Set("presentment_amount", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardFinancialNetworkDetailsVisaFromRaw : IFromRawJson +{ + /// + public CardFinancialNetworkDetailsVisa FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialNetworkDetailsVisa.FromRawUnchecked(rawData); +} +/// +/// For electronic commerce transactions, this identifies the level of security used +/// in obtaining the customer's payment credential. For mail or telephone order transactions, +/// identifies the type of mail or telephone order. +/// +[JsonConverter(typeof(CardFinancialNetworkDetailsVisaElectronicCommerceIndicatorConverter))] +public enum CardFinancialNetworkDetailsVisaElectronicCommerceIndicator +{ /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// presentment currency. + /// Single transaction of a mail/phone order: Use to indicate that the transaction + /// is a mail/phone order purchase, not a recurring transaction or installment + /// payment. For domestic transactions in the US region, this value may also indicate + /// one bill payment transaction in the card-present or card-absent environments. /// - public required string PresentmentCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); - } - init { this._rawData.Set("presentment_currency", value); } - } + MailPhoneOrder, /// - /// The identifier of the Real-Time Decision sent to approve or decline this - /// incremental authorization. + /// Recurring transaction: Payment indicator used to indicate a recurring transaction + /// that originates from an acquirer in the US region. /// - public required string? RealTimeDecisionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("real_time_decision_id"); - } - init { this._rawData.Set("real_time_decision_id", value); } - } + Recurring, /// - /// A constant representing the object's type. For this resource it will always - /// be `card_increment`. + /// Installment payment: Payment indicator used to indicate one purchase of goods + /// or services that is billed to the account in multiple charges over a period + /// of time agreed upon by the cardholder and merchant from transactions that + /// originate from an acquirer in the US region. /// - public required ApiEnum Type - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } - } + Installment, /// - /// The updated authorization amount after this increment, in the minor unit of - /// the transaction's currency. For dollars, for example, this is cents. + /// Unknown classification: other mail order: Use to indicate that the type of + /// mail/telephone order is unknown. /// - public required long UpdatedAuthorizationAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("updated_authorization_amount"); - } - init { this._rawData.Set("updated_authorization_amount", value); } - } - - /// - public override void Validate() - { - _ = this.ID; - this.Actioner.Validate(); - this.AdditionalAmounts.Validate(); - _ = this.Amount; - _ = this.CardAuthorizationID; - this.Currency.Validate(); - this.Network.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.NetworkRiskScore; - _ = this.PendingTransactionID; - _ = this.PresentmentAmount; - _ = this.PresentmentCurrency; - _ = this.RealTimeDecisionID; - this.Type.Validate(); - _ = this.UpdatedAuthorizationAmount; - } - - public CardIncrement() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrement(CardIncrement cardIncrement) - : base(cardIncrement) { } -#pragma warning restore CS8618 - - public CardIncrement(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrement(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardIncrement FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + UnknownMailPhoneOrder, -class CardIncrementFromRaw : IFromRawJson -{ - /// - public CardIncrement FromRawUnchecked(IReadOnlyDictionary rawData) => - CardIncrement.FromRawUnchecked(rawData); -} + /// + /// Secure electronic commerce transaction: Use to indicate that the electronic + /// commerce transaction has been authenticated using e.g., 3-D Secure + /// + SecureElectronicCommerce, -/// -/// Whether this authorization was approved by Increase, the card network through -/// stand-in processing, or the user through a real-time decision. -/// -[JsonConverter(typeof(CardIncrementActionerConverter))] -public enum CardIncrementActioner -{ /// - /// This object was actioned by the user through a real-time decision. + /// Non-authenticated security transaction at a 3-D Secure-capable merchant, + /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use + /// to identify an electronic commerce transaction where the merchant attempted + /// to authenticate the cardholder using 3-D Secure, but was unable to complete + /// the authentication because the issuer or cardholder does not participate in + /// the 3-D Secure program. /// - User, + NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, /// - /// This object was actioned by Increase without user intervention. + /// Non-authenticated security transaction: Use to identify an electronic commerce + /// transaction that uses data encryption for security however, cardholder authentication + /// is not performed using 3-D Secure. /// - Increase, + NonAuthenticatedSecurityTransaction, /// - /// This object was actioned by the network, through stand-in processing. + /// Non-secure transaction: Use to identify an electronic commerce transaction + /// that has no data protection. /// - Network, + NonSecureTransaction, } -sealed class CardIncrementActionerConverter : JsonConverter +sealed class CardFinancialNetworkDetailsVisaElectronicCommerceIndicatorConverter + : JsonConverter { - public override CardIncrementActioner Read( + public override CardFinancialNetworkDetailsVisaElectronicCommerceIndicator Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -17241,16 +16822,27 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "user" => CardIncrementActioner.User, - "increase" => CardIncrementActioner.Increase, - "network" => CardIncrementActioner.Network, - _ => (CardIncrementActioner)(-1), + "mail_phone_order" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, + "recurring" => CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Recurring, + "installment" => CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Installment, + "unknown_mail_phone_order" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, + "secure_electronic_commerce" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, + "non_authenticated_security_transaction_at_3ds_capable_merchant" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + "non_authenticated_security_transaction" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, + "non_secure_transaction" => + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, + _ => (CardFinancialNetworkDetailsVisaElectronicCommerceIndicator)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardIncrementActioner value, + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator value, JsonSerializerOptions options ) { @@ -17258,9 +16850,21 @@ JsonSerializerOptions options writer, value switch { - CardIncrementActioner.User => "user", - CardIncrementActioner.Increase => "increase", - CardIncrementActioner.Network => "network", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => + "mail_phone_order", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Recurring => "recurring", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.Installment => + "installment", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => + "unknown_mail_phone_order", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => + "secure_electronic_commerce", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => + "non_authenticated_security_transaction_at_3ds_capable_merchant", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => + "non_authenticated_security_transaction", + CardFinancialNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => + "non_secure_transaction", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -17271,551 +16875,463 @@ JsonSerializerOptions options } /// -/// Additional amounts associated with the card authorization, such as ATM surcharges -/// fees. These are usually a subset of the `amount` field and are used to provide -/// more detailed information about the transaction. +/// The method used to enter the cardholder's primary account number and card expiration date. /// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmounts, - CardIncrementAdditionalAmountsFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmounts : JsonModel +[JsonConverter(typeof(CardFinancialNetworkDetailsVisaPointOfServiceEntryModeConverter))] +public enum CardFinancialNetworkDetailsVisaPointOfServiceEntryMode { /// - /// The part of this transaction amount that was for clinic-related services. + /// Unknown /// - public required CardIncrementAdditionalAmountsClinic? Clinic - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("clinic"); - } - init { this._rawData.Set("clinic", value); } - } + Unknown, /// - /// The part of this transaction amount that was for dental-related services. + /// Manual key entry /// - public required CardIncrementAdditionalAmountsDental? Dental - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("dental"); - } - init { this._rawData.Set("dental", value); } - } + Manual, /// - /// The original pre-authorized amount. + /// Magnetic stripe read, without card verification value /// - public required CardIncrementAdditionalAmountsOriginal? Original - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "original" - ); - } - init { this._rawData.Set("original", value); } - } + MagneticStripeNoCvv, /// - /// The part of this transaction amount that was for healthcare prescriptions. + /// Optical code /// - public required CardIncrementAdditionalAmountsPrescription? Prescription - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "prescription" - ); - } - init { this._rawData.Set("prescription", value); } - } + OpticalCode, /// - /// The surcharge amount charged for this transaction by the merchant. + /// Contact chip card /// - public required CardIncrementAdditionalAmountsSurcharge? Surcharge - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "surcharge" - ); - } - init { this._rawData.Set("surcharge", value); } - } + IntegratedCircuitCard, /// - /// The total amount of a series of incremental authorizations, optionally provided. + /// Contactless read of chip card /// - public required CardIncrementAdditionalAmountsTotalCumulative? TotalCumulative - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_cumulative" - ); - } - init { this._rawData.Set("total_cumulative", value); } - } + Contactless, /// - /// The total amount of healthcare-related additional amounts. + /// Transaction initiated using a credential that has previously been stored + /// on file /// - public required CardIncrementAdditionalAmountsTotalHealthcare? TotalHealthcare - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_healthcare" - ); - } - init { this._rawData.Set("total_healthcare", value); } - } + CredentialOnFile, /// - /// The part of this transaction amount that was for transit-related services. + /// Magnetic stripe read /// - public required CardIncrementAdditionalAmountsTransit? Transit - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("transit"); - } - init { this._rawData.Set("transit", value); } - } + MagneticStripe, /// - /// An unknown additional amount. + /// Contactless read of magnetic stripe data /// - public required CardIncrementAdditionalAmountsUnknown? Unknown - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("unknown"); - } - init { this._rawData.Set("unknown", value); } - } + ContactlessMagneticStripe, /// - /// The part of this transaction amount that was for vision-related services. + /// Contact chip card, without card verification value /// - public required CardIncrementAdditionalAmountsVision? Vision - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("vision"); - } - init { this._rawData.Set("vision", value); } - } - - /// - public override void Validate() - { - this.Clinic?.Validate(); - this.Dental?.Validate(); - this.Original?.Validate(); - this.Prescription?.Validate(); - this.Surcharge?.Validate(); - this.TotalCumulative?.Validate(); - this.TotalHealthcare?.Validate(); - this.Transit?.Validate(); - this.Unknown?.Validate(); - this.Vision?.Validate(); - } - - public CardIncrementAdditionalAmounts() { } + IntegratedCircuitCardNoCvv, +} -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmounts( - CardIncrementAdditionalAmounts cardIncrementAdditionalAmounts +sealed class CardFinancialNetworkDetailsVisaPointOfServiceEntryModeConverter + : JsonConverter +{ + public override CardFinancialNetworkDetailsVisaPointOfServiceEntryMode Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options ) - : base(cardIncrementAdditionalAmounts) { } -#pragma warning restore CS8618 - - public CardIncrementAdditionalAmounts(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmounts(FrozenDictionary rawData) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "unknown" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Unknown, + "manual" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Manual, + "magnetic_stripe_no_cvv" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, + "optical_code" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, + "integrated_circuit_card" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, + "contactless" => CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Contactless, + "credential_on_file" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, + "magnetic_stripe" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, + "contactless_magnetic_stripe" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, + "integrated_circuit_card_no_cvv" => + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, + _ => (CardFinancialNetworkDetailsVisaPointOfServiceEntryMode)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => + "magnetic_stripe_no_cvv", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => + "optical_code", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => + "integrated_circuit_card", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.Contactless => "contactless", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => + "credential_on_file", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => + "magnetic_stripe", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => + "contactless_magnetic_stripe", + CardFinancialNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => + "integrated_circuit_card_no_cvv", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardIncrementAdditionalAmountsFromRaw : IFromRawJson -{ - /// - public CardIncrementAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmounts.FromRawUnchecked(rawData); -} - /// -/// The part of this transaction amount that was for clinic-related services. +/// Only present when `actioner: network`. Describes why a card authorization was +/// approved or declined by Visa through stand-in processing. /// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsClinic, - CardIncrementAdditionalAmountsClinicFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsClinic : JsonModel +[JsonConverter(typeof(CardFinancialNetworkDetailsVisaStandInProcessingReasonConverter))] +public enum CardFinancialNetworkDetailsVisaStandInProcessingReason { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Increase failed to process the authorization in a timely manner. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + IssuerError, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The physical card read had an invalid CVV or dCVV. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + InvalidPhysicalCard, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// The card's authorization request cryptogram was invalid. The cryptogram can + /// be from a physical card or a Digital Wallet Token purchase. + /// + InvalidCryptogram, - public CardIncrementAdditionalAmountsClinic() { } + /// + /// The 3DS cardholder authentication verification value was invalid. + /// + InvalidCardholderAuthenticationVerificationValue, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsClinic( - CardIncrementAdditionalAmountsClinic cardIncrementAdditionalAmountsClinic - ) - : base(cardIncrementAdditionalAmountsClinic) { } -#pragma warning restore CS8618 + /// + /// An internal Visa error occurred. Visa uses this reason code for certain expected + /// occurrences as well, such as Application Transaction Counter (ATC) replays. + /// + InternalVisaError, - public CardIncrementAdditionalAmountsClinic(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// The merchant has enabled Visa's Transaction Advisory Service and requires + /// further authentication to perform the transaction. In practice this is often + /// utilized at fuel pumps to tell the cardholder to see the cashier. + /// + MerchantTransactionAdvisoryServiceAuthenticationRequired, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsClinic(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// The transaction was blocked by Visa's Payment Fraud Disruption service due + /// to fraudulent Acquirer behavior, such as card testing. + /// + PaymentFraudDisruptionAcquirerBlock, - /// - public static CardIncrementAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData + /// + /// An unspecific reason for stand-in processing. + /// + Other, +} + +sealed class CardFinancialNetworkDetailsVisaStandInProcessingReasonConverter + : JsonConverter +{ + public override CardFinancialNetworkDetailsVisaStandInProcessingReason Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "issuer_error" => CardFinancialNetworkDetailsVisaStandInProcessingReason.IssuerError, + "invalid_physical_card" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, + "invalid_cryptogram" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, + "invalid_cardholder_authentication_verification_value" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, + "internal_visa_error" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.InternalVisaError, + "merchant_transaction_advisory_service_authentication_required" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, + "payment_fraud_disruption_acquirer_block" => + CardFinancialNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, + "other" => CardFinancialNetworkDetailsVisaStandInProcessingReason.Other, + _ => (CardFinancialNetworkDetailsVisaStandInProcessingReason)(-1), + }; } -} -class CardIncrementAdditionalAmountsClinicFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsClinic.FromRawUnchecked(rawData); + public override void Write( + Utf8JsonWriter writer, + CardFinancialNetworkDetailsVisaStandInProcessingReason value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialNetworkDetailsVisaStandInProcessingReason.IssuerError => + "issuer_error", + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => + "invalid_physical_card", + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => + "invalid_cryptogram", + CardFinancialNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => + "invalid_cardholder_authentication_verification_value", + CardFinancialNetworkDetailsVisaStandInProcessingReason.InternalVisaError => + "internal_visa_error", + CardFinancialNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => + "merchant_transaction_advisory_service_authentication_required", + CardFinancialNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => + "payment_fraud_disruption_acquirer_block", + CardFinancialNetworkDetailsVisaStandInProcessingReason.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } } /// -/// The part of this transaction amount that was for dental-related services. +/// The capability of the terminal being used to read the card. Shows whether a terminal +/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This +/// reflects the highest capability of the terminal — for example, a terminal that +/// supports both chip and magnetic stripe will be identified as chip-capable. /// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsDental, - CardIncrementAdditionalAmountsDentalFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsDental : JsonModel +[JsonConverter(typeof(CardFinancialNetworkDetailsVisaTerminalEntryCapabilityConverter))] +public enum CardFinancialNetworkDetailsVisaTerminalEntryCapability { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Unknown /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + Unknown, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// No terminal was used for this transaction. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + TerminalNotUsed, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// The terminal can only read magnetic stripes and does not have chip or contactless + /// reading capability. + /// + MagneticStripe, - public CardIncrementAdditionalAmountsDental() { } + /// + /// The terminal can only read barcodes. + /// + Barcode, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsDental( - CardIncrementAdditionalAmountsDental cardIncrementAdditionalAmountsDental - ) - : base(cardIncrementAdditionalAmountsDental) { } -#pragma warning restore CS8618 + /// + /// The terminal can only read cards via Optical Character Recognition. + /// + OpticalCharacterRecognition, - public CardIncrementAdditionalAmountsDental(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// The terminal supports contact chip cards and can also read the magnetic stripe. + /// If contact chip is supported, this value is used regardless of whether contactless + /// is also supported. + /// + ChipOrContactless, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsDental(FrozenDictionary rawData) + /// + /// The terminal supports contactless reads but does not support contact chip. + /// Only used when the terminal lacks contact chip capability. + /// + ContactlessOnly, + + /// + /// The terminal has no card reading capability. + /// + NoCapability, +} + +sealed class CardFinancialNetworkDetailsVisaTerminalEntryCapabilityConverter + : JsonConverter +{ + public override CardFinancialNetworkDetailsVisaTerminalEntryCapability Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "unknown" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.Unknown, + "terminal_not_used" => + CardFinancialNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, + "magnetic_stripe" => + CardFinancialNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, + "barcode" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.Barcode, + "optical_character_recognition" => + CardFinancialNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, + "chip_or_contactless" => + CardFinancialNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, + "contactless_only" => + CardFinancialNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, + "no_capability" => CardFinancialNetworkDetailsVisaTerminalEntryCapability.NoCapability, + _ => (CardFinancialNetworkDetailsVisaTerminalEntryCapability)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardFinancialNetworkDetailsVisaTerminalEntryCapability value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => + "terminal_not_used", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => + "magnetic_stripe", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => + "optical_character_recognition", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => + "chip_or_contactless", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => + "contactless_only", + CardFinancialNetworkDetailsVisaTerminalEntryCapability.NoCapability => + "no_capability", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardIncrementAdditionalAmountsDentalFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsDental.FromRawUnchecked(rawData); -} - /// -/// The original pre-authorized amount. +/// Network-specific identifiers for a specific request or transaction. /// [JsonConverter( typeof(JsonModelConverter< - CardIncrementAdditionalAmountsOriginal, - CardIncrementAdditionalAmountsOriginalFromRaw + CardFinancialNetworkIdentifiers, + CardFinancialNetworkIdentifiersFromRaw >) )] -public sealed record class CardIncrementAdditionalAmountsOriginal : JsonModel +public sealed record class CardFinancialNetworkIdentifiers : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. /// - public required long Amount + public required string? AuthorizationIdentificationResponse { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("authorization_identification_response"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("authorization_identification_response", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. - /// - public required string Currency + /// A life-cycle identifier used across e.g., an authorization and a reversal. + /// Expected to be unique per acquirer within a window of time. For some card + /// networks the retrieval reference number includes the trace counter. + /// + public required string? RetrievalReferenceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("retrieval_reference_number"); } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardIncrementAdditionalAmountsOriginal() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsOriginal( - CardIncrementAdditionalAmountsOriginal cardIncrementAdditionalAmountsOriginal - ) - : base(cardIncrementAdditionalAmountsOriginal) { } -#pragma warning restore CS8618 - - public CardIncrementAdditionalAmountsOriginal(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsOriginal(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardIncrementAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + init { this._rawData.Set("retrieval_reference_number", value); } } -} - -class CardIncrementAdditionalAmountsOriginalFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsOriginal.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for healthcare prescriptions. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsPrescription, - CardIncrementAdditionalAmountsPrescriptionFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsPrescription : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// A counter used to verify an individual authorization. Expected to be unique + /// per acquirer within a window of time. /// - public required long Amount + public required string? TraceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("trace_number"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("trace_number", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - public required string Currency + public required string? TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("transaction_id"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("transaction_id", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Currency; + _ = this.AuthorizationIdentificationResponse; + _ = this.RetrievalReferenceNumber; + _ = this.TraceNumber; + _ = this.TransactionID; } - public CardIncrementAdditionalAmountsPrescription() { } + public CardFinancialNetworkIdentifiers() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardIncrementAdditionalAmountsPrescription( - CardIncrementAdditionalAmountsPrescription cardIncrementAdditionalAmountsPrescription + public CardFinancialNetworkIdentifiers( + CardFinancialNetworkIdentifiers cardFinancialNetworkIdentifiers ) - : base(cardIncrementAdditionalAmountsPrescription) { } + : base(cardFinancialNetworkIdentifiers) { } #pragma warning restore CS8618 - public CardIncrementAdditionalAmountsPrescription( - IReadOnlyDictionary rawData - ) + public CardFinancialNetworkIdentifiers(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardIncrementAdditionalAmountsPrescription(FrozenDictionary rawData) + CardFinancialNetworkIdentifiers(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmountsPrescription FromRawUnchecked( + /// + public static CardFinancialNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -17823,355 +17339,256 @@ IReadOnlyDictionary rawData } } -class CardIncrementAdditionalAmountsPrescriptionFromRaw - : IFromRawJson +class CardFinancialNetworkIdentifiersFromRaw : IFromRawJson { /// - public CardIncrementAdditionalAmountsPrescription FromRawUnchecked( + public CardFinancialNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsPrescription.FromRawUnchecked(rawData); + ) => CardFinancialNetworkIdentifiers.FromRawUnchecked(rawData); } /// -/// The surcharge amount charged for this transaction by the merchant. +/// The processing category describes the intent behind the financial, such as whether +/// it was used for bill payments or an automatic fuel dispenser. /// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsSurcharge, - CardIncrementAdditionalAmountsSurchargeFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsSurcharge : JsonModel +[JsonConverter(typeof(CardFinancialProcessingCategoryConverter))] +public enum CardFinancialProcessingCategory { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Account funding transactions are transactions used to e.g., fund an account + /// or transfer funds between accounts. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + AccountFunding, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Automatic fuel dispenser authorizations occur when a card is used at a gas + /// pump, prior to the actual transaction amount being known. They are followed + /// by an advice message that updates the amount of the pending transaction. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardIncrementAdditionalAmountsSurcharge() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsSurcharge( - CardIncrementAdditionalAmountsSurcharge cardIncrementAdditionalAmountsSurcharge - ) - : base(cardIncrementAdditionalAmountsSurcharge) { } -#pragma warning restore CS8618 + AutomaticFuelDispenser, - public CardIncrementAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// A transaction used to pay a bill. + /// + BillPayment, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsSurcharge(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// Original credit transactions are used to send money to a cardholder. + /// + OriginalCredit, - /// - public static CardIncrementAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// A regular purchase. + /// + Purchase, -class CardIncrementAdditionalAmountsSurchargeFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsSurcharge.FromRawUnchecked(rawData); -} + /// + /// Quasi-cash transactions represent purchases of items which may be convertible + /// to cash. + /// + QuasiCash, -/// -/// The total amount of a series of incremental authorizations, optionally provided. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsTotalCumulative, - CardIncrementAdditionalAmountsTotalCumulativeFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsTotalCumulative : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// A refund card authorization, sometimes referred to as a credit voucher authorization, + /// where funds are credited to the cardholder. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + Refund, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Cash disbursement transactions are used to withdraw cash from an ATM or a + /// point of sale. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + CashDisbursement, - public CardIncrementAdditionalAmountsTotalCumulative() { } + /// + /// A balance inquiry transaction is used to check the balance of an account associated + /// with a card. + /// + BalanceInquiry, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsTotalCumulative( - CardIncrementAdditionalAmountsTotalCumulative cardIncrementAdditionalAmountsTotalCumulative - ) - : base(cardIncrementAdditionalAmountsTotalCumulative) { } -#pragma warning restore CS8618 + /// + /// The processing category is unknown. + /// + Unknown, +} - public CardIncrementAdditionalAmountsTotalCumulative( - IReadOnlyDictionary rawData +sealed class CardFinancialProcessingCategoryConverter + : JsonConverter +{ + public override CardFinancialProcessingCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options ) { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsTotalCumulative(FrozenDictionary rawData) - { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "account_funding" => CardFinancialProcessingCategory.AccountFunding, + "automatic_fuel_dispenser" => CardFinancialProcessingCategory.AutomaticFuelDispenser, + "bill_payment" => CardFinancialProcessingCategory.BillPayment, + "original_credit" => CardFinancialProcessingCategory.OriginalCredit, + "purchase" => CardFinancialProcessingCategory.Purchase, + "quasi_cash" => CardFinancialProcessingCategory.QuasiCash, + "refund" => CardFinancialProcessingCategory.Refund, + "cash_disbursement" => CardFinancialProcessingCategory.CashDisbursement, + "balance_inquiry" => CardFinancialProcessingCategory.BalanceInquiry, + "unknown" => CardFinancialProcessingCategory.Unknown, + _ => (CardFinancialProcessingCategory)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmountsTotalCumulative FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardFinancialProcessingCategory value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialProcessingCategory.AccountFunding => "account_funding", + CardFinancialProcessingCategory.AutomaticFuelDispenser => + "automatic_fuel_dispenser", + CardFinancialProcessingCategory.BillPayment => "bill_payment", + CardFinancialProcessingCategory.OriginalCredit => "original_credit", + CardFinancialProcessingCategory.Purchase => "purchase", + CardFinancialProcessingCategory.QuasiCash => "quasi_cash", + CardFinancialProcessingCategory.Refund => "refund", + CardFinancialProcessingCategory.CashDisbursement => "cash_disbursement", + CardFinancialProcessingCategory.BalanceInquiry => "balance_inquiry", + CardFinancialProcessingCategory.Unknown => "unknown", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardIncrementAdditionalAmountsTotalCumulativeFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsTotalCumulative FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); -} - -/// -/// The total amount of healthcare-related additional amounts. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsTotalHealthcare, - CardIncrementAdditionalAmountsTotalHealthcareFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsTotalHealthcare : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardFinancialSchemeFee : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The fee amount given as a string containing a decimal number. /// - public required long Amount + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("amount"); } init { this._rawData.Set("amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required string Currency + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardIncrementAdditionalAmountsTotalHealthcare() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsTotalHealthcare( - CardIncrementAdditionalAmountsTotalHealthcare cardIncrementAdditionalAmountsTotalHealthcare - ) - : base(cardIncrementAdditionalAmountsTotalHealthcare) { } -#pragma warning restore CS8618 - - public CardIncrementAdditionalAmountsTotalHealthcare( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); + init { this._rawData.Set("created_at", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } } -#pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } } -} - -class CardIncrementAdditionalAmountsTotalHealthcareFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for transit-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsTransit, - CardIncrementAdditionalAmountsTransitFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsTransit : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required long Amount + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required string Currency + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { _ = this.Amount; - _ = this.Currency; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardIncrementAdditionalAmountsTransit() { } + public CardFinancialSchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardIncrementAdditionalAmountsTransit( - CardIncrementAdditionalAmountsTransit cardIncrementAdditionalAmountsTransit - ) - : base(cardIncrementAdditionalAmountsTransit) { } + public CardFinancialSchemeFee(CardFinancialSchemeFee cardFinancialSchemeFee) + : base(cardFinancialSchemeFee) { } #pragma warning restore CS8618 - public CardIncrementAdditionalAmountsTransit(IReadOnlyDictionary rawData) + public CardFinancialSchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardIncrementAdditionalAmountsTransit(FrozenDictionary rawData) + CardFinancialSchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardIncrementAdditionalAmountsTransit FromRawUnchecked( + /// + public static CardFinancialSchemeFee FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -18179,196 +17596,19 @@ IReadOnlyDictionary rawData } } -class CardIncrementAdditionalAmountsTransitFromRaw - : IFromRawJson +class CardFinancialSchemeFeeFromRaw : IFromRawJson { /// - public CardIncrementAdditionalAmountsTransit FromRawUnchecked( + public CardFinancialSchemeFee FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsTransit.FromRawUnchecked(rawData); + ) => CardFinancialSchemeFee.FromRawUnchecked(rawData); } /// -/// An unknown additional amount. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsUnknown, - CardIncrementAdditionalAmountsUnknownFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsUnknown : JsonModel -{ - /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). - /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. - /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardIncrementAdditionalAmountsUnknown() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsUnknown( - CardIncrementAdditionalAmountsUnknown cardIncrementAdditionalAmountsUnknown - ) - : base(cardIncrementAdditionalAmountsUnknown) { } -#pragma warning restore CS8618 - - public CardIncrementAdditionalAmountsUnknown(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsUnknown(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardIncrementAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardIncrementAdditionalAmountsUnknownFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsUnknown.FromRawUnchecked(rawData); -} - -/// -/// The part of this transaction amount that was for vision-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementAdditionalAmountsVision, - CardIncrementAdditionalAmountsVisionFromRaw - >) -)] -public sealed record class CardIncrementAdditionalAmountsVision : JsonModel -{ - /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). - /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. - /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardIncrementAdditionalAmountsVision() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementAdditionalAmountsVision( - CardIncrementAdditionalAmountsVision cardIncrementAdditionalAmountsVision - ) - : base(cardIncrementAdditionalAmountsVision) { } -#pragma warning restore CS8618 - - public CardIncrementAdditionalAmountsVision(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementAdditionalAmountsVision(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardIncrementAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardIncrementAdditionalAmountsVisionFromRaw - : IFromRawJson -{ - /// - public CardIncrementAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementAdditionalAmountsVision.FromRawUnchecked(rawData); -} - -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. -/// -[JsonConverter(typeof(CardIncrementCurrencyConverter))] -public enum CardIncrementCurrency +[JsonConverter(typeof(CardFinancialSchemeFeeCurrencyConverter))] +public enum CardFinancialSchemeFeeCurrency { /// /// US Dollar (USD) @@ -18376,9 +17616,9 @@ public enum CardIncrementCurrency Usd, } -sealed class CardIncrementCurrencyConverter : JsonConverter +sealed class CardFinancialSchemeFeeCurrencyConverter : JsonConverter { - public override CardIncrementCurrency Read( + public override CardFinancialSchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -18386,14 +17626,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardIncrementCurrency.Usd, - _ => (CardIncrementCurrency)(-1), + "USD" => CardFinancialSchemeFeeCurrency.Usd, + _ => (CardFinancialSchemeFeeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardIncrementCurrency value, + CardFinancialSchemeFeeCurrency value, JsonSerializerOptions options ) { @@ -18401,7 +17641,7 @@ JsonSerializerOptions options writer, value switch { - CardIncrementCurrency.Usd => "USD", + CardFinancialSchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -18412,188 +17652,197 @@ JsonSerializerOptions options } /// -/// The card network used to process this card authorization. +/// The type of fee being assessed. /// -[JsonConverter(typeof(CardIncrementNetworkConverter))] -public enum CardIncrementNetwork +[JsonConverter(typeof(CardFinancialSchemeFeeFeeTypeConverter))] +public enum CardFinancialSchemeFeeFeeType { /// - /// Visa + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - Visa, + VisaInternationalServiceAssessmentSingleCurrency, /// - /// Pulse + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - Pulse, -} - -sealed class CardIncrementNetworkConverter : JsonConverter -{ - public override CardIncrementNetwork Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "visa" => CardIncrementNetwork.Visa, - "pulse" => CardIncrementNetwork.Pulse, - _ => (CardIncrementNetwork)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardIncrementNetwork value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardIncrementNetwork.Visa => "visa", - CardIncrementNetwork.Pulse => "pulse", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} + VisaInternationalServiceAssessmentCrossCurrency, -/// -/// Network-specific identifiers for a specific request or transaction. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardIncrementNetworkIdentifiers, - CardIncrementNetworkIdentifiersFromRaw - >) -)] -public sealed record class CardIncrementNetworkIdentifiers : JsonModel -{ /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? AuthorizationIdentificationResponse - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); - } - init { this._rawData.Set("authorization_identification_response", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// A life-cycle identifier used across e.g., an authorization and a reversal. - /// Expected to be unique per acquirer within a window of time. For some card - /// networks the retrieval reference number includes the trace counter. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string? RetrievalReferenceNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("retrieval_reference_number"); - } - init { this._rawData.Set("retrieval_reference_number", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// A counter used to verify an individual authorization. Expected to be unique - /// per acquirer within a window of time. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required string? TraceNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("trace_number"); - } - init { this._rawData.Set("trace_number", value); } - } + VisaAuthorizationCanadaPointOfSale, /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. /// - public required string? TransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); - } - init { this._rawData.Set("transaction_id", value); } - } + VisaAuthorizationReversalPointOfSale, - /// - public override void Validate() - { - _ = this.AuthorizationIdentificationResponse; - _ = this.RetrievalReferenceNumber; - _ = this.TraceNumber; - _ = this.TransactionID; - } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, - public CardIncrementNetworkIdentifiers() { } + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardIncrementNetworkIdentifiers( - CardIncrementNetworkIdentifiers cardIncrementNetworkIdentifiers - ) - : base(cardIncrementNetworkIdentifiers) { } -#pragma warning restore CS8618 + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, - public CardIncrementNetworkIdentifiers(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardIncrementNetworkIdentifiers(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, - /// - public static CardIncrementNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, -class CardIncrementNetworkIdentifiersFromRaw : IFromRawJson -{ - /// - public CardIncrementNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardIncrementNetworkIdentifiers.FromRawUnchecked(rawData); -} + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, -/// -/// A constant representing the object's type. For this resource it will always be `card_increment`. -/// -[JsonConverter(typeof(CardIncrementTypeConverter))] -public enum CardIncrementType -{ - CardIncrement, + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class CardIncrementTypeConverter : JsonConverter +sealed class CardFinancialSchemeFeeFeeTypeConverter : JsonConverter { - public override CardIncrementType Read( + public override CardFinancialSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -18601,14 +17850,64 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "card_increment" => CardIncrementType.CardIncrement, - _ => (CardIncrementType)(-1), + "visa_international_service_assessment_single_currency" => + CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardFinancialSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardFinancialSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardFinancialSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardFinancialSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardFinancialSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardFinancialSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardFinancialSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardFinancialSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardFinancialSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardFinancialSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardFinancialSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardFinancialSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardFinancialSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardFinancialSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardFinancialSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardFinancialSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardFinancialSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardFinancialSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardFinancialSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardFinancialSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardFinancialSchemeFeeFeeType.PulseSwitchFee, + _ => (CardFinancialSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardIncrementType value, + CardFinancialSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -18616,7 +17915,61 @@ JsonSerializerOptions options writer, value switch { - CardIncrementType.CardIncrement => "card_increment", + CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardFinancialSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardFinancialSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardFinancialSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardFinancialSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardFinancialSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardFinancialSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardFinancialSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardFinancialSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardFinancialSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardFinancialSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardFinancialSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardFinancialSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardFinancialSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardFinancialSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardFinancialSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardFinancialSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardFinancialSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardFinancialSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardFinancialSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardFinancialSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardFinancialSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardFinancialSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardFinancialSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardFinancialSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardFinancialSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardFinancialSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardFinancialSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -18627,467 +17980,470 @@ JsonSerializerOptions options } /// -/// A Card Refund object. This field will be present in the JSON response if and only -/// if `category` is equal to `card_refund`. Card Refunds move money back to the cardholder. -/// While they are usually connected to a Card Settlement, an acquirer can also refund -/// money directly to a card without relation to a transaction. +/// A constant representing the object's type. For this resource it will always be `card_financial`. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardRefund : JsonModel +[JsonConverter(typeof(CardFinancialTypeConverter))] +public enum CardFinancialType { - /// - /// The Card Refund identifier. - /// - public required string ID + CardFinancial, +} + +sealed class CardFinancialTypeConverter : JsonConverter +{ + public override CardFinancialType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } + "card_financial" => CardFinancialType.CardFinancial, + _ => (CardFinancialType)(-1), + }; } - /// - /// The amount in the minor unit of the transaction's settlement currency. For - /// dollars, for example, this is cents. - /// - public required long Amount + public override void Write( + Utf8JsonWriter writer, + CardFinancialType value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialType.CardFinancial => "card_financial", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Fields related to verification of cardholder-provided values. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardFinancialVerification : JsonModel +{ /// - /// The ID of the Card Payment this transaction belongs to. + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. /// - public required string CardPaymentID + public required CardFinancialVerificationCardVerificationCode CardVerificationCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); + return this._rawData.GetNotNullClass( + "card_verification_code" + ); } - init { this._rawData.Set("card_payment_id", value); } + init { this._rawData.Set("card_verification_code", value); } } /// - /// Cashback debited for this transaction, if eligible. Cashback is paid out in - /// aggregate, monthly. + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. /// - public required Cashback? Cashback + public required CardFinancialVerificationCardholderAddress CardholderAddress { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("cashback"); + return this._rawData.GetNotNullClass( + "cardholder_address" + ); } - init { this._rawData.Set("cashback", value); } + init { this._rawData.Set("cardholder_address", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// settlement currency. + /// Cardholder name provided in the authorization request. /// - public required ApiEnum Currency + public required CardFinancialVerificationCardholderName? CardholderName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); + return this._rawData.GetNullableClass( + "cardholder_name" + ); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("cardholder_name", value); } } - /// - /// Interchange assessed as a part of this transaction. - /// - public required Interchange? Interchange + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("interchange"); - } - init { this._rawData.Set("interchange", value); } + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); } - /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. - /// - public required string MerchantAcceptorID + public CardFinancialVerification() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialVerification(CardFinancialVerification cardFinancialVerification) + : base(cardFinancialVerification) { } +#pragma warning restore CS8618 + + public CardFinancialVerification(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); - } - init { this._rawData.Set("merchant_acceptor_id", value); } + this._rawData = new(rawData); } - /// - /// The 4-digit MCC describing the merchant's business. - /// - public required string MerchantCategoryCode +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialVerification(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); - } - init { this._rawData.Set("merchant_category_code", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// The city the merchant resides in. - /// - public required string MerchantCity + /// + public static CardFinancialVerification FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_city"); - } - init { this._rawData.Set("merchant_city", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardFinancialVerificationFromRaw : IFromRawJson +{ + /// + public CardFinancialVerification FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialVerification.FromRawUnchecked(rawData); +} +/// +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialVerificationCardVerificationCode, + CardFinancialVerificationCardVerificationCodeFromRaw + >) +)] +public sealed record class CardFinancialVerificationCardVerificationCode : JsonModel +{ /// - /// The country the merchant resides in. + /// The result of verifying the Card Verification Code. /// - public required string MerchantCountry + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("merchant_country", value); } + init { this._rawData.Set("result", value); } } - /// - /// The name of the merchant. - /// - public required string MerchantName + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_name"); - } - init { this._rawData.Set("merchant_name", value); } + this.Result.Validate(); } - /// - /// The merchant's postal code. For US merchants this is always a 5-digit ZIP code. - /// - public required string? MerchantPostalCode + public CardFinancialVerificationCardVerificationCode() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFinancialVerificationCardVerificationCode( + CardFinancialVerificationCardVerificationCode cardFinancialVerificationCardVerificationCode + ) + : base(cardFinancialVerificationCardVerificationCode) { } +#pragma warning restore CS8618 + + public CardFinancialVerificationCardVerificationCode( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } + this._rawData = new(rawData); } - /// - /// The state the merchant resides in. - /// - public required string? MerchantState +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFinancialVerificationCardVerificationCode(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Network-specific identifiers for this refund. - /// - public required CardRefundNetworkIdentifiers NetworkIdentifiers - { - get + /// + public static CardFinancialVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } + + [SetsRequiredMembers] + public CardFinancialVerificationCardVerificationCode( + ApiEnum result + ) + : this() + { + this.Result = result; + } +} + +class CardFinancialVerificationCardVerificationCodeFromRaw + : IFromRawJson +{ + /// + public CardFinancialVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialVerificationCardVerificationCode.FromRawUnchecked(rawData); +} + +/// +/// The result of verifying the Card Verification Code. +/// +[JsonConverter(typeof(CardFinancialVerificationCardVerificationCodeResultConverter))] +public enum CardFinancialVerificationCardVerificationCodeResult +{ + /// + /// No card verification code was provided in the authorization request. + /// + NotChecked, + + /// + /// The card verification code matched the one on file. + /// + Match, + + /// + /// The card verification code did not match the one on file. + /// + NoMatch, +} + +sealed class CardFinancialVerificationCardVerificationCodeResultConverter + : JsonConverter +{ + public override CardFinancialVerificationCardVerificationCodeResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } + "not_checked" => CardFinancialVerificationCardVerificationCodeResult.NotChecked, + "match" => CardFinancialVerificationCardVerificationCodeResult.Match, + "no_match" => CardFinancialVerificationCardVerificationCodeResult.NoMatch, + _ => (CardFinancialVerificationCardVerificationCodeResult)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardFinancialVerificationCardVerificationCodeResult value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardFinancialVerificationCardVerificationCodeResult.NotChecked => "not_checked", + CardFinancialVerificationCardVerificationCodeResult.Match => "match", + CardFinancialVerificationCardVerificationCodeResult.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialVerificationCardholderAddress, + CardFinancialVerificationCardholderAddressFromRaw + >) +)] +public sealed record class CardFinancialVerificationCardholderAddress : JsonModel +{ /// - /// The amount in the minor unit of the transaction's presentment currency. + /// Line 1 of the address on file for the cardholder. /// - public required long PresentmentAmount + public required string? ActualLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); + return this._rawData.GetNullableClass("actual_line1"); } - init { this._rawData.Set("presentment_amount", value); } + init { this._rawData.Set("actual_line1", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// presentment currency. + /// The postal code of the address on file for the cardholder. /// - public required string PresentmentCurrency + public required string? ActualPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); + return this._rawData.GetNullableClass("actual_postal_code"); } - init { this._rawData.Set("presentment_currency", value); } + init { this._rawData.Set("actual_postal_code", value); } } /// - /// Additional details about the card purchase, such as tax and industry-specific fields. + /// The cardholder address line 1 provided for verification in the authorization request. /// - public required PurchaseDetails? PurchaseDetails + public required string? ProvidedLine1 { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("purchase_details"); + return this._rawData.GetNullableClass("provided_line1"); } - init { this._rawData.Set("purchase_details", value); } + init { this._rawData.Set("provided_line1", value); } } /// - /// The identifier of the Transaction associated with this Transaction. + /// The postal code provided for verification in the authorization request. /// - public required string TransactionID + public required string? ProvidedPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("transaction_id"); + return this._rawData.GetNullableClass("provided_postal_code"); } - init { this._rawData.Set("transaction_id", value); } + init { this._rawData.Set("provided_postal_code", value); } } /// - /// A constant representing the object's type. For this resource it will always - /// be `card_refund`. + /// The address verification result returned to the card network. /// - public required ApiEnum Type + public required ApiEnum Result { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); } - init { this._rawData.Set("type", value); } + init { this._rawData.Set("result", value); } } /// public override void Validate() { - _ = this.ID; - _ = this.Amount; - _ = this.CardPaymentID; - this.Cashback?.Validate(); - this.Currency.Validate(); - this.Interchange?.Validate(); - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantName; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.NetworkIdentifiers.Validate(); - _ = this.PresentmentAmount; - _ = this.PresentmentCurrency; - this.PurchaseDetails?.Validate(); - _ = this.TransactionID; - this.Type.Validate(); + _ = this.ActualLine1; + _ = this.ActualPostalCode; + _ = this.ProvidedLine1; + _ = this.ProvidedPostalCode; + this.Result.Validate(); } - public CardRefund() { } + public CardFinancialVerificationCardholderAddress() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardRefund(CardRefund cardRefund) - : base(cardRefund) { } + public CardFinancialVerificationCardholderAddress( + CardFinancialVerificationCardholderAddress cardFinancialVerificationCardholderAddress + ) + : base(cardFinancialVerificationCardholderAddress) { } #pragma warning restore CS8618 - public CardRefund(IReadOnlyDictionary rawData) + public CardFinancialVerificationCardholderAddress( + IReadOnlyDictionary rawData + ) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardRefund(FrozenDictionary rawData) + CardFinancialVerificationCardholderAddress(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardRefund FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardFinancialVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardRefundFromRaw : IFromRawJson +class CardFinancialVerificationCardholderAddressFromRaw + : IFromRawJson { /// - public CardRefund FromRawUnchecked(IReadOnlyDictionary rawData) => - CardRefund.FromRawUnchecked(rawData); + public CardFinancialVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialVerificationCardholderAddress.FromRawUnchecked(rawData); } /// -/// Cashback debited for this transaction, if eligible. Cashback is paid out in aggregate, monthly. +/// The address verification result returned to the card network. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Cashback : JsonModel +[JsonConverter(typeof(CardFinancialVerificationCardholderAddressResultConverter))] +public enum CardFinancialVerificationCardholderAddressResult { /// - /// The cashback amount given as a string containing a decimal number. The amount - /// is a positive number if it will be credited to you (e.g., settlements) and - /// a negative number if it will be debited (e.g., refunds). + /// No address information was provided in the authorization request. /// - public required string Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("amount"); - } - init { this._rawData.Set("amount", value); } - } + NotChecked, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. + /// Postal code matches, but the street address does not match or was not provided. /// - public required ApiEnum Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); - } - init { this._rawData.Set("currency", value); } - } + PostalCodeMatchAddressNoMatch, - /// - public override void Validate() - { - _ = this.Amount; - this.Currency.Validate(); - } + /// + /// Postal code does not match, but the street address matches or was not provided. + /// + PostalCodeNoMatchAddressMatch, - public Cashback() { } + /// + /// Postal code and street address match. + /// + Match, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Cashback(Cashback cashback) - : base(cashback) { } -#pragma warning restore CS8618 + /// + /// Postal code and street address do not match. + /// + NoMatch, - public Cashback(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Cashback(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static Cashback FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CashbackFromRaw : IFromRawJson -{ - /// - public Cashback FromRawUnchecked(IReadOnlyDictionary rawData) => - Cashback.FromRawUnchecked(rawData); -} - -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. -/// -[JsonConverter(typeof(CashbackCurrencyConverter))] -public enum CashbackCurrency -{ - /// - /// US Dollar (USD) - /// - Usd, -} - -sealed class CashbackCurrencyConverter : JsonConverter -{ - public override CashbackCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "USD" => CashbackCurrency.Usd, - _ => (CashbackCurrency)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CashbackCurrency value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CashbackCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's -/// settlement currency. -/// -[JsonConverter(typeof(CardRefundCurrencyConverter))] -public enum CardRefundCurrency -{ /// - /// US Dollar (USD) + /// Postal code matches, but the street address was not verified. (deprecated) /// - Usd, + PostalCodeMatchAddressNotChecked, } -sealed class CardRefundCurrencyConverter : JsonConverter +sealed class CardFinancialVerificationCardholderAddressResultConverter + : JsonConverter { - public override CardRefundCurrency Read( + public override CardFinancialVerificationCardholderAddressResult Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -19095,14 +18451,22 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardRefundCurrency.Usd, - _ => (CardRefundCurrency)(-1), + "not_checked" => CardFinancialVerificationCardholderAddressResult.NotChecked, + "postal_code_match_address_no_match" => + CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, + "postal_code_no_match_address_match" => + CardFinancialVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, + "match" => CardFinancialVerificationCardholderAddressResult.Match, + "no_match" => CardFinancialVerificationCardholderAddressResult.NoMatch, + "postal_code_match_address_not_checked" => + CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, + _ => (CardFinancialVerificationCardholderAddressResult)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardRefundCurrency value, + CardFinancialVerificationCardholderAddressResult value, JsonSerializerOptions options ) { @@ -19110,7 +18474,15 @@ JsonSerializerOptions options writer, value switch { - CardRefundCurrency.Usd => "USD", + CardFinancialVerificationCardholderAddressResult.NotChecked => "not_checked", + CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => + "postal_code_match_address_no_match", + CardFinancialVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => + "postal_code_no_match_address_match", + CardFinancialVerificationCardholderAddressResult.Match => "match", + CardFinancialVerificationCardholderAddressResult.NoMatch => "no_match", + CardFinancialVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => + "postal_code_match_address_not_checked", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -19121,762 +18493,676 @@ JsonSerializerOptions options } /// -/// Interchange assessed as a part of this transaction. +/// Cardholder name provided in the authorization request. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Interchange : JsonModel +[JsonConverter( + typeof(JsonModelConverter< + CardFinancialVerificationCardholderName, + CardFinancialVerificationCardholderNameFromRaw + >) +)] +public sealed record class CardFinancialVerificationCardholderName : JsonModel { /// - /// The interchange amount given as a string containing a decimal number in major - /// units (so e.g., "3.14" for $3.14). The amount is a positive number if it is - /// credited to Increase (e.g., settlements) and a negative number if it is debited - /// (e.g., refunds). + /// The first name provided for verification in the authorization request. /// - public required string Amount + public required string? ProvidedFirstName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("amount"); + return this._rawData.GetNullableClass("provided_first_name"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("provided_first_name", value); } } /// - /// The card network specific interchange code. + /// The last name provided for verification in the authorization request. /// - public required string? Code + public required string? ProvidedLastName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("code"); + return this._rawData.GetNullableClass("provided_last_name"); } - init { this._rawData.Set("code", value); } + init { this._rawData.Set("provided_last_name", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. + /// The middle name provided for verification in the authorization request. /// - public required ApiEnum Currency + public required string? ProvidedMiddleName { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); + return this._rawData.GetNullableClass("provided_middle_name"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("provided_middle_name", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.Code; - this.Currency.Validate(); + _ = this.ProvidedFirstName; + _ = this.ProvidedLastName; + _ = this.ProvidedMiddleName; } - public Interchange() { } + public CardFinancialVerificationCardholderName() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public Interchange(Interchange interchange) - : base(interchange) { } + public CardFinancialVerificationCardholderName( + CardFinancialVerificationCardholderName cardFinancialVerificationCardholderName + ) + : base(cardFinancialVerificationCardholderName) { } #pragma warning restore CS8618 - public Interchange(IReadOnlyDictionary rawData) + public CardFinancialVerificationCardholderName(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - Interchange(FrozenDictionary rawData) + CardFinancialVerificationCardholderName(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static Interchange FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardFinancialVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class InterchangeFromRaw : IFromRawJson +class CardFinancialVerificationCardholderNameFromRaw + : IFromRawJson { /// - public Interchange FromRawUnchecked(IReadOnlyDictionary rawData) => - Interchange.FromRawUnchecked(rawData); + public CardFinancialVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFinancialVerificationCardholderName.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. +/// A Card Fuel Confirmation object. This field will be present in the JSON response +/// if and only if `category` is equal to `card_fuel_confirmation`. Card Fuel Confirmations +/// update the amount of a Card Authorization after a fuel pump transaction is completed. /// -[JsonConverter(typeof(InterchangeCurrencyConverter))] -public enum InterchangeCurrency +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardFuelConfirmation : JsonModel { /// - /// US Dollar (USD) + /// The Card Fuel Confirmation identifier. /// - Usd, -} - -sealed class InterchangeCurrencyConverter : JsonConverter -{ - public override InterchangeCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string ID { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "USD" => InterchangeCurrency.Usd, - _ => (InterchangeCurrency)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - InterchangeCurrency value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - InterchangeCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("id"); + } + init { this._rawData.Set("id", value); } } -} -/// -/// Network-specific identifiers for this refund. -/// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardRefundNetworkIdentifiers : JsonModel -{ /// - /// A network assigned business ID that identifies the acquirer that processed - /// this transaction. + /// The identifier for the Card Authorization this updates. /// - public required string AcquirerBusinessID + public required string CardAuthorizationID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("acquirer_business_id"); + return this._rawData.GetNotNullClass("card_authorization_id"); } - init { this._rawData.Set("acquirer_business_id", value); } + init { this._rawData.Set("card_authorization_id", value); } } /// - /// A globally unique identifier for this settlement. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. /// - public required string AcquirerReferenceNumber + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("acquirer_reference_number"); - } - init { this._rawData.Set("acquirer_reference_number", value); } - } - - /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. - /// - public required string? AuthorizationIdentificationResponse - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); - } - init { this._rawData.Set("authorization_identification_response", value); } - } - - /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. - /// - public required string? TransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); - } - init { this._rawData.Set("transaction_id", value); } - } - - /// - public override void Validate() - { - _ = this.AcquirerBusinessID; - _ = this.AcquirerReferenceNumber; - _ = this.AuthorizationIdentificationResponse; - _ = this.TransactionID; - } - - public CardRefundNetworkIdentifiers() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardRefundNetworkIdentifiers(CardRefundNetworkIdentifiers cardRefundNetworkIdentifiers) - : base(cardRefundNetworkIdentifiers) { } -#pragma warning restore CS8618 - - public CardRefundNetworkIdentifiers(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardRefundNetworkIdentifiers(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardRefundNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardRefundNetworkIdentifiersFromRaw : IFromRawJson -{ - /// - public CardRefundNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardRefundNetworkIdentifiers.FromRawUnchecked(rawData); -} - -/// -/// Additional details about the card purchase, such as tax and industry-specific fields. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class PurchaseDetails : JsonModel -{ - /// - /// Fields specific to car rentals. - /// - public required CarRental? CarRental - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("car_rental"); - } - init { this._rawData.Set("car_rental", value); } - } - - /// - /// An identifier from the merchant for the customer or consumer. - /// - public required string? CustomerReferenceIdentifier - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("customer_reference_identifier"); - } - init { this._rawData.Set("customer_reference_identifier", value); } - } - - /// - /// The state or provincial tax amount in minor units. - /// - public required long? LocalTaxAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("local_tax_amount"); + return this._rawData.GetNotNullClass>( + "currency" + ); } - init { this._rawData.Set("local_tax_amount", value); } + init { this._rawData.Set("currency", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local - /// tax assessed. + /// The card network used to process this card authorization. /// - public required string? LocalTaxCurrency + public required ApiEnum Network { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("local_tax_currency"); + return this._rawData.GetNotNullClass>( + "network" + ); } - init { this._rawData.Set("local_tax_currency", value); } + init { this._rawData.Set("network", value); } } /// - /// Fields specific to lodging. + /// Network-specific identifiers for a specific request or transaction. /// - public required Lodging? Lodging + public required CardFuelConfirmationNetworkIdentifiers NetworkIdentifiers { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("lodging"); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); } - init { this._rawData.Set("lodging", value); } + init { this._rawData.Set("network_identifiers", value); } } /// - /// The national tax amount in minor units. + /// The identifier of the Pending Transaction associated with this Card Fuel Confirmation. /// - public required long? NationalTaxAmount + public required string? PendingTransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("national_tax_amount"); + return this._rawData.GetNullableClass("pending_transaction_id"); } - init { this._rawData.Set("national_tax_amount", value); } + init { this._rawData.Set("pending_transaction_id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local - /// tax assessed. + /// The scheme fees associated with this card fuel confirmation. /// - public required string? NationalTaxCurrency + public required IReadOnlyList SchemeFees { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("national_tax_currency"); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); } - init { this._rawData.Set("national_tax_currency", value); } - } - - /// - /// An identifier from the merchant for the purchase to the issuer and cardholder. - /// - public required string? PurchaseIdentifier - { - get + init { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("purchase_identifier"); + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); } - init { this._rawData.Set("purchase_identifier", value); } } /// - /// The format of the purchase identifier. + /// A constant representing the object's type. For this resource it will always + /// be `card_fuel_confirmation`. /// - public required ApiEnum? PurchaseIdentifierFormat + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "purchase_identifier_format" - ); + return this._rawData.GetNotNullClass>("type"); } - init { this._rawData.Set("purchase_identifier_format", value); } + init { this._rawData.Set("type", value); } } /// - /// Fields specific to travel. + /// The updated authorization amount after this fuel confirmation, in the minor + /// unit of the transaction's currency. For dollars, for example, this is cents. /// - public required Travel? Travel + public required long UpdatedAuthorizationAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel"); + return this._rawData.GetNotNullStruct("updated_authorization_amount"); } - init { this._rawData.Set("travel", value); } + init { this._rawData.Set("updated_authorization_amount", value); } } /// public override void Validate() { - this.CarRental?.Validate(); - _ = this.CustomerReferenceIdentifier; - _ = this.LocalTaxAmount; - _ = this.LocalTaxCurrency; - this.Lodging?.Validate(); - _ = this.NationalTaxAmount; - _ = this.NationalTaxCurrency; - _ = this.PurchaseIdentifier; - this.PurchaseIdentifierFormat?.Validate(); - this.Travel?.Validate(); + _ = this.ID; + _ = this.CardAuthorizationID; + this.Currency.Validate(); + this.Network.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.PendingTransactionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + this.Type.Validate(); + _ = this.UpdatedAuthorizationAmount; } - public PurchaseDetails() { } + public CardFuelConfirmation() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public PurchaseDetails(PurchaseDetails purchaseDetails) - : base(purchaseDetails) { } + public CardFuelConfirmation(CardFuelConfirmation cardFuelConfirmation) + : base(cardFuelConfirmation) { } #pragma warning restore CS8618 - public PurchaseDetails(IReadOnlyDictionary rawData) + public CardFuelConfirmation(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - PurchaseDetails(FrozenDictionary rawData) + CardFuelConfirmation(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static PurchaseDetails FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardFuelConfirmation FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class PurchaseDetailsFromRaw : IFromRawJson +class CardFuelConfirmationFromRaw : IFromRawJson { /// - public PurchaseDetails FromRawUnchecked(IReadOnlyDictionary rawData) => - PurchaseDetails.FromRawUnchecked(rawData); + public CardFuelConfirmation FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFuelConfirmation.FromRawUnchecked(rawData); } /// -/// Fields specific to car rentals. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CarRental : JsonModel +[JsonConverter(typeof(CardFuelConfirmationCurrencyConverter))] +public enum CardFuelConfirmationCurrency { /// - /// Code indicating the vehicle's class. + /// US Dollar (USD) /// - public required string? CarClassCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("car_class_code"); - } - init { this._rawData.Set("car_class_code", value); } - } + Usd, +} - /// - /// Date the customer picked up the car or, in the case of a no-show or pre-pay - /// transaction, the scheduled pick up date. - /// - public required string? CheckoutDate +sealed class CardFuelConfirmationCurrencyConverter : JsonConverter +{ + public override CardFuelConfirmationCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("checkout_date"); - } - init { this._rawData.Set("checkout_date", value); } + "USD" => CardFuelConfirmationCurrency.Usd, + _ => (CardFuelConfirmationCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardFuelConfirmationCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardFuelConfirmationCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} + +/// +/// The card network used to process this card authorization. +/// +[JsonConverter(typeof(CardFuelConfirmationNetworkConverter))] +public enum CardFuelConfirmationNetwork +{ + /// + /// Visa + /// + Visa, /// - /// Daily rate being charged for the vehicle. + /// Pulse /// - public required long? DailyRentalRateAmount + Pulse, +} + +sealed class CardFuelConfirmationNetworkConverter : JsonConverter +{ + public override CardFuelConfirmationNetwork Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("daily_rental_rate_amount"); - } - init { this._rawData.Set("daily_rental_rate_amount", value); } + "visa" => CardFuelConfirmationNetwork.Visa, + "pulse" => CardFuelConfirmationNetwork.Pulse, + _ => (CardFuelConfirmationNetwork)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardFuelConfirmationNetwork value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardFuelConfirmationNetwork.Visa => "visa", + CardFuelConfirmationNetwork.Pulse => "pulse", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Network-specific identifiers for a specific request or transaction. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardFuelConfirmationNetworkIdentifiers, + CardFuelConfirmationNetworkIdentifiersFromRaw + >) +)] +public sealed record class CardFuelConfirmationNetworkIdentifiers : JsonModel +{ /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily - /// rental rate. + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. /// - public required string? DailyRentalRateCurrency + public required string? AuthorizationIdentificationResponse { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("daily_rental_rate_currency"); + return this._rawData.GetNullableClass("authorization_identification_response"); } - init { this._rawData.Set("daily_rental_rate_currency", value); } + init { this._rawData.Set("authorization_identification_response", value); } } /// - /// Number of days the vehicle was rented. + /// A life-cycle identifier used across e.g., an authorization and a reversal. + /// Expected to be unique per acquirer within a window of time. For some card + /// networks the retrieval reference number includes the trace counter. /// - public required long? DaysRented + public required string? RetrievalReferenceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("days_rented"); + return this._rawData.GetNullableClass("retrieval_reference_number"); } - init { this._rawData.Set("days_rented", value); } + init { this._rawData.Set("retrieval_reference_number", value); } } /// - /// Additional charges (gas, late fee, etc.) being billed. + /// A counter used to verify an individual authorization. Expected to be unique + /// per acquirer within a window of time. /// - public required ApiEnum? ExtraCharges + public required string? TraceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>("extra_charges"); + return this._rawData.GetNullableClass("trace_number"); } - init { this._rawData.Set("extra_charges", value); } + init { this._rawData.Set("trace_number", value); } } /// - /// Fuel charges for the vehicle. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - public required long? FuelChargesAmount + public required string? TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("fuel_charges_amount"); + return this._rawData.GetNullableClass("transaction_id"); } - init { this._rawData.Set("fuel_charges_amount", value); } + init { this._rawData.Set("transaction_id", value); } + } + + /// + public override void Validate() + { + _ = this.AuthorizationIdentificationResponse; + _ = this.RetrievalReferenceNumber; + _ = this.TraceNumber; + _ = this.TransactionID; + } + + public CardFuelConfirmationNetworkIdentifiers() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardFuelConfirmationNetworkIdentifiers( + CardFuelConfirmationNetworkIdentifiers cardFuelConfirmationNetworkIdentifiers + ) + : base(cardFuelConfirmationNetworkIdentifiers) { } +#pragma warning restore CS8618 + + public CardFuelConfirmationNetworkIdentifiers(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardFuelConfirmationNetworkIdentifiers(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardFuelConfirmationNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardFuelConfirmationNetworkIdentifiersFromRaw + : IFromRawJson +{ + /// + public CardFuelConfirmationNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFuelConfirmationNetworkIdentifiers.FromRawUnchecked(rawData); +} +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardFuelConfirmationSchemeFee : JsonModel +{ /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fuel charges assessed. + /// The fee amount given as a string containing a decimal number. /// - public required string? FuelChargesCurrency + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("fuel_charges_currency"); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("fuel_charges_currency", value); } + init { this._rawData.Set("amount", value); } } /// - /// Any insurance being charged for the vehicle. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required long? InsuranceChargesAmount + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("insurance_charges_amount"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("insurance_charges_amount", value); } + init { this._rawData.Set("created_at", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the insurance - /// charges assessed. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required string? InsuranceChargesCurrency + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("insurance_charges_currency"); + return this._rawData.GetNotNullClass< + ApiEnum + >("currency"); } - init { this._rawData.Set("insurance_charges_currency", value); } + init { this._rawData.Set("currency", value); } } /// - /// An indicator that the cardholder is being billed for a reserved vehicle that - /// was not actually rented (that is, a "no-show" charge). + /// The type of fee being assessed. /// - public required ApiEnum? NoShowIndicator + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "no_show_indicator" - ); + return this._rawData.GetNotNullClass< + ApiEnum + >("fee_type"); } - init { this._rawData.Set("no_show_indicator", value); } + init { this._rawData.Set("fee_type", value); } } /// - /// Charges for returning the vehicle at a different location than where it was - /// picked up. + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required long? OneWayDropOffChargesAmount + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("one_way_drop_off_charges_amount"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("one_way_drop_off_charges_amount", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the one-way - /// drop-off charges assessed. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required string? OneWayDropOffChargesCurrency + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("one_way_drop_off_charges_currency"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("one_way_drop_off_charges_currency", value); } - } - - /// - /// Name of the person renting the vehicle. - /// - public required string? RenterName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("renter_name"); - } - init { this._rawData.Set("renter_name", value); } - } - - /// - /// Weekly rate being charged for the vehicle. - /// - public required long? WeeklyRentalRateAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("weekly_rental_rate_amount"); - } - init { this._rawData.Set("weekly_rental_rate_amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the weekly - /// rental rate. - /// - public required string? WeeklyRentalRateCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("weekly_rental_rate_currency"); - } - init { this._rawData.Set("weekly_rental_rate_currency", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - _ = this.CarClassCode; - _ = this.CheckoutDate; - _ = this.DailyRentalRateAmount; - _ = this.DailyRentalRateCurrency; - _ = this.DaysRented; - this.ExtraCharges?.Validate(); - _ = this.FuelChargesAmount; - _ = this.FuelChargesCurrency; - _ = this.InsuranceChargesAmount; - _ = this.InsuranceChargesCurrency; - this.NoShowIndicator?.Validate(); - _ = this.OneWayDropOffChargesAmount; - _ = this.OneWayDropOffChargesCurrency; - _ = this.RenterName; - _ = this.WeeklyRentalRateAmount; - _ = this.WeeklyRentalRateCurrency; + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CarRental() { } + public CardFuelConfirmationSchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CarRental(CarRental carRental) - : base(carRental) { } + public CardFuelConfirmationSchemeFee( + CardFuelConfirmationSchemeFee cardFuelConfirmationSchemeFee + ) + : base(cardFuelConfirmationSchemeFee) { } #pragma warning restore CS8618 - public CarRental(IReadOnlyDictionary rawData) + public CardFuelConfirmationSchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CarRental(FrozenDictionary rawData) + CardFuelConfirmationSchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CarRental FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardFuelConfirmationSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CarRentalFromRaw : IFromRawJson +class CardFuelConfirmationSchemeFeeFromRaw : IFromRawJson { /// - public CarRental FromRawUnchecked(IReadOnlyDictionary rawData) => - CarRental.FromRawUnchecked(rawData); + public CardFuelConfirmationSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardFuelConfirmationSchemeFee.FromRawUnchecked(rawData); } /// -/// Additional charges (gas, late fee, etc.) being billed. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(ExtraChargesConverter))] -public enum ExtraCharges +[JsonConverter(typeof(CardFuelConfirmationSchemeFeeCurrencyConverter))] +public enum CardFuelConfirmationSchemeFeeCurrency { /// - /// No extra charge - /// - NoExtraCharge, - - /// - /// Gas - /// - Gas, - - /// - /// Extra mileage - /// - ExtraMileage, - - /// - /// Late return - /// - LateReturn, - - /// - /// One way service fee - /// - OneWayServiceFee, - - /// - /// Parking violation + /// US Dollar (USD) /// - ParkingViolation, + Usd, } -sealed class ExtraChargesConverter : JsonConverter +sealed class CardFuelConfirmationSchemeFeeCurrencyConverter + : JsonConverter { - public override ExtraCharges Read( + public override CardFuelConfirmationSchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -19884,19 +19170,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "no_extra_charge" => ExtraCharges.NoExtraCharge, - "gas" => ExtraCharges.Gas, - "extra_mileage" => ExtraCharges.ExtraMileage, - "late_return" => ExtraCharges.LateReturn, - "one_way_service_fee" => ExtraCharges.OneWayServiceFee, - "parking_violation" => ExtraCharges.ParkingViolation, - _ => (ExtraCharges)(-1), + "USD" => CardFuelConfirmationSchemeFeeCurrency.Usd, + _ => (CardFuelConfirmationSchemeFeeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - ExtraCharges value, + CardFuelConfirmationSchemeFeeCurrency value, JsonSerializerOptions options ) { @@ -19904,12 +19185,7 @@ JsonSerializerOptions options writer, value switch { - ExtraCharges.NoExtraCharge => "no_extra_charge", - ExtraCharges.Gas => "gas", - ExtraCharges.ExtraMileage => "extra_mileage", - ExtraCharges.LateReturn => "late_return", - ExtraCharges.OneWayServiceFee => "one_way_service_fee", - ExtraCharges.ParkingViolation => "parking_violation", + CardFuelConfirmationSchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -19920,450 +19196,198 @@ JsonSerializerOptions options } /// -/// An indicator that the cardholder is being billed for a reserved vehicle that was -/// not actually rented (that is, a "no-show" charge). +/// The type of fee being assessed. /// -[JsonConverter(typeof(NoShowIndicatorConverter))] -public enum NoShowIndicator +[JsonConverter(typeof(CardFuelConfirmationSchemeFeeFeeTypeConverter))] +public enum CardFuelConfirmationSchemeFeeFeeType { /// - /// Not applicable + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - NotApplicable, + VisaInternationalServiceAssessmentSingleCurrency, /// - /// No show for specialized vehicle + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - NoShowForSpecializedVehicle, -} - -sealed class NoShowIndicatorConverter : JsonConverter -{ - public override NoShowIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_applicable" => NoShowIndicator.NotApplicable, - "no_show_for_specialized_vehicle" => NoShowIndicator.NoShowForSpecializedVehicle, - _ => (NoShowIndicator)(-1), - }; - } + VisaInternationalServiceAssessmentCrossCurrency, - public override void Write( - Utf8JsonWriter writer, - NoShowIndicator value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - NoShowIndicator.NotApplicable => "not_applicable", - NoShowIndicator.NoShowForSpecializedVehicle => "no_show_for_specialized_vehicle", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, -/// -/// Fields specific to lodging. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Lodging : JsonModel -{ /// - /// Date the customer checked in. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string? CheckInDate - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("check_in_date"); - } - init { this._rawData.Set("check_in_date", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// Daily rate being charged for the room. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required long? DailyRoomRateAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("daily_room_rate_amount"); - } - init { this._rawData.Set("daily_room_rate_amount", value); } - } + VisaAuthorizationCanadaPointOfSale, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily - /// room rate. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. /// - public required string? DailyRoomRateCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("daily_room_rate_currency"); - } - init { this._rawData.Set("daily_room_rate_currency", value); } - } + VisaAuthorizationReversalPointOfSale, /// - /// Additional charges (phone, late check-out, etc.) being billed. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. /// - public required ApiEnum? ExtraCharges - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "extra_charges" - ); - } - init { this._rawData.Set("extra_charges", value); } - } + VisaAuthorizationReversalInternationalPointOfSale, /// - /// Folio cash advances for the room. + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. /// - public required long? FolioCashAdvancesAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("folio_cash_advances_amount"); - } - init { this._rawData.Set("folio_cash_advances_amount", value); } - } + VisaAuthorizationAddressVerificationService, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the folio - /// cash advances. + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). /// - public required string? FolioCashAdvancesCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("folio_cash_advances_currency"); - } - init { this._rawData.Set("folio_cash_advances_currency", value); } - } + VisaAdvancedAuthorization, /// - /// Food and beverage charges for the room. + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. /// - public required long? FoodBeverageChargesAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("food_beverage_charges_amount"); - } - init { this._rawData.Set("food_beverage_charges_amount", value); } - } + VisaMessageTransmission, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the food and - /// beverage charges. + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. /// - public required string? FoodBeverageChargesCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("food_beverage_charges_currency"); - } - init { this._rawData.Set("food_beverage_charges_currency", value); } - } + VisaAccountVerificationDomestic, /// - /// Indicator that the cardholder is being billed for a reserved room that was - /// not actually used. + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. /// - public required ApiEnum? NoShowIndicator - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "no_show_indicator" - ); - } - init { this._rawData.Set("no_show_indicator", value); } - } + VisaAccountVerificationInternational, /// - /// Prepaid expenses being charged for the room. + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. /// - public required long? PrepaidExpensesAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("prepaid_expenses_amount"); - } - init { this._rawData.Set("prepaid_expenses_amount", value); } - } + VisaAccountVerificationCanada, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the prepaid expenses. + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. /// - public required string? PrepaidExpensesCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("prepaid_expenses_currency"); - } - init { this._rawData.Set("prepaid_expenses_currency", value); } - } + VisaCorporateAcceptanceFee, /// - /// Number of nights the room was rented. + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. /// - public required long? RoomNights - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("room_nights"); - } - init { this._rawData.Set("room_nights", value); } - } + VisaConsumerDebitAcceptanceFee, /// - /// Total room tax being charged. + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. /// - public required long? TotalRoomTaxAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("total_room_tax_amount"); - } - init { this._rawData.Set("total_room_tax_amount", value); } - } + VisaBusinessDebitAcceptanceFee, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total - /// room tax. + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. /// - public required string? TotalRoomTaxCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("total_room_tax_currency"); - } - init { this._rawData.Set("total_room_tax_currency", value); } - } + VisaPurchasingAcceptanceFee, /// - /// Total tax being charged for the room. + /// Activity and fees for the processing of a sales draft original for a purchase transaction. /// - public required long? TotalTaxAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("total_tax_amount"); - } - init { this._rawData.Set("total_tax_amount", value); } - } + VisaPurchaseDomestic, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total - /// tax assessed. + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. /// - public required string? TotalTaxCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("total_tax_currency"); - } - init { this._rawData.Set("total_tax_currency", value); } - } - - /// - public override void Validate() - { - _ = this.CheckInDate; - _ = this.DailyRoomRateAmount; - _ = this.DailyRoomRateCurrency; - this.ExtraCharges?.Validate(); - _ = this.FolioCashAdvancesAmount; - _ = this.FolioCashAdvancesCurrency; - _ = this.FoodBeverageChargesAmount; - _ = this.FoodBeverageChargesCurrency; - this.NoShowIndicator?.Validate(); - _ = this.PrepaidExpensesAmount; - _ = this.PrepaidExpensesCurrency; - _ = this.RoomNights; - _ = this.TotalRoomTaxAmount; - _ = this.TotalRoomTaxCurrency; - _ = this.TotalTaxAmount; - _ = this.TotalTaxCurrency; - } - - public Lodging() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Lodging(Lodging lodging) - : base(lodging) { } -#pragma warning restore CS8618 - - public Lodging(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Lodging(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static Lodging FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class LodgingFromRaw : IFromRawJson -{ - /// - public Lodging FromRawUnchecked(IReadOnlyDictionary rawData) => - Lodging.FromRawUnchecked(rawData); -} + VisaPurchaseInternational, -/// -/// Additional charges (phone, late check-out, etc.) being billed. -/// -[JsonConverter(typeof(LodgingExtraChargesConverter))] -public enum LodgingExtraCharges -{ /// - /// No extra charge + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - NoExtraCharge, + VisaCreditPurchaseToken, /// - /// Restaurant + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - Restaurant, + VisaDebitPurchaseToken, /// - /// Gift shop + /// A per transaction fee assessed for Base II financial draft - Issuer. /// - GiftShop, + VisaClearingTransmission, /// - /// Mini bar + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. /// - MiniBar, + VisaDirectAuthorization, /// - /// Telephone + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. /// - Telephone, + VisaDirectTransactionDomestic, /// - /// Other + /// Issuer card service fee for Commercial Credit cards. /// - Other, + VisaServiceCommercialCredit, /// - /// Laundry + /// Issuer Advertising Service Fee for Commercial Credit cards. /// - Laundry, -} - -sealed class LodgingExtraChargesConverter : JsonConverter -{ - public override LodgingExtraCharges Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "no_extra_charge" => LodgingExtraCharges.NoExtraCharge, - "restaurant" => LodgingExtraCharges.Restaurant, - "gift_shop" => LodgingExtraCharges.GiftShop, - "mini_bar" => LodgingExtraCharges.MiniBar, - "telephone" => LodgingExtraCharges.Telephone, - "other" => LodgingExtraCharges.Other, - "laundry" => LodgingExtraCharges.Laundry, - _ => (LodgingExtraCharges)(-1), - }; - } + VisaAdvertisingServiceCommercialCredit, - public override void Write( - Utf8JsonWriter writer, - LodgingExtraCharges value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - LodgingExtraCharges.NoExtraCharge => "no_extra_charge", - LodgingExtraCharges.Restaurant => "restaurant", - LodgingExtraCharges.GiftShop => "gift_shop", - LodgingExtraCharges.MiniBar => "mini_bar", - LodgingExtraCharges.Telephone => "telephone", - LodgingExtraCharges.Other => "other", - LodgingExtraCharges.Laundry => "laundry", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, -/// -/// Indicator that the cardholder is being billed for a reserved room that was not -/// actually used. -/// -[JsonConverter(typeof(LodgingNoShowIndicatorConverter))] -public enum LodgingNoShowIndicator -{ /// - /// Not applicable + /// Issuer Processing Guarantee for Commercial Credit cards. /// - NotApplicable, + VisaProcessingGuaranteeCommercialCredit, /// - /// No show + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. /// - NoShow, + PulseSwitchFee, } -sealed class LodgingNoShowIndicatorConverter : JsonConverter +sealed class CardFuelConfirmationSchemeFeeFeeTypeConverter + : JsonConverter { - public override LodgingNoShowIndicator Read( + public override CardFuelConfirmationSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -20371,15 +19395,69 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_applicable" => LodgingNoShowIndicator.NotApplicable, - "no_show" => LodgingNoShowIndicator.NoShow, - _ => (LodgingNoShowIndicator)(-1), + "visa_international_service_assessment_single_currency" => + CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardFuelConfirmationSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => + CardFuelConfirmationSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardFuelConfirmationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardFuelConfirmationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardFuelConfirmationSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => + CardFuelConfirmationSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => + CardFuelConfirmationSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => + CardFuelConfirmationSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => + CardFuelConfirmationSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardFuelConfirmationSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardFuelConfirmationSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardFuelConfirmationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardFuelConfirmationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardFuelConfirmationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardFuelConfirmationSchemeFeeFeeType.PulseSwitchFee, + _ => (CardFuelConfirmationSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - LodgingNoShowIndicator value, + CardFuelConfirmationSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -20387,8 +19465,63 @@ JsonSerializerOptions options writer, value switch { - LodgingNoShowIndicator.NotApplicable => "not_applicable", - LodgingNoShowIndicator.NoShow => "no_show", + CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardFuelConfirmationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardFuelConfirmationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardFuelConfirmationSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardFuelConfirmationSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardFuelConfirmationSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardFuelConfirmationSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardFuelConfirmationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardFuelConfirmationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardFuelConfirmationSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseDomestic => + "visa_purchase_domestic", + CardFuelConfirmationSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardFuelConfirmationSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardFuelConfirmationSchemeFeeFeeType.VisaDebitPurchaseToken => + "visa_debit_purchase_token", + CardFuelConfirmationSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardFuelConfirmationSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardFuelConfirmationSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardFuelConfirmationSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardFuelConfirmationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardFuelConfirmationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardFuelConfirmationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardFuelConfirmationSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -20399,40 +19532,17 @@ JsonSerializerOptions options } /// -/// The format of the purchase identifier. +/// A constant representing the object's type. For this resource it will always be `card_fuel_confirmation`. /// -[JsonConverter(typeof(PurchaseIdentifierFormatConverter))] -public enum PurchaseIdentifierFormat +[JsonConverter(typeof(CardFuelConfirmationTypeConverter))] +public enum CardFuelConfirmationType { - /// - /// Free text - /// - FreeText, - - /// - /// Order number - /// - OrderNumber, - - /// - /// Rental agreement number - /// - RentalAgreementNumber, - - /// - /// Hotel folio number - /// - HotelFolioNumber, - - /// - /// Invoice number - /// - InvoiceNumber, + CardFuelConfirmation, } -sealed class PurchaseIdentifierFormatConverter : JsonConverter +sealed class CardFuelConfirmationTypeConverter : JsonConverter { - public override PurchaseIdentifierFormat Read( + public override CardFuelConfirmationType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -20440,18 +19550,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "free_text" => PurchaseIdentifierFormat.FreeText, - "order_number" => PurchaseIdentifierFormat.OrderNumber, - "rental_agreement_number" => PurchaseIdentifierFormat.RentalAgreementNumber, - "hotel_folio_number" => PurchaseIdentifierFormat.HotelFolioNumber, - "invoice_number" => PurchaseIdentifierFormat.InvoiceNumber, - _ => (PurchaseIdentifierFormat)(-1), + "card_fuel_confirmation" => CardFuelConfirmationType.CardFuelConfirmation, + _ => (CardFuelConfirmationType)(-1), }; } public override void Write( Utf8JsonWriter writer, - PurchaseIdentifierFormat value, + CardFuelConfirmationType value, JsonSerializerOptions options ) { @@ -20459,11 +19565,7 @@ JsonSerializerOptions options writer, value switch { - PurchaseIdentifierFormat.FreeText => "free_text", - PurchaseIdentifierFormat.OrderNumber => "order_number", - PurchaseIdentifierFormat.RentalAgreementNumber => "rental_agreement_number", - PurchaseIdentifierFormat.HotelFolioNumber => "hotel_folio_number", - PurchaseIdentifierFormat.InvoiceNumber => "invoice_number", + CardFuelConfirmationType.CardFuelConfirmation => "card_fuel_confirmation", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -20474,393 +19576,331 @@ JsonSerializerOptions options } /// -/// Fields specific to travel. +/// A Card Increment object. This field will be present in the JSON response if and +/// only if `category` is equal to `card_increment`. Card Increments increase the +/// pending amount of an authorized transaction. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Travel : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardIncrement : JsonModel { /// - /// Ancillary purchases in addition to the airfare. + /// The Card Increment identifier. /// - public required Ancillary? Ancillary + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("ancillary"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("ancillary", value); } + init { this._rawData.Set("id", value); } } /// - /// Indicates the computerized reservation system used to book the ticket. + /// Whether this authorization was approved by Increase, the card network through + /// stand-in processing, or the user through a real-time decision. /// - public required string? ComputerizedReservationSystem + public required ApiEnum Actioner { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("computerized_reservation_system"); + return this._rawData.GetNotNullClass>( + "actioner" + ); } - init { this._rawData.Set("computerized_reservation_system", value); } + init { this._rawData.Set("actioner", value); } } /// - /// Indicates the reason for a credit to the cardholder. + /// Additional amounts associated with the card authorization, such as ATM surcharges + /// fees. These are usually a subset of the `amount` field and are used to provide + /// more detailed information about the transaction. /// - public required ApiEnum? CreditReasonIndicator + public required CardIncrementAdditionalAmounts AdditionalAmounts { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "credit_reason_indicator" + return this._rawData.GetNotNullClass( + "additional_amounts" ); } - init { this._rawData.Set("credit_reason_indicator", value); } + init { this._rawData.Set("additional_amounts", value); } } /// - /// Date of departure. + /// The amount of this increment in the minor unit of the transaction's currency. + /// For dollars, for example, this is cents. /// - public required string? DepartureDate + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("departure_date"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("departure_date", value); } + init { this._rawData.Set("amount", value); } } /// - /// Code for the originating city or airport. + /// The identifier for the Card Authorization this increments. /// - public required string? OriginationCityAirportCode + public required string CardAuthorizationID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("origination_city_airport_code"); + return this._rawData.GetNotNullClass("card_authorization_id"); } - init { this._rawData.Set("origination_city_airport_code", value); } + init { this._rawData.Set("card_authorization_id", value); } } /// - /// Name of the passenger. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. /// - public required string? PassengerName + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("passenger_name"); + return this._rawData.GetNotNullClass>( + "currency" + ); } - init { this._rawData.Set("passenger_name", value); } + init { this._rawData.Set("currency", value); } } /// - /// Indicates whether this ticket is non-refundable. + /// The card network used to process this card authorization. /// - public required ApiEnum? RestrictedTicketIndicator + public required ApiEnum Network { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "restricted_ticket_indicator" - ); + return this._rawData.GetNotNullClass>("network"); } - init { this._rawData.Set("restricted_ticket_indicator", value); } + init { this._rawData.Set("network", value); } } /// - /// Indicates why a ticket was changed. + /// Network-specific identifiers for a specific request or transaction. /// - public required ApiEnum? TicketChangeIndicator + public required CardIncrementNetworkIdentifiers NetworkIdentifiers { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "ticket_change_indicator" + return this._rawData.GetNotNullClass( + "network_identifiers" ); } - init { this._rawData.Set("ticket_change_indicator", value); } + init { this._rawData.Set("network_identifiers", value); } } /// - /// Ticket number. + /// The risk score generated by the card network. For Visa this is the Visa Advanced + /// Authorization risk score, from 0 to 99, where 99 is the riskiest. /// - public required string? TicketNumber + public required long? NetworkRiskScore { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("ticket_number"); + return this._rawData.GetNullableStruct("network_risk_score"); } - init { this._rawData.Set("ticket_number", value); } + init { this._rawData.Set("network_risk_score", value); } } /// - /// Code for the travel agency if the ticket was issued by a travel agency. + /// The identifier of the Pending Transaction associated with this Card Increment. /// - public required string? TravelAgencyCode + public required string? PendingTransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel_agency_code"); + return this._rawData.GetNullableClass("pending_transaction_id"); } - init { this._rawData.Set("travel_agency_code", value); } + init { this._rawData.Set("pending_transaction_id", value); } } /// - /// Name of the travel agency if the ticket was issued by a travel agency. + /// The amount of this increment in the minor unit of the transaction's presentment currency. /// - public required string? TravelAgencyName + public required long PresentmentAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel_agency_name"); + return this._rawData.GetNotNullStruct("presentment_amount"); } - init { this._rawData.Set("travel_agency_name", value); } + init { this._rawData.Set("presentment_amount", value); } } /// - /// Fields specific to each leg of the journey. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// presentment currency. /// - public required IReadOnlyList? TripLegs + public required string PresentmentCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct>("trip_legs"); - } - init - { - this._rawData.Set?>( - "trip_legs", - value == null ? null : ImmutableArray.ToImmutableArray(value) - ); - } - } - - /// - public override void Validate() - { - this.Ancillary?.Validate(); - _ = this.ComputerizedReservationSystem; - this.CreditReasonIndicator?.Validate(); - _ = this.DepartureDate; - _ = this.OriginationCityAirportCode; - _ = this.PassengerName; - this.RestrictedTicketIndicator?.Validate(); - this.TicketChangeIndicator?.Validate(); - _ = this.TicketNumber; - _ = this.TravelAgencyCode; - _ = this.TravelAgencyName; - foreach (var item in this.TripLegs ?? []) - { - item.Validate(); + return this._rawData.GetNotNullClass("presentment_currency"); } + init { this._rawData.Set("presentment_currency", value); } } - public Travel() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Travel(Travel travel) - : base(travel) { } -#pragma warning restore CS8618 - - public Travel(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Travel(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static Travel FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class TravelFromRaw : IFromRawJson -{ - /// - public Travel FromRawUnchecked(IReadOnlyDictionary rawData) => - Travel.FromRawUnchecked(rawData); -} - -/// -/// Ancillary purchases in addition to the airfare. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Ancillary : JsonModel -{ /// - /// If this purchase has a connection or relationship to another purchase, such - /// as a baggage fee for a passenger transport ticket, this field should contain - /// the ticket document number for the other purchase. + /// The identifier of the Real-Time Decision sent to approve or decline this + /// incremental authorization. /// - public required string? ConnectedTicketDocumentNumber + public required string? RealTimeDecisionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("connected_ticket_document_number"); + return this._rawData.GetNullableClass("real_time_decision_id"); } - init { this._rawData.Set("connected_ticket_document_number", value); } + init { this._rawData.Set("real_time_decision_id", value); } } /// - /// Indicates the reason for a credit to the cardholder. + /// The scheme fees associated with this card increment. /// - public required ApiEnum? CreditReasonIndicator + public required IReadOnlyList SchemeFees { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "credit_reason_indicator" + return this._rawData.GetNotNullStruct>( + "scheme_fees" ); } - init { this._rawData.Set("credit_reason_indicator", value); } - } - - /// - /// Name of the passenger or description of the ancillary purchase. - /// - public required string? PassengerNameOrDescription - { - get + init { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("passenger_name_or_description"); + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); } - init { this._rawData.Set("passenger_name_or_description", value); } } /// - /// Additional travel charges, such as baggage fees. + /// A constant representing the object's type. For this resource it will always + /// be `card_increment`. /// - public required IReadOnlyList Services + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct>("services"); - } - init - { - this._rawData.Set>( - "services", - ImmutableArray.ToImmutableArray(value) - ); + return this._rawData.GetNotNullClass>("type"); } + init { this._rawData.Set("type", value); } } /// - /// Ticket document number. + /// The updated authorization amount after this increment, in the minor unit of + /// the transaction's currency. For dollars, for example, this is cents. /// - public required string? TicketDocumentNumber + public required long UpdatedAuthorizationAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("ticket_document_number"); + return this._rawData.GetNotNullStruct("updated_authorization_amount"); } - init { this._rawData.Set("ticket_document_number", value); } + init { this._rawData.Set("updated_authorization_amount", value); } } /// public override void Validate() { - _ = this.ConnectedTicketDocumentNumber; - this.CreditReasonIndicator?.Validate(); - _ = this.PassengerNameOrDescription; - foreach (var item in this.Services) + _ = this.ID; + this.Actioner.Validate(); + this.AdditionalAmounts.Validate(); + _ = this.Amount; + _ = this.CardAuthorizationID; + this.Currency.Validate(); + this.Network.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.NetworkRiskScore; + _ = this.PendingTransactionID; + _ = this.PresentmentAmount; + _ = this.PresentmentCurrency; + _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) { item.Validate(); } - _ = this.TicketDocumentNumber; + this.Type.Validate(); + _ = this.UpdatedAuthorizationAmount; } - public Ancillary() { } + public CardIncrement() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public Ancillary(Ancillary ancillary) - : base(ancillary) { } + public CardIncrement(CardIncrement cardIncrement) + : base(cardIncrement) { } #pragma warning restore CS8618 - public Ancillary(IReadOnlyDictionary rawData) + public CardIncrement(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - Ancillary(FrozenDictionary rawData) + CardIncrement(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static Ancillary FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardIncrement FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class AncillaryFromRaw : IFromRawJson +class CardIncrementFromRaw : IFromRawJson { /// - public Ancillary FromRawUnchecked(IReadOnlyDictionary rawData) => - Ancillary.FromRawUnchecked(rawData); + public CardIncrement FromRawUnchecked(IReadOnlyDictionary rawData) => + CardIncrement.FromRawUnchecked(rawData); } /// -/// Indicates the reason for a credit to the cardholder. +/// Whether this authorization was approved by Increase, the card network through +/// stand-in processing, or the user through a real-time decision. /// -[JsonConverter(typeof(CreditReasonIndicatorConverter))] -public enum CreditReasonIndicator +[JsonConverter(typeof(CardIncrementActionerConverter))] +public enum CardIncrementActioner { /// - /// No credit - /// - NoCredit, - - /// - /// Passenger transport ancillary purchase cancellation + /// This object was actioned by the user through a real-time decision. /// - PassengerTransportAncillaryPurchaseCancellation, + User, /// - /// Airline ticket and passenger transport ancillary purchase cancellation + /// This object was actioned by Increase without user intervention. /// - AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + Increase, /// - /// Other + /// This object was actioned by the network, through stand-in processing. /// - Other, + Network, } -sealed class CreditReasonIndicatorConverter : JsonConverter +sealed class CardIncrementActionerConverter : JsonConverter { - public override CreditReasonIndicator Read( + public override CardIncrementActioner Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -20868,19 +19908,16 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "no_credit" => CreditReasonIndicator.NoCredit, - "passenger_transport_ancillary_purchase_cancellation" => - CreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => - CreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, - "other" => CreditReasonIndicator.Other, - _ => (CreditReasonIndicator)(-1), + "user" => CardIncrementActioner.User, + "increase" => CardIncrementActioner.Increase, + "network" => CardIncrementActioner.Network, + _ => (CardIncrementActioner)(-1), }; } public override void Write( Utf8JsonWriter writer, - CreditReasonIndicator value, + CardIncrementActioner value, JsonSerializerOptions options ) { @@ -20888,12 +19925,9 @@ JsonSerializerOptions options writer, value switch { - CreditReasonIndicator.NoCredit => "no_credit", - CreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => - "passenger_transport_ancillary_purchase_cancellation", - CreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", - CreditReasonIndicator.Other => "other", + CardIncrementActioner.User => "user", + CardIncrementActioner.Increase => "increase", + CardIncrementActioner.Network => "network", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -20903,1084 +19937,1105 @@ JsonSerializerOptions options } } -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Service : JsonModel +/// +/// Additional amounts associated with the card authorization, such as ATM surcharges +/// fees. These are usually a subset of the `amount` field and are used to provide +/// more detailed information about the transaction. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmounts, + CardIncrementAdditionalAmountsFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmounts : JsonModel { /// - /// Category of the ancillary service. + /// The part of this transaction amount that was for clinic-related services. /// - public required ApiEnum? Category + public required CardIncrementAdditionalAmountsClinic? Clinic { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>("category"); + return this._rawData.GetNullableClass("clinic"); } - init { this._rawData.Set("category", value); } + init { this._rawData.Set("clinic", value); } } /// - /// Sub-category of the ancillary service, free-form. + /// The part of this transaction amount that was for dental-related services. /// - public required string? SubCategory + public required CardIncrementAdditionalAmountsDental? Dental { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("sub_category"); + return this._rawData.GetNullableClass("dental"); } - init { this._rawData.Set("sub_category", value); } + init { this._rawData.Set("dental", value); } + } + + /// + /// The original pre-authorized amount. + /// + public required CardIncrementAdditionalAmountsOriginal? Original + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "original" + ); + } + init { this._rawData.Set("original", value); } + } + + /// + /// The part of this transaction amount that was for healthcare prescriptions. + /// + public required CardIncrementAdditionalAmountsPrescription? Prescription + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "prescription" + ); + } + init { this._rawData.Set("prescription", value); } + } + + /// + /// The surcharge amount charged for this transaction by the merchant. + /// + public required CardIncrementAdditionalAmountsSurcharge? Surcharge + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "surcharge" + ); + } + init { this._rawData.Set("surcharge", value); } + } + + /// + /// The total amount of a series of incremental authorizations, optionally provided. + /// + public required CardIncrementAdditionalAmountsTotalCumulative? TotalCumulative + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_cumulative" + ); + } + init { this._rawData.Set("total_cumulative", value); } + } + + /// + /// The total amount of healthcare-related additional amounts. + /// + public required CardIncrementAdditionalAmountsTotalHealthcare? TotalHealthcare + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_healthcare" + ); + } + init { this._rawData.Set("total_healthcare", value); } + } + + /// + /// The part of this transaction amount that was for transit-related services. + /// + public required CardIncrementAdditionalAmountsTransit? Transit + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("transit"); + } + init { this._rawData.Set("transit", value); } + } + + /// + /// An unknown additional amount. + /// + public required CardIncrementAdditionalAmountsUnknown? Unknown + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("unknown"); + } + init { this._rawData.Set("unknown", value); } + } + + /// + /// The part of this transaction amount that was for vision-related services. + /// + public required CardIncrementAdditionalAmountsVision? Vision + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("vision"); + } + init { this._rawData.Set("vision", value); } } /// public override void Validate() { - this.Category?.Validate(); - _ = this.SubCategory; + this.Clinic?.Validate(); + this.Dental?.Validate(); + this.Original?.Validate(); + this.Prescription?.Validate(); + this.Surcharge?.Validate(); + this.TotalCumulative?.Validate(); + this.TotalHealthcare?.Validate(); + this.Transit?.Validate(); + this.Unknown?.Validate(); + this.Vision?.Validate(); } - public Service() { } + public CardIncrementAdditionalAmounts() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public Service(Service service) - : base(service) { } + public CardIncrementAdditionalAmounts( + CardIncrementAdditionalAmounts cardIncrementAdditionalAmounts + ) + : base(cardIncrementAdditionalAmounts) { } #pragma warning restore CS8618 - public Service(IReadOnlyDictionary rawData) + public CardIncrementAdditionalAmounts(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - Service(FrozenDictionary rawData) + CardIncrementAdditionalAmounts(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static Service FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardIncrementAdditionalAmounts FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class ServiceFromRaw : IFromRawJson +class CardIncrementAdditionalAmountsFromRaw : IFromRawJson { /// - public Service FromRawUnchecked(IReadOnlyDictionary rawData) => - Service.FromRawUnchecked(rawData); + public CardIncrementAdditionalAmounts FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmounts.FromRawUnchecked(rawData); } /// -/// Category of the ancillary service. +/// The part of this transaction amount that was for clinic-related services. /// -[JsonConverter(typeof(ServiceCategoryConverter))] -public enum ServiceCategory +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsClinic, + CardIncrementAdditionalAmountsClinicFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsClinic : JsonModel { /// - /// None - /// - None, - - /// - /// Bundled service + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - BundledService, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Baggage fee + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - BaggageFee, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Change fee - /// - ChangeFee, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// Cargo - /// - Cargo, + public CardIncrementAdditionalAmountsClinic() { } - /// - /// Carbon offset - /// - CarbonOffset, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsClinic( + CardIncrementAdditionalAmountsClinic cardIncrementAdditionalAmountsClinic + ) + : base(cardIncrementAdditionalAmountsClinic) { } +#pragma warning restore CS8618 - /// - /// Frequent flyer - /// - FrequentFlyer, + public CardIncrementAdditionalAmountsClinic(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } - /// - /// Gift card - /// - GiftCard, +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsClinic(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 - /// - /// Ground transport - /// - GroundTransport, + /// + public static CardIncrementAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} - /// - /// In-flight entertainment - /// - InFlightEntertainment, - - /// - /// Lounge - /// - Lounge, - - /// - /// Medical - /// - Medical, - - /// - /// Meal beverage - /// - MealBeverage, - - /// - /// Other - /// - Other, - - /// - /// Passenger assist fee - /// - PassengerAssistFee, - - /// - /// Pets - /// - Pets, - - /// - /// Seat fees - /// - SeatFees, - - /// - /// Standby - /// - Standby, +class CardIncrementAdditionalAmountsClinicFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsClinic.FromRawUnchecked(rawData); +} +/// +/// The part of this transaction amount that was for dental-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsDental, + CardIncrementAdditionalAmountsDentalFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsDental : JsonModel +{ /// - /// Service fee + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - ServiceFee, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Store + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - Store, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Travel service - /// - TravelService, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } - /// - /// Unaccompanied travel - /// - UnaccompaniedTravel, + public CardIncrementAdditionalAmountsDental() { } - /// - /// Upgrades - /// - Upgrades, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsDental( + CardIncrementAdditionalAmountsDental cardIncrementAdditionalAmountsDental + ) + : base(cardIncrementAdditionalAmountsDental) { } +#pragma warning restore CS8618 - /// - /// Wi-fi - /// - Wifi, -} + public CardIncrementAdditionalAmountsDental(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } -sealed class ServiceCategoryConverter : JsonConverter -{ - public override ServiceCategory Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsDental(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "none" => ServiceCategory.None, - "bundled_service" => ServiceCategory.BundledService, - "baggage_fee" => ServiceCategory.BaggageFee, - "change_fee" => ServiceCategory.ChangeFee, - "cargo" => ServiceCategory.Cargo, - "carbon_offset" => ServiceCategory.CarbonOffset, - "frequent_flyer" => ServiceCategory.FrequentFlyer, - "gift_card" => ServiceCategory.GiftCard, - "ground_transport" => ServiceCategory.GroundTransport, - "in_flight_entertainment" => ServiceCategory.InFlightEntertainment, - "lounge" => ServiceCategory.Lounge, - "medical" => ServiceCategory.Medical, - "meal_beverage" => ServiceCategory.MealBeverage, - "other" => ServiceCategory.Other, - "passenger_assist_fee" => ServiceCategory.PassengerAssistFee, - "pets" => ServiceCategory.Pets, - "seat_fees" => ServiceCategory.SeatFees, - "standby" => ServiceCategory.Standby, - "service_fee" => ServiceCategory.ServiceFee, - "store" => ServiceCategory.Store, - "travel_service" => ServiceCategory.TravelService, - "unaccompanied_travel" => ServiceCategory.UnaccompaniedTravel, - "upgrades" => ServiceCategory.Upgrades, - "wifi" => ServiceCategory.Wifi, - _ => (ServiceCategory)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - ServiceCategory value, - JsonSerializerOptions options + /// + public static CardIncrementAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - ServiceCategory.None => "none", - ServiceCategory.BundledService => "bundled_service", - ServiceCategory.BaggageFee => "baggage_fee", - ServiceCategory.ChangeFee => "change_fee", - ServiceCategory.Cargo => "cargo", - ServiceCategory.CarbonOffset => "carbon_offset", - ServiceCategory.FrequentFlyer => "frequent_flyer", - ServiceCategory.GiftCard => "gift_card", - ServiceCategory.GroundTransport => "ground_transport", - ServiceCategory.InFlightEntertainment => "in_flight_entertainment", - ServiceCategory.Lounge => "lounge", - ServiceCategory.Medical => "medical", - ServiceCategory.MealBeverage => "meal_beverage", - ServiceCategory.Other => "other", - ServiceCategory.PassengerAssistFee => "passenger_assist_fee", - ServiceCategory.Pets => "pets", - ServiceCategory.SeatFees => "seat_fees", - ServiceCategory.Standby => "standby", - ServiceCategory.ServiceFee => "service_fee", - ServiceCategory.Store => "store", - ServiceCategory.TravelService => "travel_service", - ServiceCategory.UnaccompaniedTravel => "unaccompanied_travel", - ServiceCategory.Upgrades => "upgrades", - ServiceCategory.Wifi => "wifi", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardIncrementAdditionalAmountsDentalFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsDental.FromRawUnchecked(rawData); +} + /// -/// Indicates the reason for a credit to the cardholder. +/// The original pre-authorized amount. /// -[JsonConverter(typeof(TravelCreditReasonIndicatorConverter))] -public enum TravelCreditReasonIndicator +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsOriginal, + CardIncrementAdditionalAmountsOriginalFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsOriginal : JsonModel { /// - /// No credit - /// - NoCredit, - - /// - /// Passenger transport ancillary purchase cancellation + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - PassengerTransportAncillaryPurchaseCancellation, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Airline ticket and passenger transport ancillary purchase cancellation + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Airline ticket cancellation - /// - AirlineTicketCancellation, - - /// - /// Other - /// - Other, - - /// - /// Partial refund of airline ticket - /// - PartialRefundOfAirlineTicket, -} - -sealed class TravelCreditReasonIndicatorConverter : JsonConverter -{ - public override TravelCreditReasonIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + public override void Validate() { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "no_credit" => TravelCreditReasonIndicator.NoCredit, - "passenger_transport_ancillary_purchase_cancellation" => - TravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => - TravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_cancellation" => TravelCreditReasonIndicator.AirlineTicketCancellation, - "other" => TravelCreditReasonIndicator.Other, - "partial_refund_of_airline_ticket" => - TravelCreditReasonIndicator.PartialRefundOfAirlineTicket, - _ => (TravelCreditReasonIndicator)(-1), - }; + _ = this.Amount; + _ = this.Currency; } - public override void Write( - Utf8JsonWriter writer, - TravelCreditReasonIndicator value, - JsonSerializerOptions options + public CardIncrementAdditionalAmountsOriginal() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsOriginal( + CardIncrementAdditionalAmountsOriginal cardIncrementAdditionalAmountsOriginal ) + : base(cardIncrementAdditionalAmountsOriginal) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsOriginal(IReadOnlyDictionary rawData) { - JsonSerializer.Serialize( - writer, - value switch - { - TravelCreditReasonIndicator.NoCredit => "no_credit", - TravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => - "passenger_transport_ancillary_purchase_cancellation", - TravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", - TravelCreditReasonIndicator.AirlineTicketCancellation => - "airline_ticket_cancellation", - TravelCreditReasonIndicator.Other => "other", - TravelCreditReasonIndicator.PartialRefundOfAirlineTicket => - "partial_refund_of_airline_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData = new(rawData); } -} - -/// -/// Indicates whether this ticket is non-refundable. -/// -[JsonConverter(typeof(RestrictedTicketIndicatorConverter))] -public enum RestrictedTicketIndicator -{ - /// - /// No restrictions - /// - NoRestrictions, - - /// - /// Restricted non-refundable ticket - /// - RestrictedNonRefundableTicket, -} -sealed class RestrictedTicketIndicatorConverter : JsonConverter -{ - public override RestrictedTicketIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsOriginal(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "no_restrictions" => RestrictedTicketIndicator.NoRestrictions, - "restricted_non_refundable_ticket" => - RestrictedTicketIndicator.RestrictedNonRefundableTicket, - _ => (RestrictedTicketIndicator)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - RestrictedTicketIndicator value, - JsonSerializerOptions options + /// + public static CardIncrementAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - RestrictedTicketIndicator.NoRestrictions => "no_restrictions", - RestrictedTicketIndicator.RestrictedNonRefundableTicket => - "restricted_non_refundable_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -/// -/// Indicates why a ticket was changed. -/// -[JsonConverter(typeof(TicketChangeIndicatorConverter))] -public enum TicketChangeIndicator -{ - /// - /// None - /// - None, - - /// - /// Change to existing ticket - /// - ChangeToExistingTicket, - - /// - /// New ticket - /// - NewTicket, -} - -sealed class TicketChangeIndicatorConverter : JsonConverter +class CardIncrementAdditionalAmountsOriginalFromRaw + : IFromRawJson { - public override TicketChangeIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "none" => TicketChangeIndicator.None, - "change_to_existing_ticket" => TicketChangeIndicator.ChangeToExistingTicket, - "new_ticket" => TicketChangeIndicator.NewTicket, - _ => (TicketChangeIndicator)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - TicketChangeIndicator value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - TicketChangeIndicator.None => "none", - TicketChangeIndicator.ChangeToExistingTicket => "change_to_existing_ticket", - TicketChangeIndicator.NewTicket => "new_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } + /// + public CardIncrementAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsOriginal.FromRawUnchecked(rawData); } -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class TripLeg : JsonModel +/// +/// The part of this transaction amount that was for healthcare prescriptions. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsPrescription, + CardIncrementAdditionalAmountsPrescriptionFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsPrescription : JsonModel { /// - /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? CarrierCode + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("carrier_code"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("carrier_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// Code for the destination city or airport. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string? DestinationCityAirportCode + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("destination_city_airport_code"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("destination_city_airport_code", value); } + init { this._rawData.Set("currency", value); } } - /// - /// Fare basis code. - /// - public required string? FareBasisCode + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("fare_basis_code"); - } - init { this._rawData.Set("fare_basis_code", value); } + _ = this.Amount; + _ = this.Currency; } - /// - /// Flight number. - /// - public required string? FlightNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("flight_number"); - } - init { this._rawData.Set("flight_number", value); } - } + public CardIncrementAdditionalAmountsPrescription() { } - /// - /// Service class (e.g., first class, business class, etc.). +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsPrescription( + CardIncrementAdditionalAmountsPrescription cardIncrementAdditionalAmountsPrescription + ) + : base(cardIncrementAdditionalAmountsPrescription) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsPrescription( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsPrescription(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardIncrementAdditionalAmountsPrescription FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardIncrementAdditionalAmountsPrescriptionFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsPrescription FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsPrescription.FromRawUnchecked(rawData); +} + +/// +/// The surcharge amount charged for this transaction by the merchant. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsSurcharge, + CardIncrementAdditionalAmountsSurchargeFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsSurcharge : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? ServiceClass + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("service_class"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("service_class", value); } + init { this._rawData.Set("amount", value); } } /// - /// Indicates whether a stopover is allowed on this ticket. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required ApiEnum? StopOverCode + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>("stop_over_code"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("stop_over_code", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.CarrierCode; - _ = this.DestinationCityAirportCode; - _ = this.FareBasisCode; - _ = this.FlightNumber; - _ = this.ServiceClass; - this.StopOverCode?.Validate(); + _ = this.Amount; + _ = this.Currency; } - public TripLeg() { } + public CardIncrementAdditionalAmountsSurcharge() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public TripLeg(TripLeg tripLeg) - : base(tripLeg) { } + public CardIncrementAdditionalAmountsSurcharge( + CardIncrementAdditionalAmountsSurcharge cardIncrementAdditionalAmountsSurcharge + ) + : base(cardIncrementAdditionalAmountsSurcharge) { } #pragma warning restore CS8618 - public TripLeg(IReadOnlyDictionary rawData) + public CardIncrementAdditionalAmountsSurcharge(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - TripLeg(FrozenDictionary rawData) + CardIncrementAdditionalAmountsSurcharge(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardIncrementAdditionalAmountsSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class TripLegFromRaw : IFromRawJson +class CardIncrementAdditionalAmountsSurchargeFromRaw + : IFromRawJson { /// - public TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) => - TripLeg.FromRawUnchecked(rawData); + public CardIncrementAdditionalAmountsSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsSurcharge.FromRawUnchecked(rawData); } /// -/// Indicates whether a stopover is allowed on this ticket. +/// The total amount of a series of incremental authorizations, optionally provided. /// -[JsonConverter(typeof(StopOverCodeConverter))] -public enum StopOverCode +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsTotalCumulative, + CardIncrementAdditionalAmountsTotalCumulativeFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsTotalCumulative : JsonModel { /// - /// None - /// - None, - - /// - /// Stop over allowed + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - StopOverAllowed, + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Stop over not allowed + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - StopOverNotAllowed, -} - -sealed class StopOverCodeConverter : JsonConverter -{ - public override StopOverCode Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string Currency { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "none" => StopOverCode.None, - "stop_over_allowed" => StopOverCode.StopOverAllowed, - "stop_over_not_allowed" => StopOverCode.StopOverNotAllowed, - _ => (StopOverCode)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } } - public override void Write( - Utf8JsonWriter writer, - StopOverCode value, - JsonSerializerOptions options - ) + /// + public override void Validate() { - JsonSerializer.Serialize( - writer, - value switch - { - StopOverCode.None => "none", - StopOverCode.StopOverAllowed => "stop_over_allowed", - StopOverCode.StopOverNotAllowed => "stop_over_not_allowed", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + _ = this.Amount; + _ = this.Currency; } -} -/// -/// A constant representing the object's type. For this resource it will always be `card_refund`. -/// -[JsonConverter(typeof(CardRefundTypeConverter))] -public enum CardRefundType -{ - CardRefund, -} + public CardIncrementAdditionalAmountsTotalCumulative() { } -sealed class CardRefundTypeConverter : JsonConverter -{ - public override CardRefundType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsTotalCumulative( + CardIncrementAdditionalAmountsTotalCumulative cardIncrementAdditionalAmountsTotalCumulative + ) + : base(cardIncrementAdditionalAmountsTotalCumulative) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsTotalCumulative( + IReadOnlyDictionary rawData ) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "card_refund" => CardRefundType.CardRefund, - _ => (CardRefundType)(-1), - }; + this._rawData = new(rawData); } - public override void Write( - Utf8JsonWriter writer, - CardRefundType value, - JsonSerializerOptions options +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsTotalCumulative(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardIncrementAdditionalAmountsTotalCumulative FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - CardRefundType.CardRefund => "card_refund", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardIncrementAdditionalAmountsTotalCumulativeFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsTotalCumulative FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); +} + /// -/// A Card Reversal object. This field will be present in the JSON response if and -/// only if `category` is equal to `card_reversal`. Card Reversals cancel parts of -/// or the entirety of an existing Card Authorization. +/// The total amount of healthcare-related additional amounts. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardReversal : JsonModel +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsTotalHealthcare, + CardIncrementAdditionalAmountsTotalHealthcareFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsTotalHealthcare : JsonModel { /// - /// The Card Reversal identifier. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string ID + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("id", value); } + init { this._rawData.Set("amount", value); } } /// - /// The identifier for the Card Authorization this reverses. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string CardAuthorizationID + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_authorization_id"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("card_authorization_id", value); } + init { this._rawData.Set("currency", value); } } - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. - /// - public required ApiEnum Currency + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); - } - init { this._rawData.Set("currency", value); } + _ = this.Amount; + _ = this.Currency; } - /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. - /// - public required string MerchantAcceptorID + public CardIncrementAdditionalAmountsTotalHealthcare() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsTotalHealthcare( + CardIncrementAdditionalAmountsTotalHealthcare cardIncrementAdditionalAmountsTotalHealthcare + ) + : base(cardIncrementAdditionalAmountsTotalHealthcare) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsTotalHealthcare( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); - } - init { this._rawData.Set("merchant_acceptor_id", value); } + this._rawData = new(rawData); } - /// - /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - /// card is transacting with. - /// - public required string MerchantCategoryCode +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); - } - init { this._rawData.Set("merchant_category_code", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// The city the merchant resides in. - /// - public required string? MerchantCity + /// + public static CardIncrementAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_city"); - } - init { this._rawData.Set("merchant_city", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardIncrementAdditionalAmountsTotalHealthcareFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); +} +/// +/// The part of this transaction amount that was for transit-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsTransit, + CardIncrementAdditionalAmountsTransitFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsTransit : JsonModel +{ /// - /// The country the merchant resides in. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? MerchantCountry + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_country"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("merchant_country", value); } + init { this._rawData.Set("amount", value); } } /// - /// The merchant descriptor of the merchant the card is transacting with. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string MerchantDescriptor + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_descriptor"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("merchant_descriptor", value); } + init { this._rawData.Set("currency", value); } } - /// - /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit - /// ZIP code, where the first 5 and last 4 are separated by a dash. - /// - public required string? MerchantPostalCode + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } + _ = this.Amount; + _ = this.Currency; } - /// - /// The state the merchant resides in. - /// - public required string? MerchantState + public CardIncrementAdditionalAmountsTransit() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsTransit( + CardIncrementAdditionalAmountsTransit cardIncrementAdditionalAmountsTransit + ) + : base(cardIncrementAdditionalAmountsTransit) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsTransit(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } + this._rawData = new(rawData); } - /// - /// The card network used to process this card authorization. - /// - public required ApiEnum Network +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsTransit(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("network"); - } - init { this._rawData.Set("network", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Network-specific identifiers for a specific request or transaction. - /// - public required CardReversalNetworkIdentifiers NetworkIdentifiers + /// + public static CardIncrementAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardIncrementAdditionalAmountsTransitFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsTransit.FromRawUnchecked(rawData); +} +/// +/// An unknown additional amount. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsUnknown, + CardIncrementAdditionalAmountsUnknownFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsUnknown : JsonModel +{ /// - /// The identifier of the Pending Transaction associated with this Card Reversal. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required string? PendingTransactionID + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("pending_transaction_id"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("pending_transaction_id", value); } + init { this._rawData.Set("amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's - /// presentment currency. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required string PresentmentCurrency + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("presentment_currency", value); } + init { this._rawData.Set("currency", value); } } - /// - /// The amount of this reversal in the minor unit of the transaction's currency. - /// For dollars, for example, this is cents. - /// - public required long ReversalAmount + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("reversal_amount"); - } - init { this._rawData.Set("reversal_amount", value); } + _ = this.Amount; + _ = this.Currency; } - /// - /// The amount of this reversal in the minor unit of the transaction's presentment - /// currency. For dollars, for example, this is cents. - /// - public required long ReversalPresentmentAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("reversal_presentment_amount"); - } - init { this._rawData.Set("reversal_presentment_amount", value); } - } + public CardIncrementAdditionalAmountsUnknown() { } - /// - /// Why this reversal was initiated. - /// - public required ApiEnum? ReversalReason +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementAdditionalAmountsUnknown( + CardIncrementAdditionalAmountsUnknown cardIncrementAdditionalAmountsUnknown + ) + : base(cardIncrementAdditionalAmountsUnknown) { } +#pragma warning restore CS8618 + + public CardIncrementAdditionalAmountsUnknown(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass>( - "reversal_reason" - ); - } - init { this._rawData.Set("reversal_reason", value); } + this._rawData = new(rawData); } - /// - /// The terminal identifier (commonly abbreviated as TID) of the terminal the - /// card is transacting with. - /// - public required string? TerminalID +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementAdditionalAmountsUnknown(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("terminal_id"); - } - init { this._rawData.Set("terminal_id", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// A constant representing the object's type. For this resource it will always - /// be `card_reversal`. - /// - public required ApiEnum Type + /// + public static CardIncrementAdditionalAmountsUnknown FromRawUnchecked( + IReadOnlyDictionary rawData + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardIncrementAdditionalAmountsUnknownFromRaw + : IFromRawJson +{ + /// + public CardIncrementAdditionalAmountsUnknown FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsUnknown.FromRawUnchecked(rawData); +} +/// +/// The part of this transaction amount that was for vision-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardIncrementAdditionalAmountsVision, + CardIncrementAdditionalAmountsVisionFromRaw + >) +)] +public sealed record class CardIncrementAdditionalAmountsVision : JsonModel +{ /// - /// The amount left pending on the Card Authorization in the minor unit of the - /// transaction's currency. For dollars, for example, this is cents. + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). /// - public required long UpdatedAuthorizationAmount + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("updated_authorization_amount"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("updated_authorization_amount", value); } + init { this._rawData.Set("amount", value); } } /// - /// The amount left pending on the Card Authorization in the minor unit of the - /// transaction's presentment currency. For dollars, for example, this is cents. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. /// - public required long UpdatedAuthorizationPresentmentAmount + public required string Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("updated_authorization_presentment_amount"); + return this._rawData.GetNotNullClass("currency"); } - init { this._rawData.Set("updated_authorization_presentment_amount", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.ID; - _ = this.CardAuthorizationID; - this.Currency.Validate(); - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantDescriptor; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.Network.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.PendingTransactionID; - _ = this.PresentmentCurrency; - _ = this.ReversalAmount; - _ = this.ReversalPresentmentAmount; - this.ReversalReason?.Validate(); - _ = this.TerminalID; - this.Type.Validate(); - _ = this.UpdatedAuthorizationAmount; - _ = this.UpdatedAuthorizationPresentmentAmount; + _ = this.Amount; + _ = this.Currency; } - public CardReversal() { } + public CardIncrementAdditionalAmountsVision() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardReversal(CardReversal cardReversal) - : base(cardReversal) { } + public CardIncrementAdditionalAmountsVision( + CardIncrementAdditionalAmountsVision cardIncrementAdditionalAmountsVision + ) + : base(cardIncrementAdditionalAmountsVision) { } #pragma warning restore CS8618 - public CardReversal(IReadOnlyDictionary rawData) + public CardIncrementAdditionalAmountsVision(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardReversal(FrozenDictionary rawData) + CardIncrementAdditionalAmountsVision(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardReversal FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardIncrementAdditionalAmountsVision FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardReversalFromRaw : IFromRawJson +class CardIncrementAdditionalAmountsVisionFromRaw + : IFromRawJson { /// - public CardReversal FromRawUnchecked(IReadOnlyDictionary rawData) => - CardReversal.FromRawUnchecked(rawData); + public CardIncrementAdditionalAmountsVision FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementAdditionalAmountsVision.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the increment's currency. /// -[JsonConverter(typeof(CardReversalCurrencyConverter))] -public enum CardReversalCurrency +[JsonConverter(typeof(CardIncrementCurrencyConverter))] +public enum CardIncrementCurrency { /// /// US Dollar (USD) @@ -21988,9 +21043,9 @@ public enum CardReversalCurrency Usd, } -sealed class CardReversalCurrencyConverter : JsonConverter +sealed class CardIncrementCurrencyConverter : JsonConverter { - public override CardReversalCurrency Read( + public override CardIncrementCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -21998,14 +21053,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardReversalCurrency.Usd, - _ => (CardReversalCurrency)(-1), + "USD" => CardIncrementCurrency.Usd, + _ => (CardIncrementCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardReversalCurrency value, + CardIncrementCurrency value, JsonSerializerOptions options ) { @@ -22013,7 +21068,7 @@ JsonSerializerOptions options writer, value switch { - CardReversalCurrency.Usd => "USD", + CardIncrementCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -22026,8 +21081,8 @@ JsonSerializerOptions options /// /// The card network used to process this card authorization. /// -[JsonConverter(typeof(CardReversalNetworkConverter))] -public enum CardReversalNetwork +[JsonConverter(typeof(CardIncrementNetworkConverter))] +public enum CardIncrementNetwork { /// /// Visa @@ -22040,9 +21095,9 @@ public enum CardReversalNetwork Pulse, } -sealed class CardReversalNetworkConverter : JsonConverter +sealed class CardIncrementNetworkConverter : JsonConverter { - public override CardReversalNetwork Read( + public override CardIncrementNetwork Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -22050,15 +21105,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "visa" => CardReversalNetwork.Visa, - "pulse" => CardReversalNetwork.Pulse, - _ => (CardReversalNetwork)(-1), + "visa" => CardIncrementNetwork.Visa, + "pulse" => CardIncrementNetwork.Pulse, + _ => (CardIncrementNetwork)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardReversalNetwork value, + CardIncrementNetwork value, JsonSerializerOptions options ) { @@ -22066,8 +21121,8 @@ JsonSerializerOptions options writer, value switch { - CardReversalNetwork.Visa => "visa", - CardReversalNetwork.Pulse => "pulse", + CardIncrementNetwork.Visa => "visa", + CardIncrementNetwork.Pulse => "pulse", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -22082,11 +21137,11 @@ JsonSerializerOptions options /// [JsonConverter( typeof(JsonModelConverter< - CardReversalNetworkIdentifiers, - CardReversalNetworkIdentifiersFromRaw + CardIncrementNetworkIdentifiers, + CardIncrementNetworkIdentifiersFromRaw >) )] -public sealed record class CardReversalNetworkIdentifiers : JsonModel +public sealed record class CardIncrementNetworkIdentifiers : JsonModel { /// /// The randomly generated 6-character Authorization Identification Response code @@ -22154,31 +21209,31 @@ public override void Validate() _ = this.TransactionID; } - public CardReversalNetworkIdentifiers() { } + public CardIncrementNetworkIdentifiers() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardReversalNetworkIdentifiers( - CardReversalNetworkIdentifiers cardReversalNetworkIdentifiers + public CardIncrementNetworkIdentifiers( + CardIncrementNetworkIdentifiers cardIncrementNetworkIdentifiers ) - : base(cardReversalNetworkIdentifiers) { } + : base(cardIncrementNetworkIdentifiers) { } #pragma warning restore CS8618 - public CardReversalNetworkIdentifiers(IReadOnlyDictionary rawData) + public CardIncrementNetworkIdentifiers(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardReversalNetworkIdentifiers(FrozenDictionary rawData) + CardIncrementNetworkIdentifiers(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardReversalNetworkIdentifiers FromRawUnchecked( + /// + public static CardIncrementNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -22186,94 +21241,166 @@ IReadOnlyDictionary rawData } } -class CardReversalNetworkIdentifiersFromRaw : IFromRawJson +class CardIncrementNetworkIdentifiersFromRaw : IFromRawJson { /// - public CardReversalNetworkIdentifiers FromRawUnchecked( + public CardIncrementNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardReversalNetworkIdentifiers.FromRawUnchecked(rawData); + ) => CardIncrementNetworkIdentifiers.FromRawUnchecked(rawData); } -/// -/// Why this reversal was initiated. -/// -[JsonConverter(typeof(ReversalReasonConverter))] -public enum ReversalReason +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardIncrementSchemeFee : JsonModel { /// - /// The Card Reversal was initiated at the customer's request. - /// - ReversedByCustomer, - - /// - /// The Card Reversal was initiated by the network or acquirer. + /// The fee amount given as a string containing a decimal number. /// - ReversedByNetworkOrAcquirer, + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// The Card Reversal was initiated by the point of sale device. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - ReversedByPointOfSale, + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } /// - /// The Card Reversal was a partial reversal, for any reason. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - PartialReversal, -} + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } -sealed class ReversalReasonConverter : JsonConverter -{ - public override ReversalReason Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "reversed_by_customer" => ReversalReason.ReversedByCustomer, - "reversed_by_network_or_acquirer" => ReversalReason.ReversedByNetworkOrAcquirer, - "reversed_by_point_of_sale" => ReversalReason.ReversedByPointOfSale, - "partial_reversal" => ReversalReason.PartialReversal, - _ => (ReversalReason)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } } - public override void Write( - Utf8JsonWriter writer, - ReversalReason value, - JsonSerializerOptions options + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } + + /// + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). + /// + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } + + public CardIncrementSchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardIncrementSchemeFee(CardIncrementSchemeFee cardIncrementSchemeFee) + : base(cardIncrementSchemeFee) { } +#pragma warning restore CS8618 + + public CardIncrementSchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardIncrementSchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardIncrementSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData ) { - JsonSerializer.Serialize( - writer, - value switch - { - ReversalReason.ReversedByCustomer => "reversed_by_customer", - ReversalReason.ReversedByNetworkOrAcquirer => "reversed_by_network_or_acquirer", - ReversalReason.ReversedByPointOfSale => "reversed_by_point_of_sale", - ReversalReason.PartialReversal => "partial_reversal", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class CardIncrementSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardIncrementSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardIncrementSchemeFee.FromRawUnchecked(rawData); +} + /// -/// A constant representing the object's type. For this resource it will always be `card_reversal`. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(CardReversalTypeConverter))] -public enum CardReversalType +[JsonConverter(typeof(CardIncrementSchemeFeeCurrencyConverter))] +public enum CardIncrementSchemeFeeCurrency { - CardReversal, + /// + /// US Dollar (USD) + /// + Usd, } -sealed class CardReversalTypeConverter : JsonConverter +sealed class CardIncrementSchemeFeeCurrencyConverter : JsonConverter { - public override CardReversalType Read( + public override CardIncrementSchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -22281,14 +21408,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "card_reversal" => CardReversalType.CardReversal, - _ => (CardReversalType)(-1), + "USD" => CardIncrementSchemeFeeCurrency.Usd, + _ => (CardIncrementSchemeFeeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardReversalType value, + CardIncrementSchemeFeeCurrency value, JsonSerializerOptions options ) { @@ -22296,7 +21423,7 @@ JsonSerializerOptions options writer, value switch { - CardReversalType.CardReversal => "card_reversal", + CardIncrementSchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -22307,488 +21434,197 @@ JsonSerializerOptions options } /// -/// A Card Settlement object. This field will be present in the JSON response if -/// and only if `category` is equal to `card_settlement`. Card Settlements are card -/// transactions that have cleared and settled. While a settlement is usually preceded -/// by an authorization, an acquirer can also directly clear a transaction without -/// first authorizing it. +/// The type of fee being assessed. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardSettlement : JsonModel +[JsonConverter(typeof(CardIncrementSchemeFeeFeeTypeConverter))] +public enum CardIncrementSchemeFeeFeeType { /// - /// The Card Settlement identifier. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required string ID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The amount in the minor unit of the transaction's settlement currency. For - /// dollars, for example, this is cents. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, /// - /// The Card Authorization that was created prior to this Card Settlement, if - /// one exists. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? CardAuthorization - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("card_authorization"); - } - init { this._rawData.Set("card_authorization", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// The ID of the Card Payment this transaction belongs to. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string CardPaymentID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); - } - init { this._rawData.Set("card_payment_id", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// Cashback earned on this transaction, if eligible. Cashback is paid out in - /// aggregate, monthly. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required CardSettlementCashback? Cashback - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("cashback"); - } - init { this._rawData.Set("cashback", value); } - } + VisaAuthorizationCanadaPointOfSale, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// settlement currency. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. /// - public required ApiEnum Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); - } - init { this._rawData.Set("currency", value); } - } + VisaAuthorizationReversalPointOfSale, /// - /// Interchange assessed as a part of this transaction. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. /// - public required CardSettlementInterchange? Interchange - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("interchange"); - } - init { this._rawData.Set("interchange", value); } - } + VisaAuthorizationReversalInternationalPointOfSale, /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. - /// - public required string MerchantAcceptorID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); - } - init { this._rawData.Set("merchant_acceptor_id", value); } - } + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, /// - /// The 4-digit MCC describing the merchant's business. + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). /// - public required string MerchantCategoryCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); - } - init { this._rawData.Set("merchant_category_code", value); } - } + VisaAdvancedAuthorization, /// - /// The city the merchant resides in. + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. /// - public required string MerchantCity - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_city"); - } - init { this._rawData.Set("merchant_city", value); } - } + VisaMessageTransmission, /// - /// The country the merchant resides in. + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. /// - public required string MerchantCountry - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); - } - init { this._rawData.Set("merchant_country", value); } - } + VisaAccountVerificationDomestic, /// - /// The name of the merchant. + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. /// - public required string MerchantName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_name"); - } - init { this._rawData.Set("merchant_name", value); } - } + VisaAccountVerificationInternational, /// - /// The merchant's postal code. For US merchants this is always a 5-digit ZIP code. + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. /// - public required string? MerchantPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } - } + VisaAccountVerificationCanada, /// - /// The state the merchant resides in. + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. /// - public required string? MerchantState - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } - } + VisaCorporateAcceptanceFee, /// - /// The card network on which this transaction was processed. + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. /// - public required ApiEnum Network - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("network"); - } - init { this._rawData.Set("network", value); } - } + VisaConsumerDebitAcceptanceFee, /// - /// Network-specific identifiers for this refund. + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. /// - public required CardSettlementNetworkIdentifiers NetworkIdentifiers - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } - } + VisaBusinessDebitAcceptanceFee, /// - /// The identifier of the Pending Transaction associated with this Transaction. + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. /// - public required string? PendingTransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("pending_transaction_id"); - } - init { this._rawData.Set("pending_transaction_id", value); } - } + VisaPurchasingAcceptanceFee, /// - /// The amount in the minor unit of the transaction's presentment currency. + /// Activity and fees for the processing of a sales draft original for a purchase transaction. /// - public required long PresentmentAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); - } - init { this._rawData.Set("presentment_amount", value); } - } + VisaPurchaseDomestic, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's - /// presentment currency. + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. /// - public required string PresentmentCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("presentment_currency"); - } - init { this._rawData.Set("presentment_currency", value); } - } + VisaPurchaseInternational, /// - /// Additional details about the card purchase, such as tax and industry-specific fields. + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - public required CardSettlementPurchaseDetails? PurchaseDetails - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "purchase_details" - ); - } - init { this._rawData.Set("purchase_details", value); } - } + VisaCreditPurchaseToken, /// - /// Surcharge amount details, if applicable. The amount is positive if the surcharge - /// is added to the overall transaction amount (surcharge), and negative if the - /// surcharge is deducted from the overall transaction amount (discount). + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - public required CardSettlementSurcharge? Surcharge - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("surcharge"); - } - init { this._rawData.Set("surcharge", value); } - } + VisaDebitPurchaseToken, /// - /// The identifier of the Transaction associated with this Transaction. + /// A per transaction fee assessed for Base II financial draft - Issuer. /// - public required string TransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("transaction_id"); - } - init { this._rawData.Set("transaction_id", value); } - } + VisaClearingTransmission, /// - /// A constant representing the object's type. For this resource it will always - /// be `card_settlement`. + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. /// - public required ApiEnum Type - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } - } - - /// - public override void Validate() - { - _ = this.ID; - _ = this.Amount; - _ = this.CardAuthorization; - _ = this.CardPaymentID; - this.Cashback?.Validate(); - this.Currency.Validate(); - this.Interchange?.Validate(); - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantName; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.Network.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.PendingTransactionID; - _ = this.PresentmentAmount; - _ = this.PresentmentCurrency; - this.PurchaseDetails?.Validate(); - this.Surcharge?.Validate(); - _ = this.TransactionID; - this.Type.Validate(); - } + VisaDirectAuthorization, - public CardSettlement() { } + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlement(CardSettlement cardSettlement) - : base(cardSettlement) { } -#pragma warning restore CS8618 - - public CardSettlement(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlement(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardSettlement FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardSettlementFromRaw : IFromRawJson -{ - /// - public CardSettlement FromRawUnchecked(IReadOnlyDictionary rawData) => - CardSettlement.FromRawUnchecked(rawData); -} - -/// -/// Cashback earned on this transaction, if eligible. Cashback is paid out in aggregate, monthly. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardSettlementCashback : JsonModel -{ /// - /// The cashback amount given as a string containing a decimal number. The amount - /// is a positive number if it will be credited to you (e.g., settlements) and - /// a negative number if it will be debited (e.g., refunds). + /// Issuer card service fee for Commercial Credit cards. /// - public required string Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("amount"); - } - init { this._rawData.Set("amount", value); } - } + VisaServiceCommercialCredit, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. + /// Issuer Advertising Service Fee for Commercial Credit cards. /// - public required ApiEnum Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - this.Currency.Validate(); - } - - public CardSettlementCashback() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlementCashback(CardSettlementCashback cardSettlementCashback) - : base(cardSettlementCashback) { } -#pragma warning restore CS8618 - - public CardSettlementCashback(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlementCashback(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + VisaAdvertisingServiceCommercialCredit, - /// - public static CardSettlementCashback FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, -class CardSettlementCashbackFromRaw : IFromRawJson -{ - /// - public CardSettlementCashback FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementCashback.FromRawUnchecked(rawData); -} + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. -/// -[JsonConverter(typeof(CardSettlementCashbackCurrencyConverter))] -public enum CardSettlementCashbackCurrency -{ /// - /// US Dollar (USD) + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. /// - Usd, + PulseSwitchFee, } -sealed class CardSettlementCashbackCurrencyConverter : JsonConverter +sealed class CardIncrementSchemeFeeFeeTypeConverter : JsonConverter { - public override CardSettlementCashbackCurrency Read( + public override CardIncrementSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -22796,14 +21632,64 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardSettlementCashbackCurrency.Usd, - _ => (CardSettlementCashbackCurrency)(-1), + "visa_international_service_assessment_single_currency" => + CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardIncrementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardIncrementSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardIncrementSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardIncrementSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardIncrementSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardIncrementSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardIncrementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardIncrementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardIncrementSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardIncrementSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardIncrementSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardIncrementSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardIncrementSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardIncrementSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardIncrementSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardIncrementSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardIncrementSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardIncrementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardIncrementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardIncrementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardIncrementSchemeFeeFeeType.PulseSwitchFee, + _ => (CardIncrementSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementCashbackCurrency value, + CardIncrementSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -22811,7 +21697,61 @@ JsonSerializerOptions options writer, value switch { - CardSettlementCashbackCurrency.Usd => "USD", + CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardIncrementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardIncrementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardIncrementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardIncrementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardIncrementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardIncrementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardIncrementSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardIncrementSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardIncrementSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardIncrementSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardIncrementSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardIncrementSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardIncrementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardIncrementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardIncrementSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardIncrementSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardIncrementSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardIncrementSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardIncrementSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardIncrementSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardIncrementSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardIncrementSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardIncrementSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardIncrementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardIncrementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardIncrementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardIncrementSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -22822,21 +21762,17 @@ JsonSerializerOptions options } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's -/// settlement currency. +/// A constant representing the object's type. For this resource it will always be `card_increment`. /// -[JsonConverter(typeof(CardSettlementCurrencyConverter))] -public enum CardSettlementCurrency +[JsonConverter(typeof(CardIncrementTypeConverter))] +public enum CardIncrementType { - /// - /// US Dollar (USD) - /// - Usd, + CardIncrement, } -sealed class CardSettlementCurrencyConverter : JsonConverter +sealed class CardIncrementTypeConverter : JsonConverter { - public override CardSettlementCurrency Read( + public override CardIncrementType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -22844,14 +21780,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => CardSettlementCurrency.Usd, - _ => (CardSettlementCurrency)(-1), + "card_increment" => CardIncrementType.CardIncrement, + _ => (CardIncrementType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementCurrency value, + CardIncrementType value, JsonSerializerOptions options ) { @@ -22859,7 +21795,7 @@ JsonSerializerOptions options writer, value switch { - CardSettlementCurrency.Usd => "USD", + CardIncrementType.CardIncrement => "card_increment", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -22870,861 +21806,630 @@ JsonSerializerOptions options } /// -/// Interchange assessed as a part of this transaction. +/// A Card Refund object. This field will be present in the JSON response if and only +/// if `category` is equal to `card_refund`. Card Refunds move money back to the cardholder. +/// While they are usually connected to a Card Settlement, an acquirer can also refund +/// money directly to a card without relation to a transaction. /// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardSettlementInterchange : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardRefund : JsonModel { /// - /// The interchange amount given as a string containing a decimal number in major - /// units (so e.g., "3.14" for $3.14). The amount is a positive number if it is - /// credited to Increase (e.g., settlements) and a negative number if it is debited - /// (e.g., refunds). + /// The Card Refund identifier. /// - public required string Amount + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("amount"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("id", value); } } /// - /// The card network specific interchange code. + /// The amount in the minor unit of the transaction's settlement currency. For + /// dollars, for example, this is cents. /// - public required string? Code + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("code"); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("code", value); } + init { this._rawData.Set("amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. + /// The ID of the Card Payment this transaction belongs to. /// - public required ApiEnum Currency + public required string CardPaymentID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("currency"); + return this._rawData.GetNotNullClass("card_payment_id"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("card_payment_id", value); } } - /// - public override void Validate() + /// + /// Cashback debited for this transaction, if eligible. Cashback is paid out in + /// aggregate, monthly. + /// + public required Cashback? Cashback { - _ = this.Amount; - _ = this.Code; - this.Currency.Validate(); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("cashback"); + } + init { this._rawData.Set("cashback", value); } } - public CardSettlementInterchange() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlementInterchange(CardSettlementInterchange cardSettlementInterchange) - : base(cardSettlementInterchange) { } -#pragma warning restore CS8618 - - public CardSettlementInterchange(IReadOnlyDictionary rawData) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// settlement currency. + /// + public required ApiEnum Currency { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlementInterchange(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardSettlementInterchange FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardSettlementInterchangeFromRaw : IFromRawJson -{ - /// - public CardSettlementInterchange FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementInterchange.FromRawUnchecked(rawData); -} - -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. -/// -[JsonConverter(typeof(CardSettlementInterchangeCurrencyConverter))] -public enum CardSettlementInterchangeCurrency -{ - /// - /// US Dollar (USD) - /// - Usd, -} - -sealed class CardSettlementInterchangeCurrencyConverter - : JsonConverter -{ - public override CardSettlementInterchangeCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "USD" => CardSettlementInterchangeCurrency.Usd, - _ => (CardSettlementInterchangeCurrency)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementInterchangeCurrency value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementInterchangeCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("currency"); + } + init { this._rawData.Set("currency", value); } } -} - -/// -/// The card network on which this transaction was processed. -/// -[JsonConverter(typeof(CardSettlementNetworkConverter))] -public enum CardSettlementNetwork -{ - /// - /// Visa - /// - Visa, /// - /// Pulse + /// Interchange assessed as a part of this transaction. /// - Pulse, -} - -sealed class CardSettlementNetworkConverter : JsonConverter -{ - public override CardSettlementNetwork Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required Interchange? Interchange { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "visa" => CardSettlementNetwork.Visa, - "pulse" => CardSettlementNetwork.Pulse, - _ => (CardSettlementNetwork)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementNetwork value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementNetwork.Visa => "visa", - CardSettlementNetwork.Pulse => "pulse", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNullableClass("interchange"); + } + init { this._rawData.Set("interchange", value); } } -} -/// -/// Network-specific identifiers for this refund. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementNetworkIdentifiers, - CardSettlementNetworkIdentifiersFromRaw - >) -)] -public sealed record class CardSettlementNetworkIdentifiers : JsonModel -{ /// - /// A network assigned business ID that identifies the acquirer that processed - /// this transaction. + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. /// - public required string AcquirerBusinessID + public required string MerchantAcceptorID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("acquirer_business_id"); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); } - init { this._rawData.Set("acquirer_business_id", value); } + init { this._rawData.Set("merchant_acceptor_id", value); } } /// - /// A globally unique identifier for this settlement. + /// The 4-digit MCC describing the merchant's business. /// - public required string AcquirerReferenceNumber + public required string MerchantCategoryCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("acquirer_reference_number"); + return this._rawData.GetNotNullClass("merchant_category_code"); } - init { this._rawData.Set("acquirer_reference_number", value); } + init { this._rawData.Set("merchant_category_code", value); } } /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. + /// The city the merchant resides in. /// - public required string? AuthorizationIdentificationResponse + public required string MerchantCity { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); + return this._rawData.GetNotNullClass("merchant_city"); } - init { this._rawData.Set("authorization_identification_response", value); } + init { this._rawData.Set("merchant_city", value); } } /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. + /// The country the merchant resides in. /// - public required string? TransactionID + public required string MerchantCountry { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); + return this._rawData.GetNotNullClass("merchant_country"); } - init { this._rawData.Set("transaction_id", value); } - } - - /// - public override void Validate() - { - _ = this.AcquirerBusinessID; - _ = this.AcquirerReferenceNumber; - _ = this.AuthorizationIdentificationResponse; - _ = this.TransactionID; - } - - public CardSettlementNetworkIdentifiers() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlementNetworkIdentifiers( - CardSettlementNetworkIdentifiers cardSettlementNetworkIdentifiers - ) - : base(cardSettlementNetworkIdentifiers) { } -#pragma warning restore CS8618 - - public CardSettlementNetworkIdentifiers(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlementNetworkIdentifiers(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardSettlementNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + init { this._rawData.Set("merchant_country", value); } } -} - -class CardSettlementNetworkIdentifiersFromRaw : IFromRawJson -{ - /// - public CardSettlementNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementNetworkIdentifiers.FromRawUnchecked(rawData); -} -/// -/// Additional details about the card purchase, such as tax and industry-specific fields. -/// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardSettlementPurchaseDetails : JsonModel -{ /// - /// Fields specific to car rentals. + /// The name of the merchant. /// - public required CardSettlementPurchaseDetailsCarRental? CarRental + public required string MerchantName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "car_rental" - ); + return this._rawData.GetNotNullClass("merchant_name"); } - init { this._rawData.Set("car_rental", value); } + init { this._rawData.Set("merchant_name", value); } } /// - /// An identifier from the merchant for the customer or consumer. + /// The merchant's postal code. For US merchants this is always a 5-digit ZIP code. /// - public required string? CustomerReferenceIdentifier + public required string? MerchantPostalCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("customer_reference_identifier"); + return this._rawData.GetNullableClass("merchant_postal_code"); } - init { this._rawData.Set("customer_reference_identifier", value); } + init { this._rawData.Set("merchant_postal_code", value); } } /// - /// The state or provincial tax amount in minor units. + /// The state the merchant resides in. /// - public required long? LocalTaxAmount + public required string? MerchantState { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("local_tax_amount"); + return this._rawData.GetNullableClass("merchant_state"); } - init { this._rawData.Set("local_tax_amount", value); } + init { this._rawData.Set("merchant_state", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local - /// tax assessed. + /// Network-specific identifiers for this refund. /// - public required string? LocalTaxCurrency + public required CardRefundNetworkIdentifiers NetworkIdentifiers { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("local_tax_currency"); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); } - init { this._rawData.Set("local_tax_currency", value); } + init { this._rawData.Set("network_identifiers", value); } } /// - /// Fields specific to lodging. + /// The amount in the minor unit of the transaction's presentment currency. /// - public required CardSettlementPurchaseDetailsLodging? Lodging + public required long PresentmentAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("lodging"); + return this._rawData.GetNotNullStruct("presentment_amount"); } - init { this._rawData.Set("lodging", value); } + init { this._rawData.Set("presentment_amount", value); } } /// - /// The national tax amount in minor units. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// presentment currency. /// - public required long? NationalTaxAmount + public required string PresentmentCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("national_tax_amount"); + return this._rawData.GetNotNullClass("presentment_currency"); } - init { this._rawData.Set("national_tax_amount", value); } + init { this._rawData.Set("presentment_currency", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local - /// tax assessed. + /// Additional details about the card purchase, such as tax and industry-specific fields. /// - public required string? NationalTaxCurrency + public required PurchaseDetails? PurchaseDetails { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("national_tax_currency"); + return this._rawData.GetNullableClass("purchase_details"); } - init { this._rawData.Set("national_tax_currency", value); } + init { this._rawData.Set("purchase_details", value); } } /// - /// An identifier from the merchant for the purchase to the issuer and cardholder. + /// The scheme fees associated with this card refund. /// - public required string? PurchaseIdentifier + public required IReadOnlyList SchemeFees { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("purchase_identifier"); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); } - init { this._rawData.Set("purchase_identifier", value); } } /// - /// The format of the purchase identifier. + /// The identifier of the Transaction associated with this Transaction. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsPurchaseIdentifierFormat - >? PurchaseIdentifierFormat + public required string TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("purchase_identifier_format"); + return this._rawData.GetNotNullClass("transaction_id"); } - init { this._rawData.Set("purchase_identifier_format", value); } + init { this._rawData.Set("transaction_id", value); } } /// - /// Fields specific to travel. + /// A constant representing the object's type. For this resource it will always + /// be `card_refund`. /// - public required CardSettlementPurchaseDetailsTravel? Travel + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel"); + return this._rawData.GetNotNullClass>("type"); } - init { this._rawData.Set("travel", value); } + init { this._rawData.Set("type", value); } } /// public override void Validate() { - this.CarRental?.Validate(); - _ = this.CustomerReferenceIdentifier; - _ = this.LocalTaxAmount; - _ = this.LocalTaxCurrency; - this.Lodging?.Validate(); - _ = this.NationalTaxAmount; - _ = this.NationalTaxCurrency; - _ = this.PurchaseIdentifier; - this.PurchaseIdentifierFormat?.Validate(); - this.Travel?.Validate(); + _ = this.ID; + _ = this.Amount; + _ = this.CardPaymentID; + this.Cashback?.Validate(); + this.Currency.Validate(); + this.Interchange?.Validate(); + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantName; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.NetworkIdentifiers.Validate(); + _ = this.PresentmentAmount; + _ = this.PresentmentCurrency; + this.PurchaseDetails?.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + _ = this.TransactionID; + this.Type.Validate(); } - public CardSettlementPurchaseDetails() { } + public CardRefund() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetails( - CardSettlementPurchaseDetails cardSettlementPurchaseDetails - ) - : base(cardSettlementPurchaseDetails) { } + public CardRefund(CardRefund cardRefund) + : base(cardRefund) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetails(IReadOnlyDictionary rawData) + public CardRefund(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetails(FrozenDictionary rawData) + CardRefund(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static CardRefund FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementPurchaseDetailsFromRaw : IFromRawJson +class CardRefundFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetails.FromRawUnchecked(rawData); + public CardRefund FromRawUnchecked(IReadOnlyDictionary rawData) => + CardRefund.FromRawUnchecked(rawData); } /// -/// Fields specific to car rentals. +/// Cashback debited for this transaction, if eligible. Cashback is paid out in aggregate, monthly. /// -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsCarRental, - CardSettlementPurchaseDetailsCarRentalFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsCarRental : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Cashback : JsonModel { /// - /// Code indicating the vehicle's class. + /// The cashback amount given as a string containing a decimal number. The amount + /// is a positive number if it will be credited to you (e.g., settlements) and + /// a negative number if it will be debited (e.g., refunds). /// - public required string? CarClassCode + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("car_class_code"); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("car_class_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// Date the customer picked up the car or, in the case of a no-show or pre-pay - /// transaction, the scheduled pick up date. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. /// - public required string? CheckoutDate + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("checkout_date"); + return this._rawData.GetNotNullClass>("currency"); } - init { this._rawData.Set("checkout_date", value); } + init { this._rawData.Set("currency", value); } } - /// - /// Daily rate being charged for the vehicle. - /// - public required long? DailyRentalRateAmount + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("daily_rental_rate_amount"); - } - init { this._rawData.Set("daily_rental_rate_amount", value); } + _ = this.Amount; + this.Currency.Validate(); } - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily - /// rental rate. - /// - public required string? DailyRentalRateCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("daily_rental_rate_currency"); - } - init { this._rawData.Set("daily_rental_rate_currency", value); } - } + public Cashback() { } - /// - /// Number of days the vehicle was rented. - /// - public required long? DaysRented +#pragma warning disable CS8618 + [SetsRequiredMembers] + public Cashback(Cashback cashback) + : base(cashback) { } +#pragma warning restore CS8618 + + public Cashback(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("days_rented"); - } - init { this._rawData.Set("days_rented", value); } + this._rawData = new(rawData); } - /// - /// Additional charges (gas, late fee, etc.) being billed. - /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsCarRentalExtraCharges - >? ExtraCharges +#pragma warning disable CS8618 + [SetsRequiredMembers] + Cashback(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("extra_charges"); - } - init { this._rawData.Set("extra_charges", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Fuel charges for the vehicle. - /// - public required long? FuelChargesAmount + /// + public static Cashback FromRawUnchecked(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("fuel_charges_amount"); - } - init { this._rawData.Set("fuel_charges_amount", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} +class CashbackFromRaw : IFromRawJson +{ + /// + public Cashback FromRawUnchecked(IReadOnlyDictionary rawData) => + Cashback.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. +/// +[JsonConverter(typeof(CashbackCurrencyConverter))] +public enum CashbackCurrency +{ /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fuel charges assessed. + /// US Dollar (USD) /// - public required string? FuelChargesCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("fuel_charges_currency"); - } - init { this._rawData.Set("fuel_charges_currency", value); } - } + Usd, +} - /// - /// Any insurance being charged for the vehicle. - /// - public required long? InsuranceChargesAmount +sealed class CashbackCurrencyConverter : JsonConverter +{ + public override CashbackCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("insurance_charges_amount"); - } - init { this._rawData.Set("insurance_charges_amount", value); } + "USD" => CashbackCurrency.Usd, + _ => (CashbackCurrency)(-1), + }; } - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the insurance - /// charges assessed. - /// - public required string? InsuranceChargesCurrency + public override void Write( + Utf8JsonWriter writer, + CashbackCurrency value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("insurance_charges_currency"); - } - init { this._rawData.Set("insurance_charges_currency", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CashbackCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's +/// settlement currency. +/// +[JsonConverter(typeof(CardRefundCurrencyConverter))] +public enum CardRefundCurrency +{ /// - /// An indicator that the cardholder is being billed for a reserved vehicle that - /// was not actually rented (that is, a "no-show" charge). + /// US Dollar (USD) /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsCarRentalNoShowIndicator - >? NoShowIndicator - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("no_show_indicator"); - } - init { this._rawData.Set("no_show_indicator", value); } - } + Usd, +} - /// - /// Charges for returning the vehicle at a different location than where it was - /// picked up. - /// - public required long? OneWayDropOffChargesAmount +sealed class CardRefundCurrencyConverter : JsonConverter +{ + public override CardRefundCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("one_way_drop_off_charges_amount"); - } - init { this._rawData.Set("one_way_drop_off_charges_amount", value); } + "USD" => CardRefundCurrency.Usd, + _ => (CardRefundCurrency)(-1), + }; } - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the one-way - /// drop-off charges assessed. - /// - public required string? OneWayDropOffChargesCurrency + public override void Write( + Utf8JsonWriter writer, + CardRefundCurrency value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("one_way_drop_off_charges_currency"); - } - init { this._rawData.Set("one_way_drop_off_charges_currency", value); } + JsonSerializer.Serialize( + writer, + value switch + { + CardRefundCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Interchange assessed as a part of this transaction. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Interchange : JsonModel +{ /// - /// Name of the person renting the vehicle. + /// The interchange amount given as a string containing a decimal number in major + /// units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + /// credited to Increase (e.g., settlements) and a negative number if it is debited + /// (e.g., refunds). /// - public required string? RenterName + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("renter_name"); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("renter_name", value); } + init { this._rawData.Set("amount", value); } } /// - /// Weekly rate being charged for the vehicle. + /// The card network specific interchange code. /// - public required long? WeeklyRentalRateAmount + public required string? Code { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("weekly_rental_rate_amount"); + return this._rawData.GetNullableClass("code"); } - init { this._rawData.Set("weekly_rental_rate_amount", value); } + init { this._rawData.Set("code", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the weekly - /// rental rate. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. /// - public required string? WeeklyRentalRateCurrency + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("weekly_rental_rate_currency"); + return this._rawData.GetNotNullClass>("currency"); } - init { this._rawData.Set("weekly_rental_rate_currency", value); } + init { this._rawData.Set("currency", value); } } /// public override void Validate() { - _ = this.CarClassCode; - _ = this.CheckoutDate; - _ = this.DailyRentalRateAmount; - _ = this.DailyRentalRateCurrency; - _ = this.DaysRented; - this.ExtraCharges?.Validate(); - _ = this.FuelChargesAmount; - _ = this.FuelChargesCurrency; - _ = this.InsuranceChargesAmount; - _ = this.InsuranceChargesCurrency; - this.NoShowIndicator?.Validate(); - _ = this.OneWayDropOffChargesAmount; - _ = this.OneWayDropOffChargesCurrency; - _ = this.RenterName; - _ = this.WeeklyRentalRateAmount; - _ = this.WeeklyRentalRateCurrency; + _ = this.Amount; + _ = this.Code; + this.Currency.Validate(); } - public CardSettlementPurchaseDetailsCarRental() { } + public Interchange() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetailsCarRental( - CardSettlementPurchaseDetailsCarRental cardSettlementPurchaseDetailsCarRental - ) - : base(cardSettlementPurchaseDetailsCarRental) { } + public Interchange(Interchange interchange) + : base(interchange) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetailsCarRental(IReadOnlyDictionary rawData) + public Interchange(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetailsCarRental(FrozenDictionary rawData) + Interchange(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsCarRental FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static Interchange FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementPurchaseDetailsCarRentalFromRaw - : IFromRawJson +class InterchangeFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetailsCarRental FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsCarRental.FromRawUnchecked(rawData); + public Interchange FromRawUnchecked(IReadOnlyDictionary rawData) => + Interchange.FromRawUnchecked(rawData); } /// -/// Additional charges (gas, late fee, etc.) being billed. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsCarRentalExtraChargesConverter))] -public enum CardSettlementPurchaseDetailsCarRentalExtraCharges +[JsonConverter(typeof(InterchangeCurrencyConverter))] +public enum InterchangeCurrency { /// - /// No extra charge - /// - NoExtraCharge, - - /// - /// Gas - /// - Gas, - - /// - /// Extra mileage - /// - ExtraMileage, - - /// - /// Late return - /// - LateReturn, - - /// - /// One way service fee - /// - OneWayServiceFee, - - /// - /// Parking violation + /// US Dollar (USD) /// - ParkingViolation, + Usd, } -sealed class CardSettlementPurchaseDetailsCarRentalExtraChargesConverter - : JsonConverter +sealed class InterchangeCurrencyConverter : JsonConverter { - public override CardSettlementPurchaseDetailsCarRentalExtraCharges Read( + public override InterchangeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -23732,85 +22437,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "no_extra_charge" => CardSettlementPurchaseDetailsCarRentalExtraCharges.NoExtraCharge, - "gas" => CardSettlementPurchaseDetailsCarRentalExtraCharges.Gas, - "extra_mileage" => CardSettlementPurchaseDetailsCarRentalExtraCharges.ExtraMileage, - "late_return" => CardSettlementPurchaseDetailsCarRentalExtraCharges.LateReturn, - "one_way_service_fee" => - CardSettlementPurchaseDetailsCarRentalExtraCharges.OneWayServiceFee, - "parking_violation" => - CardSettlementPurchaseDetailsCarRentalExtraCharges.ParkingViolation, - _ => (CardSettlementPurchaseDetailsCarRentalExtraCharges)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsCarRentalExtraCharges value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsCarRentalExtraCharges.NoExtraCharge => - "no_extra_charge", - CardSettlementPurchaseDetailsCarRentalExtraCharges.Gas => "gas", - CardSettlementPurchaseDetailsCarRentalExtraCharges.ExtraMileage => "extra_mileage", - CardSettlementPurchaseDetailsCarRentalExtraCharges.LateReturn => "late_return", - CardSettlementPurchaseDetailsCarRentalExtraCharges.OneWayServiceFee => - "one_way_service_fee", - CardSettlementPurchaseDetailsCarRentalExtraCharges.ParkingViolation => - "parking_violation", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// An indicator that the cardholder is being billed for a reserved vehicle that was -/// not actually rented (that is, a "no-show" charge). -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsCarRentalNoShowIndicatorConverter))] -public enum CardSettlementPurchaseDetailsCarRentalNoShowIndicator -{ - /// - /// Not applicable - /// - NotApplicable, - - /// - /// No show for specialized vehicle - /// - NoShowForSpecializedVehicle, -} - -sealed class CardSettlementPurchaseDetailsCarRentalNoShowIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsCarRentalNoShowIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_applicable" => CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NotApplicable, - "no_show_for_specialized_vehicle" => - CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NoShowForSpecializedVehicle, - _ => (CardSettlementPurchaseDetailsCarRentalNoShowIndicator)(-1), + "USD" => InterchangeCurrency.Usd, + _ => (InterchangeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementPurchaseDetailsCarRentalNoShowIndicator value, + InterchangeCurrency value, JsonSerializerOptions options ) { @@ -23818,10 +22452,7 @@ JsonSerializerOptions options writer, value switch { - CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NotApplicable => - "not_applicable", - CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NoShowForSpecializedVehicle => - "no_show_for_specialized_vehicle", + InterchangeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -23832,1162 +22463,1031 @@ JsonSerializerOptions options } /// -/// Fields specific to lodging. +/// Network-specific identifiers for this refund. /// [JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsLodging, - CardSettlementPurchaseDetailsLodgingFromRaw - >) + typeof(JsonModelConverter) )] -public sealed record class CardSettlementPurchaseDetailsLodging : JsonModel +public sealed record class CardRefundNetworkIdentifiers : JsonModel { /// - /// Date the customer checked in. + /// A network assigned business ID that identifies the acquirer that processed + /// this transaction. /// - public required string? CheckInDate + public required string AcquirerBusinessID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("check_in_date"); + return this._rawData.GetNotNullClass("acquirer_business_id"); } - init { this._rawData.Set("check_in_date", value); } + init { this._rawData.Set("acquirer_business_id", value); } } /// - /// Daily rate being charged for the room. + /// A globally unique identifier for this settlement. /// - public required long? DailyRoomRateAmount + public required string AcquirerReferenceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("daily_room_rate_amount"); + return this._rawData.GetNotNullClass("acquirer_reference_number"); } - init { this._rawData.Set("daily_room_rate_amount", value); } + init { this._rawData.Set("acquirer_reference_number", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily - /// room rate. + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. /// - public required string? DailyRoomRateCurrency + public required string? AuthorizationIdentificationResponse { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("daily_room_rate_currency"); + return this._rawData.GetNullableClass("authorization_identification_response"); } - init { this._rawData.Set("daily_room_rate_currency", value); } + init { this._rawData.Set("authorization_identification_response", value); } } /// - /// Additional charges (phone, late check-out, etc.) being billed. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - public required ApiEnum? ExtraCharges + public required string? TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("extra_charges"); + return this._rawData.GetNullableClass("transaction_id"); } - init { this._rawData.Set("extra_charges", value); } + init { this._rawData.Set("transaction_id", value); } + } + + /// + public override void Validate() + { + _ = this.AcquirerBusinessID; + _ = this.AcquirerReferenceNumber; + _ = this.AuthorizationIdentificationResponse; + _ = this.TransactionID; + } + + public CardRefundNetworkIdentifiers() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardRefundNetworkIdentifiers(CardRefundNetworkIdentifiers cardRefundNetworkIdentifiers) + : base(cardRefundNetworkIdentifiers) { } +#pragma warning restore CS8618 + + public CardRefundNetworkIdentifiers(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardRefundNetworkIdentifiers(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardRefundNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CardRefundNetworkIdentifiersFromRaw : IFromRawJson +{ + /// + public CardRefundNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardRefundNetworkIdentifiers.FromRawUnchecked(rawData); +} +/// +/// Additional details about the card purchase, such as tax and industry-specific fields. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class PurchaseDetails : JsonModel +{ /// - /// Folio cash advances for the room. + /// Fields specific to car rentals. /// - public required long? FolioCashAdvancesAmount + public required CarRental? CarRental { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("folio_cash_advances_amount"); + return this._rawData.GetNullableClass("car_rental"); } - init { this._rawData.Set("folio_cash_advances_amount", value); } + init { this._rawData.Set("car_rental", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the folio - /// cash advances. + /// An identifier from the merchant for the customer or consumer. /// - public required string? FolioCashAdvancesCurrency + public required string? CustomerReferenceIdentifier { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("folio_cash_advances_currency"); + return this._rawData.GetNullableClass("customer_reference_identifier"); } - init { this._rawData.Set("folio_cash_advances_currency", value); } + init { this._rawData.Set("customer_reference_identifier", value); } } /// - /// Food and beverage charges for the room. + /// The state or provincial tax amount in minor units. /// - public required long? FoodBeverageChargesAmount + public required long? LocalTaxAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("food_beverage_charges_amount"); + return this._rawData.GetNullableStruct("local_tax_amount"); } - init { this._rawData.Set("food_beverage_charges_amount", value); } + init { this._rawData.Set("local_tax_amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the food and - /// beverage charges. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local + /// tax assessed. /// - public required string? FoodBeverageChargesCurrency + public required string? LocalTaxCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("food_beverage_charges_currency"); + return this._rawData.GetNullableClass("local_tax_currency"); } - init { this._rawData.Set("food_beverage_charges_currency", value); } + init { this._rawData.Set("local_tax_currency", value); } } /// - /// Indicator that the cardholder is being billed for a reserved room that was - /// not actually used. + /// Fields specific to lodging. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsLodgingNoShowIndicator - >? NoShowIndicator + public required Lodging? Lodging { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("no_show_indicator"); + return this._rawData.GetNullableClass("lodging"); } - init { this._rawData.Set("no_show_indicator", value); } + init { this._rawData.Set("lodging", value); } } /// - /// Prepaid expenses being charged for the room. + /// The national tax amount in minor units. /// - public required long? PrepaidExpensesAmount + public required long? NationalTaxAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("prepaid_expenses_amount"); + return this._rawData.GetNullableStruct("national_tax_amount"); } - init { this._rawData.Set("prepaid_expenses_amount", value); } + init { this._rawData.Set("national_tax_amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the prepaid expenses. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local + /// tax assessed. /// - public required string? PrepaidExpensesCurrency + public required string? NationalTaxCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("prepaid_expenses_currency"); + return this._rawData.GetNullableClass("national_tax_currency"); } - init { this._rawData.Set("prepaid_expenses_currency", value); } + init { this._rawData.Set("national_tax_currency", value); } } /// - /// Number of nights the room was rented. + /// An identifier from the merchant for the purchase to the issuer and cardholder. /// - public required long? RoomNights + public required string? PurchaseIdentifier { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("room_nights"); + return this._rawData.GetNullableClass("purchase_identifier"); } - init { this._rawData.Set("room_nights", value); } + init { this._rawData.Set("purchase_identifier", value); } } /// - /// Total room tax being charged. + /// The format of the purchase identifier. /// - public required long? TotalRoomTaxAmount + public required ApiEnum? PurchaseIdentifierFormat { get { this._rawData.Freeze(); - return this._rawData.GetNullableStruct("total_room_tax_amount"); - } - init { this._rawData.Set("total_room_tax_amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total - /// room tax. - /// - public required string? TotalRoomTaxCurrency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("total_room_tax_currency"); - } - init { this._rawData.Set("total_room_tax_currency", value); } - } - - /// - /// Total tax being charged for the room. - /// - public required long? TotalTaxAmount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("total_tax_amount"); + return this._rawData.GetNullableClass>( + "purchase_identifier_format" + ); } - init { this._rawData.Set("total_tax_amount", value); } + init { this._rawData.Set("purchase_identifier_format", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total - /// tax assessed. + /// Fields specific to travel. /// - public required string? TotalTaxCurrency + public required Travel? Travel { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("total_tax_currency"); + return this._rawData.GetNullableClass("travel"); } - init { this._rawData.Set("total_tax_currency", value); } + init { this._rawData.Set("travel", value); } } /// public override void Validate() { - _ = this.CheckInDate; - _ = this.DailyRoomRateAmount; - _ = this.DailyRoomRateCurrency; - this.ExtraCharges?.Validate(); - _ = this.FolioCashAdvancesAmount; - _ = this.FolioCashAdvancesCurrency; - _ = this.FoodBeverageChargesAmount; - _ = this.FoodBeverageChargesCurrency; - this.NoShowIndicator?.Validate(); - _ = this.PrepaidExpensesAmount; - _ = this.PrepaidExpensesCurrency; - _ = this.RoomNights; - _ = this.TotalRoomTaxAmount; - _ = this.TotalRoomTaxCurrency; - _ = this.TotalTaxAmount; - _ = this.TotalTaxCurrency; + this.CarRental?.Validate(); + _ = this.CustomerReferenceIdentifier; + _ = this.LocalTaxAmount; + _ = this.LocalTaxCurrency; + this.Lodging?.Validate(); + _ = this.NationalTaxAmount; + _ = this.NationalTaxCurrency; + _ = this.PurchaseIdentifier; + this.PurchaseIdentifierFormat?.Validate(); + this.Travel?.Validate(); } - public CardSettlementPurchaseDetailsLodging() { } + public PurchaseDetails() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetailsLodging( - CardSettlementPurchaseDetailsLodging cardSettlementPurchaseDetailsLodging - ) - : base(cardSettlementPurchaseDetailsLodging) { } + public PurchaseDetails(PurchaseDetails purchaseDetails) + : base(purchaseDetails) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetailsLodging(IReadOnlyDictionary rawData) + public PurchaseDetails(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetailsLodging(FrozenDictionary rawData) + PurchaseDetails(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsLodging FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static PurchaseDetails FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementPurchaseDetailsLodgingFromRaw - : IFromRawJson +class PurchaseDetailsFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetailsLodging FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsLodging.FromRawUnchecked(rawData); + public PurchaseDetails FromRawUnchecked(IReadOnlyDictionary rawData) => + PurchaseDetails.FromRawUnchecked(rawData); } /// -/// Additional charges (phone, late check-out, etc.) being billed. +/// Fields specific to car rentals. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsLodgingExtraChargesConverter))] -public enum CardSettlementPurchaseDetailsLodgingExtraCharges +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CarRental : JsonModel { /// - /// No extra charge + /// Code indicating the vehicle's class. /// - NoExtraCharge, + public required string? CarClassCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("car_class_code"); + } + init { this._rawData.Set("car_class_code", value); } + } /// - /// Restaurant + /// Date the customer picked up the car or, in the case of a no-show or pre-pay + /// transaction, the scheduled pick up date. /// - Restaurant, + public required string? CheckoutDate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("checkout_date"); + } + init { this._rawData.Set("checkout_date", value); } + } /// - /// Gift shop + /// Daily rate being charged for the vehicle. /// - GiftShop, + public required long? DailyRentalRateAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("daily_rental_rate_amount"); + } + init { this._rawData.Set("daily_rental_rate_amount", value); } + } /// - /// Mini bar + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily + /// rental rate. /// - MiniBar, + public required string? DailyRentalRateCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("daily_rental_rate_currency"); + } + init { this._rawData.Set("daily_rental_rate_currency", value); } + } /// - /// Telephone + /// Number of days the vehicle was rented. /// - Telephone, + public required long? DaysRented + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("days_rented"); + } + init { this._rawData.Set("days_rented", value); } + } /// - /// Other + /// Additional charges (gas, late fee, etc.) being billed. /// - Other, + public required ApiEnum? ExtraCharges + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>("extra_charges"); + } + init { this._rawData.Set("extra_charges", value); } + } /// - /// Laundry + /// Fuel charges for the vehicle. /// - Laundry, -} - -sealed class CardSettlementPurchaseDetailsLodgingExtraChargesConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsLodgingExtraCharges Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required long? FuelChargesAmount { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "no_extra_charge" => CardSettlementPurchaseDetailsLodgingExtraCharges.NoExtraCharge, - "restaurant" => CardSettlementPurchaseDetailsLodgingExtraCharges.Restaurant, - "gift_shop" => CardSettlementPurchaseDetailsLodgingExtraCharges.GiftShop, - "mini_bar" => CardSettlementPurchaseDetailsLodgingExtraCharges.MiniBar, - "telephone" => CardSettlementPurchaseDetailsLodgingExtraCharges.Telephone, - "other" => CardSettlementPurchaseDetailsLodgingExtraCharges.Other, - "laundry" => CardSettlementPurchaseDetailsLodgingExtraCharges.Laundry, - _ => (CardSettlementPurchaseDetailsLodgingExtraCharges)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("fuel_charges_amount"); + } + init { this._rawData.Set("fuel_charges_amount", value); } } - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsLodgingExtraCharges value, - JsonSerializerOptions options - ) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fuel charges assessed. + /// + public required string? FuelChargesCurrency { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsLodgingExtraCharges.NoExtraCharge => "no_extra_charge", - CardSettlementPurchaseDetailsLodgingExtraCharges.Restaurant => "restaurant", - CardSettlementPurchaseDetailsLodgingExtraCharges.GiftShop => "gift_shop", - CardSettlementPurchaseDetailsLodgingExtraCharges.MiniBar => "mini_bar", - CardSettlementPurchaseDetailsLodgingExtraCharges.Telephone => "telephone", - CardSettlementPurchaseDetailsLodgingExtraCharges.Other => "other", - CardSettlementPurchaseDetailsLodgingExtraCharges.Laundry => "laundry", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fuel_charges_currency"); + } + init { this._rawData.Set("fuel_charges_currency", value); } } -} -/// -/// Indicator that the cardholder is being billed for a reserved room that was not -/// actually used. -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsLodgingNoShowIndicatorConverter))] -public enum CardSettlementPurchaseDetailsLodgingNoShowIndicator -{ /// - /// Not applicable + /// Any insurance being charged for the vehicle. /// - NotApplicable, + public required long? InsuranceChargesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("insurance_charges_amount"); + } + init { this._rawData.Set("insurance_charges_amount", value); } + } /// - /// No show - /// - NoShow, -} - -sealed class CardSettlementPurchaseDetailsLodgingNoShowIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsLodgingNoShowIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "not_applicable" => CardSettlementPurchaseDetailsLodgingNoShowIndicator.NotApplicable, - "no_show" => CardSettlementPurchaseDetailsLodgingNoShowIndicator.NoShow, - _ => (CardSettlementPurchaseDetailsLodgingNoShowIndicator)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsLodgingNoShowIndicator value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsLodgingNoShowIndicator.NotApplicable => - "not_applicable", - CardSettlementPurchaseDetailsLodgingNoShowIndicator.NoShow => "no_show", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// The format of the purchase identifier. -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsPurchaseIdentifierFormatConverter))] -public enum CardSettlementPurchaseDetailsPurchaseIdentifierFormat -{ - /// - /// Free text - /// - FreeText, - - /// - /// Order number - /// - OrderNumber, - - /// - /// Rental agreement number - /// - RentalAgreementNumber, - - /// - /// Hotel folio number - /// - HotelFolioNumber, - - /// - /// Invoice number + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the insurance + /// charges assessed. /// - InvoiceNumber, -} - -sealed class CardSettlementPurchaseDetailsPurchaseIdentifierFormatConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsPurchaseIdentifierFormat Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string? InsuranceChargesCurrency { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "free_text" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.FreeText, - "order_number" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.OrderNumber, - "rental_agreement_number" => - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.RentalAgreementNumber, - "hotel_folio_number" => - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.HotelFolioNumber, - "invoice_number" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.InvoiceNumber, - _ => (CardSettlementPurchaseDetailsPurchaseIdentifierFormat)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsPurchaseIdentifierFormat value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.FreeText => "free_text", - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.OrderNumber => "order_number", - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.RentalAgreementNumber => - "rental_agreement_number", - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.HotelFolioNumber => - "hotel_folio_number", - CardSettlementPurchaseDetailsPurchaseIdentifierFormat.InvoiceNumber => - "invoice_number", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNullableClass("insurance_charges_currency"); + } + init { this._rawData.Set("insurance_charges_currency", value); } } -} -/// -/// Fields specific to travel. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsTravel, - CardSettlementPurchaseDetailsTravelFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsTravel : JsonModel -{ /// - /// Ancillary purchases in addition to the airfare. + /// An indicator that the cardholder is being billed for a reserved vehicle that + /// was not actually rented (that is, a "no-show" charge). /// - public required CardSettlementPurchaseDetailsTravelAncillary? Ancillary + public required ApiEnum? NoShowIndicator { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "ancillary" + return this._rawData.GetNullableClass>( + "no_show_indicator" ); } - init { this._rawData.Set("ancillary", value); } + init { this._rawData.Set("no_show_indicator", value); } } /// - /// Indicates the computerized reservation system used to book the ticket. + /// Charges for returning the vehicle at a different location than where it was + /// picked up. /// - public required string? ComputerizedReservationSystem + public required long? OneWayDropOffChargesAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("computerized_reservation_system"); + return this._rawData.GetNullableStruct("one_way_drop_off_charges_amount"); } - init { this._rawData.Set("computerized_reservation_system", value); } + init { this._rawData.Set("one_way_drop_off_charges_amount", value); } } /// - /// Indicates the reason for a credit to the cardholder. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the one-way + /// drop-off charges assessed. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelCreditReasonIndicator - >? CreditReasonIndicator + public required string? OneWayDropOffChargesCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("credit_reason_indicator"); + return this._rawData.GetNullableClass("one_way_drop_off_charges_currency"); } - init { this._rawData.Set("credit_reason_indicator", value); } + init { this._rawData.Set("one_way_drop_off_charges_currency", value); } } /// - /// Date of departure. + /// Name of the person renting the vehicle. /// - public required string? DepartureDate + public required string? RenterName { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("departure_date"); + return this._rawData.GetNullableClass("renter_name"); } - init { this._rawData.Set("departure_date", value); } + init { this._rawData.Set("renter_name", value); } } /// - /// Code for the originating city or airport. + /// Weekly rate being charged for the vehicle. /// - public required string? OriginationCityAirportCode + public required long? WeeklyRentalRateAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("origination_city_airport_code"); + return this._rawData.GetNullableStruct("weekly_rental_rate_amount"); } - init { this._rawData.Set("origination_city_airport_code", value); } + init { this._rawData.Set("weekly_rental_rate_amount", value); } } /// - /// Name of the passenger. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the weekly + /// rental rate. /// - public required string? PassengerName + public required string? WeeklyRentalRateCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("passenger_name"); + return this._rawData.GetNullableClass("weekly_rental_rate_currency"); } - init { this._rawData.Set("passenger_name", value); } + init { this._rawData.Set("weekly_rental_rate_currency", value); } } - /// - /// Indicates whether this ticket is non-refundable. - /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator - >? RestrictedTicketIndicator + /// + public override void Validate() { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("restricted_ticket_indicator"); - } - init { this._rawData.Set("restricted_ticket_indicator", value); } + _ = this.CarClassCode; + _ = this.CheckoutDate; + _ = this.DailyRentalRateAmount; + _ = this.DailyRentalRateCurrency; + _ = this.DaysRented; + this.ExtraCharges?.Validate(); + _ = this.FuelChargesAmount; + _ = this.FuelChargesCurrency; + _ = this.InsuranceChargesAmount; + _ = this.InsuranceChargesCurrency; + this.NoShowIndicator?.Validate(); + _ = this.OneWayDropOffChargesAmount; + _ = this.OneWayDropOffChargesCurrency; + _ = this.RenterName; + _ = this.WeeklyRentalRateAmount; + _ = this.WeeklyRentalRateCurrency; } - /// - /// Indicates why a ticket was changed. - /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelTicketChangeIndicator - >? TicketChangeIndicator + public CarRental() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CarRental(CarRental carRental) + : base(carRental) { } +#pragma warning restore CS8618 + + public CarRental(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("ticket_change_indicator"); - } - init { this._rawData.Set("ticket_change_indicator", value); } + this._rawData = new(rawData); } - /// - /// Ticket number. - /// - public required string? TicketNumber +#pragma warning disable CS8618 + [SetsRequiredMembers] + CarRental(FrozenDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("ticket_number"); - } - init { this._rawData.Set("ticket_number", value); } + this._rawData = new(rawData); } +#pragma warning restore CS8618 - /// - /// Code for the travel agency if the ticket was issued by a travel agency. - /// - public required string? TravelAgencyCode + /// + public static CarRental FromRawUnchecked(IReadOnlyDictionary rawData) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel_agency_code"); - } - init { this._rawData.Set("travel_agency_code", value); } + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } +} + +class CarRentalFromRaw : IFromRawJson +{ + /// + public CarRental FromRawUnchecked(IReadOnlyDictionary rawData) => + CarRental.FromRawUnchecked(rawData); +} +/// +/// Additional charges (gas, late fee, etc.) being billed. +/// +[JsonConverter(typeof(ExtraChargesConverter))] +public enum ExtraCharges +{ /// - /// Name of the travel agency if the ticket was issued by a travel agency. + /// No extra charge /// - public required string? TravelAgencyName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("travel_agency_name"); - } - init { this._rawData.Set("travel_agency_name", value); } - } + NoExtraCharge, /// - /// Fields specific to each leg of the journey. + /// Gas /// - public required IReadOnlyList? TripLegs - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct< - ImmutableArray - >("trip_legs"); - } - init - { - this._rawData.Set?>( - "trip_legs", - value == null ? null : ImmutableArray.ToImmutableArray(value) - ); - } - } + Gas, - /// - public override void Validate() + /// + /// Extra mileage + /// + ExtraMileage, + + /// + /// Late return + /// + LateReturn, + + /// + /// One way service fee + /// + OneWayServiceFee, + + /// + /// Parking violation + /// + ParkingViolation, +} + +sealed class ExtraChargesConverter : JsonConverter +{ + public override ExtraCharges Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this.Ancillary?.Validate(); - _ = this.ComputerizedReservationSystem; - this.CreditReasonIndicator?.Validate(); - _ = this.DepartureDate; - _ = this.OriginationCityAirportCode; - _ = this.PassengerName; - this.RestrictedTicketIndicator?.Validate(); - this.TicketChangeIndicator?.Validate(); - _ = this.TicketNumber; - _ = this.TravelAgencyCode; - _ = this.TravelAgencyName; - foreach (var item in this.TripLegs ?? []) + return JsonSerializer.Deserialize(ref reader, options) switch { - item.Validate(); - } + "no_extra_charge" => ExtraCharges.NoExtraCharge, + "gas" => ExtraCharges.Gas, + "extra_mileage" => ExtraCharges.ExtraMileage, + "late_return" => ExtraCharges.LateReturn, + "one_way_service_fee" => ExtraCharges.OneWayServiceFee, + "parking_violation" => ExtraCharges.ParkingViolation, + _ => (ExtraCharges)(-1), + }; } - public CardSettlementPurchaseDetailsTravel() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlementPurchaseDetailsTravel( - CardSettlementPurchaseDetailsTravel cardSettlementPurchaseDetailsTravel + public override void Write( + Utf8JsonWriter writer, + ExtraCharges value, + JsonSerializerOptions options ) - : base(cardSettlementPurchaseDetailsTravel) { } -#pragma warning restore CS8618 - - public CardSettlementPurchaseDetailsTravel(IReadOnlyDictionary rawData) { - this._rawData = new(rawData); + JsonSerializer.Serialize( + writer, + value switch + { + ExtraCharges.NoExtraCharge => "no_extra_charge", + ExtraCharges.Gas => "gas", + ExtraCharges.ExtraMileage => "extra_mileage", + ExtraCharges.LateReturn => "late_return", + ExtraCharges.OneWayServiceFee => "one_way_service_fee", + ExtraCharges.ParkingViolation => "parking_violation", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlementPurchaseDetailsTravel(FrozenDictionary rawData) +/// +/// An indicator that the cardholder is being billed for a reserved vehicle that was +/// not actually rented (that is, a "no-show" charge). +/// +[JsonConverter(typeof(NoShowIndicatorConverter))] +public enum NoShowIndicator +{ + /// + /// Not applicable + /// + NotApplicable, + + /// + /// No show for specialized vehicle + /// + NoShowForSpecializedVehicle, +} + +sealed class NoShowIndicatorConverter : JsonConverter +{ + public override NoShowIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_applicable" => NoShowIndicator.NotApplicable, + "no_show_for_specialized_vehicle" => NoShowIndicator.NoShowForSpecializedVehicle, + _ => (NoShowIndicator)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsTravel FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + NoShowIndicator value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + NoShowIndicator.NotApplicable => "not_applicable", + NoShowIndicator.NoShowForSpecializedVehicle => "no_show_for_specialized_vehicle", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardSettlementPurchaseDetailsTravelFromRaw : IFromRawJson -{ - /// - public CardSettlementPurchaseDetailsTravel FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsTravel.FromRawUnchecked(rawData); -} - /// -/// Ancillary purchases in addition to the airfare. +/// Fields specific to lodging. /// -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsTravelAncillary, - CardSettlementPurchaseDetailsTravelAncillaryFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsTravelAncillary : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Lodging : JsonModel { /// - /// If this purchase has a connection or relationship to another purchase, such - /// as a baggage fee for a passenger transport ticket, this field should contain - /// the ticket document number for the other purchase. + /// Date the customer checked in. /// - public required string? ConnectedTicketDocumentNumber + public required string? CheckInDate { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("connected_ticket_document_number"); + return this._rawData.GetNullableClass("check_in_date"); } - init { this._rawData.Set("connected_ticket_document_number", value); } + init { this._rawData.Set("check_in_date", value); } } /// - /// Indicates the reason for a credit to the cardholder. + /// Daily rate being charged for the room. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator - >? CreditReasonIndicator + public required long? DailyRoomRateAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("credit_reason_indicator"); + return this._rawData.GetNullableStruct("daily_room_rate_amount"); } - init { this._rawData.Set("credit_reason_indicator", value); } + init { this._rawData.Set("daily_room_rate_amount", value); } } /// - /// Name of the passenger or description of the ancillary purchase. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily + /// room rate. /// - public required string? PassengerNameOrDescription + public required string? DailyRoomRateCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("passenger_name_or_description"); + return this._rawData.GetNullableClass("daily_room_rate_currency"); } - init { this._rawData.Set("passenger_name_or_description", value); } + init { this._rawData.Set("daily_room_rate_currency", value); } } /// - /// Additional travel charges, such as baggage fees. + /// Additional charges (phone, late check-out, etc.) being billed. /// - public required IReadOnlyList Services + public required ApiEnum? ExtraCharges { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct< - ImmutableArray - >("services"); - } - init - { - this._rawData.Set>( - "services", - ImmutableArray.ToImmutableArray(value) + return this._rawData.GetNullableClass>( + "extra_charges" ); } + init { this._rawData.Set("extra_charges", value); } } /// - /// Ticket document number. + /// Folio cash advances for the room. /// - public required string? TicketDocumentNumber + public required long? FolioCashAdvancesAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("ticket_document_number"); + return this._rawData.GetNullableStruct("folio_cash_advances_amount"); } - init { this._rawData.Set("ticket_document_number", value); } + init { this._rawData.Set("folio_cash_advances_amount", value); } } - /// - public override void Validate() + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the folio + /// cash advances. + /// + public required string? FolioCashAdvancesCurrency { - _ = this.ConnectedTicketDocumentNumber; - this.CreditReasonIndicator?.Validate(); - _ = this.PassengerNameOrDescription; - foreach (var item in this.Services) + get { - item.Validate(); + this._rawData.Freeze(); + return this._rawData.GetNullableClass("folio_cash_advances_currency"); } - _ = this.TicketDocumentNumber; + init { this._rawData.Set("folio_cash_advances_currency", value); } } - public CardSettlementPurchaseDetailsTravelAncillary() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardSettlementPurchaseDetailsTravelAncillary( - CardSettlementPurchaseDetailsTravelAncillary cardSettlementPurchaseDetailsTravelAncillary - ) - : base(cardSettlementPurchaseDetailsTravelAncillary) { } -#pragma warning restore CS8618 - - public CardSettlementPurchaseDetailsTravelAncillary( - IReadOnlyDictionary rawData - ) + /// + /// Food and beverage charges for the room. + /// + public required long? FoodBeverageChargesAmount { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("food_beverage_charges_amount"); + } + init { this._rawData.Set("food_beverage_charges_amount", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardSettlementPurchaseDetailsTravelAncillary(FrozenDictionary rawData) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the food and + /// beverage charges. + /// + public required string? FoodBeverageChargesCurrency { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("food_beverage_charges_currency"); + } + init { this._rawData.Set("food_beverage_charges_currency", value); } } -#pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsTravelAncillary FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// Indicator that the cardholder is being billed for a reserved room that was + /// not actually used. + /// + public required ApiEnum? NoShowIndicator { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>( + "no_show_indicator" + ); + } + init { this._rawData.Set("no_show_indicator", value); } } -} - -class CardSettlementPurchaseDetailsTravelAncillaryFromRaw - : IFromRawJson -{ - /// - public CardSettlementPurchaseDetailsTravelAncillary FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsTravelAncillary.FromRawUnchecked(rawData); -} -/// -/// Indicates the reason for a credit to the cardholder. -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicatorConverter))] -public enum CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator -{ /// - /// No credit + /// Prepaid expenses being charged for the room. /// - NoCredit, + public required long? PrepaidExpensesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("prepaid_expenses_amount"); + } + init { this._rawData.Set("prepaid_expenses_amount", value); } + } /// - /// Passenger transport ancillary purchase cancellation + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the prepaid expenses. /// - PassengerTransportAncillaryPurchaseCancellation, + public required string? PrepaidExpensesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("prepaid_expenses_currency"); + } + init { this._rawData.Set("prepaid_expenses_currency", value); } + } /// - /// Airline ticket and passenger transport ancillary purchase cancellation + /// Number of nights the room was rented. /// - AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + public required long? RoomNights + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("room_nights"); + } + init { this._rawData.Set("room_nights", value); } + } /// - /// Other + /// Total room tax being charged. /// - Other, -} - -sealed class CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required long? TotalRoomTaxAmount { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "no_credit" => - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.NoCredit, - "passenger_transport_ancillary_purchase_cancellation" => - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, - "other" => CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.Other, - _ => (CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("total_room_tax_amount"); + } + init { this._rawData.Set("total_room_tax_amount", value); } } - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator value, - JsonSerializerOptions options - ) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total + /// room tax. + /// + public required string? TotalRoomTaxCurrency { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.NoCredit => - "no_credit", - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => - "passenger_transport_ancillary_purchase_cancellation", - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", - CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.Other => "other", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("total_room_tax_currency"); + } + init { this._rawData.Set("total_room_tax_currency", value); } } -} -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsTravelAncillaryService, - CardSettlementPurchaseDetailsTravelAncillaryServiceFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsTravelAncillaryService : JsonModel -{ /// - /// Category of the ancillary service. + /// Total tax being charged for the room. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory - >? Category + public required long? TotalTaxAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("category"); + return this._rawData.GetNullableStruct("total_tax_amount"); } - init { this._rawData.Set("category", value); } + init { this._rawData.Set("total_tax_amount", value); } } /// - /// Sub-category of the ancillary service, free-form. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total + /// tax assessed. /// - public required string? SubCategory + public required string? TotalTaxCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("sub_category"); + return this._rawData.GetNullableClass("total_tax_currency"); } - init { this._rawData.Set("sub_category", value); } + init { this._rawData.Set("total_tax_currency", value); } } /// public override void Validate() { - this.Category?.Validate(); - _ = this.SubCategory; - } + _ = this.CheckInDate; + _ = this.DailyRoomRateAmount; + _ = this.DailyRoomRateCurrency; + this.ExtraCharges?.Validate(); + _ = this.FolioCashAdvancesAmount; + _ = this.FolioCashAdvancesCurrency; + _ = this.FoodBeverageChargesAmount; + _ = this.FoodBeverageChargesCurrency; + this.NoShowIndicator?.Validate(); + _ = this.PrepaidExpensesAmount; + _ = this.PrepaidExpensesCurrency; + _ = this.RoomNights; + _ = this.TotalRoomTaxAmount; + _ = this.TotalRoomTaxCurrency; + _ = this.TotalTaxAmount; + _ = this.TotalTaxCurrency; + } - public CardSettlementPurchaseDetailsTravelAncillaryService() { } + public Lodging() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetailsTravelAncillaryService( - CardSettlementPurchaseDetailsTravelAncillaryService cardSettlementPurchaseDetailsTravelAncillaryService - ) - : base(cardSettlementPurchaseDetailsTravelAncillaryService) { } + public Lodging(Lodging lodging) + : base(lodging) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetailsTravelAncillaryService( - IReadOnlyDictionary rawData - ) + public Lodging(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetailsTravelAncillaryService( - FrozenDictionary rawData - ) + Lodging(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsTravelAncillaryService FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static Lodging FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementPurchaseDetailsTravelAncillaryServiceFromRaw - : IFromRawJson +class LodgingFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetailsTravelAncillaryService FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsTravelAncillaryService.FromRawUnchecked(rawData); + public Lodging FromRawUnchecked(IReadOnlyDictionary rawData) => + Lodging.FromRawUnchecked(rawData); } /// -/// Category of the ancillary service. +/// Additional charges (phone, late check-out, etc.) being billed. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelAncillaryServiceCategoryConverter))] -public enum CardSettlementPurchaseDetailsTravelAncillaryServiceCategory +[JsonConverter(typeof(LodgingExtraChargesConverter))] +public enum LodgingExtraCharges { /// - /// None - /// - None, - - /// - /// Bundled service - /// - BundledService, - - /// - /// Baggage fee - /// - BaggageFee, - - /// - /// Change fee - /// - ChangeFee, - - /// - /// Cargo - /// - Cargo, - - /// - /// Carbon offset - /// - CarbonOffset, - - /// - /// Frequent flyer - /// - FrequentFlyer, - - /// - /// Gift card - /// - GiftCard, - - /// - /// Ground transport + /// No extra charge /// - GroundTransport, + NoExtraCharge, /// - /// In-flight entertainment + /// Restaurant /// - InFlightEntertainment, + Restaurant, /// - /// Lounge + /// Gift shop /// - Lounge, + GiftShop, /// - /// Medical + /// Mini bar /// - Medical, + MiniBar, /// - /// Meal beverage + /// Telephone /// - MealBeverage, + Telephone, /// /// Other @@ -24995,60 +23495,148 @@ public enum CardSettlementPurchaseDetailsTravelAncillaryServiceCategory Other, /// - /// Passenger assist fee + /// Laundry /// - PassengerAssistFee, + Laundry, +} - /// - /// Pets - /// - Pets, +sealed class LodgingExtraChargesConverter : JsonConverter +{ + public override LodgingExtraCharges Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_extra_charge" => LodgingExtraCharges.NoExtraCharge, + "restaurant" => LodgingExtraCharges.Restaurant, + "gift_shop" => LodgingExtraCharges.GiftShop, + "mini_bar" => LodgingExtraCharges.MiniBar, + "telephone" => LodgingExtraCharges.Telephone, + "other" => LodgingExtraCharges.Other, + "laundry" => LodgingExtraCharges.Laundry, + _ => (LodgingExtraCharges)(-1), + }; + } - /// - /// Seat fees - /// - SeatFees, + public override void Write( + Utf8JsonWriter writer, + LodgingExtraCharges value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + LodgingExtraCharges.NoExtraCharge => "no_extra_charge", + LodgingExtraCharges.Restaurant => "restaurant", + LodgingExtraCharges.GiftShop => "gift_shop", + LodgingExtraCharges.MiniBar => "mini_bar", + LodgingExtraCharges.Telephone => "telephone", + LodgingExtraCharges.Other => "other", + LodgingExtraCharges.Laundry => "laundry", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// Indicator that the cardholder is being billed for a reserved room that was not +/// actually used. +/// +[JsonConverter(typeof(LodgingNoShowIndicatorConverter))] +public enum LodgingNoShowIndicator +{ /// - /// Standby + /// Not applicable /// - Standby, + NotApplicable, /// - /// Service fee + /// No show /// - ServiceFee, + NoShow, +} + +sealed class LodgingNoShowIndicatorConverter : JsonConverter +{ + public override LodgingNoShowIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_applicable" => LodgingNoShowIndicator.NotApplicable, + "no_show" => LodgingNoShowIndicator.NoShow, + _ => (LodgingNoShowIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + LodgingNoShowIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + LodgingNoShowIndicator.NotApplicable => "not_applicable", + LodgingNoShowIndicator.NoShow => "no_show", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// The format of the purchase identifier. +/// +[JsonConverter(typeof(PurchaseIdentifierFormatConverter))] +public enum PurchaseIdentifierFormat +{ /// - /// Store + /// Free text /// - Store, + FreeText, /// - /// Travel service + /// Order number /// - TravelService, + OrderNumber, /// - /// Unaccompanied travel + /// Rental agreement number /// - UnaccompaniedTravel, + RentalAgreementNumber, /// - /// Upgrades + /// Hotel folio number /// - Upgrades, + HotelFolioNumber, /// - /// Wi-fi + /// Invoice number /// - Wifi, + InvoiceNumber, } -sealed class CardSettlementPurchaseDetailsTravelAncillaryServiceCategoryConverter - : JsonConverter +sealed class PurchaseIdentifierFormatConverter : JsonConverter { - public override CardSettlementPurchaseDetailsTravelAncillaryServiceCategory Read( + public override PurchaseIdentifierFormat Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -25056,46 +23644,18 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.None, - "bundled_service" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BundledService, - "baggage_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BaggageFee, - "change_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ChangeFee, - "cargo" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Cargo, - "carbon_offset" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.CarbonOffset, - "frequent_flyer" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.FrequentFlyer, - "gift_card" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GiftCard, - "ground_transport" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GroundTransport, - "in_flight_entertainment" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.InFlightEntertainment, - "lounge" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Lounge, - "medical" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Medical, - "meal_beverage" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.MealBeverage, - "other" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Other, - "passenger_assist_fee" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.PassengerAssistFee, - "pets" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Pets, - "seat_fees" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.SeatFees, - "standby" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Standby, - "service_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ServiceFee, - "store" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Store, - "travel_service" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.TravelService, - "unaccompanied_travel" => - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.UnaccompaniedTravel, - "upgrades" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Upgrades, - "wifi" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Wifi, - _ => (CardSettlementPurchaseDetailsTravelAncillaryServiceCategory)(-1), + "free_text" => PurchaseIdentifierFormat.FreeText, + "order_number" => PurchaseIdentifierFormat.OrderNumber, + "rental_agreement_number" => PurchaseIdentifierFormat.RentalAgreementNumber, + "hotel_folio_number" => PurchaseIdentifierFormat.HotelFolioNumber, + "invoice_number" => PurchaseIdentifierFormat.InvoiceNumber, + _ => (PurchaseIdentifierFormat)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory value, + PurchaseIdentifierFormat value, JsonSerializerOptions options ) { @@ -25103,42 +23663,11 @@ JsonSerializerOptions options writer, value switch { - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.None => "none", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BundledService => - "bundled_service", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BaggageFee => - "baggage_fee", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ChangeFee => - "change_fee", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Cargo => "cargo", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.CarbonOffset => - "carbon_offset", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.FrequentFlyer => - "frequent_flyer", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GiftCard => "gift_card", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GroundTransport => - "ground_transport", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.InFlightEntertainment => - "in_flight_entertainment", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Lounge => "lounge", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Medical => "medical", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.MealBeverage => - "meal_beverage", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Other => "other", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.PassengerAssistFee => - "passenger_assist_fee", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Pets => "pets", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.SeatFees => "seat_fees", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Standby => "standby", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ServiceFee => - "service_fee", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Store => "store", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.TravelService => - "travel_service", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.UnaccompaniedTravel => - "unaccompanied_travel", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Upgrades => "upgrades", - CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Wifi => "wifi", + PurchaseIdentifierFormat.FreeText => "free_text", + PurchaseIdentifierFormat.OrderNumber => "order_number", + PurchaseIdentifierFormat.RentalAgreementNumber => "rental_agreement_number", + PurchaseIdentifierFormat.HotelFolioNumber => "hotel_folio_number", + PurchaseIdentifierFormat.InvoiceNumber => "invoice_number", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -25149,390 +23678,393 @@ JsonSerializerOptions options } /// -/// Indicates the reason for a credit to the cardholder. +/// Fields specific to travel. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelCreditReasonIndicatorConverter))] -public enum CardSettlementPurchaseDetailsTravelCreditReasonIndicator +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Travel : JsonModel { /// - /// No credit + /// Ancillary purchases in addition to the airfare. /// - NoCredit, + public required Ancillary? Ancillary + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("ancillary"); + } + init { this._rawData.Set("ancillary", value); } + } /// - /// Passenger transport ancillary purchase cancellation + /// Indicates the computerized reservation system used to book the ticket. /// - PassengerTransportAncillaryPurchaseCancellation, + public required string? ComputerizedReservationSystem + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("computerized_reservation_system"); + } + init { this._rawData.Set("computerized_reservation_system", value); } + } /// - /// Airline ticket and passenger transport ancillary purchase cancellation + /// Indicates the reason for a credit to the cardholder. /// - AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + public required ApiEnum? CreditReasonIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>( + "credit_reason_indicator" + ); + } + init { this._rawData.Set("credit_reason_indicator", value); } + } /// - /// Airline ticket cancellation + /// Date of departure. /// - AirlineTicketCancellation, + public required string? DepartureDate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("departure_date"); + } + init { this._rawData.Set("departure_date", value); } + } /// - /// Other + /// Code for the originating city or airport. /// - Other, + public required string? OriginationCityAirportCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("origination_city_airport_code"); + } + init { this._rawData.Set("origination_city_airport_code", value); } + } /// - /// Partial refund of airline ticket + /// Name of the passenger. /// - PartialRefundOfAirlineTicket, -} - -sealed class CardSettlementPurchaseDetailsTravelCreditReasonIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsTravelCreditReasonIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string? PassengerName { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "no_credit" => CardSettlementPurchaseDetailsTravelCreditReasonIndicator.NoCredit, - "passenger_transport_ancillary_purchase_cancellation" => - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, - "airline_ticket_cancellation" => - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketCancellation, - "other" => CardSettlementPurchaseDetailsTravelCreditReasonIndicator.Other, - "partial_refund_of_airline_ticket" => - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PartialRefundOfAirlineTicket, - _ => (CardSettlementPurchaseDetailsTravelCreditReasonIndicator)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNullableClass("passenger_name"); + } + init { this._rawData.Set("passenger_name", value); } } - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelCreditReasonIndicator value, - JsonSerializerOptions options - ) + /// + /// Indicates whether this ticket is non-refundable. + /// + public required ApiEnum? RestrictedTicketIndicator { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.NoCredit => "no_credit", - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => - "passenger_transport_ancillary_purchase_cancellation", - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => - "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketCancellation => - "airline_ticket_cancellation", - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.Other => "other", - CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PartialRefundOfAirlineTicket => - "partial_refund_of_airline_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>( + "restricted_ticket_indicator" + ); + } + init { this._rawData.Set("restricted_ticket_indicator", value); } } -} -/// -/// Indicates whether this ticket is non-refundable. -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelRestrictedTicketIndicatorConverter))] -public enum CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator -{ /// - /// No restrictions + /// Indicates why a ticket was changed. /// - NoRestrictions, + public required ApiEnum? TicketChangeIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>( + "ticket_change_indicator" + ); + } + init { this._rawData.Set("ticket_change_indicator", value); } + } /// - /// Restricted non-refundable ticket + /// Ticket number. /// - RestrictedNonRefundableTicket, -} - -sealed class CardSettlementPurchaseDetailsTravelRestrictedTicketIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string? TicketNumber { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "no_restrictions" => - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.NoRestrictions, - "restricted_non_refundable_ticket" => - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.RestrictedNonRefundableTicket, - _ => (CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.NoRestrictions => - "no_restrictions", - CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.RestrictedNonRefundableTicket => - "restricted_non_refundable_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNullableClass("ticket_number"); + } + init { this._rawData.Set("ticket_number", value); } } -} -/// -/// Indicates why a ticket was changed. -/// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter))] -public enum CardSettlementPurchaseDetailsTravelTicketChangeIndicator -{ /// - /// None + /// Code for the travel agency if the ticket was issued by a travel agency. /// - None, + public required string? TravelAgencyCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("travel_agency_code"); + } + init { this._rawData.Set("travel_agency_code", value); } + } /// - /// Change to existing ticket + /// Name of the travel agency if the ticket was issued by a travel agency. /// - ChangeToExistingTicket, + public required string? TravelAgencyName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("travel_agency_name"); + } + init { this._rawData.Set("travel_agency_name", value); } + } /// - /// New ticket + /// Fields specific to each leg of the journey. /// - NewTicket, -} + public required IReadOnlyList? TripLegs + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct>("trip_legs"); + } + init + { + this._rawData.Set?>( + "trip_legs", + value == null ? null : ImmutableArray.ToImmutableArray(value) + ); + } + } -sealed class CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter - : JsonConverter -{ - public override CardSettlementPurchaseDetailsTravelTicketChangeIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + public override void Validate() { - return JsonSerializer.Deserialize(ref reader, options) switch + this.Ancillary?.Validate(); + _ = this.ComputerizedReservationSystem; + this.CreditReasonIndicator?.Validate(); + _ = this.DepartureDate; + _ = this.OriginationCityAirportCode; + _ = this.PassengerName; + this.RestrictedTicketIndicator?.Validate(); + this.TicketChangeIndicator?.Validate(); + _ = this.TicketNumber; + _ = this.TravelAgencyCode; + _ = this.TravelAgencyName; + foreach (var item in this.TripLegs ?? []) { - "none" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None, - "change_to_existing_ticket" => - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket, - "new_ticket" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket, - _ => (CardSettlementPurchaseDetailsTravelTicketChangeIndicator)(-1), - }; + item.Validate(); + } } - public override void Write( - Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelTicketChangeIndicator value, - JsonSerializerOptions options - ) + public Travel() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public Travel(Travel travel) + : base(travel) { } +#pragma warning restore CS8618 + + public Travel(IReadOnlyDictionary rawData) { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None => "none", - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket => - "change_to_existing_ticket", - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket => "new_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + Travel(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static Travel FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsTravelTripLeg, - CardSettlementPurchaseDetailsTravelTripLegFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsTravelTripLeg : JsonModel +class TravelFromRaw : IFromRawJson +{ + /// + public Travel FromRawUnchecked(IReadOnlyDictionary rawData) => + Travel.FromRawUnchecked(rawData); +} + +/// +/// Ancillary purchases in addition to the airfare. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Ancillary : JsonModel { /// - /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// If this purchase has a connection or relationship to another purchase, such + /// as a baggage fee for a passenger transport ticket, this field should contain + /// the ticket document number for the other purchase. /// - public required string? CarrierCode + public required string? ConnectedTicketDocumentNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("carrier_code"); + return this._rawData.GetNullableClass("connected_ticket_document_number"); } - init { this._rawData.Set("carrier_code", value); } + init { this._rawData.Set("connected_ticket_document_number", value); } } /// - /// Code for the destination city or airport. + /// Indicates the reason for a credit to the cardholder. /// - public required string? DestinationCityAirportCode + public required ApiEnum? CreditReasonIndicator { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("destination_city_airport_code"); + return this._rawData.GetNullableClass>( + "credit_reason_indicator" + ); } - init { this._rawData.Set("destination_city_airport_code", value); } + init { this._rawData.Set("credit_reason_indicator", value); } } /// - /// Fare basis code. + /// Name of the passenger or description of the ancillary purchase. /// - public required string? FareBasisCode + public required string? PassengerNameOrDescription { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("fare_basis_code"); + return this._rawData.GetNullableClass("passenger_name_or_description"); } - init { this._rawData.Set("fare_basis_code", value); } + init { this._rawData.Set("passenger_name_or_description", value); } } /// - /// Flight number. + /// Additional travel charges, such as baggage fees. /// - public required string? FlightNumber + public required IReadOnlyList Services { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("flight_number"); + return this._rawData.GetNotNullStruct>("services"); } - init { this._rawData.Set("flight_number", value); } - } - - /// - /// Service class (e.g., first class, business class, etc.). - /// - public required string? ServiceClass - { - get + init { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("service_class"); + this._rawData.Set>( + "services", + ImmutableArray.ToImmutableArray(value) + ); } - init { this._rawData.Set("service_class", value); } } /// - /// Indicates whether a stopover is allowed on this ticket. + /// Ticket document number. /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelTripLegStopOverCode - >? StopOverCode + public required string? TicketDocumentNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("stop_over_code"); + return this._rawData.GetNullableClass("ticket_document_number"); } - init { this._rawData.Set("stop_over_code", value); } + init { this._rawData.Set("ticket_document_number", value); } } /// public override void Validate() { - _ = this.CarrierCode; - _ = this.DestinationCityAirportCode; - _ = this.FareBasisCode; - _ = this.FlightNumber; - _ = this.ServiceClass; - this.StopOverCode?.Validate(); + _ = this.ConnectedTicketDocumentNumber; + this.CreditReasonIndicator?.Validate(); + _ = this.PassengerNameOrDescription; + foreach (var item in this.Services) + { + item.Validate(); + } + _ = this.TicketDocumentNumber; } - public CardSettlementPurchaseDetailsTravelTripLeg() { } + public Ancillary() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetailsTravelTripLeg( - CardSettlementPurchaseDetailsTravelTripLeg cardSettlementPurchaseDetailsTravelTripLeg - ) - : base(cardSettlementPurchaseDetailsTravelTripLeg) { } + public Ancillary(Ancillary ancillary) + : base(ancillary) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetailsTravelTripLeg( - IReadOnlyDictionary rawData - ) + public Ancillary(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetailsTravelTripLeg(FrozenDictionary rawData) + Ancillary(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static Ancillary FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementPurchaseDetailsTravelTripLegFromRaw - : IFromRawJson +class AncillaryFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsTravelTripLeg.FromRawUnchecked(rawData); + public Ancillary FromRawUnchecked(IReadOnlyDictionary rawData) => + Ancillary.FromRawUnchecked(rawData); } /// -/// Indicates whether a stopover is allowed on this ticket. +/// Indicates the reason for a credit to the cardholder. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter))] -public enum CardSettlementPurchaseDetailsTravelTripLegStopOverCode +[JsonConverter(typeof(CreditReasonIndicatorConverter))] +public enum CreditReasonIndicator { /// - /// None + /// No credit /// - None, + NoCredit, /// - /// Stop over allowed + /// Passenger transport ancillary purchase cancellation /// - StopOverAllowed, + PassengerTransportAncillaryPurchaseCancellation, /// - /// Stop over not allowed + /// Airline ticket and passenger transport ancillary purchase cancellation /// - StopOverNotAllowed, + AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + + /// + /// Other + /// + Other, } -sealed class CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter - : JsonConverter +sealed class CreditReasonIndicatorConverter : JsonConverter { - public override CardSettlementPurchaseDetailsTravelTripLegStopOverCode Read( + public override CreditReasonIndicator Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -25540,18 +24072,19 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None, - "stop_over_allowed" => - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed, - "stop_over_not_allowed" => - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed, - _ => (CardSettlementPurchaseDetailsTravelTripLegStopOverCode)(-1), + "no_credit" => CreditReasonIndicator.NoCredit, + "passenger_transport_ancillary_purchase_cancellation" => + CreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => + CreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + "other" => CreditReasonIndicator.Other, + _ => (CreditReasonIndicator)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelTripLegStopOverCode value, + CreditReasonIndicator value, JsonSerializerOptions options ) { @@ -25559,11 +24092,12 @@ JsonSerializerOptions options writer, value switch { - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None => "none", - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed => - "stop_over_allowed", - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed => - "stop_over_not_allowed", + CreditReasonIndicator.NoCredit => "no_credit", + CreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => + "passenger_transport_ancillary_purchase_cancellation", + CreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", + CreditReasonIndicator.Other => "other", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -25573,518 +24107,325 @@ JsonSerializerOptions options } } -/// -/// Surcharge amount details, if applicable. The amount is positive if the surcharge -/// is added to the overall transaction amount (surcharge), and negative if the surcharge -/// is deducted from the overall transaction amount (discount). -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardSettlementSurcharge : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Service : JsonModel { /// - /// The surcharge amount in the minor unit of the transaction's settlement currency. + /// Category of the ancillary service. /// - public required long Amount + public required ApiEnum? Category { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass>("category"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("category", value); } } /// - /// The surcharge amount in the minor unit of the transaction's presentment currency. + /// Sub-category of the ancillary service, free-form. /// - public required long PresentmentAmount + public required string? SubCategory { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("presentment_amount"); + return this._rawData.GetNullableClass("sub_category"); } - init { this._rawData.Set("presentment_amount", value); } + init { this._rawData.Set("sub_category", value); } } /// public override void Validate() { - _ = this.Amount; - _ = this.PresentmentAmount; + this.Category?.Validate(); + _ = this.SubCategory; } - public CardSettlementSurcharge() { } + public Service() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementSurcharge(CardSettlementSurcharge cardSettlementSurcharge) - : base(cardSettlementSurcharge) { } + public Service(Service service) + : base(service) { } #pragma warning restore CS8618 - public CardSettlementSurcharge(IReadOnlyDictionary rawData) + public Service(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementSurcharge(FrozenDictionary rawData) + Service(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static Service FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardSettlementSurchargeFromRaw : IFromRawJson +class ServiceFromRaw : IFromRawJson { /// - public CardSettlementSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardSettlementSurcharge.FromRawUnchecked(rawData); -} - -/// -/// A constant representing the object's type. For this resource it will always be `card_settlement`. -/// -[JsonConverter(typeof(CardSettlementTypeConverter))] -public enum CardSettlementType -{ - CardSettlement, -} - -sealed class CardSettlementTypeConverter : JsonConverter -{ - public override CardSettlementType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "card_settlement" => CardSettlementType.CardSettlement, - _ => (CardSettlementType)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardSettlementType value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardSettlementType.CardSettlement => "card_settlement", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } + public Service FromRawUnchecked(IReadOnlyDictionary rawData) => + Service.FromRawUnchecked(rawData); } /// -/// An Inbound Card Validation object. This field will be present in the JSON response -/// if and only if `category` is equal to `card_validation`. Inbound Card Validations -/// are requests from a merchant to verify that a card number and optionally its -/// address and/or Card Verification Value are valid. +/// Category of the ancillary service. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardValidation : JsonModel +[JsonConverter(typeof(ServiceCategoryConverter))] +public enum ServiceCategory { /// - /// The Card Validation identifier. + /// None /// - public required string ID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("id"); - } - init { this._rawData.Set("id", value); } - } + None, /// - /// Whether this authorization was approved by Increase, the card network through - /// stand-in processing, or the user through a real-time decision. + /// Bundled service /// - public required ApiEnum Actioner - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "actioner" - ); - } - init { this._rawData.Set("actioner", value); } - } + BundledService, /// - /// Additional amounts associated with the card authorization, such as ATM surcharges - /// fees. These are usually a subset of the `amount` field and are used to provide - /// more detailed information about the transaction. + /// Baggage fee /// - public required CardValidationAdditionalAmounts AdditionalAmounts - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "additional_amounts" - ); - } - init { this._rawData.Set("additional_amounts", value); } - } + BaggageFee, /// - /// The ID of the Card Payment this transaction belongs to. + /// Change fee /// - public required string CardPaymentID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_payment_id"); - } - init { this._rawData.Set("card_payment_id", value); } - } + ChangeFee, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. + /// Cargo /// - public required ApiEnum Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "currency" - ); - } - init { this._rawData.Set("currency", value); } - } + Cargo, /// - /// If the authorization was made via a Digital Wallet Token (such as an Apple - /// Pay purchase), the identifier of the token that was used. + /// Carbon offset /// - public required string? DigitalWalletTokenID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("digital_wallet_token_id"); - } - init { this._rawData.Set("digital_wallet_token_id", value); } - } + CarbonOffset, /// - /// The merchant identifier (commonly abbreviated as MID) of the merchant the - /// card is transacting with. + /// Frequent flyer /// - public required string MerchantAcceptorID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_acceptor_id"); - } - init { this._rawData.Set("merchant_acceptor_id", value); } - } + FrequentFlyer, /// - /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the - /// card is transacting with. + /// Gift card /// - public required string MerchantCategoryCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_category_code"); - } - init { this._rawData.Set("merchant_category_code", value); } - } + GiftCard, /// - /// The city the merchant resides in. + /// Ground transport /// - public required string? MerchantCity - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_city"); - } - init { this._rawData.Set("merchant_city", value); } - } + GroundTransport, /// - /// The country the merchant resides in. + /// In-flight entertainment /// - public required string MerchantCountry - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_country"); - } - init { this._rawData.Set("merchant_country", value); } - } + InFlightEntertainment, /// - /// The merchant descriptor of the merchant the card is transacting with. + /// Lounge /// - public required string MerchantDescriptor - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("merchant_descriptor"); - } - init { this._rawData.Set("merchant_descriptor", value); } - } + Lounge, /// - /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit - /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// Medical /// - public required string? MerchantPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_postal_code"); - } - init { this._rawData.Set("merchant_postal_code", value); } - } + Medical, /// - /// The state the merchant resides in. + /// Meal beverage /// - public required string? MerchantState - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("merchant_state"); - } - init { this._rawData.Set("merchant_state", value); } - } + MealBeverage, /// - /// Fields specific to the `network`. + /// Other /// - public required CardValidationNetworkDetails NetworkDetails - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("network_details"); - } - init { this._rawData.Set("network_details", value); } - } + Other, /// - /// Network-specific identifiers for a specific request or transaction. + /// Passenger assist fee /// - public required CardValidationNetworkIdentifiers NetworkIdentifiers - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "network_identifiers" - ); - } - init { this._rawData.Set("network_identifiers", value); } - } + PassengerAssistFee, /// - /// The risk score generated by the card network. For Visa this is the Visa Advanced - /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse - /// the score is from 0 to 999, where 999 is the riskiest. + /// Pets /// - public required long? NetworkRiskScore - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableStruct("network_risk_score"); - } - init { this._rawData.Set("network_risk_score", value); } - } + Pets, /// - /// If the authorization was made in-person with a physical card, the Physical - /// Card that was used. + /// Seat fees /// - public required string? PhysicalCardID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("physical_card_id"); - } - init { this._rawData.Set("physical_card_id", value); } - } + SeatFees, /// - /// The identifier of the Real-Time Decision sent to approve or decline this transaction. + /// Standby /// - public required string? RealTimeDecisionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("real_time_decision_id"); - } - init { this._rawData.Set("real_time_decision_id", value); } - } + Standby, /// - /// The terminal identifier (commonly abbreviated as TID) of the terminal the - /// card is transacting with. + /// Service fee /// - public required string? TerminalID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("terminal_id"); - } - init { this._rawData.Set("terminal_id", value); } - } + ServiceFee, /// - /// A constant representing the object's type. For this resource it will always - /// be `inbound_card_validation`. + /// Store /// - public required ApiEnum Type - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("type"); - } - init { this._rawData.Set("type", value); } - } + Store, /// - /// Fields related to verification of cardholder-provided values. + /// Travel service /// - public required CardValidationVerification Verification - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("verification"); - } - init { this._rawData.Set("verification", value); } - } + TravelService, - /// - public override void Validate() - { - _ = this.ID; - this.Actioner.Validate(); - this.AdditionalAmounts.Validate(); - _ = this.CardPaymentID; - this.Currency.Validate(); - _ = this.DigitalWalletTokenID; - _ = this.MerchantAcceptorID; - _ = this.MerchantCategoryCode; - _ = this.MerchantCity; - _ = this.MerchantCountry; - _ = this.MerchantDescriptor; - _ = this.MerchantPostalCode; - _ = this.MerchantState; - this.NetworkDetails.Validate(); - this.NetworkIdentifiers.Validate(); - _ = this.NetworkRiskScore; - _ = this.PhysicalCardID; - _ = this.RealTimeDecisionID; - _ = this.TerminalID; - this.Type.Validate(); - this.Verification.Validate(); - } + /// + /// Unaccompanied travel + /// + UnaccompaniedTravel, - public CardValidation() { } + /// + /// Upgrades + /// + Upgrades, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidation(CardValidation cardValidation) - : base(cardValidation) { } -#pragma warning restore CS8618 + /// + /// Wi-fi + /// + Wifi, +} - public CardValidation(IReadOnlyDictionary rawData) +sealed class ServiceCategoryConverter : JsonConverter +{ + public override ServiceCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidation(FrozenDictionary rawData) - { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => ServiceCategory.None, + "bundled_service" => ServiceCategory.BundledService, + "baggage_fee" => ServiceCategory.BaggageFee, + "change_fee" => ServiceCategory.ChangeFee, + "cargo" => ServiceCategory.Cargo, + "carbon_offset" => ServiceCategory.CarbonOffset, + "frequent_flyer" => ServiceCategory.FrequentFlyer, + "gift_card" => ServiceCategory.GiftCard, + "ground_transport" => ServiceCategory.GroundTransport, + "in_flight_entertainment" => ServiceCategory.InFlightEntertainment, + "lounge" => ServiceCategory.Lounge, + "medical" => ServiceCategory.Medical, + "meal_beverage" => ServiceCategory.MealBeverage, + "other" => ServiceCategory.Other, + "passenger_assist_fee" => ServiceCategory.PassengerAssistFee, + "pets" => ServiceCategory.Pets, + "seat_fees" => ServiceCategory.SeatFees, + "standby" => ServiceCategory.Standby, + "service_fee" => ServiceCategory.ServiceFee, + "store" => ServiceCategory.Store, + "travel_service" => ServiceCategory.TravelService, + "unaccompanied_travel" => ServiceCategory.UnaccompaniedTravel, + "upgrades" => ServiceCategory.Upgrades, + "wifi" => ServiceCategory.Wifi, + _ => (ServiceCategory)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardValidation FromRawUnchecked(IReadOnlyDictionary rawData) + public override void Write( + Utf8JsonWriter writer, + ServiceCategory value, + JsonSerializerOptions options + ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + ServiceCategory.None => "none", + ServiceCategory.BundledService => "bundled_service", + ServiceCategory.BaggageFee => "baggage_fee", + ServiceCategory.ChangeFee => "change_fee", + ServiceCategory.Cargo => "cargo", + ServiceCategory.CarbonOffset => "carbon_offset", + ServiceCategory.FrequentFlyer => "frequent_flyer", + ServiceCategory.GiftCard => "gift_card", + ServiceCategory.GroundTransport => "ground_transport", + ServiceCategory.InFlightEntertainment => "in_flight_entertainment", + ServiceCategory.Lounge => "lounge", + ServiceCategory.Medical => "medical", + ServiceCategory.MealBeverage => "meal_beverage", + ServiceCategory.Other => "other", + ServiceCategory.PassengerAssistFee => "passenger_assist_fee", + ServiceCategory.Pets => "pets", + ServiceCategory.SeatFees => "seat_fees", + ServiceCategory.Standby => "standby", + ServiceCategory.ServiceFee => "service_fee", + ServiceCategory.Store => "store", + ServiceCategory.TravelService => "travel_service", + ServiceCategory.UnaccompaniedTravel => "unaccompanied_travel", + ServiceCategory.Upgrades => "upgrades", + ServiceCategory.Wifi => "wifi", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardValidationFromRaw : IFromRawJson -{ - /// - public CardValidation FromRawUnchecked(IReadOnlyDictionary rawData) => - CardValidation.FromRawUnchecked(rawData); -} - /// -/// Whether this authorization was approved by Increase, the card network through -/// stand-in processing, or the user through a real-time decision. +/// Indicates the reason for a credit to the cardholder. /// -[JsonConverter(typeof(CardValidationActionerConverter))] -public enum CardValidationActioner +[JsonConverter(typeof(TravelCreditReasonIndicatorConverter))] +public enum TravelCreditReasonIndicator { /// - /// This object was actioned by the user through a real-time decision. + /// No credit /// - User, + NoCredit, /// - /// This object was actioned by Increase without user intervention. + /// Passenger transport ancillary purchase cancellation /// - Increase, + PassengerTransportAncillaryPurchaseCancellation, /// - /// This object was actioned by the network, through stand-in processing. + /// Airline ticket and passenger transport ancillary purchase cancellation /// - Network, + AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + + /// + /// Airline ticket cancellation + /// + AirlineTicketCancellation, + + /// + /// Other + /// + Other, + + /// + /// Partial refund of airline ticket + /// + PartialRefundOfAirlineTicket, } -sealed class CardValidationActionerConverter : JsonConverter +sealed class TravelCreditReasonIndicatorConverter : JsonConverter { - public override CardValidationActioner Read( + public override TravelCreditReasonIndicator Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -26092,16 +24433,22 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "user" => CardValidationActioner.User, - "increase" => CardValidationActioner.Increase, - "network" => CardValidationActioner.Network, - _ => (CardValidationActioner)(-1), + "no_credit" => TravelCreditReasonIndicator.NoCredit, + "passenger_transport_ancillary_purchase_cancellation" => + TravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => + TravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_cancellation" => TravelCreditReasonIndicator.AirlineTicketCancellation, + "other" => TravelCreditReasonIndicator.Other, + "partial_refund_of_airline_ticket" => + TravelCreditReasonIndicator.PartialRefundOfAirlineTicket, + _ => (TravelCreditReasonIndicator)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationActioner value, + TravelCreditReasonIndicator value, JsonSerializerOptions options ) { @@ -26109,9 +24456,16 @@ JsonSerializerOptions options writer, value switch { - CardValidationActioner.User => "user", - CardValidationActioner.Increase => "increase", - CardValidationActioner.Network => "network", + TravelCreditReasonIndicator.NoCredit => "no_credit", + TravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => + "passenger_transport_ancillary_purchase_cancellation", + TravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", + TravelCreditReasonIndicator.AirlineTicketCancellation => + "airline_ticket_cancellation", + TravelCreditReasonIndicator.Other => "other", + TravelCreditReasonIndicator.PartialRefundOfAirlineTicket => + "partial_refund_of_airline_ticket", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -26122,377 +24476,432 @@ JsonSerializerOptions options } /// -/// Additional amounts associated with the card authorization, such as ATM surcharges -/// fees. These are usually a subset of the `amount` field and are used to provide -/// more detailed information about the transaction. +/// Indicates whether this ticket is non-refundable. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmounts, - CardValidationAdditionalAmountsFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmounts : JsonModel +[JsonConverter(typeof(RestrictedTicketIndicatorConverter))] +public enum RestrictedTicketIndicator { /// - /// The part of this transaction amount that was for clinic-related services. + /// No restrictions /// - public required CardValidationAdditionalAmountsClinic? Clinic - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("clinic"); - } - init { this._rawData.Set("clinic", value); } - } + NoRestrictions, /// - /// The part of this transaction amount that was for dental-related services. + /// Restricted non-refundable ticket /// - public required CardValidationAdditionalAmountsDental? Dental + RestrictedNonRefundableTicket, +} + +sealed class RestrictedTicketIndicatorConverter : JsonConverter +{ + public override RestrictedTicketIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("dental"); - } - init { this._rawData.Set("dental", value); } + "no_restrictions" => RestrictedTicketIndicator.NoRestrictions, + "restricted_non_refundable_ticket" => + RestrictedTicketIndicator.RestrictedNonRefundableTicket, + _ => (RestrictedTicketIndicator)(-1), + }; } - /// - /// The original pre-authorized amount. - /// - public required CardValidationAdditionalAmountsOriginal? Original + public override void Write( + Utf8JsonWriter writer, + RestrictedTicketIndicator value, + JsonSerializerOptions options + ) { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "original" - ); - } - init { this._rawData.Set("original", value); } + JsonSerializer.Serialize( + writer, + value switch + { + RestrictedTicketIndicator.NoRestrictions => "no_restrictions", + RestrictedTicketIndicator.RestrictedNonRefundableTicket => + "restricted_non_refundable_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } +} +/// +/// Indicates why a ticket was changed. +/// +[JsonConverter(typeof(TicketChangeIndicatorConverter))] +public enum TicketChangeIndicator +{ /// - /// The part of this transaction amount that was for healthcare prescriptions. + /// None /// - public required CardValidationAdditionalAmountsPrescription? Prescription - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "prescription" - ); - } - init { this._rawData.Set("prescription", value); } - } + None, /// - /// The surcharge amount charged for this transaction by the merchant. + /// Change to existing ticket /// - public required CardValidationAdditionalAmountsSurcharge? Surcharge - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "surcharge" - ); + ChangeToExistingTicket, + + /// + /// New ticket + /// + NewTicket, +} + +sealed class TicketChangeIndicatorConverter : JsonConverter +{ + public override TicketChangeIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => TicketChangeIndicator.None, + "change_to_existing_ticket" => TicketChangeIndicator.ChangeToExistingTicket, + "new_ticket" => TicketChangeIndicator.NewTicket, + _ => (TicketChangeIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + TicketChangeIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + TicketChangeIndicator.None => "none", + TicketChangeIndicator.ChangeToExistingTicket => "change_to_existing_ticket", + TicketChangeIndicator.NewTicket => "new_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class TripLeg : JsonModel +{ + /// + /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// + public required string? CarrierCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("carrier_code"); } - init { this._rawData.Set("surcharge", value); } + init { this._rawData.Set("carrier_code", value); } } /// - /// The total amount of a series of incremental authorizations, optionally provided. + /// Code for the destination city or airport. /// - public required CardValidationAdditionalAmountsTotalCumulative? TotalCumulative + public required string? DestinationCityAirportCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_cumulative" - ); + return this._rawData.GetNullableClass("destination_city_airport_code"); } - init { this._rawData.Set("total_cumulative", value); } + init { this._rawData.Set("destination_city_airport_code", value); } } /// - /// The total amount of healthcare-related additional amounts. + /// Fare basis code. /// - public required CardValidationAdditionalAmountsTotalHealthcare? TotalHealthcare + public required string? FareBasisCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "total_healthcare" - ); + return this._rawData.GetNullableClass("fare_basis_code"); } - init { this._rawData.Set("total_healthcare", value); } + init { this._rawData.Set("fare_basis_code", value); } } /// - /// The part of this transaction amount that was for transit-related services. + /// Flight number. /// - public required CardValidationAdditionalAmountsTransit? Transit + public required string? FlightNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "transit" - ); + return this._rawData.GetNullableClass("flight_number"); } - init { this._rawData.Set("transit", value); } + init { this._rawData.Set("flight_number", value); } } /// - /// An unknown additional amount. + /// Service class (e.g., first class, business class, etc.). /// - public required CardValidationAdditionalAmountsUnknown? Unknown + public required string? ServiceClass { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "unknown" - ); + return this._rawData.GetNullableClass("service_class"); } - init { this._rawData.Set("unknown", value); } + init { this._rawData.Set("service_class", value); } } /// - /// The part of this transaction amount that was for vision-related services. + /// Indicates whether a stopover is allowed on this ticket. /// - public required CardValidationAdditionalAmountsVision? Vision + public required ApiEnum? StopOverCode { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("vision"); + return this._rawData.GetNullableClass>("stop_over_code"); } - init { this._rawData.Set("vision", value); } + init { this._rawData.Set("stop_over_code", value); } } /// public override void Validate() { - this.Clinic?.Validate(); - this.Dental?.Validate(); - this.Original?.Validate(); - this.Prescription?.Validate(); - this.Surcharge?.Validate(); - this.TotalCumulative?.Validate(); - this.TotalHealthcare?.Validate(); - this.Transit?.Validate(); - this.Unknown?.Validate(); - this.Vision?.Validate(); + _ = this.CarrierCode; + _ = this.DestinationCityAirportCode; + _ = this.FareBasisCode; + _ = this.FlightNumber; + _ = this.ServiceClass; + this.StopOverCode?.Validate(); } - public CardValidationAdditionalAmounts() { } + public TripLeg() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardValidationAdditionalAmounts( - CardValidationAdditionalAmounts cardValidationAdditionalAmounts - ) - : base(cardValidationAdditionalAmounts) { } + public TripLeg(TripLeg tripLeg) + : base(tripLeg) { } #pragma warning restore CS8618 - public CardValidationAdditionalAmounts(IReadOnlyDictionary rawData) + public TripLeg(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardValidationAdditionalAmounts(FrozenDictionary rawData) + TripLeg(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardValidationAdditionalAmountsFromRaw : IFromRawJson +class TripLegFromRaw : IFromRawJson { /// - public CardValidationAdditionalAmounts FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmounts.FromRawUnchecked(rawData); + public TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) => + TripLeg.FromRawUnchecked(rawData); } /// -/// The part of this transaction amount that was for clinic-related services. +/// Indicates whether a stopover is allowed on this ticket. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsClinic, - CardValidationAdditionalAmountsClinicFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsClinic : JsonModel +[JsonConverter(typeof(StopOverCodeConverter))] +public enum StopOverCode { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// None /// - public required long Amount + None, + + /// + /// Stop over allowed + /// + StopOverAllowed, + + /// + /// Stop over not allowed + /// + StopOverNotAllowed, +} + +sealed class StopOverCodeConverter : JsonConverter +{ + public override StopOverCode Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => StopOverCode.None, + "stop_over_allowed" => StopOverCode.StopOverAllowed, + "stop_over_not_allowed" => StopOverCode.StopOverNotAllowed, + _ => (StopOverCode)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + StopOverCode value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + StopOverCode.None => "none", + StopOverCode.StopOverAllowed => "stop_over_allowed", + StopOverCode.StopOverNotAllowed => "stop_over_not_allowed", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardRefundSchemeFee : JsonModel +{ + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("amount"); } init { this._rawData.Set("amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required string Currency + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("created_at", value); } } - /// - public override void Validate() + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } } - public CardValidationAdditionalAmountsClinic() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsClinic( - CardValidationAdditionalAmountsClinic cardValidationAdditionalAmountsClinic - ) - : base(cardValidationAdditionalAmountsClinic) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsClinic(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsClinic(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardValidationAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } } -} - -class CardValidationAdditionalAmountsClinicFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsClinic FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsClinic.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for dental-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsDental, - CardValidationAdditionalAmountsDentalFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsDental : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required long Amount + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required string Currency + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { _ = this.Amount; - _ = this.Currency; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardValidationAdditionalAmountsDental() { } + public CardRefundSchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardValidationAdditionalAmountsDental( - CardValidationAdditionalAmountsDental cardValidationAdditionalAmountsDental - ) - : base(cardValidationAdditionalAmountsDental) { } + public CardRefundSchemeFee(CardRefundSchemeFee cardRefundSchemeFee) + : base(cardRefundSchemeFee) { } #pragma warning restore CS8618 - public CardValidationAdditionalAmountsDental(IReadOnlyDictionary rawData) + public CardRefundSchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardValidationAdditionalAmountsDental(FrozenDictionary rawData) + CardRefundSchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsDental FromRawUnchecked( + /// + public static CardRefundSchemeFee FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -26500,874 +24909,859 @@ IReadOnlyDictionary rawData } } -class CardValidationAdditionalAmountsDentalFromRaw - : IFromRawJson +class CardRefundSchemeFeeFromRaw : IFromRawJson { /// - public CardValidationAdditionalAmountsDental FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsDental.FromRawUnchecked(rawData); + public CardRefundSchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + CardRefundSchemeFee.FromRawUnchecked(rawData); } /// -/// The original pre-authorized amount. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsOriginal, - CardValidationAdditionalAmountsOriginalFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsOriginal : JsonModel +[JsonConverter(typeof(CardRefundSchemeFeeCurrencyConverter))] +public enum CardRefundSchemeFeeCurrency { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). - /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } - - /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// US Dollar (USD) /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardValidationAdditionalAmountsOriginal() { } + Usd, +} -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsOriginal( - CardValidationAdditionalAmountsOriginal cardValidationAdditionalAmountsOriginal +sealed class CardRefundSchemeFeeCurrencyConverter : JsonConverter +{ + public override CardRefundSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options ) - : base(cardValidationAdditionalAmountsOriginal) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsOriginal(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsOriginal(FrozenDictionary rawData) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardRefundSchemeFeeCurrency.Usd, + _ => (CardRefundSchemeFeeCurrency)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardRefundSchemeFeeCurrency value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardRefundSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardValidationAdditionalAmountsOriginalFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsOriginal FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsOriginal.FromRawUnchecked(rawData); -} - /// -/// The part of this transaction amount that was for healthcare prescriptions. +/// The type of fee being assessed. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsPrescription, - CardValidationAdditionalAmountsPrescriptionFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsPrescription : JsonModel +[JsonConverter(typeof(CardRefundSchemeFeeFeeTypeConverter))] +public enum CardRefundSchemeFeeFeeType { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, - public CardValidationAdditionalAmountsPrescription() { } + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsPrescription( - CardValidationAdditionalAmountsPrescription cardValidationAdditionalAmountsPrescription - ) - : base(cardValidationAdditionalAmountsPrescription) { } -#pragma warning restore CS8618 + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, - public CardValidationAdditionalAmountsPrescription( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsPrescription(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, - /// - public static CardValidationAdditionalAmountsPrescription FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, -class CardValidationAdditionalAmountsPrescriptionFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsPrescription FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsPrescription.FromRawUnchecked(rawData); -} + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, -/// -/// The surcharge amount charged for this transaction by the merchant. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsSurcharge, - CardValidationAdditionalAmountsSurchargeFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsSurcharge : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + VisaMessageTransmission, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + VisaAccountVerificationDomestic, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, - public CardValidationAdditionalAmountsSurcharge() { } + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsSurcharge( - CardValidationAdditionalAmountsSurcharge cardValidationAdditionalAmountsSurcharge - ) - : base(cardValidationAdditionalAmountsSurcharge) { } -#pragma warning restore CS8618 + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, - public CardValidationAdditionalAmountsSurcharge( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsSurcharge(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, - /// - public static CardValidationAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, -class CardValidationAdditionalAmountsSurchargeFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsSurcharge FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsSurcharge.FromRawUnchecked(rawData); -} + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, -/// -/// The total amount of a series of incremental authorizations, optionally provided. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsTotalCumulative, - CardValidationAdditionalAmountsTotalCumulativeFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsTotalCumulative : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. /// - public required long Amount - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); - } - init { this._rawData.Set("amount", value); } - } + VisaPurchaseInternational, /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. /// - public required string Currency - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); - } - init { this._rawData.Set("currency", value); } - } + VisaCreditPurchaseToken, - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, - public CardValidationAdditionalAmountsTotalCumulative() { } + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsTotalCumulative( - CardValidationAdditionalAmountsTotalCumulative cardValidationAdditionalAmountsTotalCumulative - ) - : base(cardValidationAdditionalAmountsTotalCumulative) { } -#pragma warning restore CS8618 + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, - public CardValidationAdditionalAmountsTotalCumulative( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsTotalCumulative(FrozenDictionary rawData) + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class CardRefundSchemeFeeFeeTypeConverter : JsonConverter +{ + public override CardRefundSchemeFeeFeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - this._rawData = new(rawData); + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardRefundSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardRefundSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => CardRefundSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardRefundSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardRefundSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardRefundSchemeFeeFeeType.PulseSwitchFee, + _ => (CardRefundSchemeFeeFeeType)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsTotalCumulative FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardRefundSchemeFeeFeeType value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardRefundSchemeFeeFeeType.VisaMessageTransmission => "visa_message_transmission", + CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardRefundSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardRefundSchemeFeeFeeType.VisaClearingTransmission => "visa_clearing_transmission", + CardRefundSchemeFeeFeeType.VisaDirectAuthorization => "visa_direct_authorization", + CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardRefundSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardValidationAdditionalAmountsTotalCumulativeFromRaw - : IFromRawJson +/// +/// A constant representing the object's type. For this resource it will always be `card_refund`. +/// +[JsonConverter(typeof(CardRefundTypeConverter))] +public enum CardRefundType { - /// - public CardValidationAdditionalAmountsTotalCumulative FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); + CardRefund, +} + +sealed class CardRefundTypeConverter : JsonConverter +{ + public override CardRefundType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "card_refund" => CardRefundType.CardRefund, + _ => (CardRefundType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardRefundType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardRefundType.CardRefund => "card_refund", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } } /// -/// The total amount of healthcare-related additional amounts. +/// A Card Reversal object. This field will be present in the JSON response if and +/// only if `category` is equal to `card_reversal`. Card Reversals cancel parts of +/// or the entirety of an existing Card Authorization. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsTotalHealthcare, - CardValidationAdditionalAmountsTotalHealthcareFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsTotalHealthcare : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardReversal : JsonModel { /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The Card Reversal identifier. /// - public required long Amount + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The identifier for the Card Authorization this reverses. /// - public required string Currency + public required string CardAuthorizationID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass("card_authorization_id"); } - init { this._rawData.Set("currency", value); } - } - - /// - public override void Validate() - { - _ = this.Amount; - _ = this.Currency; - } - - public CardValidationAdditionalAmountsTotalHealthcare() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsTotalHealthcare( - CardValidationAdditionalAmountsTotalHealthcare cardValidationAdditionalAmountsTotalHealthcare - ) - : base(cardValidationAdditionalAmountsTotalHealthcare) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsTotalHealthcare( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) - { - this._rawData = new(rawData); + init { this._rawData.Set("card_authorization_id", value); } } -#pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. + /// + public required ApiEnum Currency { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("currency"); + } + init { this._rawData.Set("currency", value); } } -} - -class CardValidationAdditionalAmountsTotalHealthcareFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsTotalHealthcare FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); -} -/// -/// The part of this transaction amount that was for transit-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsTransit, - CardValidationAdditionalAmountsTransitFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsTransit : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. /// - public required long Amount + public required string MerchantAcceptorID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("merchant_acceptor_id", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + /// card is transacting with. /// - public required string Currency + public required string MerchantCategoryCode { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass("merchant_category_code"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("merchant_category_code", value); } } - /// - public override void Validate() + /// + /// The city the merchant resides in. + /// + public required string? MerchantCity { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_city"); + } + init { this._rawData.Set("merchant_city", value); } } - public CardValidationAdditionalAmountsTransit() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsTransit( - CardValidationAdditionalAmountsTransit cardValidationAdditionalAmountsTransit - ) - : base(cardValidationAdditionalAmountsTransit) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsTransit(IReadOnlyDictionary rawData) + /// + /// The country the merchant resides in. + /// + public required string? MerchantCountry { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_country"); + } + init { this._rawData.Set("merchant_country", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsTransit(FrozenDictionary rawData) + /// + /// The merchant descriptor of the merchant the card is transacting with. + /// + public required string MerchantDescriptor { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_descriptor"); + } + init { this._rawData.Set("merchant_descriptor", value); } } -#pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsTransit FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// + public required string? MerchantPostalCode { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } } -} - -class CardValidationAdditionalAmountsTransitFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsTransit FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsTransit.FromRawUnchecked(rawData); -} -/// -/// An unknown additional amount. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsUnknown, - CardValidationAdditionalAmountsUnknownFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsUnknown : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The state the merchant resides in. /// - public required long Amount + public required string? MerchantState { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNullableClass("merchant_state"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("merchant_state", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// The card network used to process this card authorization. /// - public required string Currency + public required ApiEnum Network { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNotNullClass>("network"); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("network", value); } } - /// - public override void Validate() + /// + /// Network-specific identifiers for a specific request or transaction. + /// + public required CardReversalNetworkIdentifiers NetworkIdentifiers { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); + } + init { this._rawData.Set("network_identifiers", value); } } - public CardValidationAdditionalAmountsUnknown() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsUnknown( - CardValidationAdditionalAmountsUnknown cardValidationAdditionalAmountsUnknown - ) - : base(cardValidationAdditionalAmountsUnknown) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsUnknown(IReadOnlyDictionary rawData) + /// + /// The identifier of the Pending Transaction associated with this Card Reversal. + /// + public required string? PendingTransactionID { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("pending_transaction_id"); + } + init { this._rawData.Set("pending_transaction_id", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsUnknown(FrozenDictionary rawData) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's + /// presentment currency. + /// + public required string PresentmentCurrency { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("presentment_currency"); + } + init { this._rawData.Set("presentment_currency", value); } } -#pragma warning restore CS8618 - /// - public static CardValidationAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The amount of this reversal in the minor unit of the transaction's currency. + /// For dollars, for example, this is cents. + /// + public required long ReversalAmount { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("reversal_amount"); + } + init { this._rawData.Set("reversal_amount", value); } } -} -class CardValidationAdditionalAmountsUnknownFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsUnknown FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsUnknown.FromRawUnchecked(rawData); -} - -/// -/// The part of this transaction amount that was for vision-related services. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationAdditionalAmountsVision, - CardValidationAdditionalAmountsVisionFromRaw - >) -)] -public sealed record class CardValidationAdditionalAmountsVision : JsonModel -{ /// - /// The amount in minor units of the `currency` field. The amount is positive - /// if it is added to the amount (such as an ATM surcharge fee) and negative - /// if it is subtracted from the amount (such as a discount). + /// The amount of this reversal in the minor unit of the transaction's presentment + /// currency. For dollars, for example, this is cents. /// - public required long Amount + public required long ReversalPresentmentAmount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("amount"); + return this._rawData.GetNotNullStruct("reversal_presentment_amount"); } - init { this._rawData.Set("amount", value); } + init { this._rawData.Set("reversal_presentment_amount", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional - /// amount's currency. + /// Why this reversal was initiated. /// - public required string Currency + public required ApiEnum? ReversalReason { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("currency"); + return this._rawData.GetNullableClass>( + "reversal_reason" + ); } - init { this._rawData.Set("currency", value); } + init { this._rawData.Set("reversal_reason", value); } } - /// - public override void Validate() + /// + /// The scheme fees associated with this card reversal. + /// + public required IReadOnlyList SchemeFees { - _ = this.Amount; - _ = this.Currency; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } } - public CardValidationAdditionalAmountsVision() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationAdditionalAmountsVision( - CardValidationAdditionalAmountsVision cardValidationAdditionalAmountsVision - ) - : base(cardValidationAdditionalAmountsVision) { } -#pragma warning restore CS8618 - - public CardValidationAdditionalAmountsVision(IReadOnlyDictionary rawData) + /// + /// The terminal identifier (commonly abbreviated as TID) of the terminal the + /// card is transacting with. + /// + public required string? TerminalID { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationAdditionalAmountsVision(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardValidationAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardValidationAdditionalAmountsVisionFromRaw - : IFromRawJson -{ - /// - public CardValidationAdditionalAmountsVision FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationAdditionalAmountsVision.FromRawUnchecked(rawData); -} - -/// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. -/// -[JsonConverter(typeof(CardValidationCurrencyConverter))] -public enum CardValidationCurrency -{ - /// - /// US Dollar (USD) - /// - Usd, -} - -sealed class CardValidationCurrencyConverter : JsonConverter -{ - public override CardValidationCurrency Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "USD" => CardValidationCurrency.Usd, - _ => (CardValidationCurrency)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - CardValidationCurrency value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardValidationCurrency.Usd => "USD", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNullableClass("terminal_id"); + } + init { this._rawData.Set("terminal_id", value); } } -} -/// -/// Fields specific to the `network`. -/// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardValidationNetworkDetails : JsonModel -{ /// - /// The payment network used to process this card authorization. + /// A constant representing the object's type. For this resource it will always + /// be `card_reversal`. /// - public required ApiEnum Category + public required ApiEnum Type { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("category"); + return this._rawData.GetNotNullClass>("type"); } - init { this._rawData.Set("category", value); } + init { this._rawData.Set("type", value); } } /// - /// Fields specific to the `pulse` network. + /// The amount left pending on the Card Authorization in the minor unit of the + /// transaction's currency. For dollars, for example, this is cents. /// - public required CardValidationNetworkDetailsPulse? Pulse + public required long UpdatedAuthorizationAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("pulse"); + return this._rawData.GetNotNullStruct("updated_authorization_amount"); } - init { this._rawData.Set("pulse", value); } + init { this._rawData.Set("updated_authorization_amount", value); } } /// - /// Fields specific to the `visa` network. + /// The amount left pending on the Card Authorization in the minor unit of the + /// transaction's presentment currency. For dollars, for example, this is cents. /// - public required CardValidationNetworkDetailsVisa? Visa + public required long UpdatedAuthorizationPresentmentAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("visa"); + return this._rawData.GetNotNullStruct("updated_authorization_presentment_amount"); } - init { this._rawData.Set("visa", value); } + init { this._rawData.Set("updated_authorization_presentment_amount", value); } } /// public override void Validate() { - this.Category.Validate(); - this.Pulse?.Validate(); - this.Visa?.Validate(); + _ = this.ID; + _ = this.CardAuthorizationID; + this.Currency.Validate(); + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantDescriptor; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.Network.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.PendingTransactionID; + _ = this.PresentmentCurrency; + _ = this.ReversalAmount; + _ = this.ReversalPresentmentAmount; + this.ReversalReason?.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + _ = this.TerminalID; + this.Type.Validate(); + _ = this.UpdatedAuthorizationAmount; + _ = this.UpdatedAuthorizationPresentmentAmount; } - public CardValidationNetworkDetails() { } + public CardReversal() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardValidationNetworkDetails(CardValidationNetworkDetails cardValidationNetworkDetails) - : base(cardValidationNetworkDetails) { } + public CardReversal(CardReversal cardReversal) + : base(cardReversal) { } #pragma warning restore CS8618 - public CardValidationNetworkDetails(IReadOnlyDictionary rawData) + public CardReversal(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardValidationNetworkDetails(FrozenDictionary rawData) + CardReversal(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardValidationNetworkDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static CardReversal FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardValidationNetworkDetailsFromRaw : IFromRawJson +class CardReversalFromRaw : IFromRawJson { /// - public CardValidationNetworkDetails FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationNetworkDetails.FromRawUnchecked(rawData); + public CardReversal FromRawUnchecked(IReadOnlyDictionary rawData) => + CardReversal.FromRawUnchecked(rawData); } /// -/// The payment network used to process this card authorization. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the reversal's currency. /// -[JsonConverter(typeof(CardValidationNetworkDetailsCategoryConverter))] -public enum CardValidationNetworkDetailsCategory +[JsonConverter(typeof(CardReversalCurrencyConverter))] +public enum CardReversalCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class CardReversalCurrencyConverter : JsonConverter +{ + public override CardReversalCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardReversalCurrency.Usd, + _ => (CardReversalCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardReversalCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardReversalCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The card network used to process this card authorization. +/// +[JsonConverter(typeof(CardReversalNetworkConverter))] +public enum CardReversalNetwork { /// /// Visa @@ -27380,10 +25774,9 @@ public enum CardValidationNetworkDetailsCategory Pulse, } -sealed class CardValidationNetworkDetailsCategoryConverter - : JsonConverter +sealed class CardReversalNetworkConverter : JsonConverter { - public override CardValidationNetworkDetailsCategory Read( + public override CardReversalNetwork Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -27391,15 +25784,15 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "visa" => CardValidationNetworkDetailsCategory.Visa, - "pulse" => CardValidationNetworkDetailsCategory.Pulse, - _ => (CardValidationNetworkDetailsCategory)(-1), + "visa" => CardReversalNetwork.Visa, + "pulse" => CardReversalNetwork.Pulse, + _ => (CardReversalNetwork)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationNetworkDetailsCategory value, + CardReversalNetwork value, JsonSerializerOptions options ) { @@ -27407,8 +25800,8 @@ JsonSerializerOptions options writer, value switch { - CardValidationNetworkDetailsCategory.Visa => "visa", - CardValidationNetworkDetailsCategory.Pulse => "pulse", + CardReversalNetwork.Visa => "visa", + CardReversalNetwork.Pulse => "pulse", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -27419,184 +25812,107 @@ JsonSerializerOptions options } /// -/// Fields specific to the `pulse` network. +/// Network-specific identifiers for a specific request or transaction. /// [JsonConverter( typeof(JsonModelConverter< - CardValidationNetworkDetailsPulse, - CardValidationNetworkDetailsPulseFromRaw + CardReversalNetworkIdentifiers, + CardReversalNetworkIdentifiersFromRaw >) )] -public sealed record class CardValidationNetworkDetailsPulse : JsonModel +public sealed record class CardReversalNetworkIdentifiers : JsonModel { - /// - public override void Validate() { } - - public CardValidationNetworkDetailsPulse() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationNetworkDetailsPulse( - CardValidationNetworkDetailsPulse cardValidationNetworkDetailsPulse - ) - : base(cardValidationNetworkDetailsPulse) { } -#pragma warning restore CS8618 - - public CardValidationNetworkDetailsPulse(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationNetworkDetailsPulse(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardValidationNetworkDetailsPulse FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardValidationNetworkDetailsPulseFromRaw : IFromRawJson -{ - /// - public CardValidationNetworkDetailsPulse FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationNetworkDetailsPulse.FromRawUnchecked(rawData); -} - -/// -/// Fields specific to the `visa` network. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationNetworkDetailsVisa, - CardValidationNetworkDetailsVisaFromRaw - >) -)] -public sealed record class CardValidationNetworkDetailsVisa : JsonModel -{ - /// - /// For electronic commerce transactions, this identifies the level of security - /// used in obtaining the customer's payment credential. For mail or telephone - /// order transactions, identifies the type of mail or telephone order. - /// - public required ApiEnum< - string, - CardValidationNetworkDetailsVisaElectronicCommerceIndicator - >? ElectronicCommerceIndicator - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("electronic_commerce_indicator"); - } - init { this._rawData.Set("electronic_commerce_indicator", value); } - } + /// + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. + /// + public required string? AuthorizationIdentificationResponse + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("authorization_identification_response"); + } + init { this._rawData.Set("authorization_identification_response", value); } + } /// - /// The method used to enter the cardholder's primary account number and card - /// expiration date. + /// A life-cycle identifier used across e.g., an authorization and a reversal. + /// Expected to be unique per acquirer within a window of time. For some card + /// networks the retrieval reference number includes the trace counter. /// - public required ApiEnum< - string, - CardValidationNetworkDetailsVisaPointOfServiceEntryMode - >? PointOfServiceEntryMode + public required string? RetrievalReferenceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("point_of_service_entry_mode"); + return this._rawData.GetNullableClass("retrieval_reference_number"); } - init { this._rawData.Set("point_of_service_entry_mode", value); } + init { this._rawData.Set("retrieval_reference_number", value); } } /// - /// Only present when `actioner: network`. Describes why a card authorization - /// was approved or declined by Visa through stand-in processing. + /// A counter used to verify an individual authorization. Expected to be unique + /// per acquirer within a window of time. /// - public required ApiEnum< - string, - CardValidationNetworkDetailsVisaStandInProcessingReason - >? StandInProcessingReason + public required string? TraceNumber { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("stand_in_processing_reason"); + return this._rawData.GetNullableClass("trace_number"); } - init { this._rawData.Set("stand_in_processing_reason", value); } + init { this._rawData.Set("trace_number", value); } } /// - /// The capability of the terminal being used to read the card. Shows whether - /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe - /// reads. This reflects the highest capability of the terminal — for example, - /// a terminal that supports both chip and magnetic stripe will be identified - /// as chip-capable. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - public required ApiEnum< - string, - CardValidationNetworkDetailsVisaTerminalEntryCapability - >? TerminalEntryCapability + public required string? TransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("terminal_entry_capability"); + return this._rawData.GetNullableClass("transaction_id"); } - init { this._rawData.Set("terminal_entry_capability", value); } + init { this._rawData.Set("transaction_id", value); } } /// public override void Validate() { - this.ElectronicCommerceIndicator?.Validate(); - this.PointOfServiceEntryMode?.Validate(); - this.StandInProcessingReason?.Validate(); - this.TerminalEntryCapability?.Validate(); + _ = this.AuthorizationIdentificationResponse; + _ = this.RetrievalReferenceNumber; + _ = this.TraceNumber; + _ = this.TransactionID; } - public CardValidationNetworkDetailsVisa() { } + public CardReversalNetworkIdentifiers() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardValidationNetworkDetailsVisa( - CardValidationNetworkDetailsVisa cardValidationNetworkDetailsVisa + public CardReversalNetworkIdentifiers( + CardReversalNetworkIdentifiers cardReversalNetworkIdentifiers ) - : base(cardValidationNetworkDetailsVisa) { } + : base(cardReversalNetworkIdentifiers) { } #pragma warning restore CS8618 - public CardValidationNetworkDetailsVisa(IReadOnlyDictionary rawData) + public CardReversalNetworkIdentifiers(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardValidationNetworkDetailsVisa(FrozenDictionary rawData) + CardReversalNetworkIdentifiers(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardValidationNetworkDetailsVisa FromRawUnchecked( + /// + public static CardReversalNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -27604,84 +25920,44 @@ IReadOnlyDictionary rawData } } -class CardValidationNetworkDetailsVisaFromRaw : IFromRawJson +class CardReversalNetworkIdentifiersFromRaw : IFromRawJson { /// - public CardValidationNetworkDetailsVisa FromRawUnchecked( + public CardReversalNetworkIdentifiers FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardValidationNetworkDetailsVisa.FromRawUnchecked(rawData); + ) => CardReversalNetworkIdentifiers.FromRawUnchecked(rawData); } /// -/// For electronic commerce transactions, this identifies the level of security used -/// in obtaining the customer's payment credential. For mail or telephone order transactions, -/// identifies the type of mail or telephone order. +/// Why this reversal was initiated. /// -[JsonConverter(typeof(CardValidationNetworkDetailsVisaElectronicCommerceIndicatorConverter))] -public enum CardValidationNetworkDetailsVisaElectronicCommerceIndicator +[JsonConverter(typeof(ReversalReasonConverter))] +public enum ReversalReason { /// - /// Single transaction of a mail/phone order: Use to indicate that the transaction - /// is a mail/phone order purchase, not a recurring transaction or installment - /// payment. For domestic transactions in the US region, this value may also indicate - /// one bill payment transaction in the card-present or card-absent environments. - /// - MailPhoneOrder, - - /// - /// Recurring transaction: Payment indicator used to indicate a recurring transaction - /// that originates from an acquirer in the US region. - /// - Recurring, - - /// - /// Installment payment: Payment indicator used to indicate one purchase of goods - /// or services that is billed to the account in multiple charges over a period - /// of time agreed upon by the cardholder and merchant from transactions that - /// originate from an acquirer in the US region. - /// - Installment, - - /// - /// Unknown classification: other mail order: Use to indicate that the type of - /// mail/telephone order is unknown. - /// - UnknownMailPhoneOrder, - - /// - /// Secure electronic commerce transaction: Use to indicate that the electronic - /// commerce transaction has been authenticated using e.g., 3-D Secure + /// The Card Reversal was initiated at the customer's request. /// - SecureElectronicCommerce, + ReversedByCustomer, /// - /// Non-authenticated security transaction at a 3-D Secure-capable merchant, - /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use - /// to identify an electronic commerce transaction where the merchant attempted - /// to authenticate the cardholder using 3-D Secure, but was unable to complete - /// the authentication because the issuer or cardholder does not participate in - /// the 3-D Secure program. + /// The Card Reversal was initiated by the network or acquirer. /// - NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + ReversedByNetworkOrAcquirer, /// - /// Non-authenticated security transaction: Use to identify an electronic commerce - /// transaction that uses data encryption for security however, cardholder authentication - /// is not performed using 3-D Secure. + /// The Card Reversal was initiated by the point of sale device. /// - NonAuthenticatedSecurityTransaction, + ReversedByPointOfSale, /// - /// Non-secure transaction: Use to identify an electronic commerce transaction - /// that has no data protection. + /// The Card Reversal was a partial reversal, for any reason. /// - NonSecureTransaction, + PartialReversal, } -sealed class CardValidationNetworkDetailsVisaElectronicCommerceIndicatorConverter - : JsonConverter +sealed class ReversalReasonConverter : JsonConverter { - public override CardValidationNetworkDetailsVisaElectronicCommerceIndicator Read( + public override ReversalReason Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -27689,28 +25965,17 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "mail_phone_order" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, - "recurring" => CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Recurring, - "installment" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Installment, - "unknown_mail_phone_order" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, - "secure_electronic_commerce" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, - "non_authenticated_security_transaction_at_3ds_capable_merchant" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, - "non_authenticated_security_transaction" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, - "non_secure_transaction" => - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, - _ => (CardValidationNetworkDetailsVisaElectronicCommerceIndicator)(-1), + "reversed_by_customer" => ReversalReason.ReversedByCustomer, + "reversed_by_network_or_acquirer" => ReversalReason.ReversedByNetworkOrAcquirer, + "reversed_by_point_of_sale" => ReversalReason.ReversedByPointOfSale, + "partial_reversal" => ReversalReason.PartialReversal, + _ => (ReversalReason)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationNetworkDetailsVisaElectronicCommerceIndicator value, + ReversalReason value, JsonSerializerOptions options ) { @@ -27718,93 +25983,171 @@ JsonSerializerOptions options writer, value switch { - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => - "mail_phone_order", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Recurring => - "recurring", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Installment => - "installment", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => - "unknown_mail_phone_order", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => - "secure_electronic_commerce", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => - "non_authenticated_security_transaction_at_3ds_capable_merchant", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => - "non_authenticated_security_transaction", - CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => - "non_secure_transaction", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), + ReversalReason.ReversedByCustomer => "reversed_by_customer", + ReversalReason.ReversedByNetworkOrAcquirer => "reversed_by_network_or_acquirer", + ReversalReason.ReversedByPointOfSale => "reversed_by_point_of_sale", + ReversalReason.PartialReversal => "partial_reversal", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), }, options ); } } -/// -/// The method used to enter the cardholder's primary account number and card expiration date. -/// -[JsonConverter(typeof(CardValidationNetworkDetailsVisaPointOfServiceEntryModeConverter))] -public enum CardValidationNetworkDetailsVisaPointOfServiceEntryMode +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardReversalSchemeFee : JsonModel { /// - /// Unknown + /// The fee amount given as a string containing a decimal number. /// - Unknown, + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Manual key entry + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - Manual, + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } /// - /// Magnetic stripe read, without card verification value + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - MagneticStripeNoCvv, + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } /// - /// Optical code + /// The type of fee being assessed. /// - OpticalCode, + public required ApiEnum FeeType + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } + } /// - /// Contact chip card + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - IntegratedCircuitCard, + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } /// - /// Contactless read of chip card + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - Contactless, + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } - /// - /// Transaction initiated using a credential that has previously been stored - /// on file - /// - CredentialOnFile, + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } - /// - /// Magnetic stripe read - /// - MagneticStripe, + public CardReversalSchemeFee() { } - /// - /// Contactless read of magnetic stripe data - /// - ContactlessMagneticStripe, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardReversalSchemeFee(CardReversalSchemeFee cardReversalSchemeFee) + : base(cardReversalSchemeFee) { } +#pragma warning restore CS8618 + + public CardReversalSchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardReversalSchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardReversalSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardReversalSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardReversalSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardReversalSchemeFee.FromRawUnchecked(rawData); +} +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(CardReversalSchemeFeeCurrencyConverter))] +public enum CardReversalSchemeFeeCurrency +{ /// - /// Contact chip card, without card verification value + /// US Dollar (USD) /// - IntegratedCircuitCardNoCvv, + Usd, } -sealed class CardValidationNetworkDetailsVisaPointOfServiceEntryModeConverter - : JsonConverter +sealed class CardReversalSchemeFeeCurrencyConverter : JsonConverter { - public override CardValidationNetworkDetailsVisaPointOfServiceEntryMode Read( + public override CardReversalSchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -27812,29 +26155,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "unknown" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Unknown, - "manual" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Manual, - "magnetic_stripe_no_cvv" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, - "optical_code" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, - "integrated_circuit_card" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, - "contactless" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Contactless, - "credential_on_file" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, - "magnetic_stripe" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, - "contactless_magnetic_stripe" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, - "integrated_circuit_card_no_cvv" => - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, - _ => (CardValidationNetworkDetailsVisaPointOfServiceEntryMode)(-1), + "USD" => CardReversalSchemeFeeCurrency.Usd, + _ => (CardReversalSchemeFeeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationNetworkDetailsVisaPointOfServiceEntryMode value, + CardReversalSchemeFeeCurrency value, JsonSerializerOptions options ) { @@ -27842,24 +26170,7 @@ JsonSerializerOptions options writer, value switch { - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => - "magnetic_stripe_no_cvv", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => - "optical_code", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => - "integrated_circuit_card", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Contactless => - "contactless", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => - "credential_on_file", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => - "magnetic_stripe", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => - "contactless_magnetic_stripe", - CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => - "integrated_circuit_card_no_cvv", + CardReversalSchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -27870,179 +26181,197 @@ JsonSerializerOptions options } /// -/// Only present when `actioner: network`. Describes why a card authorization was -/// approved or declined by Visa through stand-in processing. +/// The type of fee being assessed. /// -[JsonConverter(typeof(CardValidationNetworkDetailsVisaStandInProcessingReasonConverter))] -public enum CardValidationNetworkDetailsVisaStandInProcessingReason +[JsonConverter(typeof(CardReversalSchemeFeeFeeTypeConverter))] +public enum CardReversalSchemeFeeFeeType { /// - /// Increase failed to process the authorization in a timely manner. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - IssuerError, + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The physical card read had an invalid CVV or dCVV. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - InvalidPhysicalCard, + VisaInternationalServiceAssessmentCrossCurrency, /// - /// The card's authorization request cryptogram was invalid. The cryptogram can - /// be from a physical card or a Digital Wallet Token purchase. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - InvalidCryptogram, + VisaAuthorizationDomesticPointOfSale, /// - /// The 3DS cardholder authentication verification value was invalid. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - InvalidCardholderAuthenticationVerificationValue, + VisaAuthorizationInternationalPointOfSale, /// - /// An internal Visa error occurred. Visa uses this reason code for certain expected - /// occurrences as well, such as Application Transaction Counter (ATC) replays. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - InternalVisaError, + VisaAuthorizationCanadaPointOfSale, /// - /// The merchant has enabled Visa's Transaction Advisory Service and requires - /// further authentication to perform the transaction. In practice this is often - /// utilized at fuel pumps to tell the cardholder to see the cashier. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. /// - MerchantTransactionAdvisoryServiceAuthenticationRequired, + VisaAuthorizationReversalPointOfSale, /// - /// The transaction was blocked by Visa's Payment Fraud Disruption service due - /// to fraudulent Acquirer behavior, such as card testing. + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. /// - PaymentFraudDisruptionAcquirerBlock, + VisaAuthorizationReversalInternationalPointOfSale, /// - /// An unspecific reason for stand-in processing. + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. /// - Other, -} + VisaAuthorizationAddressVerificationService, -sealed class CardValidationNetworkDetailsVisaStandInProcessingReasonConverter - : JsonConverter -{ - public override CardValidationNetworkDetailsVisaStandInProcessingReason Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "issuer_error" => CardValidationNetworkDetailsVisaStandInProcessingReason.IssuerError, - "invalid_physical_card" => - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, - "invalid_cryptogram" => - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, - "invalid_cardholder_authentication_verification_value" => - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, - "internal_visa_error" => - CardValidationNetworkDetailsVisaStandInProcessingReason.InternalVisaError, - "merchant_transaction_advisory_service_authentication_required" => - CardValidationNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, - "payment_fraud_disruption_acquirer_block" => - CardValidationNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, - "other" => CardValidationNetworkDetailsVisaStandInProcessingReason.Other, - _ => (CardValidationNetworkDetailsVisaStandInProcessingReason)(-1), - }; - } + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, - public override void Write( - Utf8JsonWriter writer, - CardValidationNetworkDetailsVisaStandInProcessingReason value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - CardValidationNetworkDetailsVisaStandInProcessingReason.IssuerError => - "issuer_error", - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => - "invalid_physical_card", - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => - "invalid_cryptogram", - CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => - "invalid_cardholder_authentication_verification_value", - CardValidationNetworkDetailsVisaStandInProcessingReason.InternalVisaError => - "internal_visa_error", - CardValidationNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => - "merchant_transaction_advisory_service_authentication_required", - CardValidationNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => - "payment_fraud_disruption_acquirer_block", - CardValidationNetworkDetailsVisaStandInProcessingReason.Other => "other", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, -/// -/// The capability of the terminal being used to read the card. Shows whether a terminal -/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This -/// reflects the highest capability of the terminal — for example, a terminal that -/// supports both chip and magnetic stripe will be identified as chip-capable. -/// -[JsonConverter(typeof(CardValidationNetworkDetailsVisaTerminalEntryCapabilityConverter))] -public enum CardValidationNetworkDetailsVisaTerminalEntryCapability -{ /// - /// Unknown + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. /// - Unknown, + VisaAccountVerificationDomestic, /// - /// No terminal was used for this transaction. + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. /// - TerminalNotUsed, + VisaAccountVerificationInternational, /// - /// The terminal can only read magnetic stripes and does not have chip or contactless - /// reading capability. + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. /// - MagneticStripe, + VisaAccountVerificationCanada, /// - /// The terminal can only read barcodes. + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. /// - Barcode, + VisaCorporateAcceptanceFee, /// - /// The terminal can only read cards via Optical Character Recognition. + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. /// - OpticalCharacterRecognition, + VisaConsumerDebitAcceptanceFee, /// - /// The terminal supports contact chip cards and can also read the magnetic stripe. - /// If contact chip is supported, this value is used regardless of whether contactless - /// is also supported. + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. /// - ChipOrContactless, + VisaBusinessDebitAcceptanceFee, /// - /// The terminal supports contactless reads but does not support contact chip. - /// Only used when the terminal lacks contact chip capability. + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. /// - ContactlessOnly, + VisaPurchasingAcceptanceFee, /// - /// The terminal has no card reading capability. + /// Activity and fees for the processing of a sales draft original for a purchase transaction. /// - NoCapability, + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class CardValidationNetworkDetailsVisaTerminalEntryCapabilityConverter - : JsonConverter +sealed class CardReversalSchemeFeeFeeTypeConverter : JsonConverter { - public override CardValidationNetworkDetailsVisaTerminalEntryCapability Read( + public override CardReversalSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -28050,26 +26379,62 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "unknown" => CardValidationNetworkDetailsVisaTerminalEntryCapability.Unknown, - "terminal_not_used" => - CardValidationNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, - "magnetic_stripe" => - CardValidationNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, - "barcode" => CardValidationNetworkDetailsVisaTerminalEntryCapability.Barcode, - "optical_character_recognition" => - CardValidationNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, - "chip_or_contactless" => - CardValidationNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, - "contactless_only" => - CardValidationNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, - "no_capability" => CardValidationNetworkDetailsVisaTerminalEntryCapability.NoCapability, - _ => (CardValidationNetworkDetailsVisaTerminalEntryCapability)(-1), + "visa_international_service_assessment_single_currency" => + CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardReversalSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardReversalSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardReversalSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardReversalSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardReversalSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardReversalSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => CardReversalSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardReversalSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardReversalSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardReversalSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardReversalSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardReversalSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardReversalSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardReversalSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardReversalSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => CardReversalSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardReversalSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardReversalSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardReversalSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardReversalSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardReversalSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardReversalSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardReversalSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardReversalSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardReversalSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardReversalSchemeFeeFeeType.PulseSwitchFee, + _ => (CardReversalSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationNetworkDetailsVisaTerminalEntryCapability value, + CardReversalSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -28077,20 +26442,59 @@ JsonSerializerOptions options writer, value switch { - CardValidationNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", - CardValidationNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => - "terminal_not_used", - CardValidationNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => - "magnetic_stripe", - CardValidationNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", - CardValidationNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => - "optical_character_recognition", - CardValidationNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => - "chip_or_contactless", - CardValidationNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => - "contactless_only", - CardValidationNetworkDetailsVisaTerminalEntryCapability.NoCapability => - "no_capability", + CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardReversalSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardReversalSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardReversalSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardReversalSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardReversalSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardReversalSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardReversalSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardReversalSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardReversalSchemeFeeFeeType.VisaMessageTransmission => "visa_message_transmission", + CardReversalSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardReversalSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardReversalSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardReversalSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardReversalSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardReversalSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardReversalSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardReversalSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardReversalSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardReversalSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardReversalSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardReversalSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardReversalSchemeFeeFeeType.VisaDirectAuthorization => "visa_direct_authorization", + CardReversalSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardReversalSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardReversalSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardReversalSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardReversalSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardReversalSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -28101,134 +26505,17 @@ JsonSerializerOptions options } /// -/// Network-specific identifiers for a specific request or transaction. +/// A constant representing the object's type. For this resource it will always be `card_reversal`. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationNetworkIdentifiers, - CardValidationNetworkIdentifiersFromRaw - >) -)] -public sealed record class CardValidationNetworkIdentifiers : JsonModel +[JsonConverter(typeof(CardReversalTypeConverter))] +public enum CardReversalType { - /// - /// The randomly generated 6-character Authorization Identification Response code - /// sent back to the acquirer in an approved response. - /// - public required string? AuthorizationIdentificationResponse - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("authorization_identification_response"); - } - init { this._rawData.Set("authorization_identification_response", value); } - } + CardReversal, +} - /// - /// A life-cycle identifier used across e.g., an authorization and a reversal. - /// Expected to be unique per acquirer within a window of time. For some card - /// networks the retrieval reference number includes the trace counter. - /// - public required string? RetrievalReferenceNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("retrieval_reference_number"); - } - init { this._rawData.Set("retrieval_reference_number", value); } - } - - /// - /// A counter used to verify an individual authorization. Expected to be unique - /// per acquirer within a window of time. - /// - public required string? TraceNumber - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("trace_number"); - } - init { this._rawData.Set("trace_number", value); } - } - - /// - /// A globally unique transaction identifier provided by the card network, used - /// across multiple life-cycle requests. - /// - public required string? TransactionID - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("transaction_id"); - } - init { this._rawData.Set("transaction_id", value); } - } - - /// - public override void Validate() - { - _ = this.AuthorizationIdentificationResponse; - _ = this.RetrievalReferenceNumber; - _ = this.TraceNumber; - _ = this.TransactionID; - } - - public CardValidationNetworkIdentifiers() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationNetworkIdentifiers( - CardValidationNetworkIdentifiers cardValidationNetworkIdentifiers - ) - : base(cardValidationNetworkIdentifiers) { } -#pragma warning restore CS8618 - - public CardValidationNetworkIdentifiers(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationNetworkIdentifiers(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static CardValidationNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class CardValidationNetworkIdentifiersFromRaw : IFromRawJson -{ - /// - public CardValidationNetworkIdentifiers FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationNetworkIdentifiers.FromRawUnchecked(rawData); -} - -/// -/// A constant representing the object's type. For this resource it will always be `inbound_card_validation`. -/// -[JsonConverter(typeof(CardValidationTypeConverter))] -public enum CardValidationType -{ - InboundCardValidation, -} - -sealed class CardValidationTypeConverter : JsonConverter +sealed class CardReversalTypeConverter : JsonConverter { - public override CardValidationType Read( + public override CardReversalType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -28236,14 +26523,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "inbound_card_validation" => CardValidationType.InboundCardValidation, - _ => (CardValidationType)(-1), + "card_reversal" => CardReversalType.CardReversal, + _ => (CardReversalType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationType value, + CardReversalType value, JsonSerializerOptions options ) { @@ -28251,7 +26538,7 @@ JsonSerializerOptions options writer, value switch { - CardValidationType.InboundCardValidation => "inbound_card_validation", + CardReversalType.CardReversal => "card_reversal", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -28262,426 +26549,513 @@ JsonSerializerOptions options } /// -/// Fields related to verification of cardholder-provided values. +/// A Card Settlement object. This field will be present in the JSON response if +/// and only if `category` is equal to `card_settlement`. Card Settlements are card +/// transactions that have cleared and settled. While a settlement is usually preceded +/// by an authorization, an acquirer can also directly clear a transaction without +/// first authorizing it. /// -[JsonConverter( - typeof(JsonModelConverter) -)] -public sealed record class CardValidationVerification : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardSettlement : JsonModel { /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. + /// The Card Settlement identifier. /// - public required CardValidationVerificationCardVerificationCode CardVerificationCode + public required string ID { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "card_verification_code" - ); + return this._rawData.GetNotNullClass("id"); } - init { this._rawData.Set("card_verification_code", value); } + init { this._rawData.Set("id", value); } } /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// The amount in the minor unit of the transaction's settlement currency. For + /// dollars, for example, this is cents. /// - public required CardValidationVerificationCardholderAddress CardholderAddress + public required long Amount { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass( - "cardholder_address" - ); + return this._rawData.GetNotNullStruct("amount"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("amount", value); } } /// - /// Cardholder name provided in the authorization request. + /// The Card Authorization that was created prior to this Card Settlement, if + /// one exists. /// - public required CardValidationVerificationCardholderName? CardholderName + public required string? CardAuthorization { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass( - "cardholder_name" - ); + return this._rawData.GetNullableClass("card_authorization"); } - init { this._rawData.Set("cardholder_name", value); } - } - - /// - public override void Validate() - { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); + init { this._rawData.Set("card_authorization", value); } } - public CardValidationVerification() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationVerification(CardValidationVerification cardValidationVerification) - : base(cardValidationVerification) { } -#pragma warning restore CS8618 - - public CardValidationVerification(IReadOnlyDictionary rawData) + /// + /// The ID of the Card Payment this transaction belongs to. + /// + public required string CardPaymentID { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("card_payment_id"); + } + init { this._rawData.Set("card_payment_id", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationVerification(FrozenDictionary rawData) + /// + /// Cashback earned on this transaction, if eligible. Cashback is paid out in + /// aggregate, monthly. + /// + public required CardSettlementCashback? Cashback { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("cashback"); + } + init { this._rawData.Set("cashback", value); } } -#pragma warning restore CS8618 - /// - public static CardValidationVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// settlement currency. + /// + public required ApiEnum Currency { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } } -} - -class CardValidationVerificationFromRaw : IFromRawJson -{ - /// - public CardValidationVerification FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationVerification.FromRawUnchecked(rawData); -} -/// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationVerificationCardVerificationCode, - CardValidationVerificationCardVerificationCodeFromRaw - >) -)] -public sealed record class CardValidationVerificationCardVerificationCode : JsonModel -{ /// - /// The result of verifying the Card Verification Code. + /// Interchange assessed as a part of this transaction. /// - public required ApiEnum Result + public required CardSettlementInterchange? Interchange { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNullableClass("interchange"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("interchange", value); } } - /// - public override void Validate() - { - this.Result.Validate(); - } - - public CardValidationVerificationCardVerificationCode() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationVerificationCardVerificationCode( - CardValidationVerificationCardVerificationCode cardValidationVerificationCardVerificationCode - ) - : base(cardValidationVerificationCardVerificationCode) { } -#pragma warning restore CS8618 - - public CardValidationVerificationCardVerificationCode( - IReadOnlyDictionary rawData - ) + /// + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. + /// + public required string MerchantAcceptorID { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); + } + init { this._rawData.Set("merchant_acceptor_id", value); } } -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationVerificationCardVerificationCode(FrozenDictionary rawData) + /// + /// The 4-digit MCC describing the merchant's business. + /// + public required string MerchantCategoryCode { - this._rawData = new(rawData); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_category_code"); + } + init { this._rawData.Set("merchant_category_code", value); } } -#pragma warning restore CS8618 - /// - public static CardValidationVerificationCardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + /// The city the merchant resides in. + /// + public required string MerchantCity { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_city"); + } + init { this._rawData.Set("merchant_city", value); } } - [SetsRequiredMembers] - public CardValidationVerificationCardVerificationCode( - ApiEnum result - ) - : this() + /// + /// The country the merchant resides in. + /// + public required string MerchantCountry { - this.Result = result; + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_country"); + } + init { this._rawData.Set("merchant_country", value); } } -} - -class CardValidationVerificationCardVerificationCodeFromRaw - : IFromRawJson -{ - /// - public CardValidationVerificationCardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationVerificationCardVerificationCode.FromRawUnchecked(rawData); -} -/// -/// The result of verifying the Card Verification Code. -/// -[JsonConverter(typeof(CardValidationVerificationCardVerificationCodeResultConverter))] -public enum CardValidationVerificationCardVerificationCodeResult -{ /// - /// No card verification code was provided in the authorization request. + /// The name of the merchant. /// - NotChecked, + public required string MerchantName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_name"); + } + init { this._rawData.Set("merchant_name", value); } + } /// - /// The card verification code matched the one on file. + /// The merchant's postal code. For US merchants this is always a 5-digit ZIP code. /// - Match, + public required string? MerchantPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } + } /// - /// The card verification code did not match the one on file. + /// The state the merchant resides in. /// - NoMatch, -} - -sealed class CardValidationVerificationCardVerificationCodeResultConverter - : JsonConverter -{ - public override CardValidationVerificationCardVerificationCodeResult Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + public required string? MerchantState { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "not_checked" => CardValidationVerificationCardVerificationCodeResult.NotChecked, - "match" => CardValidationVerificationCardVerificationCodeResult.Match, - "no_match" => CardValidationVerificationCardVerificationCodeResult.NoMatch, - _ => (CardValidationVerificationCardVerificationCodeResult)(-1), - }; + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_state"); + } + init { this._rawData.Set("merchant_state", value); } } - public override void Write( - Utf8JsonWriter writer, - CardValidationVerificationCardVerificationCodeResult value, - JsonSerializerOptions options - ) + /// + /// The card network on which this transaction was processed. + /// + public required ApiEnum Network { - JsonSerializer.Serialize( - writer, - value switch - { - CardValidationVerificationCardVerificationCodeResult.NotChecked => "not_checked", - CardValidationVerificationCardVerificationCodeResult.Match => "match", - CardValidationVerificationCardVerificationCodeResult.NoMatch => "no_match", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("network"); + } + init { this._rawData.Set("network", value); } } -} -/// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. -/// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationVerificationCardholderAddress, - CardValidationVerificationCardholderAddressFromRaw - >) -)] -public sealed record class CardValidationVerificationCardholderAddress : JsonModel -{ /// - /// Line 1 of the address on file for the cardholder. + /// Network-specific identifiers for this refund. /// - public required string? ActualLine1 + public required CardSettlementNetworkIdentifiers NetworkIdentifiers { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); } - init { this._rawData.Set("actual_line1", value); } + init { this._rawData.Set("network_identifiers", value); } } /// - /// The postal code of the address on file for the cardholder. + /// The identifier of the Pending Transaction associated with this Transaction. /// - public required string? ActualPostalCode + public required string? PendingTransactionID { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); + return this._rawData.GetNullableClass("pending_transaction_id"); } - init { this._rawData.Set("actual_postal_code", value); } + init { this._rawData.Set("pending_transaction_id", value); } } /// - /// The cardholder address line 1 provided for verification in the authorization request. + /// The amount in the minor unit of the transaction's presentment currency. /// - public required string? ProvidedLine1 + public required long PresentmentAmount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); + return this._rawData.GetNotNullStruct("presentment_amount"); } - init { this._rawData.Set("provided_line1", value); } + init { this._rawData.Set("presentment_amount", value); } } /// - /// The postal code provided for verification in the authorization request. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's + /// presentment currency. /// - public required string? ProvidedPostalCode + public required string PresentmentCurrency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); + return this._rawData.GetNotNullClass("presentment_currency"); } - init { this._rawData.Set("provided_postal_code", value); } + init { this._rawData.Set("presentment_currency", value); } } /// - /// The address verification result returned to the card network. + /// Additional details about the card purchase, such as tax and industry-specific fields. /// - public required ApiEnum Result + public required CardSettlementPurchaseDetails? PurchaseDetails { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass< - ApiEnum - >("result"); + return this._rawData.GetNullableClass( + "purchase_details" + ); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("purchase_details", value); } } - /// - public override void Validate() + /// + /// The scheme fees associated with this card settlement. + /// + public required IReadOnlyList SchemeFees { - _ = this.ActualLine1; - _ = this.ActualPostalCode; - _ = this.ProvidedLine1; - _ = this.ProvidedPostalCode; - this.Result.Validate(); + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } } - public CardValidationVerificationCardholderAddress() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationVerificationCardholderAddress( - CardValidationVerificationCardholderAddress cardValidationVerificationCardholderAddress - ) - : base(cardValidationVerificationCardholderAddress) { } -#pragma warning restore CS8618 - - public CardValidationVerificationCardholderAddress( - IReadOnlyDictionary rawData - ) + /// + /// Surcharge amount details, if applicable. The amount is positive if the surcharge + /// is added to the overall transaction amount (surcharge), and negative if the + /// surcharge is deducted from the overall transaction amount (discount). + /// + public required CardSettlementSurcharge? Surcharge + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("surcharge"); + } + init { this._rawData.Set("surcharge", value); } + } + + /// + /// The identifier of the Transaction associated with this Transaction. + /// + public required string TransactionID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("transaction_id"); + } + init { this._rawData.Set("transaction_id", value); } + } + + /// + /// A constant representing the object's type. For this resource it will always + /// be `card_settlement`. + /// + public required ApiEnum Type + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("type"); + } + init { this._rawData.Set("type", value); } + } + + /// + public override void Validate() + { + _ = this.ID; + _ = this.Amount; + _ = this.CardAuthorization; + _ = this.CardPaymentID; + this.Cashback?.Validate(); + this.Currency.Validate(); + this.Interchange?.Validate(); + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantName; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.Network.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.PendingTransactionID; + _ = this.PresentmentAmount; + _ = this.PresentmentCurrency; + this.PurchaseDetails?.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + this.Surcharge?.Validate(); + _ = this.TransactionID; + this.Type.Validate(); + } + + public CardSettlement() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlement(CardSettlement cardSettlement) + : base(cardSettlement) { } +#pragma warning restore CS8618 + + public CardSettlement(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardValidationVerificationCardholderAddress(FrozenDictionary rawData) + CardSettlement(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardValidationVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static CardSettlement FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class CardValidationVerificationCardholderAddressFromRaw - : IFromRawJson +class CardSettlementFromRaw : IFromRawJson { /// - public CardValidationVerificationCardholderAddress FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationVerificationCardholderAddress.FromRawUnchecked(rawData); + public CardSettlement FromRawUnchecked(IReadOnlyDictionary rawData) => + CardSettlement.FromRawUnchecked(rawData); } /// -/// The address verification result returned to the card network. +/// Cashback earned on this transaction, if eligible. Cashback is paid out in aggregate, monthly. /// -[JsonConverter(typeof(CardValidationVerificationCardholderAddressResultConverter))] -public enum CardValidationVerificationCardholderAddressResult +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardSettlementCashback : JsonModel { /// - /// No address information was provided in the authorization request. + /// The cashback amount given as a string containing a decimal number. The amount + /// is a positive number if it will be credited to you (e.g., settlements) and + /// a negative number if it will be debited (e.g., refunds). /// - NotChecked, + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } /// - /// Postal code matches, but the street address does not match or was not provided. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. /// - PostalCodeMatchAddressNoMatch, + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } - /// - /// Postal code does not match, but the street address matches or was not provided. - /// - PostalCodeNoMatchAddressMatch, + /// + public override void Validate() + { + _ = this.Amount; + this.Currency.Validate(); + } - /// - /// Postal code and street address match. - /// - Match, + public CardSettlementCashback() { } - /// - /// Postal code and street address do not match. - /// - NoMatch, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementCashback(CardSettlementCashback cardSettlementCashback) + : base(cardSettlementCashback) { } +#pragma warning restore CS8618 + public CardSettlementCashback(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementCashback(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementCashback FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementCashbackFromRaw : IFromRawJson +{ + /// + public CardSettlementCashback FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementCashback.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the cashback. +/// +[JsonConverter(typeof(CardSettlementCashbackCurrencyConverter))] +public enum CardSettlementCashbackCurrency +{ /// - /// Postal code matches, but the street address was not verified. (deprecated) + /// US Dollar (USD) /// - PostalCodeMatchAddressNotChecked, + Usd, } -sealed class CardValidationVerificationCardholderAddressResultConverter - : JsonConverter +sealed class CardSettlementCashbackCurrencyConverter : JsonConverter { - public override CardValidationVerificationCardholderAddressResult Read( + public override CardSettlementCashbackCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -28689,22 +27063,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => CardValidationVerificationCardholderAddressResult.NotChecked, - "postal_code_match_address_no_match" => - CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, - "postal_code_no_match_address_match" => - CardValidationVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, - "match" => CardValidationVerificationCardholderAddressResult.Match, - "no_match" => CardValidationVerificationCardholderAddressResult.NoMatch, - "postal_code_match_address_not_checked" => - CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, - _ => (CardValidationVerificationCardholderAddressResult)(-1), + "USD" => CardSettlementCashbackCurrency.Usd, + _ => (CardSettlementCashbackCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardValidationVerificationCardholderAddressResult value, + CardSettlementCashbackCurrency value, JsonSerializerOptions options ) { @@ -28712,15 +27078,7 @@ JsonSerializerOptions options writer, value switch { - CardValidationVerificationCardholderAddressResult.NotChecked => "not_checked", - CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => - "postal_code_match_address_no_match", - CardValidationVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => - "postal_code_no_match_address_match", - CardValidationVerificationCardholderAddressResult.Match => "match", - CardValidationVerificationCardholderAddressResult.NoMatch => "no_match", - CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => - "postal_code_match_address_not_checked", + CardSettlementCashbackCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -28731,156 +27089,66 @@ JsonSerializerOptions options } /// -/// Cardholder name provided in the authorization request. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's +/// settlement currency. /// -[JsonConverter( - typeof(JsonModelConverter< - CardValidationVerificationCardholderName, - CardValidationVerificationCardholderNameFromRaw - >) -)] -public sealed record class CardValidationVerificationCardholderName : JsonModel +[JsonConverter(typeof(CardSettlementCurrencyConverter))] +public enum CardSettlementCurrency { /// - /// The first name provided for verification in the authorization request. + /// US Dollar (USD) /// - public required string? ProvidedFirstName + Usd, +} + +sealed class CardSettlementCurrencyConverter : JsonConverter +{ + public override CardSettlementCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) { - get + return JsonSerializer.Deserialize(ref reader, options) switch { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_first_name"); - } - init { this._rawData.Set("provided_first_name", value); } - } - - /// - /// The last name provided for verification in the authorization request. - /// - public required string? ProvidedLastName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_last_name"); - } - init { this._rawData.Set("provided_last_name", value); } - } - - /// - /// The middle name provided for verification in the authorization request. - /// - public required string? ProvidedMiddleName - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_middle_name"); - } - init { this._rawData.Set("provided_middle_name", value); } - } - - /// - public override void Validate() - { - _ = this.ProvidedFirstName; - _ = this.ProvidedLastName; - _ = this.ProvidedMiddleName; - } - - public CardValidationVerificationCardholderName() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public CardValidationVerificationCardholderName( - CardValidationVerificationCardholderName cardValidationVerificationCardholderName - ) - : base(cardValidationVerificationCardholderName) { } -#pragma warning restore CS8618 - - public CardValidationVerificationCardholderName( - IReadOnlyDictionary rawData - ) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - CardValidationVerificationCardholderName(FrozenDictionary rawData) - { - this._rawData = new(rawData); + "USD" => CardSettlementCurrency.Usd, + _ => (CardSettlementCurrency)(-1), + }; } -#pragma warning restore CS8618 - /// - public static CardValidationVerificationCardholderName FromRawUnchecked( - IReadOnlyDictionary rawData + public override void Write( + Utf8JsonWriter writer, + CardSettlementCurrency value, + JsonSerializerOptions options ) { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); } } -class CardValidationVerificationCardholderNameFromRaw - : IFromRawJson -{ - /// - public CardValidationVerificationCardholderName FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardValidationVerificationCardholderName.FromRawUnchecked(rawData); -} - /// -/// If the category of this Transaction source is equal to `other`, this field will -/// contain an empty object, otherwise it will contain null. +/// Interchange assessed as a part of this transaction. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Other : JsonModel -{ - /// - public override void Validate() { } - - public Other() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Other(Other other) - : base(other) { } -#pragma warning restore CS8618 - - public Other(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Other(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static Other FromRawUnchecked(IReadOnlyDictionary rawData) - { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); - } -} - -class OtherFromRaw : IFromRawJson -{ - /// - public Other FromRawUnchecked(IReadOnlyDictionary rawData) => - Other.FromRawUnchecked(rawData); -} - -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class SchemeFee : JsonModel +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardSettlementInterchange : JsonModel { /// - /// The fee amount given as a string containing a decimal number. + /// The interchange amount given as a string containing a decimal number in major + /// units (so e.g., "3.14" for $3.14). The amount is a positive number if it is + /// credited to Increase (e.g., settlements) and a negative number if it is debited + /// (e.g., refunds). /// public required string Amount { @@ -28893,124 +27161,84 @@ public required string Amount } /// - /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee - /// was created. + /// The card network specific interchange code. /// - public required System::DateTimeOffset CreatedAt + public required string? Code { get { this._rawData.Freeze(); - return this._rawData.GetNotNullStruct("created_at"); + return this._rawData.GetNullableClass("code"); } - init { this._rawData.Set("created_at", value); } + init { this._rawData.Set("code", value); } } /// - /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. /// - public required ApiEnum Currency + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("currency"); + return this._rawData.GetNotNullClass< + ApiEnum + >("currency"); } init { this._rawData.Set("currency", value); } } - /// - /// The type of fee being assessed. - /// - public required ApiEnum FeeType - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("fee_type"); - } - init { this._rawData.Set("fee_type", value); } - } - - /// - /// The fixed component of the fee, if applicable, given in major units of the - /// fee amount. - /// - public required string? FixedComponent - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("fixed_component"); - } - init { this._rawData.Set("fixed_component", value); } - } - - /// - /// The variable rate component of the fee, if applicable, given as a decimal - /// (e.g., 0.015 for 1.5%). - /// - public required string? VariableRate - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("variable_rate"); - } - init { this._rawData.Set("variable_rate", value); } - } - /// public override void Validate() { _ = this.Amount; - _ = this.CreatedAt; + _ = this.Code; this.Currency.Validate(); - this.FeeType.Validate(); - _ = this.FixedComponent; - _ = this.VariableRate; } - public SchemeFee() { } + public CardSettlementInterchange() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public SchemeFee(SchemeFee schemeFee) - : base(schemeFee) { } + public CardSettlementInterchange(CardSettlementInterchange cardSettlementInterchange) + : base(cardSettlementInterchange) { } #pragma warning restore CS8618 - public SchemeFee(IReadOnlyDictionary rawData) + public CardSettlementInterchange(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - SchemeFee(FrozenDictionary rawData) + CardSettlementInterchange(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardSettlementInterchange FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class SchemeFeeFromRaw : IFromRawJson +class CardSettlementInterchangeFromRaw : IFromRawJson { /// - public SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => - SchemeFee.FromRawUnchecked(rawData); + public CardSettlementInterchange FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementInterchange.FromRawUnchecked(rawData); } /// -/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the interchange reimbursement. /// -[JsonConverter(typeof(SchemeFeeCurrencyConverter))] -public enum SchemeFeeCurrency +[JsonConverter(typeof(CardSettlementInterchangeCurrencyConverter))] +public enum CardSettlementInterchangeCurrency { /// /// US Dollar (USD) @@ -29018,9 +27246,10 @@ public enum SchemeFeeCurrency Usd, } -sealed class SchemeFeeCurrencyConverter : JsonConverter +sealed class CardSettlementInterchangeCurrencyConverter + : JsonConverter { - public override SchemeFeeCurrency Read( + public override CardSettlementInterchangeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -29028,14 +27257,14 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "USD" => SchemeFeeCurrency.Usd, - _ => (SchemeFeeCurrency)(-1), + "USD" => CardSettlementInterchangeCurrency.Usd, + _ => (CardSettlementInterchangeCurrency)(-1), }; } public override void Write( Utf8JsonWriter writer, - SchemeFeeCurrency value, + CardSettlementInterchangeCurrency value, JsonSerializerOptions options ) { @@ -29043,7 +27272,7 @@ JsonSerializerOptions options writer, value switch { - SchemeFeeCurrency.Usd => "USD", + CardSettlementInterchangeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -29054,295 +27283,6764 @@ JsonSerializerOptions options } /// -/// The type of fee being assessed. +/// The card network on which this transaction was processed. /// -[JsonConverter(typeof(FeeTypeConverter))] -public enum FeeType +[JsonConverter(typeof(CardSettlementNetworkConverter))] +public enum CardSettlementNetwork { /// - /// International Service Assessment (ISA) single-currency is a fee assessed by - /// the card network for cross-border transactions presented and settled in the - /// same currency. + /// Visa /// - VisaInternationalServiceAssessmentSingleCurrency, + Visa, /// - /// International Service Assessment (ISA) cross-currency is a fee assessed by - /// the card network for cross-border transactions presented and settled in different currencies. + /// Pulse /// - VisaInternationalServiceAssessmentCrossCurrency, + Pulse, +} - /// - /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) - /// authorization transactions. Authorization is the process of approving or - /// declining the transaction amount specified. The fee is assessed to the Issuer. - /// - VisaAuthorizationDomesticPointOfSale, +sealed class CardSettlementNetworkConverter : JsonConverter +{ + public override CardSettlementNetwork Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa" => CardSettlementNetwork.Visa, + "pulse" => CardSettlementNetwork.Pulse, + _ => (CardSettlementNetwork)(-1), + }; + } - /// - /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) - /// International authorization transactions. Authorization is the process of - /// approving or declining the transaction amount specified. The fee is assessed - /// to the Issuer. - /// - VisaAuthorizationInternationalPointOfSale, + public override void Write( + Utf8JsonWriter writer, + CardSettlementNetwork value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementNetwork.Visa => "visa", + CardSettlementNetwork.Pulse => "pulse", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// Network-specific identifiers for this refund. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementNetworkIdentifiers, + CardSettlementNetworkIdentifiersFromRaw + >) +)] +public sealed record class CardSettlementNetworkIdentifiers : JsonModel +{ /// - /// Activity and charges for Visa Settlement System processing for Canada Region - /// POS (Point-of-Sale) authorization transactions. Authorization is the process - /// of approving or declining the transaction amount specified. + /// A network assigned business ID that identifies the acquirer that processed + /// this transaction. /// - VisaAuthorizationCanadaPointOfSale, + public required string AcquirerBusinessID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("acquirer_business_id"); + } + init { this._rawData.Set("acquirer_business_id", value); } + } /// - /// Activity only for Visa Settlement System authorization processing of POS - /// (Point-Of-Sale) reversal transactions. Authorization reversal represents - /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// A globally unique identifier for this settlement. /// - VisaAuthorizationReversalPointOfSale, + public required string AcquirerReferenceNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("acquirer_reference_number"); + } + init { this._rawData.Set("acquirer_reference_number", value); } + } /// - /// Activity only for Visa Settlement System authorization processing of POS - /// (Point-Of-Sale) International reversal transactions. Authorization reversal - /// represents a VSS message that undoes the complete or partial actions of a - /// previous authorization request. + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. /// - VisaAuthorizationReversalInternationalPointOfSale, + public required string? AuthorizationIdentificationResponse + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("authorization_identification_response"); + } + init { this._rawData.Set("authorization_identification_response", value); } + } /// - /// A per Address Verification Service (AVS) result fee. Applies to all usable - /// AVS result codes. + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. /// - VisaAuthorizationAddressVerificationService, + public required string? TransactionID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("transaction_id"); + } + init { this._rawData.Set("transaction_id", value); } + } - /// - /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates - /// 100 percent of US VisaNet authorizations in real-time. Activity related to - /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa - /// Debit (PAVD) transactions). - /// - VisaAdvancedAuthorization, + /// + public override void Validate() + { + _ = this.AcquirerBusinessID; + _ = this.AcquirerReferenceNumber; + _ = this.AuthorizationIdentificationResponse; + _ = this.TransactionID; + } - /// - /// Issuer Transactions Visa represents a charge based on total actual monthly - /// processing (Visa transactions only) through a VisaNet Access Point (VAP). - /// Charges are assessed to the processor for each VisaNet Access Point. - /// - VisaMessageTransmission, + public CardSettlementNetworkIdentifiers() { } - /// - /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. - /// - VisaAccountVerificationDomestic, +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementNetworkIdentifiers( + CardSettlementNetworkIdentifiers cardSettlementNetworkIdentifiers + ) + : base(cardSettlementNetworkIdentifiers) { } +#pragma warning restore CS8618 - /// - /// Activity, per inquiry, related to the international Issuer for Account Number Verification. - /// - VisaAccountVerificationInternational, + public CardSettlementNetworkIdentifiers(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } - /// - /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. - /// - VisaAccountVerificationCanada, +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementNetworkIdentifiers(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 - /// - /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly - /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, - /// or Deferred Debit card transactions. - /// - VisaCorporateAcceptanceFee, + /// + public static CardSettlementNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} - /// - /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the - /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback - /// portion of a Debit and Prepaid card transaction is excluded from the sales - /// volume calculation. - /// - VisaConsumerDebitAcceptanceFee, +class CardSettlementNetworkIdentifiersFromRaw : IFromRawJson +{ + /// + public CardSettlementNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementNetworkIdentifiers.FromRawUnchecked(rawData); +} +/// +/// Additional details about the card purchase, such as tax and industry-specific fields. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardSettlementPurchaseDetails : JsonModel +{ /// - /// The Business Acceptance Fee is charged to issuers and is based on the monthly - /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit - /// card transactions. The cashback portion is included in the sales volume calculation - /// with the exception of a Debit and Prepaid card transactions. + /// Fields specific to car rentals. /// - VisaBusinessDebitAcceptanceFee, + public required CardSettlementPurchaseDetailsCarRental? CarRental + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "car_rental" + ); + } + init { this._rawData.Set("car_rental", value); } + } /// - /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the - /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, - /// Charge, or Deferred Debit card transactions. + /// An identifier from the merchant for the customer or consumer. /// - VisaPurchasingAcceptanceFee, + public required string? CustomerReferenceIdentifier + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("customer_reference_identifier"); + } + init { this._rawData.Set("customer_reference_identifier", value); } + } /// - /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// The state or provincial tax amount in minor units. /// - VisaPurchaseDomestic, + public required long? LocalTaxAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("local_tax_amount"); + } + init { this._rawData.Set("local_tax_amount", value); } + } /// - /// Activity and fees for the processing of an international sales draft original - /// for a purchase transaction. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local + /// tax assessed. /// - VisaPurchaseInternational, + public required string? LocalTaxCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("local_tax_currency"); + } + init { this._rawData.Set("local_tax_currency", value); } + } /// - /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is - /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// Fields specific to lodging. /// - VisaCreditPurchaseToken, + public required CardSettlementPurchaseDetailsLodging? Lodging + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("lodging"); + } + init { this._rawData.Set("lodging", value); } + } /// - /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is - /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// The national tax amount in minor units. /// - VisaDebitPurchaseToken, + public required long? NationalTaxAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("national_tax_amount"); + } + init { this._rawData.Set("national_tax_amount", value); } + } /// - /// A per transaction fee assessed for Base II financial draft - Issuer. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the local + /// tax assessed. /// - VisaClearingTransmission, + public required string? NationalTaxCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("national_tax_currency"); + } + init { this._rawData.Set("national_tax_currency", value); } + } /// - /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial - /// OCT/AFT 0200 transactions. + /// An identifier from the merchant for the purchase to the issuer and cardholder. /// - VisaDirectAuthorization, + public required string? PurchaseIdentifier + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("purchase_identifier"); + } + init { this._rawData.Set("purchase_identifier", value); } + } /// - /// Data processing charge for Visa Direct OCTs for all business application identifiers - /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// The format of the purchase identifier. /// - VisaDirectTransactionDomestic, + public required ApiEnum< + string, + CardSettlementPurchaseDetailsPurchaseIdentifierFormat + >? PurchaseIdentifierFormat + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("purchase_identifier_format"); + } + init { this._rawData.Set("purchase_identifier_format", value); } + } /// - /// Issuer card service fee for Commercial Credit cards. + /// Fields specific to travel. /// - VisaServiceCommercialCredit, + public required CardSettlementPurchaseDetailsTravel? Travel + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("travel"); + } + init { this._rawData.Set("travel", value); } + } + + /// + public override void Validate() + { + this.CarRental?.Validate(); + _ = this.CustomerReferenceIdentifier; + _ = this.LocalTaxAmount; + _ = this.LocalTaxCurrency; + this.Lodging?.Validate(); + _ = this.NationalTaxAmount; + _ = this.NationalTaxCurrency; + _ = this.PurchaseIdentifier; + this.PurchaseIdentifierFormat?.Validate(); + this.Travel?.Validate(); + } + + public CardSettlementPurchaseDetails() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetails( + CardSettlementPurchaseDetails cardSettlementPurchaseDetails + ) + : base(cardSettlementPurchaseDetails) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetails(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetails(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetails FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsFromRaw : IFromRawJson +{ + /// + public CardSettlementPurchaseDetails FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetails.FromRawUnchecked(rawData); +} +/// +/// Fields specific to car rentals. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsCarRental, + CardSettlementPurchaseDetailsCarRentalFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsCarRental : JsonModel +{ /// - /// Issuer Advertising Service Fee for Commercial Credit cards. + /// Code indicating the vehicle's class. /// - VisaAdvertisingServiceCommercialCredit, + public required string? CarClassCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("car_class_code"); + } + init { this._rawData.Set("car_class_code", value); } + } /// - /// Issuer Community Growth Acceleration Program Fee. + /// Date the customer picked up the car or, in the case of a no-show or pre-pay + /// transaction, the scheduled pick up date. /// - VisaCommunityGrowthAccelerationProgram, + public required string? CheckoutDate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("checkout_date"); + } + init { this._rawData.Set("checkout_date", value); } + } /// - /// Issuer Processing Guarantee for Commercial Credit cards. + /// Daily rate being charged for the vehicle. /// - VisaProcessingGuaranteeCommercialCredit, + public required long? DailyRentalRateAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("daily_rental_rate_amount"); + } + init { this._rawData.Set("daily_rental_rate_amount", value); } + } /// - /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions - /// on its network. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily + /// rental rate. /// - PulseSwitchFee, -} + public required string? DailyRentalRateCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("daily_rental_rate_currency"); + } + init { this._rawData.Set("daily_rental_rate_currency", value); } + } -sealed class FeeTypeConverter : JsonConverter -{ - public override FeeType Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + /// Number of days the vehicle was rented. + /// + public required long? DaysRented { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "visa_international_service_assessment_single_currency" => - FeeType.VisaInternationalServiceAssessmentSingleCurrency, - "visa_international_service_assessment_cross_currency" => - FeeType.VisaInternationalServiceAssessmentCrossCurrency, - "visa_authorization_domestic_point_of_sale" => - FeeType.VisaAuthorizationDomesticPointOfSale, - "visa_authorization_international_point_of_sale" => - FeeType.VisaAuthorizationInternationalPointOfSale, - "visa_authorization_canada_point_of_sale" => FeeType.VisaAuthorizationCanadaPointOfSale, - "visa_authorization_reversal_point_of_sale" => - FeeType.VisaAuthorizationReversalPointOfSale, - "visa_authorization_reversal_international_point_of_sale" => - FeeType.VisaAuthorizationReversalInternationalPointOfSale, - "visa_authorization_address_verification_service" => - FeeType.VisaAuthorizationAddressVerificationService, - "visa_advanced_authorization" => FeeType.VisaAdvancedAuthorization, - "visa_message_transmission" => FeeType.VisaMessageTransmission, - "visa_account_verification_domestic" => FeeType.VisaAccountVerificationDomestic, - "visa_account_verification_international" => - FeeType.VisaAccountVerificationInternational, - "visa_account_verification_canada" => FeeType.VisaAccountVerificationCanada, - "visa_corporate_acceptance_fee" => FeeType.VisaCorporateAcceptanceFee, - "visa_consumer_debit_acceptance_fee" => FeeType.VisaConsumerDebitAcceptanceFee, - "visa_business_debit_acceptance_fee" => FeeType.VisaBusinessDebitAcceptanceFee, - "visa_purchasing_acceptance_fee" => FeeType.VisaPurchasingAcceptanceFee, - "visa_purchase_domestic" => FeeType.VisaPurchaseDomestic, - "visa_purchase_international" => FeeType.VisaPurchaseInternational, - "visa_credit_purchase_token" => FeeType.VisaCreditPurchaseToken, - "visa_debit_purchase_token" => FeeType.VisaDebitPurchaseToken, - "visa_clearing_transmission" => FeeType.VisaClearingTransmission, - "visa_direct_authorization" => FeeType.VisaDirectAuthorization, - "visa_direct_transaction_domestic" => FeeType.VisaDirectTransactionDomestic, - "visa_service_commercial_credit" => FeeType.VisaServiceCommercialCredit, + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("days_rented"); + } + init { this._rawData.Set("days_rented", value); } + } + + /// + /// Additional charges (gas, late fee, etc.) being billed. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsCarRentalExtraCharges + >? ExtraCharges + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("extra_charges"); + } + init { this._rawData.Set("extra_charges", value); } + } + + /// + /// Fuel charges for the vehicle. + /// + public required long? FuelChargesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("fuel_charges_amount"); + } + init { this._rawData.Set("fuel_charges_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fuel charges assessed. + /// + public required string? FuelChargesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fuel_charges_currency"); + } + init { this._rawData.Set("fuel_charges_currency", value); } + } + + /// + /// Any insurance being charged for the vehicle. + /// + public required long? InsuranceChargesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("insurance_charges_amount"); + } + init { this._rawData.Set("insurance_charges_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the insurance + /// charges assessed. + /// + public required string? InsuranceChargesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("insurance_charges_currency"); + } + init { this._rawData.Set("insurance_charges_currency", value); } + } + + /// + /// An indicator that the cardholder is being billed for a reserved vehicle that + /// was not actually rented (that is, a "no-show" charge). + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsCarRentalNoShowIndicator + >? NoShowIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("no_show_indicator"); + } + init { this._rawData.Set("no_show_indicator", value); } + } + + /// + /// Charges for returning the vehicle at a different location than where it was + /// picked up. + /// + public required long? OneWayDropOffChargesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("one_way_drop_off_charges_amount"); + } + init { this._rawData.Set("one_way_drop_off_charges_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the one-way + /// drop-off charges assessed. + /// + public required string? OneWayDropOffChargesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("one_way_drop_off_charges_currency"); + } + init { this._rawData.Set("one_way_drop_off_charges_currency", value); } + } + + /// + /// Name of the person renting the vehicle. + /// + public required string? RenterName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("renter_name"); + } + init { this._rawData.Set("renter_name", value); } + } + + /// + /// Weekly rate being charged for the vehicle. + /// + public required long? WeeklyRentalRateAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("weekly_rental_rate_amount"); + } + init { this._rawData.Set("weekly_rental_rate_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the weekly + /// rental rate. + /// + public required string? WeeklyRentalRateCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("weekly_rental_rate_currency"); + } + init { this._rawData.Set("weekly_rental_rate_currency", value); } + } + + /// + public override void Validate() + { + _ = this.CarClassCode; + _ = this.CheckoutDate; + _ = this.DailyRentalRateAmount; + _ = this.DailyRentalRateCurrency; + _ = this.DaysRented; + this.ExtraCharges?.Validate(); + _ = this.FuelChargesAmount; + _ = this.FuelChargesCurrency; + _ = this.InsuranceChargesAmount; + _ = this.InsuranceChargesCurrency; + this.NoShowIndicator?.Validate(); + _ = this.OneWayDropOffChargesAmount; + _ = this.OneWayDropOffChargesCurrency; + _ = this.RenterName; + _ = this.WeeklyRentalRateAmount; + _ = this.WeeklyRentalRateCurrency; + } + + public CardSettlementPurchaseDetailsCarRental() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsCarRental( + CardSettlementPurchaseDetailsCarRental cardSettlementPurchaseDetailsCarRental + ) + : base(cardSettlementPurchaseDetailsCarRental) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsCarRental(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsCarRental(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsCarRental FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsCarRentalFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsCarRental FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsCarRental.FromRawUnchecked(rawData); +} + +/// +/// Additional charges (gas, late fee, etc.) being billed. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsCarRentalExtraChargesConverter))] +public enum CardSettlementPurchaseDetailsCarRentalExtraCharges +{ + /// + /// No extra charge + /// + NoExtraCharge, + + /// + /// Gas + /// + Gas, + + /// + /// Extra mileage + /// + ExtraMileage, + + /// + /// Late return + /// + LateReturn, + + /// + /// One way service fee + /// + OneWayServiceFee, + + /// + /// Parking violation + /// + ParkingViolation, +} + +sealed class CardSettlementPurchaseDetailsCarRentalExtraChargesConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsCarRentalExtraCharges Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_extra_charge" => CardSettlementPurchaseDetailsCarRentalExtraCharges.NoExtraCharge, + "gas" => CardSettlementPurchaseDetailsCarRentalExtraCharges.Gas, + "extra_mileage" => CardSettlementPurchaseDetailsCarRentalExtraCharges.ExtraMileage, + "late_return" => CardSettlementPurchaseDetailsCarRentalExtraCharges.LateReturn, + "one_way_service_fee" => + CardSettlementPurchaseDetailsCarRentalExtraCharges.OneWayServiceFee, + "parking_violation" => + CardSettlementPurchaseDetailsCarRentalExtraCharges.ParkingViolation, + _ => (CardSettlementPurchaseDetailsCarRentalExtraCharges)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsCarRentalExtraCharges value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsCarRentalExtraCharges.NoExtraCharge => + "no_extra_charge", + CardSettlementPurchaseDetailsCarRentalExtraCharges.Gas => "gas", + CardSettlementPurchaseDetailsCarRentalExtraCharges.ExtraMileage => "extra_mileage", + CardSettlementPurchaseDetailsCarRentalExtraCharges.LateReturn => "late_return", + CardSettlementPurchaseDetailsCarRentalExtraCharges.OneWayServiceFee => + "one_way_service_fee", + CardSettlementPurchaseDetailsCarRentalExtraCharges.ParkingViolation => + "parking_violation", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// An indicator that the cardholder is being billed for a reserved vehicle that was +/// not actually rented (that is, a "no-show" charge). +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsCarRentalNoShowIndicatorConverter))] +public enum CardSettlementPurchaseDetailsCarRentalNoShowIndicator +{ + /// + /// Not applicable + /// + NotApplicable, + + /// + /// No show for specialized vehicle + /// + NoShowForSpecializedVehicle, +} + +sealed class CardSettlementPurchaseDetailsCarRentalNoShowIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsCarRentalNoShowIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_applicable" => CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NotApplicable, + "no_show_for_specialized_vehicle" => + CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NoShowForSpecializedVehicle, + _ => (CardSettlementPurchaseDetailsCarRentalNoShowIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsCarRentalNoShowIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NotApplicable => + "not_applicable", + CardSettlementPurchaseDetailsCarRentalNoShowIndicator.NoShowForSpecializedVehicle => + "no_show_for_specialized_vehicle", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields specific to lodging. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsLodging, + CardSettlementPurchaseDetailsLodgingFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsLodging : JsonModel +{ + /// + /// Date the customer checked in. + /// + public required string? CheckInDate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("check_in_date"); + } + init { this._rawData.Set("check_in_date", value); } + } + + /// + /// Daily rate being charged for the room. + /// + public required long? DailyRoomRateAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("daily_room_rate_amount"); + } + init { this._rawData.Set("daily_room_rate_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the daily + /// room rate. + /// + public required string? DailyRoomRateCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("daily_room_rate_currency"); + } + init { this._rawData.Set("daily_room_rate_currency", value); } + } + + /// + /// Additional charges (phone, late check-out, etc.) being billed. + /// + public required ApiEnum? ExtraCharges + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("extra_charges"); + } + init { this._rawData.Set("extra_charges", value); } + } + + /// + /// Folio cash advances for the room. + /// + public required long? FolioCashAdvancesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("folio_cash_advances_amount"); + } + init { this._rawData.Set("folio_cash_advances_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the folio + /// cash advances. + /// + public required string? FolioCashAdvancesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("folio_cash_advances_currency"); + } + init { this._rawData.Set("folio_cash_advances_currency", value); } + } + + /// + /// Food and beverage charges for the room. + /// + public required long? FoodBeverageChargesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("food_beverage_charges_amount"); + } + init { this._rawData.Set("food_beverage_charges_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the food and + /// beverage charges. + /// + public required string? FoodBeverageChargesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("food_beverage_charges_currency"); + } + init { this._rawData.Set("food_beverage_charges_currency", value); } + } + + /// + /// Indicator that the cardholder is being billed for a reserved room that was + /// not actually used. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsLodgingNoShowIndicator + >? NoShowIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("no_show_indicator"); + } + init { this._rawData.Set("no_show_indicator", value); } + } + + /// + /// Prepaid expenses being charged for the room. + /// + public required long? PrepaidExpensesAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("prepaid_expenses_amount"); + } + init { this._rawData.Set("prepaid_expenses_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the prepaid expenses. + /// + public required string? PrepaidExpensesCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("prepaid_expenses_currency"); + } + init { this._rawData.Set("prepaid_expenses_currency", value); } + } + + /// + /// Number of nights the room was rented. + /// + public required long? RoomNights + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("room_nights"); + } + init { this._rawData.Set("room_nights", value); } + } + + /// + /// Total room tax being charged. + /// + public required long? TotalRoomTaxAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("total_room_tax_amount"); + } + init { this._rawData.Set("total_room_tax_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total + /// room tax. + /// + public required string? TotalRoomTaxCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("total_room_tax_currency"); + } + init { this._rawData.Set("total_room_tax_currency", value); } + } + + /// + /// Total tax being charged for the room. + /// + public required long? TotalTaxAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("total_tax_amount"); + } + init { this._rawData.Set("total_tax_amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the total + /// tax assessed. + /// + public required string? TotalTaxCurrency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("total_tax_currency"); + } + init { this._rawData.Set("total_tax_currency", value); } + } + + /// + public override void Validate() + { + _ = this.CheckInDate; + _ = this.DailyRoomRateAmount; + _ = this.DailyRoomRateCurrency; + this.ExtraCharges?.Validate(); + _ = this.FolioCashAdvancesAmount; + _ = this.FolioCashAdvancesCurrency; + _ = this.FoodBeverageChargesAmount; + _ = this.FoodBeverageChargesCurrency; + this.NoShowIndicator?.Validate(); + _ = this.PrepaidExpensesAmount; + _ = this.PrepaidExpensesCurrency; + _ = this.RoomNights; + _ = this.TotalRoomTaxAmount; + _ = this.TotalRoomTaxCurrency; + _ = this.TotalTaxAmount; + _ = this.TotalTaxCurrency; + } + + public CardSettlementPurchaseDetailsLodging() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsLodging( + CardSettlementPurchaseDetailsLodging cardSettlementPurchaseDetailsLodging + ) + : base(cardSettlementPurchaseDetailsLodging) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsLodging(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsLodging(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsLodging FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsLodgingFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsLodging FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsLodging.FromRawUnchecked(rawData); +} + +/// +/// Additional charges (phone, late check-out, etc.) being billed. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsLodgingExtraChargesConverter))] +public enum CardSettlementPurchaseDetailsLodgingExtraCharges +{ + /// + /// No extra charge + /// + NoExtraCharge, + + /// + /// Restaurant + /// + Restaurant, + + /// + /// Gift shop + /// + GiftShop, + + /// + /// Mini bar + /// + MiniBar, + + /// + /// Telephone + /// + Telephone, + + /// + /// Other + /// + Other, + + /// + /// Laundry + /// + Laundry, +} + +sealed class CardSettlementPurchaseDetailsLodgingExtraChargesConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsLodgingExtraCharges Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_extra_charge" => CardSettlementPurchaseDetailsLodgingExtraCharges.NoExtraCharge, + "restaurant" => CardSettlementPurchaseDetailsLodgingExtraCharges.Restaurant, + "gift_shop" => CardSettlementPurchaseDetailsLodgingExtraCharges.GiftShop, + "mini_bar" => CardSettlementPurchaseDetailsLodgingExtraCharges.MiniBar, + "telephone" => CardSettlementPurchaseDetailsLodgingExtraCharges.Telephone, + "other" => CardSettlementPurchaseDetailsLodgingExtraCharges.Other, + "laundry" => CardSettlementPurchaseDetailsLodgingExtraCharges.Laundry, + _ => (CardSettlementPurchaseDetailsLodgingExtraCharges)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsLodgingExtraCharges value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsLodgingExtraCharges.NoExtraCharge => "no_extra_charge", + CardSettlementPurchaseDetailsLodgingExtraCharges.Restaurant => "restaurant", + CardSettlementPurchaseDetailsLodgingExtraCharges.GiftShop => "gift_shop", + CardSettlementPurchaseDetailsLodgingExtraCharges.MiniBar => "mini_bar", + CardSettlementPurchaseDetailsLodgingExtraCharges.Telephone => "telephone", + CardSettlementPurchaseDetailsLodgingExtraCharges.Other => "other", + CardSettlementPurchaseDetailsLodgingExtraCharges.Laundry => "laundry", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Indicator that the cardholder is being billed for a reserved room that was not +/// actually used. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsLodgingNoShowIndicatorConverter))] +public enum CardSettlementPurchaseDetailsLodgingNoShowIndicator +{ + /// + /// Not applicable + /// + NotApplicable, + + /// + /// No show + /// + NoShow, +} + +sealed class CardSettlementPurchaseDetailsLodgingNoShowIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsLodgingNoShowIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_applicable" => CardSettlementPurchaseDetailsLodgingNoShowIndicator.NotApplicable, + "no_show" => CardSettlementPurchaseDetailsLodgingNoShowIndicator.NoShow, + _ => (CardSettlementPurchaseDetailsLodgingNoShowIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsLodgingNoShowIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsLodgingNoShowIndicator.NotApplicable => + "not_applicable", + CardSettlementPurchaseDetailsLodgingNoShowIndicator.NoShow => "no_show", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The format of the purchase identifier. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsPurchaseIdentifierFormatConverter))] +public enum CardSettlementPurchaseDetailsPurchaseIdentifierFormat +{ + /// + /// Free text + /// + FreeText, + + /// + /// Order number + /// + OrderNumber, + + /// + /// Rental agreement number + /// + RentalAgreementNumber, + + /// + /// Hotel folio number + /// + HotelFolioNumber, + + /// + /// Invoice number + /// + InvoiceNumber, +} + +sealed class CardSettlementPurchaseDetailsPurchaseIdentifierFormatConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsPurchaseIdentifierFormat Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "free_text" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.FreeText, + "order_number" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.OrderNumber, + "rental_agreement_number" => + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.RentalAgreementNumber, + "hotel_folio_number" => + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.HotelFolioNumber, + "invoice_number" => CardSettlementPurchaseDetailsPurchaseIdentifierFormat.InvoiceNumber, + _ => (CardSettlementPurchaseDetailsPurchaseIdentifierFormat)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsPurchaseIdentifierFormat value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.FreeText => "free_text", + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.OrderNumber => "order_number", + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.RentalAgreementNumber => + "rental_agreement_number", + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.HotelFolioNumber => + "hotel_folio_number", + CardSettlementPurchaseDetailsPurchaseIdentifierFormat.InvoiceNumber => + "invoice_number", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields specific to travel. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsTravel, + CardSettlementPurchaseDetailsTravelFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsTravel : JsonModel +{ + /// + /// Ancillary purchases in addition to the airfare. + /// + public required CardSettlementPurchaseDetailsTravelAncillary? Ancillary + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "ancillary" + ); + } + init { this._rawData.Set("ancillary", value); } + } + + /// + /// Indicates the computerized reservation system used to book the ticket. + /// + public required string? ComputerizedReservationSystem + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("computerized_reservation_system"); + } + init { this._rawData.Set("computerized_reservation_system", value); } + } + + /// + /// Indicates the reason for a credit to the cardholder. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelCreditReasonIndicator + >? CreditReasonIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("credit_reason_indicator"); + } + init { this._rawData.Set("credit_reason_indicator", value); } + } + + /// + /// Date of departure. + /// + public required string? DepartureDate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("departure_date"); + } + init { this._rawData.Set("departure_date", value); } + } + + /// + /// Code for the originating city or airport. + /// + public required string? OriginationCityAirportCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("origination_city_airport_code"); + } + init { this._rawData.Set("origination_city_airport_code", value); } + } + + /// + /// Name of the passenger. + /// + public required string? PassengerName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("passenger_name"); + } + init { this._rawData.Set("passenger_name", value); } + } + + /// + /// Indicates whether this ticket is non-refundable. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator + >? RestrictedTicketIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("restricted_ticket_indicator"); + } + init { this._rawData.Set("restricted_ticket_indicator", value); } + } + + /// + /// Indicates why a ticket was changed. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelTicketChangeIndicator + >? TicketChangeIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("ticket_change_indicator"); + } + init { this._rawData.Set("ticket_change_indicator", value); } + } + + /// + /// Ticket number. + /// + public required string? TicketNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("ticket_number"); + } + init { this._rawData.Set("ticket_number", value); } + } + + /// + /// Code for the travel agency if the ticket was issued by a travel agency. + /// + public required string? TravelAgencyCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("travel_agency_code"); + } + init { this._rawData.Set("travel_agency_code", value); } + } + + /// + /// Name of the travel agency if the ticket was issued by a travel agency. + /// + public required string? TravelAgencyName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("travel_agency_name"); + } + init { this._rawData.Set("travel_agency_name", value); } + } + + /// + /// Fields specific to each leg of the journey. + /// + public required IReadOnlyList? TripLegs + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct< + ImmutableArray + >("trip_legs"); + } + init + { + this._rawData.Set?>( + "trip_legs", + value == null ? null : ImmutableArray.ToImmutableArray(value) + ); + } + } + + /// + public override void Validate() + { + this.Ancillary?.Validate(); + _ = this.ComputerizedReservationSystem; + this.CreditReasonIndicator?.Validate(); + _ = this.DepartureDate; + _ = this.OriginationCityAirportCode; + _ = this.PassengerName; + this.RestrictedTicketIndicator?.Validate(); + this.TicketChangeIndicator?.Validate(); + _ = this.TicketNumber; + _ = this.TravelAgencyCode; + _ = this.TravelAgencyName; + foreach (var item in this.TripLegs ?? []) + { + item.Validate(); + } + } + + public CardSettlementPurchaseDetailsTravel() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsTravel( + CardSettlementPurchaseDetailsTravel cardSettlementPurchaseDetailsTravel + ) + : base(cardSettlementPurchaseDetailsTravel) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsTravel(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsTravel(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsTravel FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsTravelFromRaw : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsTravel FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsTravel.FromRawUnchecked(rawData); +} + +/// +/// Ancillary purchases in addition to the airfare. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsTravelAncillary, + CardSettlementPurchaseDetailsTravelAncillaryFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsTravelAncillary : JsonModel +{ + /// + /// If this purchase has a connection or relationship to another purchase, such + /// as a baggage fee for a passenger transport ticket, this field should contain + /// the ticket document number for the other purchase. + /// + public required string? ConnectedTicketDocumentNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("connected_ticket_document_number"); + } + init { this._rawData.Set("connected_ticket_document_number", value); } + } + + /// + /// Indicates the reason for a credit to the cardholder. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator + >? CreditReasonIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("credit_reason_indicator"); + } + init { this._rawData.Set("credit_reason_indicator", value); } + } + + /// + /// Name of the passenger or description of the ancillary purchase. + /// + public required string? PassengerNameOrDescription + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("passenger_name_or_description"); + } + init { this._rawData.Set("passenger_name_or_description", value); } + } + + /// + /// Additional travel charges, such as baggage fees. + /// + public required IReadOnlyList Services + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct< + ImmutableArray + >("services"); + } + init + { + this._rawData.Set>( + "services", + ImmutableArray.ToImmutableArray(value) + ); + } + } + + /// + /// Ticket document number. + /// + public required string? TicketDocumentNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("ticket_document_number"); + } + init { this._rawData.Set("ticket_document_number", value); } + } + + /// + public override void Validate() + { + _ = this.ConnectedTicketDocumentNumber; + this.CreditReasonIndicator?.Validate(); + _ = this.PassengerNameOrDescription; + foreach (var item in this.Services) + { + item.Validate(); + } + _ = this.TicketDocumentNumber; + } + + public CardSettlementPurchaseDetailsTravelAncillary() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsTravelAncillary( + CardSettlementPurchaseDetailsTravelAncillary cardSettlementPurchaseDetailsTravelAncillary + ) + : base(cardSettlementPurchaseDetailsTravelAncillary) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsTravelAncillary( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsTravelAncillary(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsTravelAncillary FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsTravelAncillaryFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsTravelAncillary FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsTravelAncillary.FromRawUnchecked(rawData); +} + +/// +/// Indicates the reason for a credit to the cardholder. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicatorConverter))] +public enum CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator +{ + /// + /// No credit + /// + NoCredit, + + /// + /// Passenger transport ancillary purchase cancellation + /// + PassengerTransportAncillaryPurchaseCancellation, + + /// + /// Airline ticket and passenger transport ancillary purchase cancellation + /// + AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + + /// + /// Other + /// + Other, +} + +sealed class CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_credit" => + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.NoCredit, + "passenger_transport_ancillary_purchase_cancellation" => + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + "other" => CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.Other, + _ => (CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.NoCredit => + "no_credit", + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => + "passenger_transport_ancillary_purchase_cancellation", + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", + CardSettlementPurchaseDetailsTravelAncillaryCreditReasonIndicator.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsTravelAncillaryService, + CardSettlementPurchaseDetailsTravelAncillaryServiceFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsTravelAncillaryService : JsonModel +{ + /// + /// Category of the ancillary service. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory + >? Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("category"); + } + init { this._rawData.Set("category", value); } + } + + /// + /// Sub-category of the ancillary service, free-form. + /// + public required string? SubCategory + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("sub_category"); + } + init { this._rawData.Set("sub_category", value); } + } + + /// + public override void Validate() + { + this.Category?.Validate(); + _ = this.SubCategory; + } + + public CardSettlementPurchaseDetailsTravelAncillaryService() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsTravelAncillaryService( + CardSettlementPurchaseDetailsTravelAncillaryService cardSettlementPurchaseDetailsTravelAncillaryService + ) + : base(cardSettlementPurchaseDetailsTravelAncillaryService) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsTravelAncillaryService( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsTravelAncillaryService( + FrozenDictionary rawData + ) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsTravelAncillaryService FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsTravelAncillaryServiceFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsTravelAncillaryService FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsTravelAncillaryService.FromRawUnchecked(rawData); +} + +/// +/// Category of the ancillary service. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelAncillaryServiceCategoryConverter))] +public enum CardSettlementPurchaseDetailsTravelAncillaryServiceCategory +{ + /// + /// None + /// + None, + + /// + /// Bundled service + /// + BundledService, + + /// + /// Baggage fee + /// + BaggageFee, + + /// + /// Change fee + /// + ChangeFee, + + /// + /// Cargo + /// + Cargo, + + /// + /// Carbon offset + /// + CarbonOffset, + + /// + /// Frequent flyer + /// + FrequentFlyer, + + /// + /// Gift card + /// + GiftCard, + + /// + /// Ground transport + /// + GroundTransport, + + /// + /// In-flight entertainment + /// + InFlightEntertainment, + + /// + /// Lounge + /// + Lounge, + + /// + /// Medical + /// + Medical, + + /// + /// Meal beverage + /// + MealBeverage, + + /// + /// Other + /// + Other, + + /// + /// Passenger assist fee + /// + PassengerAssistFee, + + /// + /// Pets + /// + Pets, + + /// + /// Seat fees + /// + SeatFees, + + /// + /// Standby + /// + Standby, + + /// + /// Service fee + /// + ServiceFee, + + /// + /// Store + /// + Store, + + /// + /// Travel service + /// + TravelService, + + /// + /// Unaccompanied travel + /// + UnaccompaniedTravel, + + /// + /// Upgrades + /// + Upgrades, + + /// + /// Wi-fi + /// + Wifi, +} + +sealed class CardSettlementPurchaseDetailsTravelAncillaryServiceCategoryConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelAncillaryServiceCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.None, + "bundled_service" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BundledService, + "baggage_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BaggageFee, + "change_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ChangeFee, + "cargo" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Cargo, + "carbon_offset" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.CarbonOffset, + "frequent_flyer" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.FrequentFlyer, + "gift_card" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GiftCard, + "ground_transport" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GroundTransport, + "in_flight_entertainment" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.InFlightEntertainment, + "lounge" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Lounge, + "medical" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Medical, + "meal_beverage" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.MealBeverage, + "other" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Other, + "passenger_assist_fee" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.PassengerAssistFee, + "pets" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Pets, + "seat_fees" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.SeatFees, + "standby" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Standby, + "service_fee" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ServiceFee, + "store" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Store, + "travel_service" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.TravelService, + "unaccompanied_travel" => + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.UnaccompaniedTravel, + "upgrades" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Upgrades, + "wifi" => CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Wifi, + _ => (CardSettlementPurchaseDetailsTravelAncillaryServiceCategory)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.None => "none", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BundledService => + "bundled_service", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.BaggageFee => + "baggage_fee", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ChangeFee => + "change_fee", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Cargo => "cargo", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.CarbonOffset => + "carbon_offset", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.FrequentFlyer => + "frequent_flyer", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GiftCard => "gift_card", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.GroundTransport => + "ground_transport", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.InFlightEntertainment => + "in_flight_entertainment", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Lounge => "lounge", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Medical => "medical", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.MealBeverage => + "meal_beverage", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Other => "other", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.PassengerAssistFee => + "passenger_assist_fee", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Pets => "pets", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.SeatFees => "seat_fees", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Standby => "standby", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.ServiceFee => + "service_fee", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Store => "store", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.TravelService => + "travel_service", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.UnaccompaniedTravel => + "unaccompanied_travel", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Upgrades => "upgrades", + CardSettlementPurchaseDetailsTravelAncillaryServiceCategory.Wifi => "wifi", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Indicates the reason for a credit to the cardholder. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelCreditReasonIndicatorConverter))] +public enum CardSettlementPurchaseDetailsTravelCreditReasonIndicator +{ + /// + /// No credit + /// + NoCredit, + + /// + /// Passenger transport ancillary purchase cancellation + /// + PassengerTransportAncillaryPurchaseCancellation, + + /// + /// Airline ticket and passenger transport ancillary purchase cancellation + /// + AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + + /// + /// Airline ticket cancellation + /// + AirlineTicketCancellation, + + /// + /// Other + /// + Other, + + /// + /// Partial refund of airline ticket + /// + PartialRefundOfAirlineTicket, +} + +sealed class CardSettlementPurchaseDetailsTravelCreditReasonIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelCreditReasonIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_credit" => CardSettlementPurchaseDetailsTravelCreditReasonIndicator.NoCredit, + "passenger_transport_ancillary_purchase_cancellation" => + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation" => + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation, + "airline_ticket_cancellation" => + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketCancellation, + "other" => CardSettlementPurchaseDetailsTravelCreditReasonIndicator.Other, + "partial_refund_of_airline_ticket" => + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PartialRefundOfAirlineTicket, + _ => (CardSettlementPurchaseDetailsTravelCreditReasonIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelCreditReasonIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.NoCredit => "no_credit", + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PassengerTransportAncillaryPurchaseCancellation => + "passenger_transport_ancillary_purchase_cancellation", + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketAndPassengerTransportAncillaryPurchaseCancellation => + "airline_ticket_and_passenger_transport_ancillary_purchase_cancellation", + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.AirlineTicketCancellation => + "airline_ticket_cancellation", + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.Other => "other", + CardSettlementPurchaseDetailsTravelCreditReasonIndicator.PartialRefundOfAirlineTicket => + "partial_refund_of_airline_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Indicates whether this ticket is non-refundable. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelRestrictedTicketIndicatorConverter))] +public enum CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator +{ + /// + /// No restrictions + /// + NoRestrictions, + + /// + /// Restricted non-refundable ticket + /// + RestrictedNonRefundableTicket, +} + +sealed class CardSettlementPurchaseDetailsTravelRestrictedTicketIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_restrictions" => + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.NoRestrictions, + "restricted_non_refundable_ticket" => + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.RestrictedNonRefundableTicket, + _ => (CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.NoRestrictions => + "no_restrictions", + CardSettlementPurchaseDetailsTravelRestrictedTicketIndicator.RestrictedNonRefundableTicket => + "restricted_non_refundable_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Indicates why a ticket was changed. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter))] +public enum CardSettlementPurchaseDetailsTravelTicketChangeIndicator +{ + /// + /// None + /// + None, + + /// + /// Change to existing ticket + /// + ChangeToExistingTicket, + + /// + /// New ticket + /// + NewTicket, +} + +sealed class CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelTicketChangeIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None, + "change_to_existing_ticket" => + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket, + "new_ticket" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket, + _ => (CardSettlementPurchaseDetailsTravelTicketChangeIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelTicketChangeIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None => "none", + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket => + "change_to_existing_ticket", + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket => "new_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsTravelTripLeg, + CardSettlementPurchaseDetailsTravelTripLegFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsTravelTripLeg : JsonModel +{ + /// + /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// + public required string? CarrierCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("carrier_code"); + } + init { this._rawData.Set("carrier_code", value); } + } + + /// + /// Code for the destination city or airport. + /// + public required string? DestinationCityAirportCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("destination_city_airport_code"); + } + init { this._rawData.Set("destination_city_airport_code", value); } + } + + /// + /// Fare basis code. + /// + public required string? FareBasisCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fare_basis_code"); + } + init { this._rawData.Set("fare_basis_code", value); } + } + + /// + /// Flight number. + /// + public required string? FlightNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("flight_number"); + } + init { this._rawData.Set("flight_number", value); } + } + + /// + /// Service class (e.g., first class, business class, etc.). + /// + public required string? ServiceClass + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("service_class"); + } + init { this._rawData.Set("service_class", value); } + } + + /// + /// Indicates whether a stopover is allowed on this ticket. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelTripLegStopOverCode + >? StopOverCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("stop_over_code"); + } + init { this._rawData.Set("stop_over_code", value); } + } + + /// + public override void Validate() + { + _ = this.CarrierCode; + _ = this.DestinationCityAirportCode; + _ = this.FareBasisCode; + _ = this.FlightNumber; + _ = this.ServiceClass; + this.StopOverCode?.Validate(); + } + + public CardSettlementPurchaseDetailsTravelTripLeg() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsTravelTripLeg( + CardSettlementPurchaseDetailsTravelTripLeg cardSettlementPurchaseDetailsTravelTripLeg + ) + : base(cardSettlementPurchaseDetailsTravelTripLeg) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsTravelTripLeg( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsTravelTripLeg(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsTravelTripLegFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsTravelTripLeg.FromRawUnchecked(rawData); +} + +/// +/// Indicates whether a stopover is allowed on this ticket. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter))] +public enum CardSettlementPurchaseDetailsTravelTripLegStopOverCode +{ + /// + /// None + /// + None, + + /// + /// Stop over allowed + /// + StopOverAllowed, + + /// + /// Stop over not allowed + /// + StopOverNotAllowed, +} + +sealed class CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelTripLegStopOverCode Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None, + "stop_over_allowed" => + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed, + "stop_over_not_allowed" => + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed, + _ => (CardSettlementPurchaseDetailsTravelTripLegStopOverCode)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelTripLegStopOverCode value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None => "none", + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed => + "stop_over_allowed", + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed => + "stop_over_not_allowed", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardSettlementSchemeFee : JsonModel +{ + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. + /// + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } + } + + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } + + /// + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). + /// + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } + + public CardSettlementSchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementSchemeFee(CardSettlementSchemeFee cardSettlementSchemeFee) + : base(cardSettlementSchemeFee) { } +#pragma warning restore CS8618 + + public CardSettlementSchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementSchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardSettlementSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementSchemeFee.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(CardSettlementSchemeFeeCurrencyConverter))] +public enum CardSettlementSchemeFeeCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class CardSettlementSchemeFeeCurrencyConverter + : JsonConverter +{ + public override CardSettlementSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardSettlementSchemeFeeCurrency.Usd, + _ => (CardSettlementSchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementSchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(CardSettlementSchemeFeeFeeTypeConverter))] +public enum CardSettlementSchemeFeeFeeType +{ + /// + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. + /// + VisaInternationalServiceAssessmentSingleCurrency, + + /// + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. + /// + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class CardSettlementSchemeFeeFeeTypeConverter : JsonConverter +{ + public override CardSettlementSchemeFeeFeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardSettlementSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardSettlementSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardSettlementSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardSettlementSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardSettlementSchemeFeeFeeType.PulseSwitchFee, + _ => (CardSettlementSchemeFeeFeeType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementSchemeFeeFeeType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardSettlementSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardSettlementSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken => + "visa_debit_purchase_token", + CardSettlementSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardSettlementSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardSettlementSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Surcharge amount details, if applicable. The amount is positive if the surcharge +/// is added to the overall transaction amount (surcharge), and negative if the surcharge +/// is deducted from the overall transaction amount (discount). +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardSettlementSurcharge : JsonModel +{ + /// + /// The surcharge amount in the minor unit of the transaction's settlement currency. + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The surcharge amount in the minor unit of the transaction's presentment currency. + /// + public required long PresentmentAmount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("presentment_amount"); + } + init { this._rawData.Set("presentment_amount", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.PresentmentAmount; + } + + public CardSettlementSurcharge() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementSurcharge(CardSettlementSurcharge cardSettlementSurcharge) + : base(cardSettlementSurcharge) { } +#pragma warning restore CS8618 + + public CardSettlementSurcharge(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementSurcharge(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementSurchargeFromRaw : IFromRawJson +{ + /// + public CardSettlementSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementSurcharge.FromRawUnchecked(rawData); +} + +/// +/// A constant representing the object's type. For this resource it will always be `card_settlement`. +/// +[JsonConverter(typeof(CardSettlementTypeConverter))] +public enum CardSettlementType +{ + CardSettlement, +} + +sealed class CardSettlementTypeConverter : JsonConverter +{ + public override CardSettlementType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "card_settlement" => CardSettlementType.CardSettlement, + _ => (CardSettlementType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementType.CardSettlement => "card_settlement", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// An Inbound Card Validation object. This field will be present in the JSON response +/// if and only if `category` is equal to `card_validation`. Inbound Card Validations +/// are requests from a merchant to verify that a card number and optionally its +/// address and/or Card Verification Value are valid. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardValidation : JsonModel +{ + /// + /// The Card Validation identifier. + /// + public required string ID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("id"); + } + init { this._rawData.Set("id", value); } + } + + /// + /// Whether this authorization was approved by Increase, the card network through + /// stand-in processing, or the user through a real-time decision. + /// + public required ApiEnum Actioner + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "actioner" + ); + } + init { this._rawData.Set("actioner", value); } + } + + /// + /// Additional amounts associated with the card authorization, such as ATM surcharges + /// fees. These are usually a subset of the `amount` field and are used to provide + /// more detailed information about the transaction. + /// + public required CardValidationAdditionalAmounts AdditionalAmounts + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "additional_amounts" + ); + } + init { this._rawData.Set("additional_amounts", value); } + } + + /// + /// The ID of the Card Payment this transaction belongs to. + /// + public required string CardPaymentID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("card_payment_id"); + } + init { this._rawData.Set("card_payment_id", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// If the authorization was made via a Digital Wallet Token (such as an Apple + /// Pay purchase), the identifier of the token that was used. + /// + public required string? DigitalWalletTokenID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("digital_wallet_token_id"); + } + init { this._rawData.Set("digital_wallet_token_id", value); } + } + + /// + /// The merchant identifier (commonly abbreviated as MID) of the merchant the + /// card is transacting with. + /// + public required string MerchantAcceptorID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_acceptor_id"); + } + init { this._rawData.Set("merchant_acceptor_id", value); } + } + + /// + /// The Merchant Category Code (commonly abbreviated as MCC) of the merchant the + /// card is transacting with. + /// + public required string MerchantCategoryCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_category_code"); + } + init { this._rawData.Set("merchant_category_code", value); } + } + + /// + /// The city the merchant resides in. + /// + public required string? MerchantCity + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_city"); + } + init { this._rawData.Set("merchant_city", value); } + } + + /// + /// The country the merchant resides in. + /// + public required string MerchantCountry + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_country"); + } + init { this._rawData.Set("merchant_country", value); } + } + + /// + /// The merchant descriptor of the merchant the card is transacting with. + /// + public required string MerchantDescriptor + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("merchant_descriptor"); + } + init { this._rawData.Set("merchant_descriptor", value); } + } + + /// + /// The merchant's postal code. For US merchants this is either a 5-digit or 9-digit + /// ZIP code, where the first 5 and last 4 are separated by a dash. + /// + public required string? MerchantPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_postal_code"); + } + init { this._rawData.Set("merchant_postal_code", value); } + } + + /// + /// The state the merchant resides in. + /// + public required string? MerchantState + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("merchant_state"); + } + init { this._rawData.Set("merchant_state", value); } + } + + /// + /// Fields specific to the `network`. + /// + public required CardValidationNetworkDetails NetworkDetails + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("network_details"); + } + init { this._rawData.Set("network_details", value); } + } + + /// + /// Network-specific identifiers for a specific request or transaction. + /// + public required CardValidationNetworkIdentifiers NetworkIdentifiers + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "network_identifiers" + ); + } + init { this._rawData.Set("network_identifiers", value); } + } + + /// + /// The risk score generated by the card network. For Visa this is the Visa Advanced + /// Authorization risk score, from 0 to 99, where 99 is the riskiest. For Pulse + /// the score is from 0 to 999, where 999 is the riskiest. + /// + public required long? NetworkRiskScore + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableStruct("network_risk_score"); + } + init { this._rawData.Set("network_risk_score", value); } + } + + /// + /// If the authorization was made in-person with a physical card, the Physical + /// Card that was used. + /// + public required string? PhysicalCardID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("physical_card_id"); + } + init { this._rawData.Set("physical_card_id", value); } + } + + /// + /// The identifier of the Real-Time Decision sent to approve or decline this transaction. + /// + public required string? RealTimeDecisionID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("real_time_decision_id"); + } + init { this._rawData.Set("real_time_decision_id", value); } + } + + /// + /// The scheme fees associated with this card validation. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + + /// + /// The terminal identifier (commonly abbreviated as TID) of the terminal the + /// card is transacting with. + /// + public required string? TerminalID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("terminal_id"); + } + init { this._rawData.Set("terminal_id", value); } + } + + /// + /// A constant representing the object's type. For this resource it will always + /// be `inbound_card_validation`. + /// + public required ApiEnum Type + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("type"); + } + init { this._rawData.Set("type", value); } + } + + /// + /// Fields related to verification of cardholder-provided values. + /// + public required CardValidationVerification Verification + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("verification"); + } + init { this._rawData.Set("verification", value); } + } + + /// + public override void Validate() + { + _ = this.ID; + this.Actioner.Validate(); + this.AdditionalAmounts.Validate(); + _ = this.CardPaymentID; + this.Currency.Validate(); + _ = this.DigitalWalletTokenID; + _ = this.MerchantAcceptorID; + _ = this.MerchantCategoryCode; + _ = this.MerchantCity; + _ = this.MerchantCountry; + _ = this.MerchantDescriptor; + _ = this.MerchantPostalCode; + _ = this.MerchantState; + this.NetworkDetails.Validate(); + this.NetworkIdentifiers.Validate(); + _ = this.NetworkRiskScore; + _ = this.PhysicalCardID; + _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } + _ = this.TerminalID; + this.Type.Validate(); + this.Verification.Validate(); + } + + public CardValidation() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidation(CardValidation cardValidation) + : base(cardValidation) { } +#pragma warning restore CS8618 + + public CardValidation(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidation(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidation FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationFromRaw : IFromRawJson +{ + /// + public CardValidation FromRawUnchecked(IReadOnlyDictionary rawData) => + CardValidation.FromRawUnchecked(rawData); +} + +/// +/// Whether this authorization was approved by Increase, the card network through +/// stand-in processing, or the user through a real-time decision. +/// +[JsonConverter(typeof(CardValidationActionerConverter))] +public enum CardValidationActioner +{ + /// + /// This object was actioned by the user through a real-time decision. + /// + User, + + /// + /// This object was actioned by Increase without user intervention. + /// + Increase, + + /// + /// This object was actioned by the network, through stand-in processing. + /// + Network, +} + +sealed class CardValidationActionerConverter : JsonConverter +{ + public override CardValidationActioner Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "user" => CardValidationActioner.User, + "increase" => CardValidationActioner.Increase, + "network" => CardValidationActioner.Network, + _ => (CardValidationActioner)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationActioner value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationActioner.User => "user", + CardValidationActioner.Increase => "increase", + CardValidationActioner.Network => "network", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Additional amounts associated with the card authorization, such as ATM surcharges +/// fees. These are usually a subset of the `amount` field and are used to provide +/// more detailed information about the transaction. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmounts, + CardValidationAdditionalAmountsFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmounts : JsonModel +{ + /// + /// The part of this transaction amount that was for clinic-related services. + /// + public required CardValidationAdditionalAmountsClinic? Clinic + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("clinic"); + } + init { this._rawData.Set("clinic", value); } + } + + /// + /// The part of this transaction amount that was for dental-related services. + /// + public required CardValidationAdditionalAmountsDental? Dental + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("dental"); + } + init { this._rawData.Set("dental", value); } + } + + /// + /// The original pre-authorized amount. + /// + public required CardValidationAdditionalAmountsOriginal? Original + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "original" + ); + } + init { this._rawData.Set("original", value); } + } + + /// + /// The part of this transaction amount that was for healthcare prescriptions. + /// + public required CardValidationAdditionalAmountsPrescription? Prescription + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "prescription" + ); + } + init { this._rawData.Set("prescription", value); } + } + + /// + /// The surcharge amount charged for this transaction by the merchant. + /// + public required CardValidationAdditionalAmountsSurcharge? Surcharge + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "surcharge" + ); + } + init { this._rawData.Set("surcharge", value); } + } + + /// + /// The total amount of a series of incremental authorizations, optionally provided. + /// + public required CardValidationAdditionalAmountsTotalCumulative? TotalCumulative + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_cumulative" + ); + } + init { this._rawData.Set("total_cumulative", value); } + } + + /// + /// The total amount of healthcare-related additional amounts. + /// + public required CardValidationAdditionalAmountsTotalHealthcare? TotalHealthcare + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "total_healthcare" + ); + } + init { this._rawData.Set("total_healthcare", value); } + } + + /// + /// The part of this transaction amount that was for transit-related services. + /// + public required CardValidationAdditionalAmountsTransit? Transit + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "transit" + ); + } + init { this._rawData.Set("transit", value); } + } + + /// + /// An unknown additional amount. + /// + public required CardValidationAdditionalAmountsUnknown? Unknown + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "unknown" + ); + } + init { this._rawData.Set("unknown", value); } + } + + /// + /// The part of this transaction amount that was for vision-related services. + /// + public required CardValidationAdditionalAmountsVision? Vision + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("vision"); + } + init { this._rawData.Set("vision", value); } + } + + /// + public override void Validate() + { + this.Clinic?.Validate(); + this.Dental?.Validate(); + this.Original?.Validate(); + this.Prescription?.Validate(); + this.Surcharge?.Validate(); + this.TotalCumulative?.Validate(); + this.TotalHealthcare?.Validate(); + this.Transit?.Validate(); + this.Unknown?.Validate(); + this.Vision?.Validate(); + } + + public CardValidationAdditionalAmounts() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmounts( + CardValidationAdditionalAmounts cardValidationAdditionalAmounts + ) + : base(cardValidationAdditionalAmounts) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmounts(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmounts(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmounts FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsFromRaw : IFromRawJson +{ + /// + public CardValidationAdditionalAmounts FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmounts.FromRawUnchecked(rawData); +} + +/// +/// The part of this transaction amount that was for clinic-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsClinic, + CardValidationAdditionalAmountsClinicFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsClinic : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsClinic() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsClinic( + CardValidationAdditionalAmountsClinic cardValidationAdditionalAmountsClinic + ) + : base(cardValidationAdditionalAmountsClinic) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsClinic(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsClinic(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsClinicFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsClinic FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsClinic.FromRawUnchecked(rawData); +} + +/// +/// The part of this transaction amount that was for dental-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsDental, + CardValidationAdditionalAmountsDentalFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsDental : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsDental() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsDental( + CardValidationAdditionalAmountsDental cardValidationAdditionalAmountsDental + ) + : base(cardValidationAdditionalAmountsDental) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsDental(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsDental(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsDentalFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsDental FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsDental.FromRawUnchecked(rawData); +} + +/// +/// The original pre-authorized amount. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsOriginal, + CardValidationAdditionalAmountsOriginalFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsOriginal : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsOriginal() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsOriginal( + CardValidationAdditionalAmountsOriginal cardValidationAdditionalAmountsOriginal + ) + : base(cardValidationAdditionalAmountsOriginal) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsOriginal(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsOriginal(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsOriginalFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsOriginal FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsOriginal.FromRawUnchecked(rawData); +} + +/// +/// The part of this transaction amount that was for healthcare prescriptions. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsPrescription, + CardValidationAdditionalAmountsPrescriptionFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsPrescription : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsPrescription() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsPrescription( + CardValidationAdditionalAmountsPrescription cardValidationAdditionalAmountsPrescription + ) + : base(cardValidationAdditionalAmountsPrescription) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsPrescription( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsPrescription(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsPrescription FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsPrescriptionFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsPrescription FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsPrescription.FromRawUnchecked(rawData); +} + +/// +/// The surcharge amount charged for this transaction by the merchant. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsSurcharge, + CardValidationAdditionalAmountsSurchargeFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsSurcharge : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsSurcharge() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsSurcharge( + CardValidationAdditionalAmountsSurcharge cardValidationAdditionalAmountsSurcharge + ) + : base(cardValidationAdditionalAmountsSurcharge) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsSurcharge( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsSurcharge(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsSurchargeFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsSurcharge FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsSurcharge.FromRawUnchecked(rawData); +} + +/// +/// The total amount of a series of incremental authorizations, optionally provided. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsTotalCumulative, + CardValidationAdditionalAmountsTotalCumulativeFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsTotalCumulative : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsTotalCumulative() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsTotalCumulative( + CardValidationAdditionalAmountsTotalCumulative cardValidationAdditionalAmountsTotalCumulative + ) + : base(cardValidationAdditionalAmountsTotalCumulative) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsTotalCumulative( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsTotalCumulative(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsTotalCumulative FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsTotalCumulativeFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsTotalCumulative FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsTotalCumulative.FromRawUnchecked(rawData); +} + +/// +/// The total amount of healthcare-related additional amounts. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsTotalHealthcare, + CardValidationAdditionalAmountsTotalHealthcareFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsTotalHealthcare : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsTotalHealthcare() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsTotalHealthcare( + CardValidationAdditionalAmountsTotalHealthcare cardValidationAdditionalAmountsTotalHealthcare + ) + : base(cardValidationAdditionalAmountsTotalHealthcare) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsTotalHealthcare( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsTotalHealthcare(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsTotalHealthcareFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsTotalHealthcare FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsTotalHealthcare.FromRawUnchecked(rawData); +} + +/// +/// The part of this transaction amount that was for transit-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsTransit, + CardValidationAdditionalAmountsTransitFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsTransit : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsTransit() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsTransit( + CardValidationAdditionalAmountsTransit cardValidationAdditionalAmountsTransit + ) + : base(cardValidationAdditionalAmountsTransit) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsTransit(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsTransit(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsTransitFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsTransit FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsTransit.FromRawUnchecked(rawData); +} + +/// +/// An unknown additional amount. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsUnknown, + CardValidationAdditionalAmountsUnknownFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsUnknown : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsUnknown() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsUnknown( + CardValidationAdditionalAmountsUnknown cardValidationAdditionalAmountsUnknown + ) + : base(cardValidationAdditionalAmountsUnknown) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsUnknown(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsUnknown(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsUnknown FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsUnknownFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsUnknown FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsUnknown.FromRawUnchecked(rawData); +} + +/// +/// The part of this transaction amount that was for vision-related services. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationAdditionalAmountsVision, + CardValidationAdditionalAmountsVisionFromRaw + >) +)] +public sealed record class CardValidationAdditionalAmountsVision : JsonModel +{ + /// + /// The amount in minor units of the `currency` field. The amount is positive + /// if it is added to the amount (such as an ATM surcharge fee) and negative + /// if it is subtracted from the amount (such as a discount). + /// + public required long Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the additional + /// amount's currency. + /// + public required string Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.Currency; + } + + public CardValidationAdditionalAmountsVision() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationAdditionalAmountsVision( + CardValidationAdditionalAmountsVision cardValidationAdditionalAmountsVision + ) + : base(cardValidationAdditionalAmountsVision) { } +#pragma warning restore CS8618 + + public CardValidationAdditionalAmountsVision(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationAdditionalAmountsVision(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationAdditionalAmountsVision FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationAdditionalAmountsVisionFromRaw + : IFromRawJson +{ + /// + public CardValidationAdditionalAmountsVision FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationAdditionalAmountsVision.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the transaction's currency. +/// +[JsonConverter(typeof(CardValidationCurrencyConverter))] +public enum CardValidationCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class CardValidationCurrencyConverter : JsonConverter +{ + public override CardValidationCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardValidationCurrency.Usd, + _ => (CardValidationCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields specific to the `network`. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardValidationNetworkDetails : JsonModel +{ + /// + /// The payment network used to process this card authorization. + /// + public required ApiEnum Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("category"); + } + init { this._rawData.Set("category", value); } + } + + /// + /// Fields specific to the `pulse` network. + /// + public required CardValidationNetworkDetailsPulse? Pulse + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("pulse"); + } + init { this._rawData.Set("pulse", value); } + } + + /// + /// Fields specific to the `visa` network. + /// + public required CardValidationNetworkDetailsVisa? Visa + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("visa"); + } + init { this._rawData.Set("visa", value); } + } + + /// + public override void Validate() + { + this.Category.Validate(); + this.Pulse?.Validate(); + this.Visa?.Validate(); + } + + public CardValidationNetworkDetails() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationNetworkDetails(CardValidationNetworkDetails cardValidationNetworkDetails) + : base(cardValidationNetworkDetails) { } +#pragma warning restore CS8618 + + public CardValidationNetworkDetails(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationNetworkDetails(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationNetworkDetails FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationNetworkDetailsFromRaw : IFromRawJson +{ + /// + public CardValidationNetworkDetails FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationNetworkDetails.FromRawUnchecked(rawData); +} + +/// +/// The payment network used to process this card authorization. +/// +[JsonConverter(typeof(CardValidationNetworkDetailsCategoryConverter))] +public enum CardValidationNetworkDetailsCategory +{ + /// + /// Visa + /// + Visa, + + /// + /// Pulse + /// + Pulse, +} + +sealed class CardValidationNetworkDetailsCategoryConverter + : JsonConverter +{ + public override CardValidationNetworkDetailsCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa" => CardValidationNetworkDetailsCategory.Visa, + "pulse" => CardValidationNetworkDetailsCategory.Pulse, + _ => (CardValidationNetworkDetailsCategory)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationNetworkDetailsCategory value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationNetworkDetailsCategory.Visa => "visa", + CardValidationNetworkDetailsCategory.Pulse => "pulse", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields specific to the `pulse` network. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationNetworkDetailsPulse, + CardValidationNetworkDetailsPulseFromRaw + >) +)] +public sealed record class CardValidationNetworkDetailsPulse : JsonModel +{ + /// + public override void Validate() { } + + public CardValidationNetworkDetailsPulse() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationNetworkDetailsPulse( + CardValidationNetworkDetailsPulse cardValidationNetworkDetailsPulse + ) + : base(cardValidationNetworkDetailsPulse) { } +#pragma warning restore CS8618 + + public CardValidationNetworkDetailsPulse(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationNetworkDetailsPulse(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationNetworkDetailsPulseFromRaw : IFromRawJson +{ + /// + public CardValidationNetworkDetailsPulse FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationNetworkDetailsPulse.FromRawUnchecked(rawData); +} + +/// +/// Fields specific to the `visa` network. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationNetworkDetailsVisa, + CardValidationNetworkDetailsVisaFromRaw + >) +)] +public sealed record class CardValidationNetworkDetailsVisa : JsonModel +{ + /// + /// For electronic commerce transactions, this identifies the level of security + /// used in obtaining the customer's payment credential. For mail or telephone + /// order transactions, identifies the type of mail or telephone order. + /// + public required ApiEnum< + string, + CardValidationNetworkDetailsVisaElectronicCommerceIndicator + >? ElectronicCommerceIndicator + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("electronic_commerce_indicator"); + } + init { this._rawData.Set("electronic_commerce_indicator", value); } + } + + /// + /// The method used to enter the cardholder's primary account number and card + /// expiration date. + /// + public required ApiEnum< + string, + CardValidationNetworkDetailsVisaPointOfServiceEntryMode + >? PointOfServiceEntryMode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("point_of_service_entry_mode"); + } + init { this._rawData.Set("point_of_service_entry_mode", value); } + } + + /// + /// Only present when `actioner: network`. Describes why a card authorization + /// was approved or declined by Visa through stand-in processing. + /// + public required ApiEnum< + string, + CardValidationNetworkDetailsVisaStandInProcessingReason + >? StandInProcessingReason + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("stand_in_processing_reason"); + } + init { this._rawData.Set("stand_in_processing_reason", value); } + } + + /// + /// The capability of the terminal being used to read the card. Shows whether + /// a terminal can e.g., accept chip cards or if it only supports magnetic stripe + /// reads. This reflects the highest capability of the terminal — for example, + /// a terminal that supports both chip and magnetic stripe will be identified + /// as chip-capable. + /// + public required ApiEnum< + string, + CardValidationNetworkDetailsVisaTerminalEntryCapability + >? TerminalEntryCapability + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("terminal_entry_capability"); + } + init { this._rawData.Set("terminal_entry_capability", value); } + } + + /// + public override void Validate() + { + this.ElectronicCommerceIndicator?.Validate(); + this.PointOfServiceEntryMode?.Validate(); + this.StandInProcessingReason?.Validate(); + this.TerminalEntryCapability?.Validate(); + } + + public CardValidationNetworkDetailsVisa() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationNetworkDetailsVisa( + CardValidationNetworkDetailsVisa cardValidationNetworkDetailsVisa + ) + : base(cardValidationNetworkDetailsVisa) { } +#pragma warning restore CS8618 + + public CardValidationNetworkDetailsVisa(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationNetworkDetailsVisa(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationNetworkDetailsVisa FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationNetworkDetailsVisaFromRaw : IFromRawJson +{ + /// + public CardValidationNetworkDetailsVisa FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationNetworkDetailsVisa.FromRawUnchecked(rawData); +} + +/// +/// For electronic commerce transactions, this identifies the level of security used +/// in obtaining the customer's payment credential. For mail or telephone order transactions, +/// identifies the type of mail or telephone order. +/// +[JsonConverter(typeof(CardValidationNetworkDetailsVisaElectronicCommerceIndicatorConverter))] +public enum CardValidationNetworkDetailsVisaElectronicCommerceIndicator +{ + /// + /// Single transaction of a mail/phone order: Use to indicate that the transaction + /// is a mail/phone order purchase, not a recurring transaction or installment + /// payment. For domestic transactions in the US region, this value may also indicate + /// one bill payment transaction in the card-present or card-absent environments. + /// + MailPhoneOrder, + + /// + /// Recurring transaction: Payment indicator used to indicate a recurring transaction + /// that originates from an acquirer in the US region. + /// + Recurring, + + /// + /// Installment payment: Payment indicator used to indicate one purchase of goods + /// or services that is billed to the account in multiple charges over a period + /// of time agreed upon by the cardholder and merchant from transactions that + /// originate from an acquirer in the US region. + /// + Installment, + + /// + /// Unknown classification: other mail order: Use to indicate that the type of + /// mail/telephone order is unknown. + /// + UnknownMailPhoneOrder, + + /// + /// Secure electronic commerce transaction: Use to indicate that the electronic + /// commerce transaction has been authenticated using e.g., 3-D Secure + /// + SecureElectronicCommerce, + + /// + /// Non-authenticated security transaction at a 3-D Secure-capable merchant, + /// and merchant attempted to authenticate the cardholder using 3-D Secure: Use + /// to identify an electronic commerce transaction where the merchant attempted + /// to authenticate the cardholder using 3-D Secure, but was unable to complete + /// the authentication because the issuer or cardholder does not participate in + /// the 3-D Secure program. + /// + NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + + /// + /// Non-authenticated security transaction: Use to identify an electronic commerce + /// transaction that uses data encryption for security however, cardholder authentication + /// is not performed using 3-D Secure. + /// + NonAuthenticatedSecurityTransaction, + + /// + /// Non-secure transaction: Use to identify an electronic commerce transaction + /// that has no data protection. + /// + NonSecureTransaction, +} + +sealed class CardValidationNetworkDetailsVisaElectronicCommerceIndicatorConverter + : JsonConverter +{ + public override CardValidationNetworkDetailsVisaElectronicCommerceIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "mail_phone_order" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder, + "recurring" => CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Recurring, + "installment" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Installment, + "unknown_mail_phone_order" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder, + "secure_electronic_commerce" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce, + "non_authenticated_security_transaction_at_3ds_capable_merchant" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant, + "non_authenticated_security_transaction" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction, + "non_secure_transaction" => + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction, + _ => (CardValidationNetworkDetailsVisaElectronicCommerceIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationNetworkDetailsVisaElectronicCommerceIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.MailPhoneOrder => + "mail_phone_order", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Recurring => + "recurring", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.Installment => + "installment", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.UnknownMailPhoneOrder => + "unknown_mail_phone_order", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.SecureElectronicCommerce => + "secure_electronic_commerce", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransactionAt3dsCapableMerchant => + "non_authenticated_security_transaction_at_3ds_capable_merchant", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonAuthenticatedSecurityTransaction => + "non_authenticated_security_transaction", + CardValidationNetworkDetailsVisaElectronicCommerceIndicator.NonSecureTransaction => + "non_secure_transaction", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The method used to enter the cardholder's primary account number and card expiration date. +/// +[JsonConverter(typeof(CardValidationNetworkDetailsVisaPointOfServiceEntryModeConverter))] +public enum CardValidationNetworkDetailsVisaPointOfServiceEntryMode +{ + /// + /// Unknown + /// + Unknown, + + /// + /// Manual key entry + /// + Manual, + + /// + /// Magnetic stripe read, without card verification value + /// + MagneticStripeNoCvv, + + /// + /// Optical code + /// + OpticalCode, + + /// + /// Contact chip card + /// + IntegratedCircuitCard, + + /// + /// Contactless read of chip card + /// + Contactless, + + /// + /// Transaction initiated using a credential that has previously been stored + /// on file + /// + CredentialOnFile, + + /// + /// Magnetic stripe read + /// + MagneticStripe, + + /// + /// Contactless read of magnetic stripe data + /// + ContactlessMagneticStripe, + + /// + /// Contact chip card, without card verification value + /// + IntegratedCircuitCardNoCvv, +} + +sealed class CardValidationNetworkDetailsVisaPointOfServiceEntryModeConverter + : JsonConverter +{ + public override CardValidationNetworkDetailsVisaPointOfServiceEntryMode Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "unknown" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Unknown, + "manual" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Manual, + "magnetic_stripe_no_cvv" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv, + "optical_code" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode, + "integrated_circuit_card" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard, + "contactless" => CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Contactless, + "credential_on_file" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile, + "magnetic_stripe" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe, + "contactless_magnetic_stripe" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe, + "integrated_circuit_card_no_cvv" => + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv, + _ => (CardValidationNetworkDetailsVisaPointOfServiceEntryMode)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationNetworkDetailsVisaPointOfServiceEntryMode value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Unknown => "unknown", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Manual => "manual", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripeNoCvv => + "magnetic_stripe_no_cvv", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.OpticalCode => + "optical_code", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCard => + "integrated_circuit_card", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.Contactless => + "contactless", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.CredentialOnFile => + "credential_on_file", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.MagneticStripe => + "magnetic_stripe", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.ContactlessMagneticStripe => + "contactless_magnetic_stripe", + CardValidationNetworkDetailsVisaPointOfServiceEntryMode.IntegratedCircuitCardNoCvv => + "integrated_circuit_card_no_cvv", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Only present when `actioner: network`. Describes why a card authorization was +/// approved or declined by Visa through stand-in processing. +/// +[JsonConverter(typeof(CardValidationNetworkDetailsVisaStandInProcessingReasonConverter))] +public enum CardValidationNetworkDetailsVisaStandInProcessingReason +{ + /// + /// Increase failed to process the authorization in a timely manner. + /// + IssuerError, + + /// + /// The physical card read had an invalid CVV or dCVV. + /// + InvalidPhysicalCard, + + /// + /// The card's authorization request cryptogram was invalid. The cryptogram can + /// be from a physical card or a Digital Wallet Token purchase. + /// + InvalidCryptogram, + + /// + /// The 3DS cardholder authentication verification value was invalid. + /// + InvalidCardholderAuthenticationVerificationValue, + + /// + /// An internal Visa error occurred. Visa uses this reason code for certain expected + /// occurrences as well, such as Application Transaction Counter (ATC) replays. + /// + InternalVisaError, + + /// + /// The merchant has enabled Visa's Transaction Advisory Service and requires + /// further authentication to perform the transaction. In practice this is often + /// utilized at fuel pumps to tell the cardholder to see the cashier. + /// + MerchantTransactionAdvisoryServiceAuthenticationRequired, + + /// + /// The transaction was blocked by Visa's Payment Fraud Disruption service due + /// to fraudulent Acquirer behavior, such as card testing. + /// + PaymentFraudDisruptionAcquirerBlock, + + /// + /// An unspecific reason for stand-in processing. + /// + Other, +} + +sealed class CardValidationNetworkDetailsVisaStandInProcessingReasonConverter + : JsonConverter +{ + public override CardValidationNetworkDetailsVisaStandInProcessingReason Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "issuer_error" => CardValidationNetworkDetailsVisaStandInProcessingReason.IssuerError, + "invalid_physical_card" => + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard, + "invalid_cryptogram" => + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram, + "invalid_cardholder_authentication_verification_value" => + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue, + "internal_visa_error" => + CardValidationNetworkDetailsVisaStandInProcessingReason.InternalVisaError, + "merchant_transaction_advisory_service_authentication_required" => + CardValidationNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired, + "payment_fraud_disruption_acquirer_block" => + CardValidationNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock, + "other" => CardValidationNetworkDetailsVisaStandInProcessingReason.Other, + _ => (CardValidationNetworkDetailsVisaStandInProcessingReason)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationNetworkDetailsVisaStandInProcessingReason value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationNetworkDetailsVisaStandInProcessingReason.IssuerError => + "issuer_error", + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidPhysicalCard => + "invalid_physical_card", + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCryptogram => + "invalid_cryptogram", + CardValidationNetworkDetailsVisaStandInProcessingReason.InvalidCardholderAuthenticationVerificationValue => + "invalid_cardholder_authentication_verification_value", + CardValidationNetworkDetailsVisaStandInProcessingReason.InternalVisaError => + "internal_visa_error", + CardValidationNetworkDetailsVisaStandInProcessingReason.MerchantTransactionAdvisoryServiceAuthenticationRequired => + "merchant_transaction_advisory_service_authentication_required", + CardValidationNetworkDetailsVisaStandInProcessingReason.PaymentFraudDisruptionAcquirerBlock => + "payment_fraud_disruption_acquirer_block", + CardValidationNetworkDetailsVisaStandInProcessingReason.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The capability of the terminal being used to read the card. Shows whether a terminal +/// can e.g., accept chip cards or if it only supports magnetic stripe reads. This +/// reflects the highest capability of the terminal — for example, a terminal that +/// supports both chip and magnetic stripe will be identified as chip-capable. +/// +[JsonConverter(typeof(CardValidationNetworkDetailsVisaTerminalEntryCapabilityConverter))] +public enum CardValidationNetworkDetailsVisaTerminalEntryCapability +{ + /// + /// Unknown + /// + Unknown, + + /// + /// No terminal was used for this transaction. + /// + TerminalNotUsed, + + /// + /// The terminal can only read magnetic stripes and does not have chip or contactless + /// reading capability. + /// + MagneticStripe, + + /// + /// The terminal can only read barcodes. + /// + Barcode, + + /// + /// The terminal can only read cards via Optical Character Recognition. + /// + OpticalCharacterRecognition, + + /// + /// The terminal supports contact chip cards and can also read the magnetic stripe. + /// If contact chip is supported, this value is used regardless of whether contactless + /// is also supported. + /// + ChipOrContactless, + + /// + /// The terminal supports contactless reads but does not support contact chip. + /// Only used when the terminal lacks contact chip capability. + /// + ContactlessOnly, + + /// + /// The terminal has no card reading capability. + /// + NoCapability, +} + +sealed class CardValidationNetworkDetailsVisaTerminalEntryCapabilityConverter + : JsonConverter +{ + public override CardValidationNetworkDetailsVisaTerminalEntryCapability Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "unknown" => CardValidationNetworkDetailsVisaTerminalEntryCapability.Unknown, + "terminal_not_used" => + CardValidationNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed, + "magnetic_stripe" => + CardValidationNetworkDetailsVisaTerminalEntryCapability.MagneticStripe, + "barcode" => CardValidationNetworkDetailsVisaTerminalEntryCapability.Barcode, + "optical_character_recognition" => + CardValidationNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition, + "chip_or_contactless" => + CardValidationNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless, + "contactless_only" => + CardValidationNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly, + "no_capability" => CardValidationNetworkDetailsVisaTerminalEntryCapability.NoCapability, + _ => (CardValidationNetworkDetailsVisaTerminalEntryCapability)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationNetworkDetailsVisaTerminalEntryCapability value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationNetworkDetailsVisaTerminalEntryCapability.Unknown => "unknown", + CardValidationNetworkDetailsVisaTerminalEntryCapability.TerminalNotUsed => + "terminal_not_used", + CardValidationNetworkDetailsVisaTerminalEntryCapability.MagneticStripe => + "magnetic_stripe", + CardValidationNetworkDetailsVisaTerminalEntryCapability.Barcode => "barcode", + CardValidationNetworkDetailsVisaTerminalEntryCapability.OpticalCharacterRecognition => + "optical_character_recognition", + CardValidationNetworkDetailsVisaTerminalEntryCapability.ChipOrContactless => + "chip_or_contactless", + CardValidationNetworkDetailsVisaTerminalEntryCapability.ContactlessOnly => + "contactless_only", + CardValidationNetworkDetailsVisaTerminalEntryCapability.NoCapability => + "no_capability", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Network-specific identifiers for a specific request or transaction. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationNetworkIdentifiers, + CardValidationNetworkIdentifiersFromRaw + >) +)] +public sealed record class CardValidationNetworkIdentifiers : JsonModel +{ + /// + /// The randomly generated 6-character Authorization Identification Response code + /// sent back to the acquirer in an approved response. + /// + public required string? AuthorizationIdentificationResponse + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("authorization_identification_response"); + } + init { this._rawData.Set("authorization_identification_response", value); } + } + + /// + /// A life-cycle identifier used across e.g., an authorization and a reversal. + /// Expected to be unique per acquirer within a window of time. For some card + /// networks the retrieval reference number includes the trace counter. + /// + public required string? RetrievalReferenceNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("retrieval_reference_number"); + } + init { this._rawData.Set("retrieval_reference_number", value); } + } + + /// + /// A counter used to verify an individual authorization. Expected to be unique + /// per acquirer within a window of time. + /// + public required string? TraceNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("trace_number"); + } + init { this._rawData.Set("trace_number", value); } + } + + /// + /// A globally unique transaction identifier provided by the card network, used + /// across multiple life-cycle requests. + /// + public required string? TransactionID + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("transaction_id"); + } + init { this._rawData.Set("transaction_id", value); } + } + + /// + public override void Validate() + { + _ = this.AuthorizationIdentificationResponse; + _ = this.RetrievalReferenceNumber; + _ = this.TraceNumber; + _ = this.TransactionID; + } + + public CardValidationNetworkIdentifiers() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationNetworkIdentifiers( + CardValidationNetworkIdentifiers cardValidationNetworkIdentifiers + ) + : base(cardValidationNetworkIdentifiers) { } +#pragma warning restore CS8618 + + public CardValidationNetworkIdentifiers(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationNetworkIdentifiers(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationNetworkIdentifiersFromRaw : IFromRawJson +{ + /// + public CardValidationNetworkIdentifiers FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationNetworkIdentifiers.FromRawUnchecked(rawData); +} + +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardValidationSchemeFee : JsonModel +{ + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. + /// + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "currency" + ); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "fee_type" + ); + } + init { this._rawData.Set("fee_type", value); } + } + + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } + + /// + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). + /// + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } + + public CardValidationSchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationSchemeFee(CardValidationSchemeFee cardValidationSchemeFee) + : base(cardValidationSchemeFee) { } +#pragma warning restore CS8618 + + public CardValidationSchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationSchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardValidationSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationSchemeFee.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(CardValidationSchemeFeeCurrencyConverter))] +public enum CardValidationSchemeFeeCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class CardValidationSchemeFeeCurrencyConverter + : JsonConverter +{ + public override CardValidationSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardValidationSchemeFeeCurrency.Usd, + _ => (CardValidationSchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationSchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(CardValidationSchemeFeeFeeTypeConverter))] +public enum CardValidationSchemeFeeFeeType +{ + /// + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. + /// + VisaInternationalServiceAssessmentSingleCurrency, + + /// + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. + /// + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class CardValidationSchemeFeeFeeTypeConverter : JsonConverter +{ + public override CardValidationSchemeFeeFeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardValidationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardValidationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardValidationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardValidationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardValidationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardValidationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardValidationSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardValidationSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardValidationSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardValidationSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardValidationSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardValidationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardValidationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardValidationSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardValidationSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardValidationSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardValidationSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardValidationSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardValidationSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardValidationSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardValidationSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardValidationSchemeFeeFeeType.VisaServiceCommercialCredit, "visa_advertising_service_commercial_credit" => - FeeType.VisaAdvertisingServiceCommercialCredit, + CardValidationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, "visa_community_growth_acceleration_program" => - FeeType.VisaCommunityGrowthAccelerationProgram, + CardValidationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, "visa_processing_guarantee_commercial_credit" => - FeeType.VisaProcessingGuaranteeCommercialCredit, - "pulse_switch_fee" => FeeType.PulseSwitchFee, - _ => (FeeType)(-1), + CardValidationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardValidationSchemeFeeFeeType.PulseSwitchFee, + _ => (CardValidationSchemeFeeFeeType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationSchemeFeeFeeType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardValidationSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardValidationSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardValidationSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardValidationSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardValidationSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardValidationSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardValidationSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardValidationSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardValidationSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardValidationSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardValidationSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardValidationSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardValidationSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardValidationSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardValidationSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardValidationSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardValidationSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardValidationSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardValidationSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardValidationSchemeFeeFeeType.VisaDebitPurchaseToken => + "visa_debit_purchase_token", + CardValidationSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardValidationSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardValidationSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardValidationSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardValidationSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardValidationSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardValidationSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardValidationSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// A constant representing the object's type. For this resource it will always be `inbound_card_validation`. +/// +[JsonConverter(typeof(CardValidationTypeConverter))] +public enum CardValidationType +{ + InboundCardValidation, +} + +sealed class CardValidationTypeConverter : JsonConverter +{ + public override CardValidationType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "inbound_card_validation" => CardValidationType.InboundCardValidation, + _ => (CardValidationType)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationType value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationType.InboundCardValidation => "inbound_card_validation", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields related to verification of cardholder-provided values. +/// +[JsonConverter( + typeof(JsonModelConverter) +)] +public sealed record class CardValidationVerification : JsonModel +{ + /// + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. + /// + public required CardValidationVerificationCardVerificationCode CardVerificationCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "card_verification_code" + ); + } + init { this._rawData.Set("card_verification_code", value); } + } + + /// + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. + /// + public required CardValidationVerificationCardholderAddress CardholderAddress + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass( + "cardholder_address" + ); + } + init { this._rawData.Set("cardholder_address", value); } + } + + /// + /// Cardholder name provided in the authorization request. + /// + public required CardValidationVerificationCardholderName? CardholderName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass( + "cardholder_name" + ); + } + init { this._rawData.Set("cardholder_name", value); } + } + + /// + public override void Validate() + { + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); + } + + public CardValidationVerification() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationVerification(CardValidationVerification cardValidationVerification) + : base(cardValidationVerification) { } +#pragma warning restore CS8618 + + public CardValidationVerification(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationVerification(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationVerification FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationVerificationFromRaw : IFromRawJson +{ + /// + public CardValidationVerification FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationVerification.FromRawUnchecked(rawData); +} + +/// +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationVerificationCardVerificationCode, + CardValidationVerificationCardVerificationCodeFromRaw + >) +)] +public sealed record class CardValidationVerificationCardVerificationCode : JsonModel +{ + /// + /// The result of verifying the Card Verification Code. + /// + public required ApiEnum Result + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); + } + init { this._rawData.Set("result", value); } + } + + /// + public override void Validate() + { + this.Result.Validate(); + } + + public CardValidationVerificationCardVerificationCode() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationVerificationCardVerificationCode( + CardValidationVerificationCardVerificationCode cardValidationVerificationCardVerificationCode + ) + : base(cardValidationVerificationCardVerificationCode) { } +#pragma warning restore CS8618 + + public CardValidationVerificationCardVerificationCode( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationVerificationCardVerificationCode(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } + + [SetsRequiredMembers] + public CardValidationVerificationCardVerificationCode( + ApiEnum result + ) + : this() + { + this.Result = result; + } +} + +class CardValidationVerificationCardVerificationCodeFromRaw + : IFromRawJson +{ + /// + public CardValidationVerificationCardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationVerificationCardVerificationCode.FromRawUnchecked(rawData); +} + +/// +/// The result of verifying the Card Verification Code. +/// +[JsonConverter(typeof(CardValidationVerificationCardVerificationCodeResultConverter))] +public enum CardValidationVerificationCardVerificationCodeResult +{ + /// + /// No card verification code was provided in the authorization request. + /// + NotChecked, + + /// + /// The card verification code matched the one on file. + /// + Match, + + /// + /// The card verification code did not match the one on file. + /// + NoMatch, +} + +sealed class CardValidationVerificationCardVerificationCodeResultConverter + : JsonConverter +{ + public override CardValidationVerificationCardVerificationCodeResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => CardValidationVerificationCardVerificationCodeResult.NotChecked, + "match" => CardValidationVerificationCardVerificationCodeResult.Match, + "no_match" => CardValidationVerificationCardVerificationCodeResult.NoMatch, + _ => (CardValidationVerificationCardVerificationCodeResult)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardValidationVerificationCardVerificationCodeResult value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardValidationVerificationCardVerificationCodeResult.NotChecked => "not_checked", + CardValidationVerificationCardVerificationCodeResult.Match => "match", + CardValidationVerificationCardVerificationCodeResult.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationVerificationCardholderAddress, + CardValidationVerificationCardholderAddressFromRaw + >) +)] +public sealed record class CardValidationVerificationCardholderAddress : JsonModel +{ + /// + /// Line 1 of the address on file for the cardholder. + /// + public required string? ActualLine1 + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("actual_line1"); + } + init { this._rawData.Set("actual_line1", value); } + } + + /// + /// The postal code of the address on file for the cardholder. + /// + public required string? ActualPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("actual_postal_code"); + } + init { this._rawData.Set("actual_postal_code", value); } + } + + /// + /// The cardholder address line 1 provided for verification in the authorization request. + /// + public required string? ProvidedLine1 + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_line1"); + } + init { this._rawData.Set("provided_line1", value); } + } + + /// + /// The postal code provided for verification in the authorization request. + /// + public required string? ProvidedPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_postal_code"); + } + init { this._rawData.Set("provided_postal_code", value); } + } + + /// + /// The address verification result returned to the card network. + /// + public required ApiEnum Result + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("result"); + } + init { this._rawData.Set("result", value); } + } + + /// + public override void Validate() + { + _ = this.ActualLine1; + _ = this.ActualPostalCode; + _ = this.ProvidedLine1; + _ = this.ProvidedPostalCode; + this.Result.Validate(); + } + + public CardValidationVerificationCardholderAddress() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationVerificationCardholderAddress( + CardValidationVerificationCardholderAddress cardValidationVerificationCardholderAddress + ) + : base(cardValidationVerificationCardholderAddress) { } +#pragma warning restore CS8618 + + public CardValidationVerificationCardholderAddress( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationVerificationCardholderAddress(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationVerificationCardholderAddressFromRaw + : IFromRawJson +{ + /// + public CardValidationVerificationCardholderAddress FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationVerificationCardholderAddress.FromRawUnchecked(rawData); +} + +/// +/// The address verification result returned to the card network. +/// +[JsonConverter(typeof(CardValidationVerificationCardholderAddressResultConverter))] +public enum CardValidationVerificationCardholderAddressResult +{ + /// + /// No address information was provided in the authorization request. + /// + NotChecked, + + /// + /// Postal code matches, but the street address does not match or was not provided. + /// + PostalCodeMatchAddressNoMatch, + + /// + /// Postal code does not match, but the street address matches or was not provided. + /// + PostalCodeNoMatchAddressMatch, + + /// + /// Postal code and street address match. + /// + Match, + + /// + /// Postal code and street address do not match. + /// + NoMatch, + + /// + /// Postal code matches, but the street address was not verified. (deprecated) + /// + PostalCodeMatchAddressNotChecked, +} + +sealed class CardValidationVerificationCardholderAddressResultConverter + : JsonConverter +{ + public override CardValidationVerificationCardholderAddressResult Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => CardValidationVerificationCardholderAddressResult.NotChecked, + "postal_code_match_address_no_match" => + CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch, + "postal_code_no_match_address_match" => + CardValidationVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch, + "match" => CardValidationVerificationCardholderAddressResult.Match, + "no_match" => CardValidationVerificationCardholderAddressResult.NoMatch, + "postal_code_match_address_not_checked" => + CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked, + _ => (CardValidationVerificationCardholderAddressResult)(-1), }; } - public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + CardValidationVerificationCardholderAddressResult value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize( writer, value switch { - FeeType.VisaInternationalServiceAssessmentSingleCurrency => - "visa_international_service_assessment_single_currency", - FeeType.VisaInternationalServiceAssessmentCrossCurrency => - "visa_international_service_assessment_cross_currency", - FeeType.VisaAuthorizationDomesticPointOfSale => - "visa_authorization_domestic_point_of_sale", - FeeType.VisaAuthorizationInternationalPointOfSale => - "visa_authorization_international_point_of_sale", - FeeType.VisaAuthorizationCanadaPointOfSale => - "visa_authorization_canada_point_of_sale", - FeeType.VisaAuthorizationReversalPointOfSale => - "visa_authorization_reversal_point_of_sale", - FeeType.VisaAuthorizationReversalInternationalPointOfSale => - "visa_authorization_reversal_international_point_of_sale", - FeeType.VisaAuthorizationAddressVerificationService => - "visa_authorization_address_verification_service", - FeeType.VisaAdvancedAuthorization => "visa_advanced_authorization", - FeeType.VisaMessageTransmission => "visa_message_transmission", - FeeType.VisaAccountVerificationDomestic => "visa_account_verification_domestic", - FeeType.VisaAccountVerificationInternational => - "visa_account_verification_international", - FeeType.VisaAccountVerificationCanada => "visa_account_verification_canada", - FeeType.VisaCorporateAcceptanceFee => "visa_corporate_acceptance_fee", - FeeType.VisaConsumerDebitAcceptanceFee => "visa_consumer_debit_acceptance_fee", - FeeType.VisaBusinessDebitAcceptanceFee => "visa_business_debit_acceptance_fee", - FeeType.VisaPurchasingAcceptanceFee => "visa_purchasing_acceptance_fee", - FeeType.VisaPurchaseDomestic => "visa_purchase_domestic", - FeeType.VisaPurchaseInternational => "visa_purchase_international", - FeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", - FeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", - FeeType.VisaClearingTransmission => "visa_clearing_transmission", - FeeType.VisaDirectAuthorization => "visa_direct_authorization", - FeeType.VisaDirectTransactionDomestic => "visa_direct_transaction_domestic", - FeeType.VisaServiceCommercialCredit => "visa_service_commercial_credit", - FeeType.VisaAdvertisingServiceCommercialCredit => - "visa_advertising_service_commercial_credit", - FeeType.VisaCommunityGrowthAccelerationProgram => - "visa_community_growth_acceleration_program", - FeeType.VisaProcessingGuaranteeCommercialCredit => - "visa_processing_guarantee_commercial_credit", - FeeType.PulseSwitchFee => "pulse_switch_fee", + CardValidationVerificationCardholderAddressResult.NotChecked => "not_checked", + CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNoMatch => + "postal_code_match_address_no_match", + CardValidationVerificationCardholderAddressResult.PostalCodeNoMatchAddressMatch => + "postal_code_no_match_address_match", + CardValidationVerificationCardholderAddressResult.Match => "match", + CardValidationVerificationCardholderAddressResult.NoMatch => "no_match", + CardValidationVerificationCardholderAddressResult.PostalCodeMatchAddressNotChecked => + "postal_code_match_address_not_checked", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -29352,6 +34050,152 @@ public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerO } } +/// +/// Cardholder name provided in the authorization request. +/// +[JsonConverter( + typeof(JsonModelConverter< + CardValidationVerificationCardholderName, + CardValidationVerificationCardholderNameFromRaw + >) +)] +public sealed record class CardValidationVerificationCardholderName : JsonModel +{ + /// + /// The first name provided for verification in the authorization request. + /// + public required string? ProvidedFirstName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_first_name"); + } + init { this._rawData.Set("provided_first_name", value); } + } + + /// + /// The last name provided for verification in the authorization request. + /// + public required string? ProvidedLastName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_last_name"); + } + init { this._rawData.Set("provided_last_name", value); } + } + + /// + /// The middle name provided for verification in the authorization request. + /// + public required string? ProvidedMiddleName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_middle_name"); + } + init { this._rawData.Set("provided_middle_name", value); } + } + + /// + public override void Validate() + { + _ = this.ProvidedFirstName; + _ = this.ProvidedLastName; + _ = this.ProvidedMiddleName; + } + + public CardValidationVerificationCardholderName() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardValidationVerificationCardholderName( + CardValidationVerificationCardholderName cardValidationVerificationCardholderName + ) + : base(cardValidationVerificationCardholderName) { } +#pragma warning restore CS8618 + + public CardValidationVerificationCardholderName( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardValidationVerificationCardholderName(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardValidationVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardValidationVerificationCardholderNameFromRaw + : IFromRawJson +{ + /// + public CardValidationVerificationCardholderName FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardValidationVerificationCardholderName.FromRawUnchecked(rawData); +} + +/// +/// If the category of this Transaction source is equal to `other`, this field will +/// contain an empty object, otherwise it will contain null. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Other : JsonModel +{ + /// + public override void Validate() { } + + public Other() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public Other(Other other) + : base(other) { } +#pragma warning restore CS8618 + + public Other(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + Other(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static Other FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class OtherFromRaw : IFromRawJson +{ + /// + public Other FromRawUnchecked(IReadOnlyDictionary rawData) => + Other.FromRawUnchecked(rawData); +} + /// /// The summarized state of this card payment. /// diff --git a/src/Increase.Api/Models/CardPushTransfers/CardPushTransferCreateParams.cs b/src/Increase.Api/Models/CardPushTransfers/CardPushTransferCreateParams.cs index 4dc38d2..7c980b8 100644 --- a/src/Increase.Api/Models/CardPushTransfers/CardPushTransferCreateParams.cs +++ b/src/Increase.Api/Models/CardPushTransfers/CardPushTransferCreateParams.cs @@ -247,6 +247,135 @@ public required string SourceAccountNumberID init { this._rawBodyData.Set("source_account_number_id", value); } } + /// + /// The legal business name of the merchant (generally your business) sending + /// the transfer. Required if the card is issued in Canada. + /// + public string? MerchantLegalBusinessName + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("merchant_legal_business_name"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("merchant_legal_business_name", value); + } + } + + /// + /// The street address of the merchant (generally your business) sending the transfer. + /// Required if the card is issued in Canada. + /// + public string? MerchantStreetAddress + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("merchant_street_address"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("merchant_street_address", value); + } + } + + /// + /// The city of the recipient. Required if the card is issued in Canada. + /// + public string? RecipientAddressCity + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("recipient_address_city"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("recipient_address_city", value); + } + } + + /// + /// The first line of the recipient's address. Required if the card is issued + /// in Canada. + /// + public string? RecipientAddressLine1 + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("recipient_address_line1"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("recipient_address_line1", value); + } + } + + /// + /// The postal code of the recipient. Required if the card is issued in Canada. + /// + public string? RecipientAddressPostalCode + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("recipient_address_postal_code"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("recipient_address_postal_code", value); + } + } + + /// + /// The state or province of the recipient. Required if the card is issued in Canada. + /// + public string? RecipientAddressState + { + get + { + this._rawBodyData.Freeze(); + return this._rawBodyData.GetNullableClass("recipient_address_state"); + } + init + { + if (value == null) + { + return; + } + + this._rawBodyData.Set("recipient_address_state", value); + } + } + /// /// Whether the transfer requires explicit approval via the dashboard or API. /// diff --git a/src/Increase.Api/Models/CheckDeposits/CheckDeposit.cs b/src/Increase.Api/Models/CheckDeposits/CheckDeposit.cs index 553ba29..7e7a1de 100644 --- a/src/Increase.Api/Models/CheckDeposits/CheckDeposit.cs +++ b/src/Increase.Api/Models/CheckDeposits/CheckDeposit.cs @@ -646,18 +646,6 @@ public DepositAdjustment FromRawUnchecked(IReadOnlyDictionary - /// The return was initiated too late and the receiving institution has responded - /// with a Late Return Claim. - /// - LateReturn, - - /// - /// The check was deposited to the wrong payee and the depositing institution - /// has reimbursed the funds with a Wrong Payee Credit. - /// - WrongPayeeCredit, - /// /// The check was deposited with a different amount than what was written on the check. /// @@ -685,8 +673,6 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "late_return" => Reason.LateReturn, - "wrong_payee_credit" => Reason.WrongPayeeCredit, "adjusted_amount" => Reason.AdjustedAmount, "non_conforming_item" => Reason.NonConformingItem, "paid" => Reason.Paid, @@ -700,8 +686,6 @@ public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOp writer, value switch { - Reason.LateReturn => "late_return", - Reason.WrongPayeeCredit => "wrong_payee_credit", Reason.AdjustedAmount => "adjusted_amount", Reason.NonConformingItem => "non_conforming_item", Reason.Paid => "paid", diff --git a/src/Increase.Api/Models/DeclinedTransactions/DeclinedTransaction.cs b/src/Increase.Api/Models/DeclinedTransactions/DeclinedTransaction.cs index 87e4bad..a28c45d 100644 --- a/src/Increase.Api/Models/DeclinedTransactions/DeclinedTransaction.cs +++ b/src/Increase.Api/Models/DeclinedTransactions/DeclinedTransaction.cs @@ -1,5 +1,6 @@ using System.Collections.Frozen; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; @@ -861,6 +862,12 @@ public enum Reason /// TransactionNotAllowed, + /// + /// The originating financial institution asked for this transfer to be returned. + /// The receiving bank is complying with the request. + /// + ReturnedPerOdfiRequest, + /// /// Your integration declined this transfer via the API. /// @@ -871,12 +878,6 @@ public enum Reason /// InsufficientFunds, - /// - /// The originating financial institution asked for this transfer to be returned. - /// The receiving bank is complying with the request. - /// - ReturnedPerOdfiRequest, - /// /// The customer no longer authorizes this transaction. /// @@ -934,9 +935,9 @@ JsonSerializerOptions options "entity_not_active" => Reason.EntityNotActive, "group_locked" => Reason.GroupLocked, "transaction_not_allowed" => Reason.TransactionNotAllowed, + "returned_per_odfi_request" => Reason.ReturnedPerOdfiRequest, "user_initiated" => Reason.UserInitiated, "insufficient_funds" => Reason.InsufficientFunds, - "returned_per_odfi_request" => Reason.ReturnedPerOdfiRequest, "authorization_revoked_by_customer" => Reason.AuthorizationRevokedByCustomer, "payment_stopped" => Reason.PaymentStopped, "customer_advised_unauthorized_improper_ineligible_or_incomplete" => @@ -964,9 +965,9 @@ public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOp Reason.EntityNotActive => "entity_not_active", Reason.GroupLocked => "group_locked", Reason.TransactionNotAllowed => "transaction_not_allowed", + Reason.ReturnedPerOdfiRequest => "returned_per_odfi_request", Reason.UserInitiated => "user_initiated", Reason.InsufficientFunds => "insufficient_funds", - Reason.ReturnedPerOdfiRequest => "returned_per_odfi_request", Reason.AuthorizationRevokedByCustomer => "authorization_revoked_by_customer", Reason.PaymentStopped => "payment_stopped", Reason.CustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete => @@ -1409,6 +1410,25 @@ public required ApiEnum Reason init { this._rawData.Set("reason", value); } } + /// + /// The scheme fees associated with this card decline. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>("scheme_fees"); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The terminal identifier (commonly abbreviated as TID) of the terminal the /// card is transacting with. @@ -1466,6 +1486,10 @@ public override void Validate() _ = this.RealTimeDecisionID; this.RealTimeDecisionReason?.Validate(); this.Reason.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TerminalID; this.Verification.Validate(); } @@ -3883,6 +3907,482 @@ JsonSerializerOptions options } } +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class SchemeFee : JsonModel +{ + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. + /// + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("fee_type"); + } + init { this._rawData.Set("fee_type", value); } + } + + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } + + /// + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). + /// + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } + + public SchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public SchemeFee(SchemeFee schemeFee) + : base(schemeFee) { } +#pragma warning restore CS8618 + + public SchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + SchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class SchemeFeeFromRaw : IFromRawJson +{ + /// + public SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + SchemeFee.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(SchemeFeeCurrencyConverter))] +public enum SchemeFeeCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class SchemeFeeCurrencyConverter : JsonConverter +{ + public override SchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => SchemeFeeCurrency.Usd, + _ => (SchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + SchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + SchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(FeeTypeConverter))] +public enum FeeType +{ + /// + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. + /// + VisaInternationalServiceAssessmentSingleCurrency, + + /// + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. + /// + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class FeeTypeConverter : JsonConverter +{ + public override FeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + FeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + FeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + FeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + FeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => FeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + FeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + FeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + FeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => FeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => FeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => FeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + FeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => FeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => FeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => FeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => FeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => FeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => FeeType.VisaPurchaseDomestic, + "visa_purchase_international" => FeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => FeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => FeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => FeeType.VisaClearingTransmission, + "visa_direct_authorization" => FeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => FeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => FeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + FeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + FeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + FeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => FeeType.PulseSwitchFee, + _ => (FeeType)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + FeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + FeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + FeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + FeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + FeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + FeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + FeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + FeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + FeeType.VisaAdvancedAuthorization => "visa_advanced_authorization", + FeeType.VisaMessageTransmission => "visa_message_transmission", + FeeType.VisaAccountVerificationDomestic => "visa_account_verification_domestic", + FeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + FeeType.VisaAccountVerificationCanada => "visa_account_verification_canada", + FeeType.VisaCorporateAcceptanceFee => "visa_corporate_acceptance_fee", + FeeType.VisaConsumerDebitAcceptanceFee => "visa_consumer_debit_acceptance_fee", + FeeType.VisaBusinessDebitAcceptanceFee => "visa_business_debit_acceptance_fee", + FeeType.VisaPurchasingAcceptanceFee => "visa_purchasing_acceptance_fee", + FeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + FeeType.VisaPurchaseInternational => "visa_purchase_international", + FeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + FeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + FeeType.VisaClearingTransmission => "visa_clearing_transmission", + FeeType.VisaDirectAuthorization => "visa_direct_authorization", + FeeType.VisaDirectTransactionDomestic => "visa_direct_transaction_domestic", + FeeType.VisaServiceCommercialCredit => "visa_service_commercial_credit", + FeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + FeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + FeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + FeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + /// /// Fields related to verification of cardholder-provided values. /// diff --git a/src/Increase.Api/Models/Entities/Entity.cs b/src/Increase.Api/Models/Entities/Entity.cs index 297b236..b0919ce 100644 --- a/src/Increase.Api/Models/Entities/Entity.cs +++ b/src/Increase.Api/Models/Entities/Entity.cs @@ -434,29 +434,31 @@ public required string? IndustryCode } /// - /// The legal name of the corporation. + /// The legal identifier of the corporation. /// - public required string Name + public required EntityCorporationLegalIdentifier? LegalIdentifier { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("name"); + return this._rawData.GetNullableClass( + "legal_identifier" + ); } - init { this._rawData.Set("name", value); } + init { this._rawData.Set("legal_identifier", value); } } /// - /// The Employer Identification Number (EIN) for the corporation. + /// The legal name of the corporation. /// - public required string? TaxIdentifier + public required string Name { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("tax_identifier"); + return this._rawData.GetNotNullClass("name"); } - init { this._rawData.Set("tax_identifier", value); } + init { this._rawData.Set("name", value); } } /// @@ -483,8 +485,8 @@ public override void Validate() _ = this.Email; _ = this.IncorporationState; _ = this.IndustryCode; + this.LegalIdentifier?.Validate(); _ = this.Name; - _ = this.TaxIdentifier; _ = this.Website; } @@ -534,18 +536,31 @@ public EntityCorporation FromRawUnchecked(IReadOnlyDictionary - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -573,28 +588,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -603,6 +618,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -1261,6 +1277,151 @@ JsonSerializerOptions options } } +/// +/// The legal identifier of the corporation. +/// +[JsonConverter( + typeof(JsonModelConverter< + EntityCorporationLegalIdentifier, + EntityCorporationLegalIdentifierFromRaw + >) +)] +public sealed record class EntityCorporationLegalIdentifier : JsonModel +{ + /// + /// The category of the legal identifier. + /// + public required ApiEnum Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass< + ApiEnum + >("category"); + } + init { this._rawData.Set("category", value); } + } + + /// + /// The identifier of the legal identifier. + /// + public required string Value + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("value"); + } + init { this._rawData.Set("value", value); } + } + + /// + public override void Validate() + { + this.Category.Validate(); + _ = this.Value; + } + + public EntityCorporationLegalIdentifier() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public EntityCorporationLegalIdentifier( + EntityCorporationLegalIdentifier entityCorporationLegalIdentifier + ) + : base(entityCorporationLegalIdentifier) { } +#pragma warning restore CS8618 + + public EntityCorporationLegalIdentifier(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + EntityCorporationLegalIdentifier(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static EntityCorporationLegalIdentifier FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class EntityCorporationLegalIdentifierFromRaw : IFromRawJson +{ + /// + public EntityCorporationLegalIdentifier FromRawUnchecked( + IReadOnlyDictionary rawData + ) => EntityCorporationLegalIdentifier.FromRawUnchecked(rawData); +} + +/// +/// The category of the legal identifier. +/// +[JsonConverter(typeof(EntityCorporationLegalIdentifierCategoryConverter))] +public enum EntityCorporationLegalIdentifierCategory +{ + /// + /// The Employer Identification Number (EIN) for the company. The EIN is a 9-digit + /// number assigned by the IRS. + /// + UsEmployerIdentificationNumber, + + /// + /// A legal identifier issued by a foreign government, like a tax identification + /// number or registration number. + /// + Other, +} + +sealed class EntityCorporationLegalIdentifierCategoryConverter + : JsonConverter +{ + public override EntityCorporationLegalIdentifierCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "us_employer_identification_number" => + EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + "other" => EntityCorporationLegalIdentifierCategory.Other, + _ => (EntityCorporationLegalIdentifierCategory)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + EntityCorporationLegalIdentifierCategory value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + EntityCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber => + "us_employer_identification_number", + EntityCorporationLegalIdentifierCategory.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + /// /// Details of the government authority entity. Will be present if `structure` is /// equal to `government_authority`. @@ -1422,18 +1583,31 @@ IReadOnlyDictionary rawData public sealed record class EntityGovernmentAuthorityAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -1461,28 +1635,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -1491,6 +1665,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -1888,18 +2063,31 @@ IReadOnlyDictionary rawData public sealed record class EntityJointIndividualAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -1927,28 +2115,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -1957,6 +2145,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -2284,18 +2473,31 @@ public EntityNaturalPerson FromRawUnchecked(IReadOnlyDictionary - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -2323,28 +2525,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -2353,6 +2555,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -3261,18 +3464,31 @@ public EntityTrust FromRawUnchecked(IReadOnlyDictionary raw public sealed record class EntityTrustAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -3300,28 +3516,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -3330,6 +3546,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -3542,18 +3759,31 @@ public EntityTrustGrantor FromRawUnchecked(IReadOnlyDictionary - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -3581,28 +3811,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -3611,6 +3841,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -4019,18 +4250,31 @@ IReadOnlyDictionary rawData public sealed record class EntityTrustTrusteeIndividualAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// - public required string City + public required string? City { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("city"); + return this._rawData.GetNullableClass("city"); } init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. /// @@ -4058,28 +4302,28 @@ public required string? Line2 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. /// - public required string State + public required string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("state"); } init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The ZIP or postal code of the address. /// - public required string Zip + public required string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("zip"); } init { this._rawData.Set("zip", value); } } @@ -4088,6 +4332,7 @@ public required string Zip public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; _ = this.Line2; _ = this.State; @@ -4797,7 +5042,7 @@ public enum IssueCategory { /// /// The entity's tax identifier could not be validated. Update the tax ID with - /// the [update an entity API](/documentation/api/entities#update-an-entity.corporation.tax_identifier). + /// the [update an entity API](/documentation/api/entities#update-an-entity.corporation.legal_identifier). /// EntityTaxIdentifier, diff --git a/src/Increase.Api/Models/Entities/EntityCreateParams.cs b/src/Increase.Api/Models/Entities/EntityCreateParams.cs index 0390e1a..cda36b5 100644 --- a/src/Increase.Api/Models/Entities/EntityCreateParams.cs +++ b/src/Increase.Api/Models/Entities/EntityCreateParams.cs @@ -500,29 +500,30 @@ public required IReadOnlyList BeneficialOwners } /// - /// The legal name of the corporation. + /// The legal identifier of the corporation. This is usually the Employer Identification + /// Number (EIN). /// - public required string Name + public required LegalIdentifier LegalIdentifier { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("name"); + return this._rawData.GetNotNullClass("legal_identifier"); } - init { this._rawData.Set("name", value); } + init { this._rawData.Set("legal_identifier", value); } } /// - /// The Employer Identification Number (EIN) for the corporation. + /// The legal name of the corporation. /// - public required string TaxIdentifier + public required string Name { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("tax_identifier"); + return this._rawData.GetNotNullClass("name"); } - init { this._rawData.Set("tax_identifier", value); } + init { this._rawData.Set("name", value); } } /// @@ -646,8 +647,8 @@ public override void Validate() { item.Validate(); } + this.LegalIdentifier.Validate(); _ = this.Name; - _ = this.TaxIdentifier; this.BeneficialOwnershipExemptionReason?.Validate(); _ = this.Email; _ = this.IncorporationState; @@ -698,7 +699,7 @@ public Corporation FromRawUnchecked(IReadOnlyDictionary raw public sealed record class Address : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -710,6 +711,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -724,41 +738,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -767,7 +797,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -775,10 +805,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public Address() { } @@ -1805,6 +1836,148 @@ public override void Write(Utf8JsonWriter writer, Prong value, JsonSerializerOpt } } +/// +/// The legal identifier of the corporation. This is usually the Employer Identification +/// Number (EIN). +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class LegalIdentifier : JsonModel +{ + /// + /// The legal identifier. + /// + public required string Value + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("value"); + } + init { this._rawData.Set("value", value); } + } + + /// + /// The category of the legal identifier. If not provided, the default is `us_employer_identification_number`. + /// + public ApiEnum? Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>("category"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("category", value); + } + } + + /// + public override void Validate() + { + _ = this.Value; + this.Category?.Validate(); + } + + public LegalIdentifier() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public LegalIdentifier(LegalIdentifier legalIdentifier) + : base(legalIdentifier) { } +#pragma warning restore CS8618 + + public LegalIdentifier(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + LegalIdentifier(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static LegalIdentifier FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } + + [SetsRequiredMembers] + public LegalIdentifier(string value) + : this() + { + this.Value = value; + } +} + +class LegalIdentifierFromRaw : IFromRawJson +{ + /// + public LegalIdentifier FromRawUnchecked(IReadOnlyDictionary rawData) => + LegalIdentifier.FromRawUnchecked(rawData); +} + +/// +/// The category of the legal identifier. If not provided, the default is `us_employer_identification_number`. +/// +[JsonConverter(typeof(CategoryConverter))] +public enum Category +{ + /// + /// The Employer Identification Number (EIN) for the company. The EIN is a 9-digit + /// number assigned by the IRS. + /// + UsEmployerIdentificationNumber, + + /// + /// A legal identifier issued by a foreign government, like a tax identification + /// number or registration number. + /// + Other, +} + +sealed class CategoryConverter : JsonConverter +{ + public override Category Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "us_employer_identification_number" => Category.UsEmployerIdentificationNumber, + "other" => Category.Other, + _ => (Category)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, Category value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + Category.UsEmployerIdentificationNumber => "us_employer_identification_number", + Category.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + /// /// If the entity is exempt from the requirement to submit beneficial owners, provide /// the justification. If a reason is provided, you do not need to submit a list @@ -1926,12 +2099,14 @@ public required IReadOnlyList AuthorizedPersons /// /// The category of the government authority. /// - public required ApiEnum Category + public required ApiEnum Category { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("category"); + return this._rawData.GetNotNullClass>( + "category" + ); } init { this._rawData.Set("category", value); } } @@ -2234,8 +2409,8 @@ public AuthorizedPerson FromRawUnchecked(IReadOnlyDictionary /// The category of the government authority. /// -[JsonConverter(typeof(CategoryConverter))] -public enum Category +[JsonConverter(typeof(GovernmentAuthorityCategoryConverter))] +public enum GovernmentAuthorityCategory { /// /// A municipality. @@ -2258,9 +2433,9 @@ public enum Category FederalAgency, } -sealed class CategoryConverter : JsonConverter +sealed class GovernmentAuthorityCategoryConverter : JsonConverter { - public override Category Read( + public override GovernmentAuthorityCategory Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -2268,24 +2443,28 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "municipality" => Category.Municipality, - "state_agency" => Category.StateAgency, - "state_government" => Category.StateGovernment, - "federal_agency" => Category.FederalAgency, - _ => (Category)(-1), + "municipality" => GovernmentAuthorityCategory.Municipality, + "state_agency" => GovernmentAuthorityCategory.StateAgency, + "state_government" => GovernmentAuthorityCategory.StateGovernment, + "federal_agency" => GovernmentAuthorityCategory.FederalAgency, + _ => (GovernmentAuthorityCategory)(-1), }; } - public override void Write(Utf8JsonWriter writer, Category value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + GovernmentAuthorityCategory value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize( writer, value switch { - Category.Municipality => "municipality", - Category.StateAgency => "state_agency", - Category.StateGovernment => "state_government", - Category.FederalAgency => "federal_agency", + GovernmentAuthorityCategory.Municipality => "municipality", + GovernmentAuthorityCategory.StateAgency => "state_agency", + GovernmentAuthorityCategory.StateGovernment => "state_government", + GovernmentAuthorityCategory.FederalAgency => "federal_agency", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -2503,7 +2682,7 @@ public JointIndividual FromRawUnchecked(IReadOnlyDictionary public sealed record class JointIndividualAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -2515,6 +2694,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -2529,41 +2721,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -2572,7 +2780,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -2580,10 +2788,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public JointIndividualAddress() { } @@ -3143,7 +3352,7 @@ public sealed record class JointIndividualIdentificationPassport : JsonModel { /// /// The two-character ISO 3166-1 code representing the country that issued the - /// passport (e.g., `US`). + /// document (e.g., `US`). /// public required string Country { @@ -3367,7 +3576,7 @@ public NaturalPerson FromRawUnchecked(IReadOnlyDictionary r public sealed record class NaturalPersonAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -3379,6 +3588,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -3393,41 +3615,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -3436,7 +3674,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -3444,10 +3682,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public NaturalPersonAddress() { } @@ -4002,7 +4241,7 @@ public sealed record class NaturalPersonIdentificationPassport : JsonModel { /// /// The two-character ISO 3166-1 code representing the country that issued the - /// passport (e.g., `US`). + /// document (e.g., `US`). /// public required string Country { @@ -5183,7 +5422,7 @@ public TrusteeIndividual FromRawUnchecked(IReadOnlyDictionary - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -5195,6 +5434,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -5209,41 +5461,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -5252,7 +5520,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -5260,10 +5528,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public TrusteeIndividualAddress() { } @@ -5827,7 +6096,7 @@ public sealed record class TrusteeIndividualIdentificationPassport : JsonModel { /// /// The two-character ISO 3166-1 code representing the country that issued the - /// passport (e.g., `US`). + /// document (e.g., `US`). /// public required string Country { @@ -6049,7 +6318,7 @@ public Grantor FromRawUnchecked(IReadOnlyDictionary rawData public sealed record class GrantorAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -6061,6 +6330,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -6075,41 +6357,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -6118,7 +6416,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -6126,10 +6424,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public GrantorAddress() { } @@ -6667,7 +6966,7 @@ public sealed record class GrantorIdentificationPassport : JsonModel { /// /// The two-character ISO 3166-1 code representing the country that issued the - /// passport (e.g., `US`). + /// document (e.g., `US`). /// public required string Country { diff --git a/src/Increase.Api/Models/Entities/EntityUpdateParams.cs b/src/Increase.Api/Models/Entities/EntityUpdateParams.cs index c7a0a18..4877503 100644 --- a/src/Increase.Api/Models/Entities/EntityUpdateParams.cs +++ b/src/Increase.Api/Models/Entities/EntityUpdateParams.cs @@ -411,14 +411,17 @@ public string? IndustryCode } /// - /// The legal name of the corporation. + /// The legal identifier of the corporation. This is usually the Employer Identification + /// Number (EIN). /// - public string? Name + public EntityUpdateParamsCorporationLegalIdentifier? LegalIdentifier { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("name"); + return this._rawData.GetNullableClass( + "legal_identifier" + ); } init { @@ -427,19 +430,19 @@ public string? Name return; } - this._rawData.Set("name", value); + this._rawData.Set("legal_identifier", value); } } /// - /// The Employer Identification Number (EIN) for the corporation. + /// The legal name of the corporation. /// - public string? TaxIdentifier + public string? Name { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("tax_identifier"); + return this._rawData.GetNullableClass("name"); } init { @@ -448,7 +451,7 @@ public string? TaxIdentifier return; } - this._rawData.Set("tax_identifier", value); + this._rawData.Set("name", value); } } @@ -459,8 +462,8 @@ public override void Validate() _ = this.Email; _ = this.IncorporationState; _ = this.IndustryCode; + this.LegalIdentifier?.Validate(); _ = this.Name; - _ = this.TaxIdentifier; } public EntityUpdateParamsCorporation() { } @@ -516,7 +519,7 @@ IReadOnlyDictionary rawData public sealed record class EntityUpdateParamsCorporationAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -528,6 +531,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -542,41 +558,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -585,7 +617,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -593,10 +625,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public EntityUpdateParamsCorporationAddress() { } @@ -640,6 +673,170 @@ IReadOnlyDictionary rawData ) => EntityUpdateParamsCorporationAddress.FromRawUnchecked(rawData); } +/// +/// The legal identifier of the corporation. This is usually the Employer Identification +/// Number (EIN). +/// +[JsonConverter( + typeof(JsonModelConverter< + EntityUpdateParamsCorporationLegalIdentifier, + EntityUpdateParamsCorporationLegalIdentifierFromRaw + >) +)] +public sealed record class EntityUpdateParamsCorporationLegalIdentifier : JsonModel +{ + /// + /// The identifier of the legal identifier. + /// + public required string Value + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("value"); + } + init { this._rawData.Set("value", value); } + } + + /// + /// The category of the legal identifier. + /// + public ApiEnum? Category + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("category"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("category", value); + } + } + + /// + public override void Validate() + { + _ = this.Value; + this.Category?.Validate(); + } + + public EntityUpdateParamsCorporationLegalIdentifier() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public EntityUpdateParamsCorporationLegalIdentifier( + EntityUpdateParamsCorporationLegalIdentifier entityUpdateParamsCorporationLegalIdentifier + ) + : base(entityUpdateParamsCorporationLegalIdentifier) { } +#pragma warning restore CS8618 + + public EntityUpdateParamsCorporationLegalIdentifier( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + EntityUpdateParamsCorporationLegalIdentifier(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static EntityUpdateParamsCorporationLegalIdentifier FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } + + [SetsRequiredMembers] + public EntityUpdateParamsCorporationLegalIdentifier(string value) + : this() + { + this.Value = value; + } +} + +class EntityUpdateParamsCorporationLegalIdentifierFromRaw + : IFromRawJson +{ + /// + public EntityUpdateParamsCorporationLegalIdentifier FromRawUnchecked( + IReadOnlyDictionary rawData + ) => EntityUpdateParamsCorporationLegalIdentifier.FromRawUnchecked(rawData); +} + +/// +/// The category of the legal identifier. +/// +[JsonConverter(typeof(EntityUpdateParamsCorporationLegalIdentifierCategoryConverter))] +public enum EntityUpdateParamsCorporationLegalIdentifierCategory +{ + /// + /// The Employer Identification Number (EIN) for the company. The EIN is a 9-digit + /// number assigned by the IRS. + /// + UsEmployerIdentificationNumber, + + /// + /// A legal identifier issued by a foreign government, like a tax identification + /// number or registration number. + /// + Other, +} + +sealed class EntityUpdateParamsCorporationLegalIdentifierCategoryConverter + : JsonConverter +{ + public override EntityUpdateParamsCorporationLegalIdentifierCategory Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "us_employer_identification_number" => + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber, + "other" => EntityUpdateParamsCorporationLegalIdentifierCategory.Other, + _ => (EntityUpdateParamsCorporationLegalIdentifierCategory)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + EntityUpdateParamsCorporationLegalIdentifierCategory value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + EntityUpdateParamsCorporationLegalIdentifierCategory.UsEmployerIdentificationNumber => + "us_employer_identification_number", + EntityUpdateParamsCorporationLegalIdentifierCategory.Other => "other", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + /// /// Details of the government authority entity to update. If you specify this parameter /// and the entity is not a government authority, the request will fail. @@ -1001,7 +1198,7 @@ IReadOnlyDictionary rawData public sealed record class EntityUpdateParamsNaturalPersonAddress : JsonModel { /// - /// The city of the address. + /// The city, district, town, or village of the address. /// public required string City { @@ -1013,6 +1210,19 @@ public required string City init { this._rawData.Set("city", value); } } + /// + /// The two-letter ISO 3166-1 alpha-2 code for the country of the address. + /// + public required string Country + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("country"); + } + init { this._rawData.Set("country", value); } + } + /// /// The first line of the address. This is usually the street number and street. /// @@ -1027,41 +1237,57 @@ public required string Line1 } /// - /// The two-letter United States Postal Service (USPS) abbreviation for the state - /// of the address. + /// The second line of the address. This might be the floor or room number. /// - public required string State + public string? Line2 { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("state"); + return this._rawData.GetNullableClass("line2"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("line2", value); } - init { this._rawData.Set("state", value); } } /// - /// The ZIP code of the address. + /// The two-letter United States Postal Service (USPS) abbreviation for the US + /// state, province, or region of the address. Required in certain countries. /// - public required string Zip + public string? State { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("zip"); + return this._rawData.GetNullableClass("state"); + } + init + { + if (value == null) + { + return; + } + + this._rawData.Set("state", value); } - init { this._rawData.Set("zip", value); } } /// - /// The second line of the address. This might be the floor or room number. + /// The ZIP or postal code of the address. Required in certain countries. /// - public string? Line2 + public string? Zip { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("line2"); + return this._rawData.GetNullableClass("zip"); } init { @@ -1070,7 +1296,7 @@ public string? Line2 return; } - this._rawData.Set("line2", value); + this._rawData.Set("zip", value); } } @@ -1078,10 +1304,11 @@ public string? Line2 public override void Validate() { _ = this.City; + _ = this.Country; _ = this.Line1; + _ = this.Line2; _ = this.State; _ = this.Zip; - _ = this.Line2; } public EntityUpdateParamsNaturalPersonAddress() { } diff --git a/src/Increase.Api/Models/Groups/Group.cs b/src/Increase.Api/Models/Groups/Group.cs index 8a3fd62..48711f2 100644 --- a/src/Increase.Api/Models/Groups/Group.cs +++ b/src/Increase.Api/Models/Groups/Group.cs @@ -31,36 +31,6 @@ public required string ID init { this._rawData.Set("id", value); } } - /// - /// If the Group is allowed to create ACH debits. - /// - public required ApiEnum AchDebitStatus - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "ach_debit_status" - ); - } - init { this._rawData.Set("ach_debit_status", value); } - } - - /// - /// If the Group is activated or not. - /// - public required ApiEnum ActivationStatus - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "activation_status" - ); - } - init { this._rawData.Set("activation_status", value); } - } - /// /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the Group /// was created. @@ -95,8 +65,6 @@ public required ApiEnum ActivationStatus public override void Validate() { _ = this.ID; - this.AchDebitStatus.Validate(); - this.ActivationStatus.Validate(); _ = this.CreatedAt; this.Type.Validate(); } @@ -136,114 +104,6 @@ public Group FromRawUnchecked(IReadOnlyDictionary rawData) Group.FromRawUnchecked(rawData); } -/// -/// If the Group is allowed to create ACH debits. -/// -[JsonConverter(typeof(AchDebitStatusConverter))] -public enum AchDebitStatus -{ - /// - /// The Group cannot make ACH debits. - /// - Disabled, - - /// - /// The Group can make ACH debits. - /// - Enabled, -} - -sealed class AchDebitStatusConverter : JsonConverter -{ - public override AchDebitStatus Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "disabled" => AchDebitStatus.Disabled, - "enabled" => AchDebitStatus.Enabled, - _ => (AchDebitStatus)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - AchDebitStatus value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - AchDebitStatus.Disabled => "disabled", - AchDebitStatus.Enabled => "enabled", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - -/// -/// If the Group is activated or not. -/// -[JsonConverter(typeof(ActivationStatusConverter))] -public enum ActivationStatus -{ - /// - /// The Group is not activated. - /// - Unactivated, - - /// - /// The Group is activated. - /// - Activated, -} - -sealed class ActivationStatusConverter : JsonConverter -{ - public override ActivationStatus Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) - { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "unactivated" => ActivationStatus.Unactivated, - "activated" => ActivationStatus.Activated, - _ => (ActivationStatus)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - ActivationStatus value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - ActivationStatus.Unactivated => "unactivated", - ActivationStatus.Activated => "activated", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); - } -} - /// /// A constant representing the object's type. For this resource it will always be `group`. /// diff --git a/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransfer.cs b/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransfer.cs index c9e699a..bdc4442 100644 --- a/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransfer.cs +++ b/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransfer.cs @@ -909,6 +909,12 @@ public enum DeclineReason /// TransactionNotAllowed, + /// + /// The originating financial institution asked for this transfer to be returned. + /// The receiving bank is complying with the request. + /// + ReturnedPerOdfiRequest, + /// /// Your integration declined this transfer via the API. /// @@ -919,12 +925,6 @@ public enum DeclineReason /// InsufficientFunds, - /// - /// The originating financial institution asked for this transfer to be returned. - /// The receiving bank is complying with the request. - /// - ReturnedPerOdfiRequest, - /// /// The customer no longer authorizes this transaction. /// @@ -982,9 +982,9 @@ JsonSerializerOptions options "entity_not_active" => DeclineReason.EntityNotActive, "group_locked" => DeclineReason.GroupLocked, "transaction_not_allowed" => DeclineReason.TransactionNotAllowed, + "returned_per_odfi_request" => DeclineReason.ReturnedPerOdfiRequest, "user_initiated" => DeclineReason.UserInitiated, "insufficient_funds" => DeclineReason.InsufficientFunds, - "returned_per_odfi_request" => DeclineReason.ReturnedPerOdfiRequest, "authorization_revoked_by_customer" => DeclineReason.AuthorizationRevokedByCustomer, "payment_stopped" => DeclineReason.PaymentStopped, "customer_advised_unauthorized_improper_ineligible_or_incomplete" => @@ -1017,9 +1017,9 @@ JsonSerializerOptions options DeclineReason.EntityNotActive => "entity_not_active", DeclineReason.GroupLocked => "group_locked", DeclineReason.TransactionNotAllowed => "transaction_not_allowed", + DeclineReason.ReturnedPerOdfiRequest => "returned_per_odfi_request", DeclineReason.UserInitiated => "user_initiated", DeclineReason.InsufficientFunds => "insufficient_funds", - DeclineReason.ReturnedPerOdfiRequest => "returned_per_odfi_request", DeclineReason.AuthorizationRevokedByCustomer => "authorization_revoked_by_customer", DeclineReason.PaymentStopped => "payment_stopped", DeclineReason.CustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete => diff --git a/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransferDeclineParams.cs b/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransferDeclineParams.cs index f18ed06..200e33a 100644 --- a/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransferDeclineParams.cs +++ b/src/Increase.Api/Models/InboundAchTransfers/InboundAchTransferDeclineParams.cs @@ -193,12 +193,6 @@ public enum Reason /// InsufficientFunds, - /// - /// The originating financial institution asked for this transfer to be returned. - /// The receiving bank is complying with the request. The Nacha return code is R06. - /// - ReturnedPerOdfiRequest, - /// /// The customer no longer authorizes this transaction. The Nacha return code /// is R07. @@ -257,7 +251,6 @@ JsonSerializerOptions options return JsonSerializer.Deserialize(ref reader, options) switch { "insufficient_funds" => Reason.InsufficientFunds, - "returned_per_odfi_request" => Reason.ReturnedPerOdfiRequest, "authorization_revoked_by_customer" => Reason.AuthorizationRevokedByCustomer, "payment_stopped" => Reason.PaymentStopped, "customer_advised_unauthorized_improper_ineligible_or_incomplete" => @@ -280,7 +273,6 @@ public override void Write(Utf8JsonWriter writer, Reason value, JsonSerializerOp value switch { Reason.InsufficientFunds => "insufficient_funds", - Reason.ReturnedPerOdfiRequest => "returned_per_odfi_request", Reason.AuthorizationRevokedByCustomer => "authorization_revoked_by_customer", Reason.PaymentStopped => "payment_stopped", Reason.CustomerAdvisedUnauthorizedImproperIneligibleOrIncomplete => diff --git a/src/Increase.Api/Models/InboundCheckDeposits/InboundCheckDeposit.cs b/src/Increase.Api/Models/InboundCheckDeposits/InboundCheckDeposit.cs index 5ab9f20..4fd19a7 100644 --- a/src/Increase.Api/Models/InboundCheckDeposits/InboundCheckDeposit.cs +++ b/src/Increase.Api/Models/InboundCheckDeposits/InboundCheckDeposit.cs @@ -479,22 +479,6 @@ public enum AdjustmentReason /// has reimbursed the funds with a Wrong Payee Credit. /// WrongPayeeCredit, - - /// - /// The check was deposited with a different amount than what was written on the check. - /// - AdjustedAmount, - - /// - /// The recipient was not able to process the check. This usually happens for - /// e.g., low quality images. - /// - NonConformingItem, - - /// - /// The check has already been deposited elsewhere and so this is a duplicate. - /// - Paid, } sealed class AdjustmentReasonConverter : JsonConverter @@ -509,9 +493,6 @@ JsonSerializerOptions options { "late_return" => AdjustmentReason.LateReturn, "wrong_payee_credit" => AdjustmentReason.WrongPayeeCredit, - "adjusted_amount" => AdjustmentReason.AdjustedAmount, - "non_conforming_item" => AdjustmentReason.NonConformingItem, - "paid" => AdjustmentReason.Paid, _ => (AdjustmentReason)(-1), }; } @@ -528,9 +509,6 @@ JsonSerializerOptions options { AdjustmentReason.LateReturn => "late_return", AdjustmentReason.WrongPayeeCredit => "wrong_payee_credit", - AdjustmentReason.AdjustedAmount => "adjusted_amount", - AdjustmentReason.NonConformingItem => "non_conforming_item", - AdjustmentReason.Paid => "paid", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), diff --git a/src/Increase.Api/Models/PendingTransactions/PendingTransaction.cs b/src/Increase.Api/Models/PendingTransactions/PendingTransaction.cs index aad2b27..c4c0312 100644 --- a/src/Increase.Api/Models/PendingTransactions/PendingTransaction.cs +++ b/src/Increase.Api/Models/PendingTransactions/PendingTransaction.cs @@ -1,5 +1,6 @@ using System.Collections.Frozen; using System.Collections.Generic; +using System.Collections.Immutable; using System.Diagnostics.CodeAnalysis; using System.Text.Json; using System.Text.Json.Serialization; @@ -1631,6 +1632,25 @@ public required string? RealTimeDecisionID init { this._rawData.Set("real_time_decision_id", value); } } + /// + /// The scheme fees associated with this card authorization. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>("scheme_fees"); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The terminal identifier (commonly abbreviated as TID) of the terminal the /// card is transacting with. @@ -1702,6 +1722,10 @@ public override void Validate() _ = this.PresentmentCurrency; this.ProcessingCategory.Validate(); _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TerminalID; this.Type.Validate(); this.Verification.Validate(); @@ -3842,6 +3866,482 @@ JsonSerializerOptions options } } +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class SchemeFee : JsonModel +{ + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } + } + + /// + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. + /// + public required System::DateTimeOffset CreatedAt + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct("created_at"); + } + init { this._rawData.Set("created_at", value); } + } + + /// + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. + /// + public required ApiEnum Currency + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("currency"); + } + init { this._rawData.Set("currency", value); } + } + + /// + /// The type of fee being assessed. + /// + public required ApiEnum FeeType + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("fee_type"); + } + init { this._rawData.Set("fee_type", value); } + } + + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } + } + + /// + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). + /// + public required string? VariableRate + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("variable_rate"); + } + init { this._rawData.Set("variable_rate", value); } + } + + /// + public override void Validate() + { + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; + } + + public SchemeFee() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public SchemeFee(SchemeFee schemeFee) + : base(schemeFee) { } +#pragma warning restore CS8618 + + public SchemeFee(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + SchemeFee(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class SchemeFeeFromRaw : IFromRawJson +{ + /// + public SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + SchemeFee.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(SchemeFeeCurrencyConverter))] +public enum SchemeFeeCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class SchemeFeeCurrencyConverter : JsonConverter +{ + public override SchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => SchemeFeeCurrency.Usd, + _ => (SchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + SchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + SchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(FeeTypeConverter))] +public enum FeeType +{ + /// + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. + /// + VisaInternationalServiceAssessmentSingleCurrency, + + /// + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. + /// + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class FeeTypeConverter : JsonConverter +{ + public override FeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + FeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + FeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + FeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + FeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => FeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + FeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + FeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + FeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => FeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => FeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => FeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + FeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => FeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => FeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => FeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => FeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => FeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => FeeType.VisaPurchaseDomestic, + "visa_purchase_international" => FeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => FeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => FeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => FeeType.VisaClearingTransmission, + "visa_direct_authorization" => FeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => FeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => FeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + FeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + FeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + FeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => FeeType.PulseSwitchFee, + _ => (FeeType)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + FeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + FeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + FeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + FeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + FeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + FeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + FeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + FeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + FeeType.VisaAdvancedAuthorization => "visa_advanced_authorization", + FeeType.VisaMessageTransmission => "visa_message_transmission", + FeeType.VisaAccountVerificationDomestic => "visa_account_verification_domestic", + FeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + FeeType.VisaAccountVerificationCanada => "visa_account_verification_canada", + FeeType.VisaCorporateAcceptanceFee => "visa_corporate_acceptance_fee", + FeeType.VisaConsumerDebitAcceptanceFee => "visa_consumer_debit_acceptance_fee", + FeeType.VisaBusinessDebitAcceptanceFee => "visa_business_debit_acceptance_fee", + FeeType.VisaPurchasingAcceptanceFee => "visa_purchasing_acceptance_fee", + FeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + FeeType.VisaPurchaseInternational => "visa_purchase_international", + FeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + FeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + FeeType.VisaClearingTransmission => "visa_clearing_transmission", + FeeType.VisaDirectAuthorization => "visa_direct_authorization", + FeeType.VisaDirectTransactionDomestic => "visa_direct_transaction_domestic", + FeeType.VisaServiceCommercialCredit => "visa_service_commercial_credit", + FeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + FeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + FeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + FeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + /// /// A constant representing the object's type. For this resource it will always be `card_authorization`. /// diff --git a/src/Increase.Api/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParams.cs b/src/Increase.Api/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParams.cs index b1b52d7..0598fe1 100644 --- a/src/Increase.Api/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParams.cs +++ b/src/Increase.Api/Models/RealTimePaymentsTransfers/RealTimePaymentsTransferCreateParams.cs @@ -119,42 +119,6 @@ public string? DebtorName } } - public string? DestinationAccountNumber - { - get - { - this._rawBodyData.Freeze(); - return this._rawBodyData.GetNullableClass("destination_account_number"); - } - init - { - if (value == null) - { - return; - } - - this._rawBodyData.Set("destination_account_number", value); - } - } - - public string? DestinationRoutingNumber - { - get - { - this._rawBodyData.Freeze(); - return this._rawBodyData.GetNullableClass("destination_routing_number"); - } - init - { - if (value == null) - { - return; - } - - this._rawBodyData.Set("destination_routing_number", value); - } - } - /// /// The ID of an External Account to initiate a transfer to. If this parameter /// is provided, `account_number` and `routing_number` must be absent. diff --git a/src/Increase.Api/Models/Transactions/Transaction.cs b/src/Increase.Api/Models/Transactions/Transaction.cs index 812d1e5..e82283f 100644 --- a/src/Increase.Api/Models/Transactions/Transaction.cs +++ b/src/Increase.Api/Models/Transactions/Transaction.cs @@ -3598,6 +3598,25 @@ public required string? RealTimeDecisionID init { this._rawData.Set("real_time_decision_id", value); } } + /// + /// The scheme fees associated with this card financial. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>("scheme_fees"); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The terminal identifier (commonly abbreviated as TID) of the terminal the /// card is transacting with. @@ -3680,6 +3699,10 @@ public override void Validate() _ = this.PresentmentCurrency; this.ProcessingCategory.Validate(); _ = this.RealTimeDecisionID; + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TerminalID; _ = this.TransactionID; this.Type.Validate(); @@ -5821,236 +5844,151 @@ JsonSerializerOptions options } } -/// -/// A constant representing the object's type. For this resource it will always be `card_financial`. -/// -[JsonConverter(typeof(TypeConverter))] -public enum Type -{ - CardFinancial, -} - -sealed class TypeConverter : JsonConverter +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class SchemeFee : JsonModel { - public override global::Increase.Api.Models.Transactions.Type Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) + /// + /// The fee amount given as a string containing a decimal number. + /// + public required string Amount { - return JsonSerializer.Deserialize(ref reader, options) switch + get { - "card_financial" => global::Increase.Api.Models.Transactions.Type.CardFinancial, - _ => (global::Increase.Api.Models.Transactions.Type)(-1), - }; - } - - public override void Write( - Utf8JsonWriter writer, - global::Increase.Api.Models.Transactions.Type value, - JsonSerializerOptions options - ) - { - JsonSerializer.Serialize( - writer, - value switch - { - global::Increase.Api.Models.Transactions.Type.CardFinancial => "card_financial", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("amount"); + } + init { this._rawData.Set("amount", value); } } -} -/// -/// Fields related to verification of cardholder-provided values. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class Verification : JsonModel -{ /// - /// Fields related to verification of the Card Verification Code, a 3-digit code - /// on the back of the card. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required CardVerificationCode CardVerificationCode + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("card_verification_code"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("card_verification_code", value); } + init { this._rawData.Set("created_at", value); } } /// - /// Cardholder address provided in the authorization request and the address - /// on file we verified it against. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required CardholderAddress CardholderAddress + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass("cardholder_address"); + return this._rawData.GetNotNullClass>("currency"); } - init { this._rawData.Set("cardholder_address", value); } + init { this._rawData.Set("currency", value); } } /// - /// Cardholder name provided in the authorization request. + /// The type of fee being assessed. /// - public required CardholderName? CardholderName + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("cardholder_name"); + return this._rawData.GetNotNullClass>("fee_type"); } - init { this._rawData.Set("cardholder_name", value); } - } - - /// - public override void Validate() - { - this.CardVerificationCode.Validate(); - this.CardholderAddress.Validate(); - this.CardholderName?.Validate(); + init { this._rawData.Set("fee_type", value); } } - public Verification() { } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - public Verification(Verification verification) - : base(verification) { } -#pragma warning restore CS8618 - - public Verification(IReadOnlyDictionary rawData) - { - this._rawData = new(rawData); - } - -#pragma warning disable CS8618 - [SetsRequiredMembers] - Verification(FrozenDictionary rawData) - { - this._rawData = new(rawData); - } -#pragma warning restore CS8618 - - /// - public static Verification FromRawUnchecked(IReadOnlyDictionary rawData) + /// + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. + /// + public required string? FixedComponent { - return new(FrozenDictionary.ToFrozenDictionary(rawData)); + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fixed_component"); + } + init { this._rawData.Set("fixed_component", value); } } -} - -class VerificationFromRaw : IFromRawJson -{ - /// - public Verification FromRawUnchecked(IReadOnlyDictionary rawData) => - Verification.FromRawUnchecked(rawData); -} -/// -/// Fields related to verification of the Card Verification Code, a 3-digit code -/// on the back of the card. -/// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardVerificationCode : JsonModel -{ /// - /// The result of verifying the Card Verification Code. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required ApiEnum Result + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNotNullClass>("result"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("result", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - this.Result.Validate(); + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardVerificationCode() { } + public SchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardVerificationCode(CardVerificationCode cardVerificationCode) - : base(cardVerificationCode) { } + public SchemeFee(SchemeFee schemeFee) + : base(schemeFee) { } #pragma warning restore CS8618 - public CardVerificationCode(IReadOnlyDictionary rawData) + public SchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardVerificationCode(FrozenDictionary rawData) + SchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) + /// + public static SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } - - [SetsRequiredMembers] - public CardVerificationCode(ApiEnum result) - : this() - { - this.Result = result; - } } -class CardVerificationCodeFromRaw : IFromRawJson +class SchemeFeeFromRaw : IFromRawJson { /// - public CardVerificationCode FromRawUnchecked( - IReadOnlyDictionary rawData - ) => CardVerificationCode.FromRawUnchecked(rawData); + public SchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + SchemeFee.FromRawUnchecked(rawData); } /// -/// The result of verifying the Card Verification Code. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(ResultConverter))] -public enum Result +[JsonConverter(typeof(SchemeFeeCurrencyConverter))] +public enum SchemeFeeCurrency { /// - /// No card verification code was provided in the authorization request. - /// - NotChecked, - - /// - /// The card verification code matched the one on file. - /// - Match, - - /// - /// The card verification code did not match the one on file. + /// US Dollar (USD) /// - NoMatch, + Usd, } -sealed class ResultConverter : JsonConverter +sealed class SchemeFeeCurrencyConverter : JsonConverter { - public override Result Read( + public override SchemeFeeCurrency Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -6058,22 +5996,22 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "not_checked" => Result.NotChecked, - "match" => Result.Match, - "no_match" => Result.NoMatch, - _ => (Result)(-1), + "USD" => SchemeFeeCurrency.Usd, + _ => (SchemeFeeCurrency)(-1), }; } - public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) + public override void Write( + Utf8JsonWriter writer, + SchemeFeeCurrency value, + JsonSerializerOptions options + ) { JsonSerializer.Serialize( writer, value switch { - Result.NotChecked => "not_checked", - Result.Match => "match", - Result.NoMatch => "no_match", + SchemeFeeCurrency.Usd => "USD", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -6084,78 +6022,639 @@ public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOp } /// -/// Cardholder address provided in the authorization request and the address on file -/// we verified it against. +/// The type of fee being assessed. /// -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class CardholderAddress : JsonModel +[JsonConverter(typeof(FeeTypeConverter))] +public enum FeeType { /// - /// Line 1 of the address on file for the cardholder. + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - public required string? ActualLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_line1"); - } - init { this._rawData.Set("actual_line1", value); } - } + VisaInternationalServiceAssessmentSingleCurrency, /// - /// The postal code of the address on file for the cardholder. + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - public required string? ActualPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("actual_postal_code"); - } - init { this._rawData.Set("actual_postal_code", value); } - } + VisaInternationalServiceAssessmentCrossCurrency, /// - /// The cardholder address line 1 provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. /// - public required string? ProvidedLine1 - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_line1"); - } - init { this._rawData.Set("provided_line1", value); } - } + VisaAuthorizationDomesticPointOfSale, /// - /// The postal code provided for verification in the authorization request. + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. /// - public required string? ProvidedPostalCode - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNullableClass("provided_postal_code"); - } - init { this._rawData.Set("provided_postal_code", value); } - } + VisaAuthorizationInternationalPointOfSale, /// - /// The address verification result returned to the card network. + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. /// - public required ApiEnum Result - { - get - { - this._rawData.Freeze(); - return this._rawData.GetNotNullClass>( - "result" - ); - } - init { this._rawData.Set("result", value); } - } + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, +} + +sealed class FeeTypeConverter : JsonConverter +{ + public override FeeType Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "visa_international_service_assessment_single_currency" => + FeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + FeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + FeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + FeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => FeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + FeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + FeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + FeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => FeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => FeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => FeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + FeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => FeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => FeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => FeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => FeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => FeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => FeeType.VisaPurchaseDomestic, + "visa_purchase_international" => FeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => FeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => FeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => FeeType.VisaClearingTransmission, + "visa_direct_authorization" => FeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => FeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => FeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + FeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + FeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + FeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => FeeType.PulseSwitchFee, + _ => (FeeType)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, FeeType value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + FeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + FeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + FeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + FeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + FeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + FeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + FeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + FeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + FeeType.VisaAdvancedAuthorization => "visa_advanced_authorization", + FeeType.VisaMessageTransmission => "visa_message_transmission", + FeeType.VisaAccountVerificationDomestic => "visa_account_verification_domestic", + FeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + FeeType.VisaAccountVerificationCanada => "visa_account_verification_canada", + FeeType.VisaCorporateAcceptanceFee => "visa_corporate_acceptance_fee", + FeeType.VisaConsumerDebitAcceptanceFee => "visa_consumer_debit_acceptance_fee", + FeeType.VisaBusinessDebitAcceptanceFee => "visa_business_debit_acceptance_fee", + FeeType.VisaPurchasingAcceptanceFee => "visa_purchasing_acceptance_fee", + FeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + FeeType.VisaPurchaseInternational => "visa_purchase_international", + FeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + FeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + FeeType.VisaClearingTransmission => "visa_clearing_transmission", + FeeType.VisaDirectAuthorization => "visa_direct_authorization", + FeeType.VisaDirectTransactionDomestic => "visa_direct_transaction_domestic", + FeeType.VisaServiceCommercialCredit => "visa_service_commercial_credit", + FeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + FeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + FeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + FeeType.PulseSwitchFee => "pulse_switch_fee", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// A constant representing the object's type. For this resource it will always be `card_financial`. +/// +[JsonConverter(typeof(TypeConverter))] +public enum Type +{ + CardFinancial, +} + +sealed class TypeConverter : JsonConverter +{ + public override global::Increase.Api.Models.Transactions.Type Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "card_financial" => global::Increase.Api.Models.Transactions.Type.CardFinancial, + _ => (global::Increase.Api.Models.Transactions.Type)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + global::Increase.Api.Models.Transactions.Type value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + global::Increase.Api.Models.Transactions.Type.CardFinancial => "card_financial", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Fields related to verification of cardholder-provided values. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class Verification : JsonModel +{ + /// + /// Fields related to verification of the Card Verification Code, a 3-digit code + /// on the back of the card. + /// + public required CardVerificationCode CardVerificationCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("card_verification_code"); + } + init { this._rawData.Set("card_verification_code", value); } + } + + /// + /// Cardholder address provided in the authorization request and the address + /// on file we verified it against. + /// + public required CardholderAddress CardholderAddress + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass("cardholder_address"); + } + init { this._rawData.Set("cardholder_address", value); } + } + + /// + /// Cardholder name provided in the authorization request. + /// + public required CardholderName? CardholderName + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("cardholder_name"); + } + init { this._rawData.Set("cardholder_name", value); } + } + + /// + public override void Validate() + { + this.CardVerificationCode.Validate(); + this.CardholderAddress.Validate(); + this.CardholderName?.Validate(); + } + + public Verification() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public Verification(Verification verification) + : base(verification) { } +#pragma warning restore CS8618 + + public Verification(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + Verification(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static Verification FromRawUnchecked(IReadOnlyDictionary rawData) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class VerificationFromRaw : IFromRawJson +{ + /// + public Verification FromRawUnchecked(IReadOnlyDictionary rawData) => + Verification.FromRawUnchecked(rawData); +} + +/// +/// Fields related to verification of the Card Verification Code, a 3-digit code +/// on the back of the card. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardVerificationCode : JsonModel +{ + /// + /// The result of verifying the Card Verification Code. + /// + public required ApiEnum Result + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>("result"); + } + init { this._rawData.Set("result", value); } + } + + /// + public override void Validate() + { + this.Result.Validate(); + } + + public CardVerificationCode() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardVerificationCode(CardVerificationCode cardVerificationCode) + : base(cardVerificationCode) { } +#pragma warning restore CS8618 + + public CardVerificationCode(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardVerificationCode(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } + + [SetsRequiredMembers] + public CardVerificationCode(ApiEnum result) + : this() + { + this.Result = result; + } +} + +class CardVerificationCodeFromRaw : IFromRawJson +{ + /// + public CardVerificationCode FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardVerificationCode.FromRawUnchecked(rawData); +} + +/// +/// The result of verifying the Card Verification Code. +/// +[JsonConverter(typeof(ResultConverter))] +public enum Result +{ + /// + /// No card verification code was provided in the authorization request. + /// + NotChecked, + + /// + /// The card verification code matched the one on file. + /// + Match, + + /// + /// The card verification code did not match the one on file. + /// + NoMatch, +} + +sealed class ResultConverter : JsonConverter +{ + public override Result Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "not_checked" => Result.NotChecked, + "match" => Result.Match, + "no_match" => Result.NoMatch, + _ => (Result)(-1), + }; + } + + public override void Write(Utf8JsonWriter writer, Result value, JsonSerializerOptions options) + { + JsonSerializer.Serialize( + writer, + value switch + { + Result.NotChecked => "not_checked", + Result.Match => "match", + Result.NoMatch => "no_match", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Cardholder address provided in the authorization request and the address on file +/// we verified it against. +/// +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardholderAddress : JsonModel +{ + /// + /// Line 1 of the address on file for the cardholder. + /// + public required string? ActualLine1 + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("actual_line1"); + } + init { this._rawData.Set("actual_line1", value); } + } + + /// + /// The postal code of the address on file for the cardholder. + /// + public required string? ActualPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("actual_postal_code"); + } + init { this._rawData.Set("actual_postal_code", value); } + } + + /// + /// The cardholder address line 1 provided for verification in the authorization request. + /// + public required string? ProvidedLine1 + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_line1"); + } + init { this._rawData.Set("provided_line1", value); } + } + + /// + /// The postal code provided for verification in the authorization request. + /// + public required string? ProvidedPostalCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("provided_postal_code"); + } + init { this._rawData.Set("provided_postal_code", value); } + } + + /// + /// The address verification result returned to the card network. + /// + public required ApiEnum Result + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullClass>( + "result" + ); + } + init { this._rawData.Set("result", value); } + } /// public override void Validate() @@ -6699,6 +7198,27 @@ public required PurchaseDetails? PurchaseDetails init { this._rawData.Set("purchase_details", value); } } + /// + /// The scheme fees associated with this card refund. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// The identifier of the Transaction associated with this Transaction. /// @@ -6746,6 +7266,10 @@ public override void Validate() _ = this.PresentmentAmount; _ = this.PresentmentCurrency; this.PurchaseDetails?.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } _ = this.TransactionID; this.Type.Validate(); } @@ -9124,50 +9648,238 @@ public enum RestrictedTicketIndicator RestrictedNonRefundableTicket, } -sealed class RestrictedTicketIndicatorConverter : JsonConverter -{ - public override RestrictedTicketIndicator Read( - ref Utf8JsonReader reader, - System::Type typeToConvert, - JsonSerializerOptions options - ) +sealed class RestrictedTicketIndicatorConverter : JsonConverter +{ + public override RestrictedTicketIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "no_restrictions" => RestrictedTicketIndicator.NoRestrictions, + "restricted_non_refundable_ticket" => + RestrictedTicketIndicator.RestrictedNonRefundableTicket, + _ => (RestrictedTicketIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + RestrictedTicketIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + RestrictedTicketIndicator.NoRestrictions => "no_restrictions", + RestrictedTicketIndicator.RestrictedNonRefundableTicket => + "restricted_non_refundable_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// Indicates why a ticket was changed. +/// +[JsonConverter(typeof(TicketChangeIndicatorConverter))] +public enum TicketChangeIndicator +{ + /// + /// None + /// + None, + + /// + /// Change to existing ticket + /// + ChangeToExistingTicket, + + /// + /// New ticket + /// + NewTicket, +} + +sealed class TicketChangeIndicatorConverter : JsonConverter +{ + public override TicketChangeIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => TicketChangeIndicator.None, + "change_to_existing_ticket" => TicketChangeIndicator.ChangeToExistingTicket, + "new_ticket" => TicketChangeIndicator.NewTicket, + _ => (TicketChangeIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + TicketChangeIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + TicketChangeIndicator.None => "none", + TicketChangeIndicator.ChangeToExistingTicket => "change_to_existing_ticket", + TicketChangeIndicator.NewTicket => "new_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class TripLeg : JsonModel +{ + /// + /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// + public required string? CarrierCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("carrier_code"); + } + init { this._rawData.Set("carrier_code", value); } + } + + /// + /// Code for the destination city or airport. + /// + public required string? DestinationCityAirportCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("destination_city_airport_code"); + } + init { this._rawData.Set("destination_city_airport_code", value); } + } + + /// + /// Fare basis code. + /// + public required string? FareBasisCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fare_basis_code"); + } + init { this._rawData.Set("fare_basis_code", value); } + } + + /// + /// Flight number. + /// + public required string? FlightNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("flight_number"); + } + init { this._rawData.Set("flight_number", value); } + } + + /// + /// Service class (e.g., first class, business class, etc.). + /// + public required string? ServiceClass + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("service_class"); + } + init { this._rawData.Set("service_class", value); } + } + + /// + /// Indicates whether a stopover is allowed on this ticket. + /// + public required ApiEnum? StopOverCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass>("stop_over_code"); + } + init { this._rawData.Set("stop_over_code", value); } + } + + /// + public override void Validate() + { + _ = this.CarrierCode; + _ = this.DestinationCityAirportCode; + _ = this.FareBasisCode; + _ = this.FlightNumber; + _ = this.ServiceClass; + this.StopOverCode?.Validate(); + } + + public TripLeg() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public TripLeg(TripLeg tripLeg) + : base(tripLeg) { } +#pragma warning restore CS8618 + + public TripLeg(IReadOnlyDictionary rawData) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + TripLeg(FrozenDictionary rawData) { - return JsonSerializer.Deserialize(ref reader, options) switch - { - "no_restrictions" => RestrictedTicketIndicator.NoRestrictions, - "restricted_non_refundable_ticket" => - RestrictedTicketIndicator.RestrictedNonRefundableTicket, - _ => (RestrictedTicketIndicator)(-1), - }; + this._rawData = new(rawData); } +#pragma warning restore CS8618 - public override void Write( - Utf8JsonWriter writer, - RestrictedTicketIndicator value, - JsonSerializerOptions options - ) + /// + public static TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) { - JsonSerializer.Serialize( - writer, - value switch - { - RestrictedTicketIndicator.NoRestrictions => "no_restrictions", - RestrictedTicketIndicator.RestrictedNonRefundableTicket => - "restricted_non_refundable_ticket", - _ => throw new IncreaseInvalidDataException( - string.Format("Invalid value '{0}' in {1}", value, nameof(value)) - ), - }, - options - ); + return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } +class TripLegFromRaw : IFromRawJson +{ + /// + public TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) => + TripLeg.FromRawUnchecked(rawData); +} + /// -/// Indicates why a ticket was changed. +/// Indicates whether a stopover is allowed on this ticket. /// -[JsonConverter(typeof(TicketChangeIndicatorConverter))] -public enum TicketChangeIndicator +[JsonConverter(typeof(StopOverCodeConverter))] +public enum StopOverCode { /// /// None @@ -9175,19 +9887,19 @@ public enum TicketChangeIndicator None, /// - /// Change to existing ticket + /// Stop over allowed /// - ChangeToExistingTicket, + StopOverAllowed, /// - /// New ticket + /// Stop over not allowed /// - NewTicket, + StopOverNotAllowed, } -sealed class TicketChangeIndicatorConverter : JsonConverter +sealed class StopOverCodeConverter : JsonConverter { - public override TicketChangeIndicator Read( + public override StopOverCode Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -9195,16 +9907,16 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => TicketChangeIndicator.None, - "change_to_existing_ticket" => TicketChangeIndicator.ChangeToExistingTicket, - "new_ticket" => TicketChangeIndicator.NewTicket, - _ => (TicketChangeIndicator)(-1), + "none" => StopOverCode.None, + "stop_over_allowed" => StopOverCode.StopOverAllowed, + "stop_over_not_allowed" => StopOverCode.StopOverNotAllowed, + _ => (StopOverCode)(-1), }; } public override void Write( Utf8JsonWriter writer, - TicketChangeIndicator value, + StopOverCode value, JsonSerializerOptions options ) { @@ -9212,9 +9924,9 @@ JsonSerializerOptions options writer, value switch { - TicketChangeIndicator.None => "none", - TicketChangeIndicator.ChangeToExistingTicket => "change_to_existing_ticket", - TicketChangeIndicator.NewTicket => "new_ticket", + StopOverCode.None => "none", + StopOverCode.StopOverAllowed => "stop_over_allowed", + StopOverCode.StopOverNotAllowed => "stop_over_not_allowed", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -9224,158 +9936,381 @@ JsonSerializerOptions options } } -[JsonConverter(typeof(JsonModelConverter))] -public sealed record class TripLeg : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardRefundSchemeFee : JsonModel { /// - /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// The fee amount given as a string containing a decimal number. /// - public required string? CarrierCode + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("carrier_code"); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("carrier_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// Code for the destination city or airport. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required string? DestinationCityAirportCode + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("destination_city_airport_code"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("destination_city_airport_code", value); } + init { this._rawData.Set("created_at", value); } } /// - /// Fare basis code. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required string? FareBasisCode + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("fare_basis_code"); + return this._rawData.GetNotNullClass>( + "currency" + ); } - init { this._rawData.Set("fare_basis_code", value); } + init { this._rawData.Set("currency", value); } } /// - /// Flight number. + /// The type of fee being assessed. /// - public required string? FlightNumber + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("flight_number"); + return this._rawData.GetNotNullClass>( + "fee_type" + ); } - init { this._rawData.Set("flight_number", value); } + init { this._rawData.Set("fee_type", value); } } /// - /// Service class (e.g., first class, business class, etc.). + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required string? ServiceClass + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("service_class"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("service_class", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// Indicates whether a stopover is allowed on this ticket. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required ApiEnum? StopOverCode + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass>("stop_over_code"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("stop_over_code", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - _ = this.CarrierCode; - _ = this.DestinationCityAirportCode; - _ = this.FareBasisCode; - _ = this.FlightNumber; - _ = this.ServiceClass; - this.StopOverCode?.Validate(); + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public TripLeg() { } + public CardRefundSchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public TripLeg(TripLeg tripLeg) - : base(tripLeg) { } + public CardRefundSchemeFee(CardRefundSchemeFee cardRefundSchemeFee) + : base(cardRefundSchemeFee) { } #pragma warning restore CS8618 - public TripLeg(IReadOnlyDictionary rawData) + public CardRefundSchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - TripLeg(FrozenDictionary rawData) + CardRefundSchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) + /// + public static CardRefundSchemeFee FromRawUnchecked( + IReadOnlyDictionary rawData + ) { return new(FrozenDictionary.ToFrozenDictionary(rawData)); } } -class TripLegFromRaw : IFromRawJson -{ - /// - public TripLeg FromRawUnchecked(IReadOnlyDictionary rawData) => - TripLeg.FromRawUnchecked(rawData); -} +class CardRefundSchemeFeeFromRaw : IFromRawJson +{ + /// + public CardRefundSchemeFee FromRawUnchecked(IReadOnlyDictionary rawData) => + CardRefundSchemeFee.FromRawUnchecked(rawData); +} + +/// +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. +/// +[JsonConverter(typeof(CardRefundSchemeFeeCurrencyConverter))] +public enum CardRefundSchemeFeeCurrency +{ + /// + /// US Dollar (USD) + /// + Usd, +} + +sealed class CardRefundSchemeFeeCurrencyConverter : JsonConverter +{ + public override CardRefundSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardRefundSchemeFeeCurrency.Usd, + _ => (CardRefundSchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardRefundSchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardRefundSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(CardRefundSchemeFeeFeeTypeConverter))] +public enum CardRefundSchemeFeeFeeType +{ + /// + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. + /// + VisaInternationalServiceAssessmentSingleCurrency, + + /// + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. + /// + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, -/// -/// Indicates whether a stopover is allowed on this ticket. -/// -[JsonConverter(typeof(StopOverCodeConverter))] -public enum StopOverCode -{ /// - /// None + /// Issuer Advertising Service Fee for Commercial Credit cards. /// - None, + VisaAdvertisingServiceCommercialCredit, /// - /// Stop over allowed + /// Issuer Community Growth Acceleration Program Fee. /// - StopOverAllowed, + VisaCommunityGrowthAccelerationProgram, /// - /// Stop over not allowed + /// Issuer Processing Guarantee for Commercial Credit cards. /// - StopOverNotAllowed, + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class StopOverCodeConverter : JsonConverter +sealed class CardRefundSchemeFeeFeeTypeConverter : JsonConverter { - public override StopOverCode Read( + public override CardRefundSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -9383,16 +10318,62 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => StopOverCode.None, - "stop_over_allowed" => StopOverCode.StopOverAllowed, - "stop_over_not_allowed" => StopOverCode.StopOverNotAllowed, - _ => (StopOverCode)(-1), + "visa_international_service_assessment_single_currency" => + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardRefundSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardRefundSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => CardRefundSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardRefundSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardRefundSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardRefundSchemeFeeFeeType.PulseSwitchFee, + _ => (CardRefundSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - StopOverCode value, + CardRefundSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -9400,9 +10381,57 @@ JsonSerializerOptions options writer, value switch { - StopOverCode.None => "none", - StopOverCode.StopOverAllowed => "stop_over_allowed", - StopOverCode.StopOverNotAllowed => "stop_over_not_allowed", + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardRefundSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardRefundSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardRefundSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardRefundSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardRefundSchemeFeeFeeType.VisaMessageTransmission => "visa_message_transmission", + CardRefundSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardRefundSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardRefundSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardRefundSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardRefundSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardRefundSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardRefundSchemeFeeFeeType.VisaCreditPurchaseToken => "visa_credit_purchase_token", + CardRefundSchemeFeeFeeType.VisaDebitPurchaseToken => "visa_debit_purchase_token", + CardRefundSchemeFeeFeeType.VisaClearingTransmission => "visa_clearing_transmission", + CardRefundSchemeFeeFeeType.VisaDirectAuthorization => "visa_direct_authorization", + CardRefundSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardRefundSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardRefundSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardRefundSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardRefundSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardRefundSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -9908,6 +10937,27 @@ public required CardSettlementPurchaseDetails? PurchaseDetails init { this._rawData.Set("purchase_details", value); } } + /// + /// The scheme fees associated with this card settlement. + /// + public required IReadOnlyList SchemeFees + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNotNullStruct>( + "scheme_fees" + ); + } + init + { + this._rawData.Set>( + "scheme_fees", + ImmutableArray.ToImmutableArray(value) + ); + } + } + /// /// Surcharge amount details, if applicable. The amount is positive if the surcharge /// is added to the overall transaction amount (surcharge), and negative if the @@ -9973,6 +11023,10 @@ public override void Validate() _ = this.PresentmentAmount; _ = this.PresentmentCurrency; this.PurchaseDetails?.Validate(); + foreach (var item in this.SchemeFees) + { + item.Validate(); + } this.Surcharge?.Validate(); _ = this.TransactionID; this.Type.Validate(); @@ -12619,10 +13673,219 @@ JsonSerializerOptions options } /// -/// Indicates why a ticket was changed. +/// Indicates why a ticket was changed. +/// +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter))] +public enum CardSettlementPurchaseDetailsTravelTicketChangeIndicator +{ + /// + /// None + /// + None, + + /// + /// Change to existing ticket + /// + ChangeToExistingTicket, + + /// + /// New ticket + /// + NewTicket, +} + +sealed class CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter + : JsonConverter +{ + public override CardSettlementPurchaseDetailsTravelTicketChangeIndicator Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "none" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None, + "change_to_existing_ticket" => + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket, + "new_ticket" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket, + _ => (CardSettlementPurchaseDetailsTravelTicketChangeIndicator)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementPurchaseDetailsTravelTicketChangeIndicator value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None => "none", + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket => + "change_to_existing_ticket", + CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket => "new_ticket", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} + +[JsonConverter( + typeof(JsonModelConverter< + CardSettlementPurchaseDetailsTravelTripLeg, + CardSettlementPurchaseDetailsTravelTripLegFromRaw + >) +)] +public sealed record class CardSettlementPurchaseDetailsTravelTripLeg : JsonModel +{ + /// + /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// + public required string? CarrierCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("carrier_code"); + } + init { this._rawData.Set("carrier_code", value); } + } + + /// + /// Code for the destination city or airport. + /// + public required string? DestinationCityAirportCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("destination_city_airport_code"); + } + init { this._rawData.Set("destination_city_airport_code", value); } + } + + /// + /// Fare basis code. + /// + public required string? FareBasisCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("fare_basis_code"); + } + init { this._rawData.Set("fare_basis_code", value); } + } + + /// + /// Flight number. + /// + public required string? FlightNumber + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("flight_number"); + } + init { this._rawData.Set("flight_number", value); } + } + + /// + /// Service class (e.g., first class, business class, etc.). + /// + public required string? ServiceClass + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass("service_class"); + } + init { this._rawData.Set("service_class", value); } + } + + /// + /// Indicates whether a stopover is allowed on this ticket. + /// + public required ApiEnum< + string, + CardSettlementPurchaseDetailsTravelTripLegStopOverCode + >? StopOverCode + { + get + { + this._rawData.Freeze(); + return this._rawData.GetNullableClass< + ApiEnum + >("stop_over_code"); + } + init { this._rawData.Set("stop_over_code", value); } + } + + /// + public override void Validate() + { + _ = this.CarrierCode; + _ = this.DestinationCityAirportCode; + _ = this.FareBasisCode; + _ = this.FlightNumber; + _ = this.ServiceClass; + this.StopOverCode?.Validate(); + } + + public CardSettlementPurchaseDetailsTravelTripLeg() { } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + public CardSettlementPurchaseDetailsTravelTripLeg( + CardSettlementPurchaseDetailsTravelTripLeg cardSettlementPurchaseDetailsTravelTripLeg + ) + : base(cardSettlementPurchaseDetailsTravelTripLeg) { } +#pragma warning restore CS8618 + + public CardSettlementPurchaseDetailsTravelTripLeg( + IReadOnlyDictionary rawData + ) + { + this._rawData = new(rawData); + } + +#pragma warning disable CS8618 + [SetsRequiredMembers] + CardSettlementPurchaseDetailsTravelTripLeg(FrozenDictionary rawData) + { + this._rawData = new(rawData); + } +#pragma warning restore CS8618 + + /// + public static CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + IReadOnlyDictionary rawData + ) + { + return new(FrozenDictionary.ToFrozenDictionary(rawData)); + } +} + +class CardSettlementPurchaseDetailsTravelTripLegFromRaw + : IFromRawJson +{ + /// + public CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + IReadOnlyDictionary rawData + ) => CardSettlementPurchaseDetailsTravelTripLeg.FromRawUnchecked(rawData); +} + +/// +/// Indicates whether a stopover is allowed on this ticket. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter))] -public enum CardSettlementPurchaseDetailsTravelTicketChangeIndicator +[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter))] +public enum CardSettlementPurchaseDetailsTravelTripLegStopOverCode { /// /// None @@ -12630,20 +13893,20 @@ public enum CardSettlementPurchaseDetailsTravelTicketChangeIndicator None, /// - /// Change to existing ticket + /// Stop over allowed /// - ChangeToExistingTicket, + StopOverAllowed, /// - /// New ticket + /// Stop over not allowed /// - NewTicket, + StopOverNotAllowed, } -sealed class CardSettlementPurchaseDetailsTravelTicketChangeIndicatorConverter - : JsonConverter +sealed class CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter + : JsonConverter { - public override CardSettlementPurchaseDetailsTravelTicketChangeIndicator Read( + public override CardSettlementPurchaseDetailsTravelTripLegStopOverCode Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12651,17 +13914,18 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None, - "change_to_existing_ticket" => - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket, - "new_ticket" => CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket, - _ => (CardSettlementPurchaseDetailsTravelTicketChangeIndicator)(-1), + "none" => CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None, + "stop_over_allowed" => + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed, + "stop_over_not_allowed" => + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed, + _ => (CardSettlementPurchaseDetailsTravelTripLegStopOverCode)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelTicketChangeIndicator value, + CardSettlementPurchaseDetailsTravelTripLegStopOverCode value, JsonSerializerOptions options ) { @@ -12669,10 +13933,11 @@ JsonSerializerOptions options writer, value switch { - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.None => "none", - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.ChangeToExistingTicket => - "change_to_existing_ticket", - CardSettlementPurchaseDetailsTravelTicketChangeIndicator.NewTicket => "new_ticket", + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None => "none", + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed => + "stop_over_allowed", + CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed => + "stop_over_not_allowed", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ), @@ -12682,135 +13947,128 @@ JsonSerializerOptions options } } -[JsonConverter( - typeof(JsonModelConverter< - CardSettlementPurchaseDetailsTravelTripLeg, - CardSettlementPurchaseDetailsTravelTripLegFromRaw - >) -)] -public sealed record class CardSettlementPurchaseDetailsTravelTripLeg : JsonModel +[JsonConverter(typeof(JsonModelConverter))] +public sealed record class CardSettlementSchemeFee : JsonModel { /// - /// Carrier code (e.g., United Airlines, Jet Blue, etc.). + /// The fee amount given as a string containing a decimal number. /// - public required string? CarrierCode + public required string Amount { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("carrier_code"); + return this._rawData.GetNotNullClass("amount"); } - init { this._rawData.Set("carrier_code", value); } + init { this._rawData.Set("amount", value); } } /// - /// Code for the destination city or airport. + /// The [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) time at which the fee + /// was created. /// - public required string? DestinationCityAirportCode + public required System::DateTimeOffset CreatedAt { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("destination_city_airport_code"); + return this._rawData.GetNotNullStruct("created_at"); } - init { this._rawData.Set("destination_city_airport_code", value); } + init { this._rawData.Set("created_at", value); } } /// - /// Fare basis code. + /// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// - public required string? FareBasisCode + public required ApiEnum Currency { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("fare_basis_code"); + return this._rawData.GetNotNullClass>( + "currency" + ); } - init { this._rawData.Set("fare_basis_code", value); } + init { this._rawData.Set("currency", value); } } /// - /// Flight number. + /// The type of fee being assessed. /// - public required string? FlightNumber + public required ApiEnum FeeType { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("flight_number"); + return this._rawData.GetNotNullClass>( + "fee_type" + ); } - init { this._rawData.Set("flight_number", value); } + init { this._rawData.Set("fee_type", value); } } /// - /// Service class (e.g., first class, business class, etc.). + /// The fixed component of the fee, if applicable, given in major units of the + /// fee amount. /// - public required string? ServiceClass + public required string? FixedComponent { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass("service_class"); + return this._rawData.GetNullableClass("fixed_component"); } - init { this._rawData.Set("service_class", value); } + init { this._rawData.Set("fixed_component", value); } } /// - /// Indicates whether a stopover is allowed on this ticket. + /// The variable rate component of the fee, if applicable, given as a decimal + /// (e.g., 0.015 for 1.5%). /// - public required ApiEnum< - string, - CardSettlementPurchaseDetailsTravelTripLegStopOverCode - >? StopOverCode + public required string? VariableRate { get { this._rawData.Freeze(); - return this._rawData.GetNullableClass< - ApiEnum - >("stop_over_code"); + return this._rawData.GetNullableClass("variable_rate"); } - init { this._rawData.Set("stop_over_code", value); } + init { this._rawData.Set("variable_rate", value); } } /// public override void Validate() { - _ = this.CarrierCode; - _ = this.DestinationCityAirportCode; - _ = this.FareBasisCode; - _ = this.FlightNumber; - _ = this.ServiceClass; - this.StopOverCode?.Validate(); + _ = this.Amount; + _ = this.CreatedAt; + this.Currency.Validate(); + this.FeeType.Validate(); + _ = this.FixedComponent; + _ = this.VariableRate; } - public CardSettlementPurchaseDetailsTravelTripLeg() { } + public CardSettlementSchemeFee() { } #pragma warning disable CS8618 [SetsRequiredMembers] - public CardSettlementPurchaseDetailsTravelTripLeg( - CardSettlementPurchaseDetailsTravelTripLeg cardSettlementPurchaseDetailsTravelTripLeg - ) - : base(cardSettlementPurchaseDetailsTravelTripLeg) { } + public CardSettlementSchemeFee(CardSettlementSchemeFee cardSettlementSchemeFee) + : base(cardSettlementSchemeFee) { } #pragma warning restore CS8618 - public CardSettlementPurchaseDetailsTravelTripLeg( - IReadOnlyDictionary rawData - ) + public CardSettlementSchemeFee(IReadOnlyDictionary rawData) { this._rawData = new(rawData); } #pragma warning disable CS8618 [SetsRequiredMembers] - CardSettlementPurchaseDetailsTravelTripLeg(FrozenDictionary rawData) + CardSettlementSchemeFee(FrozenDictionary rawData) { this._rawData = new(rawData); } #pragma warning restore CS8618 - /// - public static CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + /// + public static CardSettlementSchemeFee FromRawUnchecked( IReadOnlyDictionary rawData ) { @@ -12818,41 +14076,254 @@ IReadOnlyDictionary rawData } } -class CardSettlementPurchaseDetailsTravelTripLegFromRaw - : IFromRawJson +class CardSettlementSchemeFeeFromRaw : IFromRawJson { /// - public CardSettlementPurchaseDetailsTravelTripLeg FromRawUnchecked( + public CardSettlementSchemeFee FromRawUnchecked( IReadOnlyDictionary rawData - ) => CardSettlementPurchaseDetailsTravelTripLeg.FromRawUnchecked(rawData); + ) => CardSettlementSchemeFee.FromRawUnchecked(rawData); } /// -/// Indicates whether a stopover is allowed on this ticket. +/// The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) code for the fee reimbursement. /// -[JsonConverter(typeof(CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter))] -public enum CardSettlementPurchaseDetailsTravelTripLegStopOverCode +[JsonConverter(typeof(CardSettlementSchemeFeeCurrencyConverter))] +public enum CardSettlementSchemeFeeCurrency { /// - /// None + /// US Dollar (USD) /// - None, + Usd, +} + +sealed class CardSettlementSchemeFeeCurrencyConverter + : JsonConverter +{ + public override CardSettlementSchemeFeeCurrency Read( + ref Utf8JsonReader reader, + System::Type typeToConvert, + JsonSerializerOptions options + ) + { + return JsonSerializer.Deserialize(ref reader, options) switch + { + "USD" => CardSettlementSchemeFeeCurrency.Usd, + _ => (CardSettlementSchemeFeeCurrency)(-1), + }; + } + + public override void Write( + Utf8JsonWriter writer, + CardSettlementSchemeFeeCurrency value, + JsonSerializerOptions options + ) + { + JsonSerializer.Serialize( + writer, + value switch + { + CardSettlementSchemeFeeCurrency.Usd => "USD", + _ => throw new IncreaseInvalidDataException( + string.Format("Invalid value '{0}' in {1}", value, nameof(value)) + ), + }, + options + ); + } +} +/// +/// The type of fee being assessed. +/// +[JsonConverter(typeof(CardSettlementSchemeFeeFeeTypeConverter))] +public enum CardSettlementSchemeFeeFeeType +{ /// - /// Stop over allowed + /// International Service Assessment (ISA) single-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in the + /// same currency. /// - StopOverAllowed, + VisaInternationalServiceAssessmentSingleCurrency, /// - /// Stop over not allowed + /// International Service Assessment (ISA) cross-currency is a fee assessed by + /// the card network for cross-border transactions presented and settled in different currencies. /// - StopOverNotAllowed, + VisaInternationalServiceAssessmentCrossCurrency, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// authorization transactions. Authorization is the process of approving or + /// declining the transaction amount specified. The fee is assessed to the Issuer. + /// + VisaAuthorizationDomesticPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for POS (Point-Of-Sale) + /// International authorization transactions. Authorization is the process of + /// approving or declining the transaction amount specified. The fee is assessed + /// to the Issuer. + /// + VisaAuthorizationInternationalPointOfSale, + + /// + /// Activity and charges for Visa Settlement System processing for Canada Region + /// POS (Point-of-Sale) authorization transactions. Authorization is the process + /// of approving or declining the transaction amount specified. + /// + VisaAuthorizationCanadaPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) reversal transactions. Authorization reversal represents + /// a VSS message that undoes the complete or partial actions of a previous authorization request. + /// + VisaAuthorizationReversalPointOfSale, + + /// + /// Activity only for Visa Settlement System authorization processing of POS + /// (Point-Of-Sale) International reversal transactions. Authorization reversal + /// represents a VSS message that undoes the complete or partial actions of a + /// previous authorization request. + /// + VisaAuthorizationReversalInternationalPointOfSale, + + /// + /// A per Address Verification Service (AVS) result fee. Applies to all usable + /// AVS result codes. + /// + VisaAuthorizationAddressVerificationService, + + /// + /// Advanced Authorization is a fraud detection tool that monitors and risk evaluates + /// 100 percent of US VisaNet authorizations in real-time. Activity related to + /// Purchase (includes Signature Authenticated Visa and PIN Authenticated Visa + /// Debit (PAVD) transactions). + /// + VisaAdvancedAuthorization, + + /// + /// Issuer Transactions Visa represents a charge based on total actual monthly + /// processing (Visa transactions only) through a VisaNet Access Point (VAP). + /// Charges are assessed to the processor for each VisaNet Access Point. + /// + VisaMessageTransmission, + + /// + /// Activity, per inquiry, related to the domestic Issuer for Account Number Verification. + /// + VisaAccountVerificationDomestic, + + /// + /// Activity, per inquiry, related to the international Issuer for Account Number Verification. + /// + VisaAccountVerificationInternational, + + /// + /// Activity, per inquiry, related to the US-Canada Issuer for Account Number Verification. + /// + VisaAccountVerificationCanada, + + /// + /// The Corporate Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Commercial and Government Debit, Prepaid, Credit, Charge, + /// or Deferred Debit card transactions. + /// + VisaCorporateAcceptanceFee, + + /// + /// The Consumer Debit Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume of Consumer Debit or Prepaid card transactions. The cashback + /// portion of a Debit and Prepaid card transaction is excluded from the sales + /// volume calculation. + /// + VisaConsumerDebitAcceptanceFee, + + /// + /// The Business Acceptance Fee is charged to issuers and is based on the monthly + /// sales volume on Business Debit, Prepaid, Credit, Charge, or Deferred Debit + /// card transactions. The cashback portion is included in the sales volume calculation + /// with the exception of a Debit and Prepaid card transactions. + /// + VisaBusinessDebitAcceptanceFee, + + /// + /// The Purchasing Card Acceptance Fee is charged to issuers and is based on the + /// monthly sales volume on Commercial and Government Debit, Prepaid, Credit, + /// Charge, or Deferred Debit card transactions. + /// + VisaPurchasingAcceptanceFee, + + /// + /// Activity and fees for the processing of a sales draft original for a purchase transaction. + /// + VisaPurchaseDomestic, + + /// + /// Activity and fees for the processing of an international sales draft original + /// for a purchase transaction. + /// + VisaPurchaseInternational, + + /// + /// Apple Pay Credit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaCreditPurchaseToken, + + /// + /// Apple Pay Debit Product Token Purchase Original Transactions. This fee is + /// billed by Visa on behalf of Apple Inc. for Apple Pay transactions. + /// + VisaDebitPurchaseToken, + + /// + /// A per transaction fee assessed for Base II financial draft - Issuer. + /// + VisaClearingTransmission, + + /// + /// Issuer charge for Non-Financial OCT/AFT Authorization 0100 and Declined Financial + /// OCT/AFT 0200 transactions. + /// + VisaDirectAuthorization, + + /// + /// Data processing charge for Visa Direct OCTs for all business application identifiers + /// (BAIs) other than money transfer-bank initiated (BI). BASE II transactions. + /// + VisaDirectTransactionDomestic, + + /// + /// Issuer card service fee for Commercial Credit cards. + /// + VisaServiceCommercialCredit, + + /// + /// Issuer Advertising Service Fee for Commercial Credit cards. + /// + VisaAdvertisingServiceCommercialCredit, + + /// + /// Issuer Community Growth Acceleration Program Fee. + /// + VisaCommunityGrowthAccelerationProgram, + + /// + /// Issuer Processing Guarantee for Commercial Credit cards. + /// + VisaProcessingGuaranteeCommercialCredit, + + /// + /// Pulse Switch Fee is a fee charged by the Pulse network for processing transactions + /// on its network. + /// + PulseSwitchFee, } -sealed class CardSettlementPurchaseDetailsTravelTripLegStopOverCodeConverter - : JsonConverter +sealed class CardSettlementSchemeFeeFeeTypeConverter : JsonConverter { - public override CardSettlementPurchaseDetailsTravelTripLegStopOverCode Read( + public override CardSettlementSchemeFeeFeeType Read( ref Utf8JsonReader reader, System::Type typeToConvert, JsonSerializerOptions options @@ -12860,18 +14331,64 @@ JsonSerializerOptions options { return JsonSerializer.Deserialize(ref reader, options) switch { - "none" => CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None, - "stop_over_allowed" => - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed, - "stop_over_not_allowed" => - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed, - _ => (CardSettlementPurchaseDetailsTravelTripLegStopOverCode)(-1), + "visa_international_service_assessment_single_currency" => + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency, + "visa_international_service_assessment_cross_currency" => + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency, + "visa_authorization_domestic_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale, + "visa_authorization_international_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale, + "visa_authorization_canada_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale, + "visa_authorization_reversal_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale, + "visa_authorization_reversal_international_point_of_sale" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale, + "visa_authorization_address_verification_service" => + CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService, + "visa_advanced_authorization" => + CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization, + "visa_message_transmission" => CardSettlementSchemeFeeFeeType.VisaMessageTransmission, + "visa_account_verification_domestic" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic, + "visa_account_verification_international" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational, + "visa_account_verification_canada" => + CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada, + "visa_corporate_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee, + "visa_consumer_debit_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee, + "visa_business_debit_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee, + "visa_purchasing_acceptance_fee" => + CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee, + "visa_purchase_domestic" => CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic, + "visa_purchase_international" => + CardSettlementSchemeFeeFeeType.VisaPurchaseInternational, + "visa_credit_purchase_token" => CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken, + "visa_debit_purchase_token" => CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken, + "visa_clearing_transmission" => CardSettlementSchemeFeeFeeType.VisaClearingTransmission, + "visa_direct_authorization" => CardSettlementSchemeFeeFeeType.VisaDirectAuthorization, + "visa_direct_transaction_domestic" => + CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic, + "visa_service_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit, + "visa_advertising_service_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit, + "visa_community_growth_acceleration_program" => + CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram, + "visa_processing_guarantee_commercial_credit" => + CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit, + "pulse_switch_fee" => CardSettlementSchemeFeeFeeType.PulseSwitchFee, + _ => (CardSettlementSchemeFeeFeeType)(-1), }; } public override void Write( Utf8JsonWriter writer, - CardSettlementPurchaseDetailsTravelTripLegStopOverCode value, + CardSettlementSchemeFeeFeeType value, JsonSerializerOptions options ) { @@ -12879,11 +14396,62 @@ JsonSerializerOptions options writer, value switch { - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.None => "none", - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverAllowed => - "stop_over_allowed", - CardSettlementPurchaseDetailsTravelTripLegStopOverCode.StopOverNotAllowed => - "stop_over_not_allowed", + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentSingleCurrency => + "visa_international_service_assessment_single_currency", + CardSettlementSchemeFeeFeeType.VisaInternationalServiceAssessmentCrossCurrency => + "visa_international_service_assessment_cross_currency", + CardSettlementSchemeFeeFeeType.VisaAuthorizationDomesticPointOfSale => + "visa_authorization_domestic_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationInternationalPointOfSale => + "visa_authorization_international_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationCanadaPointOfSale => + "visa_authorization_canada_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalPointOfSale => + "visa_authorization_reversal_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationReversalInternationalPointOfSale => + "visa_authorization_reversal_international_point_of_sale", + CardSettlementSchemeFeeFeeType.VisaAuthorizationAddressVerificationService => + "visa_authorization_address_verification_service", + CardSettlementSchemeFeeFeeType.VisaAdvancedAuthorization => + "visa_advanced_authorization", + CardSettlementSchemeFeeFeeType.VisaMessageTransmission => + "visa_message_transmission", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationDomestic => + "visa_account_verification_domestic", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationInternational => + "visa_account_verification_international", + CardSettlementSchemeFeeFeeType.VisaAccountVerificationCanada => + "visa_account_verification_canada", + CardSettlementSchemeFeeFeeType.VisaCorporateAcceptanceFee => + "visa_corporate_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaConsumerDebitAcceptanceFee => + "visa_consumer_debit_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaBusinessDebitAcceptanceFee => + "visa_business_debit_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaPurchasingAcceptanceFee => + "visa_purchasing_acceptance_fee", + CardSettlementSchemeFeeFeeType.VisaPurchaseDomestic => "visa_purchase_domestic", + CardSettlementSchemeFeeFeeType.VisaPurchaseInternational => + "visa_purchase_international", + CardSettlementSchemeFeeFeeType.VisaCreditPurchaseToken => + "visa_credit_purchase_token", + CardSettlementSchemeFeeFeeType.VisaDebitPurchaseToken => + "visa_debit_purchase_token", + CardSettlementSchemeFeeFeeType.VisaClearingTransmission => + "visa_clearing_transmission", + CardSettlementSchemeFeeFeeType.VisaDirectAuthorization => + "visa_direct_authorization", + CardSettlementSchemeFeeFeeType.VisaDirectTransactionDomestic => + "visa_direct_transaction_domestic", + CardSettlementSchemeFeeFeeType.VisaServiceCommercialCredit => + "visa_service_commercial_credit", + CardSettlementSchemeFeeFeeType.VisaAdvertisingServiceCommercialCredit => + "visa_advertising_service_commercial_credit", + CardSettlementSchemeFeeFeeType.VisaCommunityGrowthAccelerationProgram => + "visa_community_growth_acceleration_program", + CardSettlementSchemeFeeFeeType.VisaProcessingGuaranteeCommercialCredit => + "visa_processing_guarantee_commercial_credit", + CardSettlementSchemeFeeFeeType.PulseSwitchFee => "pulse_switch_fee", _ => throw new IncreaseInvalidDataException( string.Format("Invalid value '{0}' in {1}", value, nameof(value)) ),