Skip to content
This repository has been archived by the owner on Dec 10, 2023. It is now read-only.

Commit

Permalink
feat: more states
Browse files Browse the repository at this point in the history
  • Loading branch information
brokeyourbike committed Nov 27, 2023
1 parent 9fd050e commit fac75de
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
13 changes: 11 additions & 2 deletions src/Enums/TransactionStateCodeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -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,

Check failure on line 42 in src/Enums/TransactionStateCodeEnum.php

View workflow job for this annotation

GitHub Actions / PHPStan (8.1)

Match arm is unreachable because previous comparison is always true.
};
}

Expand Down

0 comments on commit fac75de

Please sign in to comment.