From 8333e69fbfd975115dfbb08d2db478c12e09cd32 Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 00:27:36 +0600 Subject: [PATCH 1/6] Fix dispute schema --- openapi/components/requestBodies/Dispute.yaml | 232 +++++++++++++++++- openapi/components/schemas/Dispute.yaml | 26 +- 2 files changed, 245 insertions(+), 13 deletions(-) diff --git a/openapi/components/requestBodies/Dispute.yaml b/openapi/components/requestBodies/Dispute.yaml index 333416b60a..d6c2749ac3 100644 --- a/openapi/components/requestBodies/Dispute.yaml +++ b/openapi/components/requestBodies/Dispute.yaml @@ -1,6 +1,236 @@ content: application/json: schema: - $ref: ../schemas/Dispute.yaml + type: object + required: + - currency + - amount + - transactionId + - postedTime + - type + - status + - reasonCode + properties: + transactionId: + description: ID of the disputed transaction. + $ref: ./TransactionId.yaml + currency: + $ref: ./CurrencyCode.yaml + amount: + description: Dispute amount. + type: number + format: double + acquirerReferenceNumber: + description: Acquirer reference number for the dispute. + type: + - 'string' + - 'null' + caseId: + description: Case ID of the dispute. + type: + - 'string' + - 'null' + reasonCode: + description: Code used in the chargeback that describes the reason for the dispute. + type: string + enum: + - '1000' + - '10.1' + - '10.2' + - '10.3' + - '10.4' + - '10.5' + - '11.1' + - '11.2' + - '11.3' + - '12' + - '12.1' + - '12.2' + - '12.3' + - '12.4' + - '12.5' + - '12.6' + - '12.7' + - '13.1' + - '13.2' + - '13.3' + - '13.4' + - '13.5' + - '13.6' + - '13.7' + - '13.8' + - '13.9' + - '30' + - '31' + - '35' + - '37' + - '40' + - '41' + - '42' + - '46' + - '47' + - '49' + - '50' + - '53' + - '54' + - '55' + - '57' + - '59' + - '60' + - '62' + - '70' + - '71' + - '72' + - '73' + - '74' + - '75' + - '76' + - '77' + - '79' + - '80' + - '81' + - '82' + - '83' + - '85' + - '86' + - '93' + - '00' + - '63' + - A01 + - A02 + - A08 + - F10 + - F14 + - F22 + - F24 + - F29 + - C02 + - C04 + - C05 + - C08 + - C14 + - C18 + - C28 + - C31 + - C32 + - M10 + - M49 + - P01 + - P03 + - P04 + - P05 + - P07 + - P08 + - P22 + - P23 + - R03 + - R13 + - M01 + - FR1 + - FR4 + - FR6 + - AL + - AP + - AW + - CA + - CD + - CR + - DA + - DP + - DP1 + - EX + - IC + - IN + - IS + - LP + - 'N' + - NA + - NC + - P + - RG + - RM + - RN1 + - RN2 + - SV + - TF + - TNM + - UA01 + - UA02 + - UA32 + - UA99 + - UA03 + - UA10 + - UA11 + - UA12 + - UA18 + - UA20 + - UA21 + - UA22 + - UA23 + - UA28 + - UA30 + - UA31 + - UA38 + - duplicate + - fraudulent + - subscription_canceled + - product_unacceptable + - product_not_received + - unrecognized + - credit_not_processed + - customer_initiated + - incorrect_account_details + - insufficient_funds + - bank_cannot_process + - debit_not_authorized + - general + - pre-chargeback-alert + - '0' + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '51' + - 'A' + - 'B' + type: + description: Type of dispute. + type: string + enum: + - information-request + - first-chargeback + - second-chargeback + - arbitration + - fraud + - ethoca-alert + - verifi-alert + - bank-return + status: + description: Status of the dispute. + type: string + enum: + - response-needed + - under-review + - forfeited + - won + - lost + - unknown + postedTime: + description: Date and time when the dispute is posted. + type: string + format: date-time + deadlineTime: + description: |- + Latest date and time by when a merchant must submit a representment for a dispute. + If the deadline is missed, the merchant loses the dispute. + type: + - 'string' + - 'null' + format: date-time description: Dispute resource. required: true diff --git a/openapi/components/schemas/Dispute.yaml b/openapi/components/schemas/Dispute.yaml index 9939f1f7d7..87ee10ccec 100644 --- a/openapi/components/schemas/Dispute.yaml +++ b/openapi/components/schemas/Dispute.yaml @@ -1,12 +1,4 @@ type: object -required: - - currency - - amount - - transactionId - - postedTime - - type - - status - - reasonCode properties: id: type: string @@ -16,13 +8,19 @@ properties: example: dp_0YVCE8J5F2DE58FV0S8YASW4HK customerId: description: ID of the customer who is disputing a transaction. - type: string + type: + - 'string' + - 'null' readOnly: true maxLength: 50 example: cus_0YV7DDSDD1C8DA64KHH2W33CPF transactionId: description: ID of the disputed transaction. - $ref: ./TransactionId.yaml + type: + - 'string' + - 'null' + maxLength: 50 + example: txn_0YVDTQJ8YWDGQACV2N2N5SPWQ0 currency: $ref: ./CurrencyCode.yaml amount: @@ -41,7 +39,9 @@ properties: - 'null' reasonCode: description: Code used in the chargeback that describes the reason for the dispute. - type: string + type: + - 'string' + - 'null' enum: - '1000' - '10.1' @@ -249,7 +249,9 @@ properties: - unknown postedTime: description: Date and time when the dispute is posted. - type: string + type: + - 'string' + - 'null' format: date-time deadlineTime: description: |- From 9eaaabc795ae6929d7de1fdccc7180a4044381a9 Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 00:30:17 +0600 Subject: [PATCH 2/6] Fix dispute schema --- openapi/components/requestBodies/Dispute.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/openapi/components/requestBodies/Dispute.yaml b/openapi/components/requestBodies/Dispute.yaml index d6c2749ac3..a243bc9885 100644 --- a/openapi/components/requestBodies/Dispute.yaml +++ b/openapi/components/requestBodies/Dispute.yaml @@ -13,9 +13,9 @@ content: properties: transactionId: description: ID of the disputed transaction. - $ref: ./TransactionId.yaml + $ref: ../schemas/TransactionId.yaml currency: - $ref: ./CurrencyCode.yaml + $ref: ../schemas/CurrencyCode.yaml amount: description: Dispute amount. type: number From 12b2ec4d3a8fc0c358bc8ad071318457536730ef Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 01:34:31 +0600 Subject: [PATCH 3/6] Remove enum --- openapi/components/requestBodies/Dispute.yaml | 172 +----------------- openapi/components/schemas/Dispute.yaml | 166 +---------------- 2 files changed, 6 insertions(+), 332 deletions(-) diff --git a/openapi/components/requestBodies/Dispute.yaml b/openapi/components/requestBodies/Dispute.yaml index a243bc9885..06a8c78b8e 100644 --- a/openapi/components/requestBodies/Dispute.yaml +++ b/openapi/components/requestBodies/Dispute.yaml @@ -9,7 +9,6 @@ content: - postedTime - type - status - - reasonCode properties: transactionId: description: ID of the disputed transaction. @@ -32,172 +31,11 @@ content: - 'null' reasonCode: description: Code used in the chargeback that describes the reason for the dispute. - type: string - enum: - - '1000' - - '10.1' - - '10.2' - - '10.3' - - '10.4' - - '10.5' - - '11.1' - - '11.2' - - '11.3' - - '12' - - '12.1' - - '12.2' - - '12.3' - - '12.4' - - '12.5' - - '12.6' - - '12.7' - - '13.1' - - '13.2' - - '13.3' - - '13.4' - - '13.5' - - '13.6' - - '13.7' - - '13.8' - - '13.9' - - '30' - - '31' - - '35' - - '37' - - '40' - - '41' - - '42' - - '46' - - '47' - - '49' - - '50' - - '53' - - '54' - - '55' - - '57' - - '59' - - '60' - - '62' - - '70' - - '71' - - '72' - - '73' - - '74' - - '75' - - '76' - - '77' - - '79' - - '80' - - '81' - - '82' - - '83' - - '85' - - '86' - - '93' - - '00' - - '63' - - A01 - - A02 - - A08 - - F10 - - F14 - - F22 - - F24 - - F29 - - C02 - - C04 - - C05 - - C08 - - C14 - - C18 - - C28 - - C31 - - C32 - - M10 - - M49 - - P01 - - P03 - - P04 - - P05 - - P07 - - P08 - - P22 - - P23 - - R03 - - R13 - - M01 - - FR1 - - FR4 - - FR6 - - AL - - AP - - AW - - CA - - CD - - CR - - DA - - DP - - DP1 - - EX - - IC - - IN - - IS - - LP - - 'N' - - NA - - NC - - P - - RG - - RM - - RN1 - - RN2 - - SV - - TF - - TNM - - UA01 - - UA02 - - UA32 - - UA99 - - UA03 - - UA10 - - UA11 - - UA12 - - UA18 - - UA20 - - UA21 - - UA22 - - UA23 - - UA28 - - UA30 - - UA31 - - UA38 - - duplicate - - fraudulent - - subscription_canceled - - product_unacceptable - - product_not_received - - unrecognized - - credit_not_processed - - customer_initiated - - incorrect_account_details - - insufficient_funds - - bank_cannot_process - - debit_not_authorized - - general - - pre-chargeback-alert - - '0' - - '1' - - '2' - - '3' - - '4' - - '5' - - '6' - - '7' - - '8' - - '9' - - '51' - - 'A' - - 'B' + type: + - 'string' + - 'null' + maxLength: 255 + example: 10.1 type: description: Type of dispute. type: string diff --git a/openapi/components/schemas/Dispute.yaml b/openapi/components/schemas/Dispute.yaml index 87ee10ccec..cff272831e 100644 --- a/openapi/components/schemas/Dispute.yaml +++ b/openapi/components/schemas/Dispute.yaml @@ -42,171 +42,7 @@ properties: type: - 'string' - 'null' - enum: - - '1000' - - '10.1' - - '10.2' - - '10.3' - - '10.4' - - '10.5' - - '11.1' - - '11.2' - - '11.3' - - '12' - - '12.1' - - '12.2' - - '12.3' - - '12.4' - - '12.5' - - '12.6' - - '12.7' - - '13.1' - - '13.2' - - '13.3' - - '13.4' - - '13.5' - - '13.6' - - '13.7' - - '13.8' - - '13.9' - - '30' - - '31' - - '35' - - '37' - - '40' - - '41' - - '42' - - '46' - - '47' - - '49' - - '50' - - '53' - - '54' - - '55' - - '57' - - '59' - - '60' - - '62' - - '70' - - '71' - - '72' - - '73' - - '74' - - '75' - - '76' - - '77' - - '79' - - '80' - - '81' - - '82' - - '83' - - '85' - - '86' - - '93' - - '00' - - '63' - - A01 - - A02 - - A08 - - F10 - - F14 - - F22 - - F24 - - F29 - - C02 - - C04 - - C05 - - C08 - - C14 - - C18 - - C28 - - C31 - - C32 - - M10 - - M49 - - P01 - - P03 - - P04 - - P05 - - P07 - - P08 - - P22 - - P23 - - R03 - - R13 - - M01 - - FR1 - - FR4 - - FR6 - - AL - - AP - - AW - - CA - - CD - - CR - - DA - - DP - - DP1 - - EX - - IC - - IN - - IS - - LP - - 'N' - - NA - - NC - - P - - RG - - RM - - RN1 - - RN2 - - SV - - TF - - TNM - - UA01 - - UA02 - - UA32 - - UA99 - - UA03 - - UA10 - - UA11 - - UA12 - - UA18 - - UA20 - - UA21 - - UA22 - - UA23 - - UA28 - - UA30 - - UA31 - - UA38 - - duplicate - - fraudulent - - subscription_canceled - - product_unacceptable - - product_not_received - - unrecognized - - credit_not_processed - - customer_initiated - - incorrect_account_details - - insufficient_funds - - bank_cannot_process - - debit_not_authorized - - general - - pre-chargeback-alert - - '0' - - '1' - - '2' - - '3' - - '4' - - '5' - - '6' - - '7' - - '8' - - '9' - - '51' - - 'A' - - 'B' + maxLength: 255 reasonDescription: description: Description of the reason for the dispute. type: From f157b5deba06ac817b780e749f2f8449ff1cb470 Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 01:37:58 +0600 Subject: [PATCH 4/6] Remove example --- openapi/components/requestBodies/Dispute.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/openapi/components/requestBodies/Dispute.yaml b/openapi/components/requestBodies/Dispute.yaml index 06a8c78b8e..fa3f0e7d89 100644 --- a/openapi/components/requestBodies/Dispute.yaml +++ b/openapi/components/requestBodies/Dispute.yaml @@ -35,7 +35,6 @@ content: - 'string' - 'null' maxLength: 255 - example: 10.1 type: description: Type of dispute. type: string From a5f13115b6b3985177fce9148d04aa071f94db27 Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 01:53:58 +0600 Subject: [PATCH 5/6] Make posted time not nullable --- openapi/components/schemas/Dispute.yaml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/openapi/components/schemas/Dispute.yaml b/openapi/components/schemas/Dispute.yaml index cff272831e..a9c2e57f24 100644 --- a/openapi/components/schemas/Dispute.yaml +++ b/openapi/components/schemas/Dispute.yaml @@ -85,9 +85,7 @@ properties: - unknown postedTime: description: Date and time when the dispute is posted. - type: - - 'string' - - 'null' + type: string format: date-time deadlineTime: description: |- From 5ef7653d3477a5b65341ea61583a34eff880f9cb Mon Sep 17 00:00:00 2001 From: Alexander Shkarpetin Date: Wed, 6 Dec 2023 02:19:05 +0600 Subject: [PATCH 6/6] Rollback reason codes --- openapi/components/requestBodies/Dispute.yaml | 176 +++++++++++++++++- 1 file changed, 172 insertions(+), 4 deletions(-) diff --git a/openapi/components/requestBodies/Dispute.yaml b/openapi/components/requestBodies/Dispute.yaml index fa3f0e7d89..5625c04b10 100644 --- a/openapi/components/requestBodies/Dispute.yaml +++ b/openapi/components/requestBodies/Dispute.yaml @@ -9,6 +9,7 @@ content: - postedTime - type - status + - reasonCode properties: transactionId: description: ID of the disputed transaction. @@ -31,10 +32,177 @@ content: - 'null' reasonCode: description: Code used in the chargeback that describes the reason for the dispute. - type: - - 'string' - - 'null' - maxLength: 255 + type: string + enum: + - '0' + - '00' + - '1' + - '2' + - '3' + - '4' + - '5' + - '6' + - '7' + - '8' + - '9' + - '10.1' + - '10.2' + - '10.3' + - '10.4' + - '10.5' + - '11.1' + - '11.2' + - '11.3' + - '12' + - '12.1' + - '12.2' + - '12.3' + - '12.4' + - '12.5' + - '12.6' + - '12.7' + - '13.1' + - '13.2' + - '13.3' + - '13.4' + - '13.5' + - '13.6' + - '13.7' + - '13.8' + - '13.9' + - '30' + - '31' + - '34' + - '35' + - '37' + - '40' + - '41' + - '42' + - '46' + - '47' + - '49' + - '50' + - '51' + - '53' + - '54' + - '55' + - '57' + - '59' + - '60' + - '62' + - '63' + - '70' + - '71' + - '72' + - '73' + - '74' + - '75' + - '76' + - '77' + - '78' + - '79' + - '80' + - '81' + - '82' + - '83' + - '85' + - '86' + - '93' + - '98' + - '1000' + - '2700' + - '2702' + - 'A' + - 'A01' + - 'A02' + - 'A08' + - 'AL' + - 'AP' + - 'AW' + - 'B' + - 'C02' + - 'C04' + - 'C05' + - 'C08' + - 'C14' + - 'C18' + - 'C28' + - 'C31' + - 'C32' + - 'CA' + - 'CD' + - 'CR' + - 'DA' + - 'DP' + - 'DP1' + - 'EX' + - 'F10' + - 'F14' + - 'F22' + - 'F24' + - 'F29' + - 'FR1' + - 'FR4' + - 'FR6' + - 'IC' + - 'IN' + - 'IS' + - 'LP' + - 'M01' + - 'M10' + - 'M49' + - 'N' + - 'NA' + - 'NC' + - 'P' + - 'P01' + - 'P03' + - 'P04' + - 'P05' + - 'P07' + - 'P08' + - 'P22' + - 'P23' + - 'R03' + - 'R13' + - 'RG' + - 'RM' + - 'RN1' + - 'RN2' + - 'SV' + - 'TF' + - 'TNM' + - 'UA01' + - 'UA02' + - 'UA03' + - 'UA10' + - 'UA11' + - 'UA12' + - 'UA18' + - 'UA20' + - 'UA21' + - 'UA22' + - 'UA23' + - 'UA28' + - 'UA30' + - 'UA31' + - 'UA32' + - 'UA38' + - 'UA99' + - 'bank_cannot_process' + - 'credit_not_processed' + - 'customer_initiated' + - 'debit_not_authorized' + - 'duplicate' + - 'fraudulent' + - 'general' + - 'incorrect_account_details' + - 'insufficient_funds' + - 'pre-chargeback-alert' + - 'product_not_received' + - 'product_unacceptable' + - 'subscription_canceled' + - 'unrecognized' type: description: Type of dispute. type: string