Treba da integrisem jednom prijatelju Nestpay sistem za placanje karticama (koristi ga Intesa), ali iz nekog razloga ne prolazi autorizacija, pa mi sistem vraca “Wrong security code”.
Testirao sam primer koji su oni dali, sve je uradjeno kako treba, ali uvek dobijam isti error.
Taj security code " $storeK" se kreira u testnom panelu i sve je to uradjeno kako treba.
Da li je neko moze da uoci u cemu je problem, ako je nekome poznato:
$orgClientId = "111111";
$orgOid = "3939393";
$storeK="xxxx";
$orgAmount = "500.00";
$orgOkUrl = "http://www.xxxxx.com/ok.php";
$orgFailUrl = "http://www.xxxxx.com/fail.php";
$orgTransactionType = "Auth";
$orgInstallment = "";
$orgRnd = microtime();
$orgRnd=str_replace(" ","",$orgRnd);
$orgCurrency = "978";
$instalment='';
$clientId = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgClientId));
$oid = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgOid));
$amount = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgAmount));
$okUrl = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgOkUrl));
$failUrl = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgFailUrl));
$transactionType = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgTransactionType));
$installment = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgInstallment));
$rnd = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgRnd));
$currency = str_replace("|", "\\|", str_replace("\\", "\\\\", $orgCurrency));
$storeKey = str_replace("|", "\\|", str_replace("\\", "\\\\", $storeK));
$plainText = $clientId . "|" . $oid . "|" . $amount . "|" . $okUrl . "|" . $failUrl . "|" .$transactionType . "|" . $rnd . "||||" . $currency . "|" . $storeKey;
$hashValue = hash('sha512', $plainText);
$hash = base64_encode (pack('H*',$hashValue));
Sve gore navedene vrednosti se salju POSTOM na definisani link
<form method="post" action="https://specific link">
<input type="submit" value="Complete Payment" />
<input type="hidden" name="clientid" value="<?php echo $orgClientId ?>">
<input type="hidden" name="ammount" value="<?php echo $orgAmount ?>">
<input type="hidden" name="oid" value="<?php echo $orgOid ?>">
<input type="hidden" name="okUrl" value="<?php echo $orgOkUrl ?>">
<input type="hidden" name="failUrl" value="<?php echo $orgFailUrl ?>">
<input type="hidden" name="trantype" value="<?php echo $orgTransactionType ?>">
<input type="hidden" name="currency" value="<?php echo $orgCurrency ?>">
<input type="hidden" name="rnd" value="<?php echo $orgRnd ?>">
<input type="hidden" name="hash" value="<?php echo $hash ?>">
<input type="hidden" name="storetype" value="3d_pay_hosting">
<input type="hidden" name="hashAlgorithm" value="ver2">
<input type="hidden" name="lang" value="en">
</form>
Sve deluje ok, ali i dalje dobijam error:
Array
(
[clientid] => 111111
[oid] => 3939393
[mdStatus] => 7
[mdErrorMsg] => Wrong security code
[ErrMsg] => Wrong security code
[Response] => Error
[ProcReturnCode] => 99
[hashAlgorithm] => ver2
[currency] => 978
[storetype] => 3d_pay_hosting