Document Status |
| ||||||
---|---|---|---|---|---|---|---|
Document Owner(s) | |||||||
Reviewers |
Table of Contents | ||
---|---|---|
|
...
The objective is to enhance error communication between the backend and frontend.
...
✅ Proposed Solution
To address these issues, we propose the creation of new error classes in the backend that will be sent to the frontend. This implementation will include specific error codes for different scenarios, such as payment cancellations, instead of using generic codes. This change will allow the frontend to display more informative and contextualized error messages, improving clarity and the overall user experience.
Backend
Info |
---|
After the solution approval, will need to update the below documents with new classes, code errors, and any important things. |
Paycomet errors: https://docs.paycomet.com/en/recursos/codigos-de-error
Iberia errors list: Sheet
Payment code errors: /wiki/spaces/RWLAPPwiki/pages/4858741214
Payment mappers: /wiki/spaces/RWLAPPwiki/pages/5001150489
...
Expand | ||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||
Expand | ||||||||||||||||||||||
| ||||||||||||||||||||||
Code Block | | |||||||||||||||||||||
|
QTD | Payment method | Paycomet Code | Public Message (Logs/Amplitude) | Error Code | Lokalise key
title error modal: | cta errorlabel button modal: | Severity | Class Error | Parent class | Documentation | ||||||||||||
1 | Card | 100 | Expired credit card |
| 103
|
| 2 | ExpiredCardError | CardError2 | Represents an error when the card has expired | ||||||||||||
2 | Card | 105 | Insufficient funds |
| 104
|
| 2 | NoFundsCardError | CardError2 | Represents an error when the card does not have enough funds in order to perform the payment | ||||||||||||
3 | Card | 127 | Invalid parameter |
| 2
| 001.001
|
| 2
| 001.001
| 2
| 001.001
| 2
| 001
| 001.
| 24 | InvalidParameterErrorDataExternalValidationError | ExternalValidationError2 | Represents an error when there is an invalid parameter | ||||
4 | Card | 137 | Credit card not valid |
| 106
|
| 2 | CardNotValidErrorDeclinedCardError | CardError2 | Represents an error when the card declined for various reasons | ||||||||||||
5 | Card | 141 | Amount zero or not validInvalid amount |
| 107
|
| 2 | AmountNotValidErrorInvalidAmountError | NoFundsCardError | Represents an error when the amount is zero or not valid | ||||||||||||
6 | Card | 143 | Authentification error |
|
| 4 | AuthenticationError | AuthSecurityError2 | Represents errors related to security and authentication within the payment system. | |||||||||||||
7 | Card | 195 | Requires SCA authentication |
|
| 4 | ScaAuthenticationError | AuthSecurityError2 | Represents an error a Strong Customer Authentication error. SCA (Strong Customer Authentication) is a requirement of the European directive PSD2 (Revised Payment Services Directive) aimed at enhancing the security of online financial transactions | |||||||||||||
8 | Card | 500 | General | PSP external error |
| 000
|
| 000
| 000
| 000
| 4 | ExternalError2 | PspError2 | RbiError2General, unspecified payment error. | ||||||||
9 | Card | 506 | Confirmation data not valid |
|
| 4 | ConfirmationDataNotValidError | ExternalError2 | Represents an error when confirmation data is not valid | |||||||||||||
10 | Card | 510 | Refund is not possible |
|
| 4 | RefundNotPossibleError | OperationDeniedError | Represents an error when the refund is not possible | |||||||||||||
11 | Card | 535513 | General | PSP external error |
| 000
|
| 000
| 000
| 000
| 4 | ExternalError2 | PspError2 | RbiError2 | GeneralGeneral, unspecified payment error. | |||||||
12 | Card | 549514 | General | PSP external error |
| 000
|
| 000
| 000
| 000
| 4 | ExternalError2 | PspError2 | RbiError2General, unspecified payment error. | ||||||||
13 | Card | 555 | Could not find the previous operation515 | General external error |
| 009.001
|
| 009.001
| 009.001
| 009.001
| 4 | CouldNotFindPreviousOperationErrorExternalError2 | DataExternalValidationError | Represents an error when could not find the previous operationPspError2 | General, unspecified payment error. | |||||||
14 | Card | 569 | Denied operation516 | General external error |
| 010
|
| 010
| 010
| 010
| 4 | OperationDeniedErrorExternalError2 | ExternalValidationError2 | Represents an error when the operation cannot be performedPspError2 | General, unspecified payment error. | |||||||
15 | Card | 1019 | Operation timeout exceeded517 | General external error |
| 011
|
| 011
| 011
| 011
| 4 | TimeOutConnectionErrorExternalError2 | ConnectionError2 | Represents an error when there is a timeoutPspError2 | General, unspecified payment error. | |||||||
16 | Card | 1026518 | Duplicated General external | referenceerror |
| .002
| .002
| .002
| .002
| 4 | DuplicatedExternalReferenceErrorExternalError2 | ExternalError2 | Represents an error when there is a duplicated external referencePspError2 | General, unspecified payment error. | ||||||||
17 | Card | 1038 | Field DS_MERCHANT_AMOUNT incorrect519 | General external error |
| 009.002
|
| 009.002
| 009.002
| 009.002
| 4 | FieldDsMerchantAmountIncorrectErrorExternalError2 | DataExternalValidationError | Represents an error when the field DS_MERCHANT_AMOUNT is incorrectPspError2 | General, unspecified payment error. | |||||||
18 | Card | 1099520 | General | PSP external error |
| 000
|
| 000
| 000
| 000
| 4 | ExternalError2 | PspError2 | RbiError2 | GeneralGeneral, unspecified payment error. | |||||||
19 | Card | 1186 | Maximum limit not allowed521 | General external error |
| 2
| 102.004
|
| 2
| 102.004
| 2
| 102.004
| 2
| 102.004
| 24 | CardLimitExceededErrorExternalError2 | PaymentRestrictionError2 | Represents an error when the card amount/number of transaction limit has been exceededPspError2 | General, unspecified payment error. | |||
20 | Card | 1191 | Day / IP address limit (all cards) not allowed522 | General external error |
| 2
| 102.004
|
| 2
| 102.004
| 2
| 102
| 004.
| 2
| 102
| 004.
| 24 | CardLimitExceededErrorExternalError2 | PaymentRestrictionError2 | Represents an error when the card amount/number of transaction limit has been exceededPspError2 | General, unspecified payment error. | |
21 | Card | 1194 | Card brands not allowed523 | General external error |
| 2.100
|
| 2.100
| 2.100
| 2.100
| 24 | CardTypeNotAllowedErrorExternalError2 | CardError2 | Represents an error when the card type (type/brand/etc.) is not allowed for this transactionPspError2 | General, unspecified payment error. | |||||||
22 | Card | 1197 | Denied. Filter: Card country issuer not allowed535 | General external error |
| 2
| 102.005
|
| 2
| 102.005
| 2
| 102.005
| 2
| 102
| 005.
| 24 | CardCountryNotAllowedExternalError2 | PaymentRestrictionError2 | Represents an error when the card / issuing bank country is not allowed for the transactionPspError2 | General, unspecified payment error. | ||
23 | Card | 1254 | Commerce with secure cardholder and cardholder without secure purchase key524 | General external error |
| 001.004
|
| 001.004
| 001
| 004.
| 001.004
| 4 | CardholderSecurePurchaseKeyErrorExternalError2 | AuthSecurityError2 | Represents an error when there is a commerce with secure cardholder and cardholder without secure purchase keyPspError2 | General, unspecified payment error. | ||||||
24 | Card | 1326 | Denial by security controls on the processor525 | General external error |
| 2
| 002
|
| 2
| 002
| 2
| 002
| 2
| 002
| 24 | FraudErrorExternalError2 | ExternalError2 | Represents errors generated when a transaction is suspected of being fraudulent. This class extends `ExternalError` to encapsulate fraud-related issues, including abnormal user behavior, suspicious transaction patterns, and other indicators of potential fraud. It is designed to aid in the identification and management of transactions that may pose a risk to the payment system | Card | 1327 | 3DS authentication process PspError2 | General, unspecified payment error. |
25 | Card | 526 | General external error |
| 2
| 101.003
|
| 2
| 101.003
| 2
| 101.003
| 2
| 101.003
| 24 | ThreeDsChallengeFailedErrorExternalError2 | PaymentProcessingError2 | Represents an error when the 3DS Challenge failed | Payment Link | 1417 | PayPal - The instrument presented has been declined. Please select another one. | PspError2 | General, unspecified payment error. |
26 | Card | 549 | General external error |
|
| 4 | ExternalError2 | PspError2 | General, unspecified payment error. | |||||||||||||
27 | Card | 555 | Could not find the previous operation |
|
| 2
| 100
| 105
| 2
| 100
| 105
| 2
| 100
| 105
| 24 | DeclinedCardErrorCouldNotFindPreviousOperationError | CardError2DataExternalValidationError | Represents an error when | the card declined for various reasons
Created classes:
AuthSecurityError
ExternalError
FraudError
PspError
ExternalValidationError
Classes will be created:
AmountNotValidError
AuthenticationError
CardCountryNotAllowed
CardLimitExceededError
CardNotValidError
CardTypeNotAllowedError
CardholderSecurePurchaseKeyError
ConfirmationDataNotValidError
CouldNotFindPreviousOperationError
DataExternalValidationError
DeclinedCardError
DuplicatedExternalReferenceError
ExpiredCardError
FieldDsMerchantAmountIncorrectError
InvalidParameterError
NoFundsCardError
OperationDeniedError
RefundNotPossibleError
ScaAuthenticationError
TimeOutConnectionError
ThreeDsChallengeFailedError
intl-packages
Will be created new classes in the path:
intl-packages/packages/psp-base/src/errors/psp-error-2/
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
|
Created classes:
AuthSecurityError
ExternalError
FraudError
PspError
ExternalValidationError
Classes will be created:
InvalidAmountError
AuthenticationError
CardCountryNotAllowed
CardLimitExceededError
DeclinedCardError
CardTypeNotAllowedError
CardholderSecurePurchaseKeyError
ConfirmationDataNotValidError
CouldNotFindPreviousOperationError
DataExternalValidationError
DeclinedCardError
DuplicatedExternalReferenceError
ExpiredCardError
NoFundsCardError
OperationDeniedError
RefundNotPossibleError
ScaAuthenticationError
TimeOutConnectionError
ThreeDsChallengeFailedError
intl-packages
Rename the class:
From: OperationCancelledError
To: OperationCancelledFailedError
Will be created new classes in the path:
intl-packages/packages/psp-base/src/errors/psp-error-2/
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Export the classes:
path:
intl-packages/packages/psp-base/src/errors/psp-error-2/index.ts
Will create the new error codes:
path:
intl-packages/packages/psp-base/src/errors/psp-error-2/psp-error-2.ts
Code Errors:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
intl-psp-paycomet-service
Will need to map the errors code:
path:
intl-psp-paycomet-service/src/errors/paycomet-error-map.ts
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Export the classes:
path:
intl-packages/packages/psp-base/src/errors/psp-error-2/index.ts
Will create the new error codes:
path:
intl-packages/packages/psp-base/src/errors/psp-error-2/psp-error-2.ts
Code Errors:
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Expand | |||||
---|---|---|---|---|---|
| |||||
|
intl-psp-paycomet-service
We will need to map the error code:
path:
intl-psp-paycomet-service/src/errors/paycomet-error-map.ts
Expand | |||||
---|---|---|---|---|---|
| |||||
|
Check the possibility of mapping errors where classes have already been created.
e.g.:
Error Messages
Paycomet | Lokalise Key | Class Error | Description | Modal Title | Modal Message | Modal CTA | Screen |
---|---|---|---|---|---|---|---|
100 |
| ExpiredCardError | Expired Card - | “Expired Card” | “Your card has expired. Please change your payment method in order to complete the transaction.” | “Change Payment Method” | |
105 |
| NoFundsCardError | Insufficient Credit to make charge - Represents an error when the card does not have enough funds in order to perform the payment | “Payment Failed” | “Your payment couldn't be processed due to an issue with your payment method. Please review your payment method or choose a different one to complete your purchase.” | “Change Payment Method” | |
127, and 1038 |
| DataExternalValidationError |
| “Payment Failed" | “Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
137, 1417, and 1425 |
| DeclinedCardError | Invalid Card - Represents an error when the card declined for various reasons
| “Payment Declined” | “You card was declined by the issuer. Please, change your payment method and try again.” | “Change Payment Method” | |
141 |
| InvalidAmountError | Zero or Invalid Quantity - Represents an error when the amount is zero or not valid | “Payment Failed” | “Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
143 |
| AuthenticationError | Authentication error - Represents errors related to security and authentication within the payment system. | “Payment Failed” | “Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
195 |
| ScaAuthenticationError | Requires SCA Authentication - Represents an error a Strong Customer Authentication error. SCA (Strong Customer Authentication) is a requirement of the European directive PSD2 (Revised Payment Services Directive) aimed at enhancing the security of online financial transactions | “Payment Declined" | “Something went wrong with this payment. Please go back and try again.” | “Go Back” | |
500, 513, 514, 515, 516, 517, 518, 519, 520, 521, 522, 523, 524, 525, 526, 535, 549 and 1099 |
| ExternalError2 | General, unspecified payment error. | “Payment Failed” | “Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
506 |
| ConfirmationDataNotValidError | Invalid Confirmation Data - Represents an error when confirmation data is not valid | “Payment Failed” | “It seems the system could not validate the data entered. Please go back and try again.” | “Go Back and Try Again” | |
510 |
| RefundNotPossibleError | Return is not possible - Represents an error when the refund is not possible | “Payment Failed” | “Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
555 |
| CouldNotFindPreviousOperationError | Represents an error when could not find the previous operation | “Payment Failed” | ““Something went wrong with this payment. Please go back and try again.” | “Go Back and Try Again” | |
569 |
| OperationDeniedError | Operation Rejected (Denied by the issuer) - Represents an error when the operation cannot be performed | “Payment Declined” | “Your payment was declined by your card issuer. Please select another payment method in order to proceed.” | "Change Payment Method” | |
1019 |
| TimeOutConnectionError | Request Timed Out - Represents an error when there is a timeout | “Request Timed Out” | “Looks like the server is taking to long to respond, please try again.” | “Go Back and Try Again” | |
1026 |
| DuplicatedExternalReferenceError | Duplicate external reference - Represents an error when there is a duplicated external reference | “Duplicated Payment” | “Duplicate transaction detected. It seems this payment has already been processed. Please check your order history or try again in a moment.” | “Go Back” | |
1185, 1186, 1187, 1188, 1189, 1190, 1191 |
| CardLimitExceededError |
| “Payment Declined" | “Your payment was declined due to security reasons. Please review your order and try again.” | "Go Back” | |
1194 |
| CardTypeNotAllowedError | Card Brand not allowed - Represents an error when the card type (type/brand/etc.) is not allowed for this transaction | “Payment Failed” | “It seems the card type you're using is not supported. Please return and select a different payment method to complete your transaction.” | “Change Payment Method” | |
1197 |
| CardCountryNotAllowed | Represents an error when the card / issuing bank country is not allowed for the transaction | “Payment Declined” | “Unfortunately, payments from different country than card issuer are not allowed on this platform. Please use a card issued in the same country or change your payment method.” | “Change Payment Method” | |
1254 |
| CardholderSecurePurchaseKeyError | Attempt to process a secure payment, and the card does not allow it. - Represents an error when there is a commerce with secure cardholder and cardholder without secure purchase key | “Payment Failed” | “The payment couldn’t be processed because your card doesn’t support secure authentication methods. Please go back and try another payment method.” | “Change Payment Method” | |
1326 |
| FraudError | Represents errors generated when a transaction is suspected of being fraudulent. This class extends `ExternalError` to encapsulate fraud-related issues, including abnormal user behavior, suspicious transaction patterns, and other indicators of potential fraud. It is designed to aid in the identification and management of transactions that may pose a risk to the payment system | “Payment Declined” | “Your payment was declined due to security reasons. Please select a new payment method and try again.” | "Change Payment Method” | |
1327 |
| ThreeDsChallengeFailedError | Denied by security reasons - Represents an error when the 3DS Challenge failed | “Payment Declined" | “Your payment was declined due to security reasons. Please select a new payment method and try again.” | "Change Payment Method” |
Out-of-scope
It is out of the scope to create the Lokalise key, since the key can be added directly to the Lokalise portal.
...