Home Backend Development PHP Tutorial The era of anti-phishing for Alipay payment development has arrived

The era of anti-phishing for Alipay payment development has arrived

Jul 29, 2016 am 09:11 AM
encrypt key query quot timestamp

After jumping to the payment page, Alipay's checkout prompts:

There is a risk of phishing in payment

Is it wrong: AE130001040

The corresponding page was found: https://cshall.alipay.com/enterprise/help_detail.htm?help_id =474059

In the place where the payment page jump is initiated, add the parameter "anti_phishing_key" and assign the value to

<code><span>'anti_phishing_key'</span> => <span>urlencode</span><span>(</span><span>$this</span>->query_timestamp<span>()),</span></code>
Copy after login

<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>
Copy after login

The above has introduced the anti-phishing era of Alipay payment development, including anti-phishing content. I hope it will be helpful to friends who are interested in PHP tutorials.

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.

Hot Article

R.E.P.O. Energy Crystals Explained and What They Do (Yellow Crystal)
2 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Repo: How To Revive Teammates
4 weeks ago By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island Adventure: How To Get Giant Seeds
3 weeks ago By 尊渡假赌尊渡假赌尊渡假赌

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What does the identity attribute in SQL mean? What does the identity attribute in SQL mean? Feb 19, 2024 am 11:24 AM

What is Identity in SQL? Specific code examples are needed. In SQL, Identity is a special data type used to generate auto-incrementing numbers. It is often used to uniquely identify each row of data in a table. The Identity column is often used in conjunction with the primary key column to ensure that each record has a unique identifier. This article will detail how to use Identity and some practical code examples. The basic way to use Identity is to use Identit when creating a table.

How SpringBoot monitors redis Key change events How SpringBoot monitors redis Key change events May 26, 2023 pm 01:55 PM

1. Function Overview Keyspace notification allows clients to receive events that modify Rediskey changes in some way by subscribing to channels or patterns. All commands that modify key keys. All keys that received the LPUSHkeyvalue[value…] command. All expired keys in the db database. Events are distributed through Redis's subscription and publishing functions (pub/sub), so all clients that support subscription and publishing functions can directly use the keyspace notification function without any modifications. Because the current subscription and publishing functions of Redis adopt a fireandforget strategy, if your program

Unpatchable Yubico two-factor authentication key vulnerability breaks the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices Unpatchable Yubico two-factor authentication key vulnerability breaks the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices Sep 04, 2024 pm 06:32 PM

An unpatchable Yubico two-factor authentication key vulnerability has broken the security of most Yubikey 5, Security Key, and YubiHSM 2FA devices. The Feitian A22 JavaCard and other devices using Infineon SLB96xx series TPMs are also vulnerable.All

How to solve the problem of batch deletion of key values ​​in redis How to solve the problem of batch deletion of key values ​​in redis May 31, 2023 am 08:59 AM

Problems encountered: During the development process, you will encounter keys that need to be deleted in batches according to certain rules, such as login_logID (ID is a variable). Now you need to delete data such as "login_log*", but redis itself only has batch query. Command keys for class key values, but there is no command for batch deletion of a certain class. Solution: Query first, then delete, use xargs to pass parameters (xargs can convert pipe or standard input (stdin) data into command line parameters), execute the query statement first, and then remove the queried key value and the original del parameters. delete. redis-cliKEYSkey* (search condition)|xargsr

How to reorder multiple columns in Power Query via drag and drop How to reorder multiple columns in Power Query via drag and drop Mar 14, 2024 am 10:55 AM

In this article, we will show you how to reorder multiple columns in PowerQuery by dragging and dropping. Often, when importing data from various sources, columns may not be in the desired order. Reordering columns not only allows you to arrange them in a logical order that suits your analysis or reporting needs, it also improves the readability of your data and speeds up tasks such as filtering, sorting, and performing calculations. How to rearrange multiple columns in Excel? There are many ways to rearrange columns in Excel. You can simply select the column header and drag it to the desired location. However, this approach can become cumbersome when dealing with large tables with many columns. To rearrange columns more efficiently, you can use the enhanced query editor. Enhancing the query

How to solve the timestamp 2038 problem of Mysql How to solve the timestamp 2038 problem of Mysql Jun 02, 2023 am 10:13 AM

The timestamp refers to the total number of seconds from 00:00:00 on January 1, 1970, Greenwich Mean Time (08:00:00 on January 1, 1970, Beijing time) to the present. Various versions of MySQL are deployed in the production environment, including three major versions of MySQL 5.5/5.6/5.7 and N minor versions. Due to the poor upward compatibility of MySQL, the same SQL behaves differently in different versions. As follows The timestamp data type is introduced in detail from several aspects. Timestamp data access In the above three major versions of MySQL, the value range of the default timestamp (Timestamp) type is’1970-01-0100:00:01&r

React Query database plug-in: how to import and export data React Query database plug-in: how to import and export data Sep 26, 2023 pm 05:37 PM

ReactQuery database plug-in: Methods to implement data import and export, specific code examples are required. With the widespread application of ReactQuery in front-end development, more and more developers are beginning to use it to manage data. In actual development, we often need to export data to local files or import data from local files into the database. In order to implement these functions more conveniently, you can use the ReactQuery database plug-in. The ReactQuery database plugin provides a series of methods

php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 php提交表单通过后,弹出的对话框怎样在当前页弹出,该如何解决 Jun 13, 2016 am 10:23 AM

php提交表单通过后,弹出的对话框怎样在当前页弹出php提交表单通过后,弹出的对话框怎样在当前页弹出而不是在空白页弹出?想实现这样的效果:而不是空白页弹出:------解决方案--------------------如果你的验证用PHP在后端,那么就用Ajax;仅供参考:HTML code

See all articles