如何在Payu Money中手动设置货币

时间:2018-10-24 11:13:46

标签: php payment-gateway payumoney

我想在金额字段中将钱设置为固定金额。我尝试了此操作,但是在进入payumoney付款页面后收到错误消息。错误是金额无效和校验和错误

第1页

   <?php $myVariable1 = "2";?>

  <form action="http://nailspaexperience.com/old-manish/App_Data/" method="post">
                    <p>£42.00</p>
                    <input type="hidden" name="textarea1" value="<?php echo $myVariable1; ?>">
                    <button type="submit">Submit</button>
                </form>



  Page 2 

 session_start(); // needs to be before anything else on page to use 
$_SESSION
  // this page outputs the textarea1 from the session IF it exists
  $textarea1 = "2"; // set var to avoid errors
  if(isset($_SESSION['textarea1'])){
    $textarea1 = $_SESSION['textarea1'];
  }



  <div  class="form-input">
  <label>Amount: </label>
   <input name="textarea1" placeholder="Enter amount" value="<?php echo $textarea1; ?>" />
</div>

1 个答案:

答案 0 :(得分:1)

    For payu money, they have defined parameters with defined input names.
    Replace your name="textarea" to name="amount" and try.

    Let me know still your facing the issue.

    Updated Answer

     $posted['key'] = $MERCHANT_KEY;
        $posted['txnid'] = $txnid;
        $posted['amount'] = 100;
        $posted['firstname'] = 'Bhushan';
        $posted['lastname'] = Lunkad;
        $posted['email'] = 'Your email';
        $posted['phone'] = 'mobile';
        $posted['productinfo'] = 'Product info";
``      $posted['surl'] = 'success url';
        $posted['furl'] = 'failure url';
$hashSequence = "key|txnid|amount|productinfo|firstname|email|udf1|udf2|udf3|udf4|udf5|udf6|udf7|udf8|udf9|udf10";

    $hashVarsSeq = explode('|', $hashSequence);
    $hash_string = '';
    foreach ($hashVarsSeq as $hash_var)
    {
        $hash_string .= isset($posted[$hash_var]) ? $posted[$hash_var] : '';
        $hash_string .= '|';
    }
    $hash_string .= $SALT;
    $hash = strtolower(hash('sha512', $hash_string));

Hope it helps you.