diff --git a/composer.json b/composer.json index 44a5f96..4b7b1f1 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,7 @@ "brokeyourbike/base-models": "^0.3.0", "brokeyourbike/country-casts-laravel": "^0.1.0", "brokeyourbike/has-source-model": "^2.0", - "brokeyourbike/union-bank-api-client": "^0.2.2", + "brokeyourbike/union-bank-api-client": "^0.2.3", "glocurrency/middleware-blocks": "^0", "illuminate/contracts": "^8.0|^9.0", "illuminate/database": "^8.0|^9.0" diff --git a/src/Enums/TransactionStateCodeEnum.php b/src/Enums/TransactionStateCodeEnum.php index ab9db9f..6443583 100644 --- a/src/Enums/TransactionStateCodeEnum.php +++ b/src/Enums/TransactionStateCodeEnum.php @@ -28,9 +28,18 @@ public static function makeFromErrorCode(ErrorCodeEnum $errorCode): self { return match ($errorCode) { ErrorCodeEnum::SUCCESS => TransactionStateCodeEnum::PROCESSING, - ErrorCodeEnum::FORMAT_ERROR => TransactionStateCodeEnum::API_ERROR, - ErrorCodeEnum::SYSTEM_MALFUNCTION => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::PROCESSED => TransactionStateCodeEnum::PROCESSING, ErrorCodeEnum::RECIPIENT_ACCOUNT_INVALID => TransactionStateCodeEnum::RECIPIENT_ACCOUNT_VALIDATION_FAILED, + ErrorCodeEnum::FORMAT_ERROR => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::OTHERS_TYPES_OF_ERRORS => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::BENEFICIARY_AND_ORIGINAL_AMOUNT_MUST_BE_SAME => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::UNPROCESSIBLE_REQUEST => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::MISMATCHED_OR_NOT_TRANSFERABLE_CURRENCIES => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::CANNOT_TRANSFER_NGN_TO_A_NON_NGN_ACCOUNT => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::HASH_VALUE_INVALID => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::DUPLICATE_TRANSACTION_PIN => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::MERCHANT_CODE_INVALID => TransactionStateCodeEnum::API_ERROR, + ErrorCodeEnum::OTHERS_TYPES_OF_ERRORS => TransactionStateCodeEnum::API_ERROR, }; }