我正在codeigniter和集成payumeoney支付網關。在這裏我有一個註冊表單,並在表單中有各種領域現在我在做什麼我想要添加payumoney支付網關,但問題是,當我添加從我自己寫入fname或金額它工作正常,但是當我使用$這個 - >輸入 - >後( 'FIRST_NAME')它顯示錯誤,如以下 click to view the image (Here is the error in the image)Payumoney錯誤,同時集成codeigniter
下面是數據變量 the values for data array
我的代碼如下:
function checkout() {
$this->load->config('payu');
$MERCHANT_KEY = $this->config->item('MERCHANT_KEY');
$SALT = $this->config->item('SALT');
$PAYU_BASE_URL = $this->config->item('PAYU_BASE_URL');
$action = '';
$txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
$udf1 = '';
$udf2 = '';
$udf3 = '';
$udf4 = '';
$udf5 = '';
$amount = $this->input->post('corporate_plan_rate');
$productinfo = 'test';
$fname = $this->input->post('user_name');
$email = $this->input->post('user_email');
$data = array(
'mkey' => $MERCHANT_KEY,
'tid' => $txnid,
'MERCHANT_KEY'=>$MERCHANT_KEY,
'txnid'=>$txnid,
'SALT'=>$SALT,
// 'hash' => $hash,
'amount' => $amount,
'pinfo' => $productinfo,
'name' => $fname,
'productinfo'=>$productinfo,
'mailid' => $email,
'phoneno' => '9646403748',
'udf1' => $udf1,
'udf2' => $udf2,
'udf3' => $udf3,
'udf4' => $udf4,
'udf5' => $udf5,
);
$this->load->view('payu/checkout.php', $data);
}
,這裏是我的查看頁面:
<html>
<head>
<!--<script src="//code.jquery.com/jquery.min.js"></script>-->
<script>
// $(function() {
// setTimeout(function() {
// $('form').submit();
// }, 2000)
// });
</script>
</head>
<body>
<?php
$hashstring = $MERCHANT_KEY . '|' . $txnid . '|' . $amount . '|' . $productinfo . '|' . $name . '|' . $mailid . '|' . $udf1 . '|' . $udf2 . '|' . $udf3 . '|' . $udf4 . '|' . $udf5 . '||||||' . $SALT;
$hash = strtolower(hash('sha512', $hashstring));
?>
<h2>PayU Form</h2>
<br/>
<form method="post" name="payuForm" action="https://test.payu.in/_payment">
<input name="key" type="hidden" value="<?php echo $mkey ?>" />
<input name="txnid" type="hidden" value="<?php echo $tid ?>" />
<input type="hidden" name="hash" value="<?php echo $hash ?>"/>
<input name="amount" type="hidden" value="<?php echo $amount; ?>" />
<input name="productinfo" type="hidden" value="<?php echo $pinfo; ?>">
<input type="hidden" name="service_provider" value="payu_paisa" size="64" />
<input name="udf1" type="hidden" value="">
<input name="udf2" type="hidden" value="">
<input name="udf3" type="hidden" value="">
<input name="udf4" type="hidden" value="">
<input name="udf5" type="hidden" value="">
<input name="firstname" id="firstname" type="hidden" value="<?php echo $name; ?>"/>
<input name="email" id="email" type="hidden" value='<?php echo $mailid; ?>'>
<input name="phone" type="hidden" value="<?php echo $phoneno; ?>">
<input name="surl" type="hidden" value="<?php echo base_url('payu/success'); ?>" size="64" />
<input name="furl" type="hidden" value="<?php echo base_url('payu/cancel'); ?>" size="64" />
<input name="curl" type="hidden" value="<?php echo base_url('payu/cancel'); ?>" />
<input type="submit" name="submit_form" value="Click Here for Payment" class="btn btn-info btn-block" >
</form>
</body>
</html>
請幫我找出問題並解決它..感謝名單
當我在測試網址中使用原始商戶密鑰和鹽時,我從payumoney方得到了同樣的錯誤消息。所以我強烈建議你重新檢查你的商家密鑰和鹽。如果這不是你的問題,你可以發佈print_r($ data)值和問題。如果您希望發佈,您可以刪除商家密鑰,鹽和其他敏感信息。 –
好吧,只用於測試帳戶。所以我發佈了$ data –
嗨,詹姆斯我已經添加了print_r($ data)。請檢查我正在使用codeiginter –