Document Status | IN PROGRESS |
---|---|
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
Payment method | Paycomet Code | Public Message (Logs/Amplitude) | Error Code | Class Error | Documentation |
Card | 100 | Expired credit card |
| ExpiredCardError | Represents an error when the card has expired |
Card | 105 | Insufficient funds |
| NoFundsCardError | Represents an error when the card does not have enough funds in order to perform the payment |
Card | 127 | Invalid parameter |
| InvalidParameterError | Represents an error when there is an invalid parameter |
Card | 137 | Credit card not valid |
| CardNotValidError | Represents an error when the card declined for various reasons |
Card | 141 | Amount zero or not valid |
| AmountNotValidError | Represents an error when the amount is zero or not valid |
Card | 143 | Authentification error |
| AuthenticationError | Represents errors related to security and authentication within the payment system. |
Card | 195 | Requires SCA authentication |
| ScaAuthenticationError | 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 |
Card | 500 | General PSP error |
| PspError2 | General, unspecified payment error. |
Card | 506 | Confirmation data not valid |
| ConfirmationDataNotValidError | Represents an error when confirmation data is not valid |
Card | 510 | Refund is not possible |
| RefundNotPossibleError | Represents an error when the refund is not possible |
Card | 535 | General PSP error |
| PspError2 | General, unspecified payment error. |
Card | 549 | General PSP error |
| PspError2 | General, unspecified payment error. |
Card | 555 | Could not find the previous operation |
| CouldNotFindPreviousOperationError | Represents an error when could not find the previous operation |
Card | 569 | Denied operation |
| OperationDeniedError | Represents an error when the operation cannot be performed |
Card | 1019 | Operation timeout exceeded |
| TimeOutConnectionError | Represents an error when there is a timeout |
Card | 1026 | Duplicated external reference |
| DuplicatedExternalReferenceError | Represents an error when there is a duplicated external reference |
Card | 1038 | Field DS_MERCHANT_AMOUNT incorrect |
| FieldDsMerchantAmountIncorrectError | Represents an error when the field DS_MERCHANT_AMOUNT is incorrect |
Card | 1099 | General PSP error |
| PspError2 | General, unspecified payment error. |
Card | 1186 | Maximum limit not allowed |
| CardLimitExceededError | Represents an error when the card amount/number of transaction limit has been exceeded |
Card | 1191 | Day / IP address limit (all cards) not allowed |
| CardLimitExceededError | Represents an error when the card amount/number of transaction limit has been exceeded |
Card | 1194 | Card brands not allowed |
| CardTypeNotAllowedError | Represents an error when the card type (type/brand/etc.) is not allowed for this transaction |
Card | 1197 | Denied. Filter: Card country issuer not allowed |
| CardCountryNotAllowed | Represents an error when the card / issuing bank country is not allowed for the transaction |
Card | 1254 | Commerce with secure cardholder and cardholder without secure purchase key |
| CardholderSecurePurchaseKeyError | Represents an error when there is a commerce with secure cardholder and cardholder without secure purchase key |
Card | 1326 | Denial by security controls on the processor |
| 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 |
Card | 1327 | 3DS authentication process error |
| ThreeDsChallengeFailedError | Represents an error when the 3DS Challenge failed |
Payment Link | 1417 | PayPal - The instrument presented has been declined. Please select another one. |
| DeclinedCardError | 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
New classes to be created
Class name | Parent class | Severity | Description |
---|---|---|---|
AmountNotValidError | NoFundsCardError | 2 | The amount is zero or not valid |
AuthenticationError | AuthSecurityError | 4 | The user cannot be authenticated |
CardCountryNotAllowed | PaymentRestrictionError | 2 | The card / issuing bank country is not allowed for the transaction. |
CardLimitExceededError | PaymentRestrictionError | 2 | The card amount/number of transaction limit has been exceeded |
CardNotValidError | CardError | 2 | The card declined for various reasons |
CardTypeNotAllowedError | CardError | 2 | The card type (type/brand/etc.) is not allowed for this transaction |
CardholderSecurePurchaseKeyError | AuthSecurityError | 4 | There is a commerce with secure cardholder and cardholder without secure purchase key |
ConfirmationDataNotValidError | ExternalError | 4 | Confirmation data not valid |
CouldNotFindPreviousOperationError | DataExternalValidationError | 4 | Could not find the previous operation |
DataExternalValidationError | ExternalValidationError | 4 | The data sent to the PSP is not correct. It might have missing or incorrect parameters |
DeclinedCardError | CardError | 2 | The card declined for various reasons |
DuplicatedExternalReferenceError | ExternalError | 4 | There is a duplicated external reference |
ExpiredCardError | CardError | 2 | The card has expired |
FieldDsMerchantAmountIncorrectError | DataExternalValidationError | 4 | The field DS_MERCHANT_AMOUNT is incorrect |
InvalidParameterError | ExternalValidationError | 2 | There is an invalid parameter |
NoFundsCardError | CardError | 2 | The card does not have enough funds in order to perform the payment |
OperationDeniedError | ExternalValidationError | 4 | The operation cannot be performed |
RefundNotPossibleError | OperationDeniedError | 4 | A refund is not possible |
ScaAuthenticationError | AuthSecurityError | 4 | An error a Strong Customer Authentication error.
|
TimeOutConnectionError | ConnectionError | 4 | An error when the 3DS Challenge failed |
ThreeDsChallengeFailedError | PaymentProcessingError | 2 | An error when there is a timeout |
intl-packages
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
Will need to map the errors code:
path:
intl-psp-paycomet-service/src/errors/paycomet-error-map.ts
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