如何修复 payu 支付网关集成散列错误。这是我的控制器代码。
$txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
$data['tid'] = $txnid;
$SALT = 'eCwWELxi';
$udf1 = '';
$udf2 = '';
$udf3 = '';
$udf4 = '';
$udf5 = '';
$hashstring = 'gtKFFx' . '|' . $txnid . '|' . '2000' . '|' . 'sdfsdgfsgsfgdfgfsgfdgsd' . '|' . 'suman' . '|' . 'suman@weborbit.in' . '|' . $udf1 . '|' . $udf2 . '|' . $udf3 . '|' . $udf4 . '|' . $udf5 . '||||||||' . $SALT;
$hash = strtolower(hash('sha512', $hashstring));
$data['hash'] = $hash;
$this->load->view('booking_form_view', $data);
这是我的表格。
<form method="POST" name="payuForm" action="https://test.payu.in/_payment">
<input type="hidden" name="key" value="gtKFFx" />
<input type="text" name="hash" value="<?= @$hash; ?>"/>
<input type="text" name="txnid" value="<?php echo $tid; ?>" />
<input type="hidden" name="service_provider" value="" size="64" />
<tr>
<td>Amount <span class="mand">*</span>: </td>
<td><input name="amount" type="number" value="2000" /></td>
<td>First Name <span class="mand">*</span>: </td>
<td><input type="text" name="firstname" id="firstname" value="suman" /></td>
</tr>
<tr>
<td>Email <span class="mand">*</span>: </td>
<td><input type="email" name="email" id="email" value="suman@gmail.com" /></td>
<td>Phone <span class="mand">*</span>: </td>
<td><input type="text" name="phone" value="7047752176" /></td>
</tr>
<tr>
<td>Product Info <span class="mand">*</span>: </td>
<td colspan="3"><textarea name="productinfo">sdfsdgfsgsfgdfgfsgfdgsd</textarea></td>
</tr>
<tr>
<td>Success URL <span class="mand">*</span>: </td>
<td colspan="3"><input type="text" name="surl" value="<?= site_url('test/success'); ?>" size="64" /></td>
</tr>
<tr>
<td>Failure URL <span class="mand">*</span>: </td>
<td colspan="3"><input type="text" name="furl" value="<?= site_url('test/fail'); ?>" size="64" /></td>
</tr>
<button type="submit" id="test"></button>
</form>