누군가가 나를 도울 수 있기를 바란다. 나는 멍청이 다. 그래서 무지와 어리 석음에 대해 사전에 사과한다.변수가 올바르게 해싱되지 않음
카드로 지불 할 수있는 사용자를 리디렉션하려고하는데 $ 금액을 설정하는 데 문제가 있습니다. 고정 금액 ($ amount = "8000")으로 설정하면 잘 작동하지만 $ price로 설정하면 작동하지 않고 아무 것도받지 못합니다. 결국 저는 하단의 폼에 $ price를 설정하려고하지만 고정 된 양으로 설정 되어도 작동하지 않습니다. (아래 그림 참조)
도움을 주시면 감사하겠습니다. 에 다음과 같이 추가
$price = 80;
$amount = $price * 100;
, 당신은 양식을 편집 할 수 있습니다 :
<?php
//Replace these with the values you receive from Global Iris
$merchantid = "XXXXX";
$secret = "XXXXX";
//The code below is used to create the timestamp format required by Global Iris
$timestamp = strftime("%Y%m%d%H%M%S");
mt_srand((double)microtime()*1000000);
$orderid = $timestamp."-".mt_rand(1, 999);
$curr = "GBP";
$amount = $price * 100;
$price = 80;
/*-----------------------------------------------
Below is the code for creating the digital signature using the MD5 algorithm provided
by PHP. you can use the SHA1 algorithm alternatively.
*/
$tmp = "$timestamp.$merchantid.$orderid.$amount.$curr";
$md5hash = md5($tmp);
$tmp = "$md5hash.$secret";
$md5hash = md5($tmp);
?>
<!-- Prices for Global Iris -->
<br />
<br />
<form action="https://redirect.globaliris.com/epage.cgi" method=post class="select">
<input type=hidden name="MERCHANT_ID" value="<?=$merchantid?>">
<input type=hidden name="ORDER_ID" value="<?=$orderid?>">
<input type=hidden name="CURRENCY" value="<?=$curr?>">
<input type=hidden name="AMOUNT" value="<?=$amount?>">
<input type=hidden name="TIMESTAMP" value="<?=$timestamp?>">
<input type=hidden name="MD5HASH" value="<?=$md5hash?>">
<input type=hidden name="AUTO_SETTLE_FLAG" value="1">
<select name="price" id="mySelect" onchange="return show_price(this.value);">
<option value="100">Option 1 (£100)</option>
<option value="120">Option 2 (£120)</option>
<option value="115">Option 3 (£115)</option>
<option value="135">Option 4 (£135)</option>
<option value="80" >Option 5 (£80)</option>
</select>
<br />
<br />
<input type=submit value="Proceed to secure server">
</form>
<div class="java">£ <span id="price_sp"><span></div>
<script>
function show_price(price)
{
document.getElementById('price_sp').innerHTML = price;
}
</script>