ThinkPhp支付宝验证失败

原因是因为thinkphp会在post时多带一个参数_URL_
把它给过滤就好了
修改alipay_core.function.php

/**
 * 除去数组中的空值和签名参数
 * @param $para 签名参数组
 * return 去掉空值与签名参数后的新签名参数组
 
function paraFilter($para) {
	$para_filter = array();
	while (list ($key, $val) = each ($para)) {
		if($key == "sign" || $key == "sign_type" || $val == "")continue;
		else	$para_filter[$key] = $para[$key];
	}
	return $para_filter;
}
*/
function paraFilter($para) {
 
    $para_filter = array();
 
    foreach ($para as $key => $val) {
 
        if($key == "sign" || $key == "sign_type" || $key == "_URL_" || $val == "")continue;
        else    $para_filter[$key] = $para[$key];
    }
    return $para_filter;
}

Related posts:

Leave a Reply

Your email address will not be published.