Php 无法从控制器方法传递的payumoney成功响应中获取值
我已经在我的项目中集成了payumoney支付网关,它工作正常,但是我有额外的要求,所以我想传递一个id。我得到的id是这样的“$this->input->post('id'),并将变量$plan_info分配给它,当用户点击确认按钮时,将其传递到确认页面(查看页面),付款将通过借记/网上银行进行。在成功页面中,我没有获得$plan_info值,但我将传递到确认页面 在控制器中写入的代码Php 无法从控制器方法传递的payumoney成功响应中获取值,php,codeigniter,payumoney,Php,Codeigniter,Payumoney,我已经在我的项目中集成了payumoney支付网关,它工作正常,但是我有额外的要求,所以我想传递一个id。我得到的id是这样的“$this->input->post('id'),并将变量$plan_info分配给它,当用户点击确认按钮时,将其传递到确认页面(查看页面),付款将通过借记/网上银行进行。在成功页面中,我没有获得$plan_info值,但我将传递到确认页面 在控制器中写入的代码 $product_info = 'testTransaction'; $customer_n
$product_info = 'testTransaction';
$customer_name = $this->input->post('customer_name');
$customer_email = $this->input->post('customer_email');
$customer_mobile = $this->input->post('mobile_number');
$id = $this->input->post('id');
$customer_address = $this->input->post('customer_address');
$MERCHANT_KEY = "xyz";
$SALT = "xyzxyz";
$txnid = substr(hash('sha256', mt_rand() . microtime()), 0, 20);
//optional udf values
$udf1 = '';
$udf2 = '';
$udf3 = '';
$udf4 = '';
$udf5 = '';
$hashstring = $MERCHANT_KEY . '|' . $txnid . '|' . $amount . '|' . $product_info . '|' . $customer_name . '|' . $customer_email . '|'. $udf1 . '|' . $udf2 . '|' . $udf3 . '|' . $udf4 . '|' . $udf5 . '||||||' . $SALT;
$hash = strtolower(hash('sha512', $hashstring));
$success = base_url() . 'Success';
$fail = base_url() . 'Success';
$cancel = base_url() . 'Success';
$data = array(
'mkey' => $MERCHANT_KEY,
'tid' => $txnid,
'hash' => $hash,
'amount' => $amount,
'name' => $customer_name,
'productinfo' => $product_info,
'mailid' => $customer_email,
'phoneno' => $customer_mobile,
'address' => $customer_address,
'action' => "https://test.payu.in", //for live change action
https://secure.payu.in
'sucess' => $success,
'failure' => $fail,
'cancel' => $cancel,
'plan_info'=>$id // This value which is passed to confirm page should get back in payment success response
);
$this->load->view('confirmation', $data);
在视图文件中编写的代码
<div class="card-body">
<form action="<?php echo $action; ?>/_payment" method="post" id="payuForm" name="payuForm">
<input type="hidden" name="key" value="<?php echo $mkey; ?>" />
<input type="hidden" name="hash" value="<?php echo $hash; ?>"/>
<input type="hidden" name="txnid" value="<?php echo $tid; ?>" />
<div class="form-group">
<label class="control-label">Total Payable Amount</label>
<input class="form-control" name="amount" value="<?php echo $amount; ?>" readonly/>
</div>
<div class="form-group">
<label class="control-label">Your Name</label>
<input class="form-control" name="firstname" id="firstname" value="<?php echo $name; ?>" readonly/>
</div>
<div class="form-group">
<label class="control-label">Email</label>
<input class="form-control" name="email" id="email" value="<?php echo $mailid; ?>" readonly/>
</div>
<div class="form-group">
<label class="control-label">Phone</label>
<input class="form-control" name="phone" value="<?php echo $phoneno; ?>" readonly />
</div>
<div class="form-group">
<label class="control-label"> Booking Info</label>
<input class="form-control" name="productinfo" value="<?php echo $productinfo; ?>" readonly />
<input type="hidden" class="form-control" name="plan_info" value="<?php echo $plan_info; ?>" />
</div>
<div class="form-group">
<label class="control-label">Address</label>
<input class="form-control" name="address1" value="<?php echo $address; ?>" readonly/>
</div>
<div class="form-group">
<input name="surl" value="<?php echo $sucess; ?>" size="64" type="hidden" />
<input name="furl" value="<?php echo $failure; ?>" size="64" type="hidden" />
<!--for test environment comment service provider -->
<input type="hidden" name="service_provider" value="payu_paisa" size="64" />
<input name="curl" value="<?php echo $cancel; ?> " type="hidden" />
</div>
<div class="form-group float-right">
<input type="submit" value="Pay Now" class="btn btn-success" />
</div>
</form>
</div>
在$hashstring之前分配$udf1=$id
在$data数组中传递$udf1值
$data=数组('udf1'=>$id,…)
在查看页面中添加/传递udf1值
在$hashstring之前分配$udf1=$id
在$data数组中传递$udf1值
$data=数组('udf1'=>$id,…)
在查看页面中添加/传递udf1值
我尝试了你告诉我的,但是在这样做$udf1=$id之后,获取错误校验和错误消息checksum失败;在转换为HashStringPosted value之前,“udf1”在posted value中如何?如果我将值保留在$udf1/$udf2/$udf3/$udf4中,并且当单击“立即付款”时,付款失败并获取“Checksum failed”错误我尝试了您告诉的内容,但获取错误校验和错误消息Checksum失败,在执行此操作后$udf1=$id;在转换为HashStrings之前,过帐值中的“udf1”如何?如果我将值保留在$udf1/$udf2/$udf3/$udf4中,并且当单击“立即付款”时,付款失败并获取“校验和失败”错误