Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. AuthSecurityError

  2. ExternalError

  3. FraudError

  4. PspError

  5. ExternalValidationError

Classes will be created:

  1. AmountNotValidErrorInvalidAmountError

  2. AuthenticationError

  3. CardCountryNotAllowed

  4. CardLimitExceededError

  5. DeclinedCardError

  6. CardTypeNotAllowedError

  7. CardholderSecurePurchaseKeyError

  8. ConfirmationDataNotValidError

  9. CouldNotFindPreviousOperationError

  10. DataExternalValidationError

  11. DeclinedCardError

  12. DuplicatedExternalReferenceError

  13. ExpiredCardError

  14. NoFundsCardError

  15. OperationDeniedError

  16. RefundNotPossibleError

  17. ScaAuthenticationError

  18. TimeOutConnectionError

  19. ThreeDsChallengeFailedError

...

  • Will be created new classes in the path:

    • intl-packages/packages/psp-base/src/errors/psp-error-2/

Expand
titleAmountNotValidError InvalidAmountError details
Code Block
languagetypescript
import { HttpStatus } from '@nestjs/common';
import { RbiPaymentErrorCodes, TPspError2 } from '../psp-error-2';
import { NoFundsCardError } from './no-founds-card-error';

export class AmountNotValidErrorInvalidAmountError extends NoFundsCardError {
  /**
   * Represents an error when the amount is zero or not valid.
   *
   * @param params - The error parameters.
   * @param [params.httpStatus] - The HTTP status code to be returned in the response.
   * @param [params.message] - A human-readable message that provides details about the payment processing issue.
   * @param [params.metadata] - Optional metadata that may include additional context or details about the error.
   * @param [params.originalError] - The original error that caused this error.
   */
  constructor(params?: TPspError2) {
    const {
      httpStatus = HttpStatus.UNPROCESSABLE_ENTITY,
      metadata,
      rbiErrorCode = RbiPaymentErrorCodes.INVALID_AMOUNT_NOT_VALID_ERROR,
    } = params ?? {};
    super({ ...params, httpStatus, metadata, rbiErrorCode });
  }
}

...

Expand
titleSpecificRbiPaymentErrorCodes details
Code Block
languagetypescript
const SpecificRbiPaymentErrorCodes = {
  ...
  INVALID_AMOUNT_NOT_VALID_ERROR: '2.100.107',
  AUTHENTICATION_ERROR: '4.001.001',
  EXPIRED_CARD_ERROR: '2.100.103',
  NO_FUNDS_CARD_ERROR: '2.100.104',
  DECLINED_CARD_ERROR: '2.100.105',
  DECLINED_CARD_ERROR: '2.100.106',
  CARD_LIMIT_EXCEEDED_ERROR: '2.102.004',
  CARD_TYPE_NOT_ALLOWED_ERROR: '2.100.006',
  CARD_COUNTRY_NOT_ALLOWED_ERROR: '2.102.005',
  SCA_AUTHENTICATION_ERROR: '4.001.002',
  THREE_DS_CHALLENGE_FAILED_ERROR: '2.101.003',
  CONFIRMATION_DATA_NOT_VALID_ERROR: '4.006.001',
  REFUND_NOT_POSSIBLE_ERROR: '4.010.001',
  COULD_NOT_FIND_PREVIOUS_OPERATION_ERROR: '4.009.001',
  DUPLICATED_EXTERNAL_REFERENCE_ERROR: '4.006.002',
  CARDHOLDER_SECURE_PURCHASE_KEY_ERROR: '4.001.003',
} as const;

...