Home > Backend Development > PHP Tutorial > 企业网银支付回调方法验签是怎么个逻辑?

企业网银支付回调方法验签是怎么个逻辑?

WBOY
Release: 2016-06-06 20:26:56
Original
1477 people have browsed it

最近用php做银行的一个购买服务的功能,用的是银行自己的企业网银接口。现在遇到个问题,
支付成功后,银行那边 还要调我写的一个回调函数,但是我写的这个总是验签失败,谁能给个例子吗?
//支付返回界面
public function receivehandle(){

<code>$file = './138/Lib/Action/Mopro/data.txt';
$check = file_get_contents("php://input");
file_put_contents($file, $check);
//处理方法
include('./index.php');
//手动载入处理方法
include("./Lib/Action/Mopro/Common/function.php");
$exs = explode('&Plain=', $check);//var_dump($exs);$this->log('line 59 ret',var_export($exs));
//分割字符串拿到两个参数
 $signature = $exs[0];
$exp = explode('Signature=',$signature);
$signature = $exp[1];
$plain =  $exs[1];
$plain = urldecode($plain);
$plain = explode('&ResponseCode=0000',$plain);
$plain = $plain[0];echo $plain.'<br>'.$Signature; exit('1');
//验签环节
$ret = srdecode($plain,$signature);
//$this->log('line 80 ret',var_export($ret));
//1:通过,0:不通过
$arrall = array();
</code>
Copy after login
Copy after login

回复内容:

最近用php做银行的一个购买服务的功能,用的是银行自己的企业网银接口。现在遇到个问题,
支付成功后,银行那边 还要调我写的一个回调函数,但是我写的这个总是验签失败,谁能给个例子吗?
//支付返回界面
public function receivehandle(){

<code>$file = './138/Lib/Action/Mopro/data.txt';
$check = file_get_contents("php://input");
file_put_contents($file, $check);
//处理方法
include('./index.php');
//手动载入处理方法
include("./Lib/Action/Mopro/Common/function.php");
$exs = explode('&Plain=', $check);//var_dump($exs);$this->log('line 59 ret',var_export($exs));
//分割字符串拿到两个参数
 $signature = $exs[0];
$exp = explode('Signature=',$signature);
$signature = $exp[1];
$plain =  $exs[1];
$plain = urldecode($plain);
$plain = explode('&ResponseCode=0000',$plain);
$plain = $plain[0];echo $plain.'<br>'.$Signature; exit('1');
//验签环节
$ret = srdecode($plain,$signature);
//$this->log('line 80 ret',var_export($ret));
//1:通过,0:不通过
$arrall = array();
</code>
Copy after login
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template