跳到付款頁面後,支付寶的收銀台提示:
支付存在釣魚風險
錯誤嗎:AE130001040
找到了對應頁面:https://cshall.alipay.com/enterprise/help_detail.htm?helpidid =474059
在發起支付頁面跳轉的地方,增加參數“anti_phishing_key”,賦值為
<code><span>'anti_phishing_key'</span> => <span>urlencode</span><span>(</span><span>$this</span>->query_timestamp<span>()),</span></code>
<code><span>/**</span><span> * 用于<strong>防钓鱼</strong>,调用接口query_timestamp来获取时间戳的处理函数</span><span> * 注意:该功能PHP5环境及以上支持,因此必须服务器、本地电脑中装有支持DOMDocument、SSL的PHP配置环境。建议本地调试时使用PHP开发软件</span><span> * return 时间戳字符串</span><span> */</span><span>private</span><span>function</span> query_timestamp<span>()</span> { <span>$url</span> = <span>$this</span>->alipay_gateway_new . <span>"service=query_timestamp&partner="</span> . <span>trim</span><span>(</span><span>strtolower</span><span>(</span><span>$this</span>->payment<span>[</span><span>'payment_config'</span><span>][</span><span>'alipay_partner'</span><span>]))</span> . <span>"&_input_charset="</span> . <span>trim</span><span>(</span><span>strtolower</span><span>(</span><span>CHARSET</span><span>));</span><span>$encrypt_key</span> = <span>""</span><span>;</span><span>$doc</span> = <span>new</span><span>DOMDocument</span><span>();</span><span>$doc</span>->load<span>(</span><span>$url</span><span>);</span><span>$itemEncrypt_key</span> = <span>$doc</span>->getElementsByTagName<span>(</span><span>"encrypt_key"</span><span>);</span><span>$encrypt_key</span> = <span>$itemEncrypt_key</span>->item<span>(</span><span>0</span><span>)</span>->nodeValue<span>;</span><span>return</span><span>$encrypt_key</span><span>;</span> }</code>
以上就介紹了支付寶支付開發的防釣魚的時代已經到來,包括了防釣魚方面的內容,希望對PHP教程有興趣的朋友有所幫助。