Skip to content

Commit

Permalink
Merge pull request #51 from nuryagdym/garanti-pos-fixes
Browse files Browse the repository at this point in the history
GarantiPos.php quick fix issue #50
  • Loading branch information
nuryagdym authored Jan 6, 2022
2 parents a55163c + ed946af commit 274aaa0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/Gateways/GarantiPos.php
Original file line number Diff line number Diff line change
Expand Up @@ -699,7 +699,7 @@ protected function map3DPayResponseData($raw3DAuthResponseData)
$procReturnCode = $raw3DAuthResponseData['procreturncode'];

$transactionSecurity = 'MPI fallback';
if (in_array($raw3DAuthResponseData['mdstatus'], [1, 2, 3, 4])) {
if (in_array($raw3DAuthResponseData['mdstatus'], [1, 2, 3, 4]) && $raw3DAuthResponseData['response'] !== $response) {
if ($raw3DAuthResponseData['mdstatus'] == '1') {
$transactionSecurity = 'Full 3D Secure';
} elseif (in_array($raw3DAuthResponseData['mdstatus'], [2, 3, 4])) {
Expand All @@ -722,9 +722,9 @@ protected function map3DPayResponseData($raw3DAuthResponseData)
'transaction_security' => $transactionSecurity,
'proc_return_code' => $procReturnCode,
'code' => $procReturnCode,
'md_status' => $raw3DAuthResponseData['mdStatus'],
'md_status' => $raw3DAuthResponseData['mdstatus'],
'status' => $status,
'status_detail' => isset($this->codes[$raw3DAuthResponseData['ProcReturnCode']]) ? (string) $raw3DAuthResponseData['ProcReturnCode'] : null,
'status_detail' => isset($this->codes[$raw3DAuthResponseData['procreturncode']]) ? (string) $raw3DAuthResponseData['procreturncode'] : null,
'hash' => (string) $raw3DAuthResponseData['secure3dhash'],
'rand' => (string) $raw3DAuthResponseData['rnd'],
'hash_params' => (string) $raw3DAuthResponseData['hashparams'],
Expand All @@ -736,13 +736,13 @@ protected function map3DPayResponseData($raw3DAuthResponseData)
'eci' => (string) $raw3DAuthResponseData['eci'],
'cavv' => (string) $raw3DAuthResponseData['cavv'],
'xid' => (string) $raw3DAuthResponseData['xid'],
'error_code' => (string) $raw3DAuthResponseData['errcode'],
'error_code' => (string) isset($raw3DAuthResponseData['errcode'])?$raw3DAuthResponseData['errcode']:null,
'error_message' => (string) $raw3DAuthResponseData['errmsg'],
'md_error_message' => (string) $raw3DAuthResponseData['mderrormessage'],
'campaign_url' => null,
//'name' => (string) $raw3DAuthResponseData['firmaadi'],
'email' => (string) $raw3DAuthResponseData['customeremailaddress'],
'extra' => $raw3DAuthResponseData['Extra'],
'extra' => $raw3DAuthResponseData['Extra'] ?? null,
'all' => $raw3DAuthResponseData,
];
}
Expand Down

0 comments on commit 274aaa0

Please sign in to comment.