나는 우리의 새로운 지불 시스템과 우리 웹 사이트를 통합하려고합니다. 그러나 벽을 치고있다. 기본적으로 고객은 보육료를 내 웹 사이트를 통해 지불합니다. 그러나 금액은 매 달마다 변하고 각 어린이는 자녀가 참석할 것에 따라 바뀝니다. 게이트웨이 회사에서 제공 한 코드를 사용하고 있지만 입력 한 금액이 해시를 통해 전송 된 금액과 일치하지 않습니다. 따라서 웹 사이트에서 거래를 완료하지 못하게하십시오. 나는 청구 값을 반향시키고 해시 변수로 호출하려고했지만이 방법도 마음에 들지 않습니다. 나는 회사에 도움을 청했지만 그들이 할 수없는 것처럼 보인다.지불 통합
아래 코드는 아무도 도와 줄 수 있으면 감사하겠습니다. 우리의 웹 사이트
<? include("ipg-util.php"); ?>
<html>
<?php
ob_start();
echo $chargetotal;
$total = ob_get_contents($chargetotal);
ob_end_clean();
?>
<head><title>IPG Connect Sample for PHP</title></head>
<body>
<p><h1>Order Form</h1>
<form method="post" action="https://www.ipg-online.com/connect/gateway/processing">
<input type="hidden" name="txntype" value="sale">
<input type="hidden" name="timezone" value="Europe/London"/>
<input type="hidden" name="txndatetime" value="<?php echo
getDateTime() ?>"/>
<input type=”hidden” name=”hash_algorithm” value=”SHA256”/>
<input type="hidden" name="hash" value="<?php echo createHash(
$total,"826") ?>"/>
<input type="hidden" name="storename" value="Hidden"/>
<input type="hidden" name="mode" value="payonly"/>
<input type="hidden" name="paymentMethod" value="M"/>
<input type="text" name="chargetotal" value=""/>
<input type="hidden" name="currency" value="826"/>
<input type="hidden" name="responseSuccessURL" value="http://yourdomain.com/Thanks" />
<input type="hidden" name="responseFailURL" value="http://yourdomain.com/PaymentFailure" />
<input type="submit" value="Submit">
</form>
</body>
</html>
에 지불 페이지와 내가 또한 오류 페이지 결과 페이지 기본적으로
해시의 양 및 대전 량의 필요성을 포함 한 페이지
<?php
$dateTime = date("Y:m:d-H:i:s");
function getDateTime() {
global $dateTime;
return $dateTime;
}
function createHash($chargetotal, $currency) {
$storename ="Hidden";
$sharedSecret = "Hidden";
$stringToHash = $storename . getDateTime() . $chargetotal . $currency . $sharedSecret;
$ascii = bin2hex($stringToHash);
return sha1($ascii);
}
?>
포함 올바르게 생성되는 것과 동일해야합니다.
나는 chargetotal 15의 금액을 입력하고 그래서
<input type="hidden" name="hash" value="<?php echo createHash(
"15","826") ?>"/> .
그것은 그러나 우리가 모르는, 거래를 완료 할 양을 수 있도록 각 같은 해시 (15)의 양을 넣으면 사람이 지불 할 것입니다.
는 모습
HTML에서 인용 부호를 수정하면 줄무늬 인용 부호가 있어야합니다. – Barmar
예상 통화 형식을 확인하십시오. 일부 API에는 달러와 센트가 아닌 센트가 필요합니다. – rtfm