Document Status | CLOSED |
---|---|
Document Owner(s) | |
Reviewers |
Context
Iberia proposes the inclusion of new error messages in the error detailing flow, following the established processes in stories:
Story: IBFEC-2647
Story: IBFEC-2856
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
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
Description errors
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/
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:
intl-psp-paycomet-service
We will need to map the error code:
path:
intl-psp-paycomet-service/src/errors/paycomet-error-map.ts
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.
For help, there is a list of keys that can be created in the Lokalise portal in the description error table (Lokalise key column).
Potential Challenges
N/A
💰 Cost
Describe any additional cost this solution may imply.
🎛️ Configuration
For this feature work, need to enable this feature flag: enable-rbi-error-2
📈 Metrics
Measure the number of cancellations made by the user.
🗓️ Delivery Plan
Link to the task or list of all the tasks required to deliver the solution, along with its progress.
🧑🚒 QA Plan
N/A
⚠️ Call-outs
Tip: Document here any improvement or discussion regarding the feature
Add Comment