Skip to content

Commit

Permalink
removed parse methods as they are not useful
Browse files Browse the repository at this point in the history
  • Loading branch information
stevro committed Jul 13, 2021
1 parent b751424 commit 7e3cac3
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 125 deletions.
5 changes: 0 additions & 5 deletions src/Responses/BaseResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,6 @@ public function setErrorCode($errorCode)
return $this;
}

public function getErrorCodeString()
{
return ErrorCodes::parseErrorCode($this->errorCode);
}

/**
* @return string
*/
Expand Down
63 changes: 0 additions & 63 deletions src/Util/ActionCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,67 +24,4 @@ class ActionCodes
const ACTION_CODE_3DS_CREQ_FAILED = 341019;
const ACTION_CODE_3DS_RREQ_UNKNOWN_STATUS = 341020;


public function parseActionCode($actionCode)
{
switch ((int)$actionCode) {
case self::ACTION_CODE_SUCCESS:
return 'Success';
break;
case self::ACTION_CODE_INACTIVE:
return 'Card inactiv. Vă rugăm activați cardul.';
break;
case self::ACTION_CODE_ISSUER_UNAVAILABLE:
return 'Emitent indisponibil.';
break;
case self::ACTION_CODE_BLOCKED_CARD:
return 'Card blocat. Vă rugăm contactați banca emitentă.';
break;
case self::ACTION_CODE_TRANSACTION_REJECTED:
return 'Tranzacție respinsă.';
break;
case self::ACTION_CODE_INVALID_CARD_EXPIRY_DATE:
return 'Dată expirare card greșită.';
break;
case self::ACTION_CODE_INVALID_CARD_CVV:
return 'CVV gresit.';
break;
case self::ACTION_CODE_INVALID_CARD:
return 'Card invalid. Acesta nu există în baza de date.';
break;
case self::ACTION_CODE_EXPIRED_CARD:
return 'Card expirat.';
break;
case self::ACTION_CODE_INVALID_ACCOUNT:
return 'Cont invalid. Vă rugăm contactați banca emitentă.';
break;
case self::ACTION_CODE_INSUFFICIENT_FUNDS:
return 'Fonduri insuficiente.';
break;
case self::ACTION_CODE_TRANSACTION_LIMIT_EXCEDED:
return 'Limită tranzacționare depășită.';
break;
case self::ACTION_CODE_INSTALLMENTS_NOT_ALLOWED:
return 'Tranzacția în rate nu este permisă cu acest card. Te rugăm să folosești un card de credit emise de Banca Transilvania.';
break;
case self::ACTION_CODE_3DS_AUTH_DECLINED:
return '3DS2 authentication is declined by Authentication Response (ARes) – issuer';
break;
case self::ACTION_CODE_3DS_AUTH_STATUS_UNKNOWN:
return '3DS2 authentication status in ARes is unknown - issuer';
break;
case self::ACTION_CODE_3DS_CREQ_CANCELLED:
return '3DS2 CReq cancelled - client';
break;
case self::ACTION_CODE_3DS_CREQ_FAILED:
return '3DS2 CReq failed - client/issuer';
break;
case self::ACTION_CODE_3DS_RREQ_UNKNOWN_STATUS:
return '3DS2 unknown status in RReq - issuer';
break;
default:
return 'Unknown';
}
}

}
35 changes: 0 additions & 35 deletions src/Util/ErrorCodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,39 +16,4 @@ class ErrorCodes
const SYSTEM_ERROR = 7;
const ORDER_BUNDLE_ERROR = 8;

public static function parseErrorCode($errorCode)
{
switch ((int)$errorCode) {
case self::SUCCESS:
return 'Nicio eroare de sistem';
break;
case self::DUPLICATED_ORDER_NUMBER:
return 'orderNumber duplicat, comanda cu numărul de comandă dat este deja procesată';
break;
case self::UNKNOWN_CURRENCY:
return 'Valută necunoscută';
break;
case self::MISSING_REQUIRED_PARAMETERS:
return 'Parametrul solicitării obligatorii nu a fost specificat';
break;
case self::INVALID_REQUEST_PARAMETER:
return 'Valoare eronată a unui parametru din solicitare';
break;
case self::SYSTEM_ERROR:
return 'Eroare de sistem';
break;
case self::ORDER_BUNDLE_ERROR:
return 'Eroare in orderbundle';
break;
case self::ORDER_ID_NOT_REGISTERED:
return 'Order ID nerecunoscut';
case self::ORDER_REJECTED:
return 'Comanda respinsa';
case self::UNKNOWN:
default:
return 'Unknown';
break;
}
}

}
22 changes: 0 additions & 22 deletions src/Util/OrderStatuses.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,4 @@ class OrderStatuses
const STATUS_AUTH_ACS_INIATED = 5;
const STATUS_AUTH_DECLINED = 6;

public static function parseOrderStatus($orderStatus)
{
switch ($orderStatus) {
case self::STATUS_REGISTERED_BUT_NOT_PAID:
return 'Order registered, but not paid off';
case self::STATUS_PRE_AUTH_HELD:
return 'Pre-authorization amount was held (for two-phase payment)';
case self::STATUS_DEPOSITED_SUCCESSFULLY:
return 'The amount was deposited successfully';
case self::STATUS_AUTH_REVERSED:
return 'Authorization reversed';
case self::STATUS_REFUNDED:
return 'Transaction was refunded';
case self::STATUS_AUTH_ACS_INIATED:
return "Authorization through the issuer's ACS initiated.";
case self::STATUS_AUTH_DECLINED:
return "Authorization declined";
default:
return 'Unknown';
}
}

}

0 comments on commit 7e3cac3

Please sign in to comment.