支付宝支付开发的防垂钓的时代已经到来

WBOY
Release: 2016-06-13 12:27:56
Original
1291 people have browsed it

支付宝支付开发的防钓鱼的时代已经到来

跳转到支付页面后,支付宝的收银台提示:

支付存在钓鱼风险

错误吗:AE130001040

找到了相应页面:https://cshall.alipay.com/enterprise/help_detail.htm?help_id=474059

在发起支付页面跳转的地方,增加参数“anti_phishing_key”,赋值为

'anti_phishing_key' => urlencode($this->query_timestamp()),
Copy after login

/**     * 用于防钓鱼,调用接口query_timestamp来获取时间戳的处理函数     * 注意:该功能PHP5环境及以上支持,因此必须服务器、本地电脑中装有支持DOMDocument、SSL的PHP配置环境。建议本地调试时使用PHP开发软件     * return 时间戳字符串     */    private function query_timestamp($partner) {        $url = $this->gateway_new . "service=query_timestamp&partner=" . trim(strtolower($partner) . "&_input_charset=" . trim(strtolower('UTF-8'));        $encrypt_key = "";        $doc = new DOMDocument();        $doc->load($url);        $itemEncrypt_key = $doc->getElementsByTagName("encrypt_key");        $encrypt_key = $itemEncrypt_key->item(0)->nodeValue;        return $encrypt_key;    }
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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!