【问题标题】:How to fix payu biz integration error in codeigniter如何修复 codeigniter 中的 payu biz 集成错误
【发布时间】:2017-07-23 10:26:50
【问题描述】:

如何修复 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>

当我提交用于测试付款的表单时,它给了我一些散列错误和散列而不是数组。

【问题讨论】:

    标签: codeigniter payumoney


    【解决方案1】:

    在 $SALT 之前,您使用了八个 '|'这是不正确的。

    用户六'|'并且金额应该是浮动的(至少两位小数 ) 值 例如:2000.00

    我希望这会奏效。

    【讨论】:

    • 如果 udf 变量为空,则删除它们。用 $hashstring = 'gtKFFx' 替换散列。 '|' . $txnid 。 '|' . '2000' 。 '|' . 'sdfsdgfsgsfgdfgfsgfdgsd' 。 '|' . '苏曼' 。 '|' . 'suman@weborbit.in' .||||||||||| $盐;
    【解决方案2】:

    使用下面的代码作为哈希参数:

    $hashdata = ($key."|".$txnid."|".$amount."|".$productinfo."|".$firstname."|".$email."|||||||||||".$salt);
    $hash = strtolower(hash("sha512", $hashdata));
    

    【讨论】:

      猜你喜欢
      • 2017-09-05
      • 2020-03-27
      • 1970-01-01
      • 2020-12-13
      • 2016-11-09
      • 2012-07-02
      • 2017-05-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多