preface
In the domestic environment, the majority of personal sites and applications, because of business development needs, often need to apply for personal qualifications to connect with wechat and Alipay payment channels. However, now both wechat and Alipay only support the subject with enterprise qualifications to apply for interface docking, for individual developers, the road has been completely blocked. But while the devil climbs a foot higher, clever and industrious Chinese have come up with many ways to get around these restrictions. This paper mainly analyzes the current operable two methods for the reference of the decision.
1. Approved amount
The principle of
Alipay on Android will pop up a notification message of receiving XX yuan in the application bar when receiving the payment message. This notification message can be obtained programmatically. You only need to listen to the user’s notification bar message, determine whether it is a notification from Alipay, and then parse the amount in it, and you have the basis of a customized callback interface.
Imagine such A scenario: the user on the web site launched A $100 payment, then the collection qr code in the website backstage to present 100 yuan (the qr code can be generated in advance in the background), the user after the success of the payment, in the business of mobile terminal, monitoring by the program to pay treasure to received orders for 100 yuan, and then back to the site. Ok, you can continue with the subsequent flow and callback logic.
If the scenario is more complicated, then at the same time, another user B also initiates a payment of 100 yuan, which may not have been paid. At the same time, the merchant mobile terminal detected an order of 100 yuan and made a callback. Because only the amount information, the website background can not distinguish the 100 yuan order, whether it belongs to user A, or user B, all of A sudden chaos. When it comes to money, it’s a big deal, so I guess users are gonna blow up.
This kind of concurrent scenario can be solved by a very simple technique, that is, when multiple users initiate the payment of the same amount, the two-dimensional code of different amount will be presented to different users. For example, in the above scenario, user A presents A QR code of 100 yuan, at the same time user B initiates A payment request of 100 yuan, then presents A PAYMENT QR code of 99.99 yuan, user C again, presents A payment QR code of 99.98 yuan, and so on. In this way, mobile devices can detect different amounts of money, and thus have the ability to distinguish between orders and users by amount.
advantages
- Simple principle, simple implementation.
- The account is relatively safe and there is no risk of alipay risk control.
disadvantages
The disadvantages of the above method of implementing callbacks by different amounts are obvious, to name a few:
- Only Alipay is supported. Wechat’s mobile notification messages do not contain information on the amount of money, so this method has stalled.
- Since orders and users are differentiated by amount, qr codes for collection need to be uploaded in advance, including a large number of up and down QR codes for concurrent scenarios. For sites and applications with a lot of pricing, this can be a significant amount of work.
- Not conducive to pricing adjustment. Each pricing adjustment, need to upload a large number of collection TWO-DIMENSIONAL code.
- Arbitrary amounts are not supported. Or because we need to upload the qr code in advance.
On behalf of
The payment interface callback is realized by differentiating order and user by amount. Due to its simple principle and low implementation cost, there are a large number of payment interface platforms based on this principle in the market. The list is as follows:
1.paysapi
Comments: PaysAPI official website mentions support wechat. In fact, it is achieved by uploading a wechat TWO-DIMENSIONAL code of any amount. That is, after users initiate payment, they need to input the payment amount with human flesh, which is relatively poor in experience.
2.goddpay
Comments: PaysAPI’s website is the same.
3. Payment
Comments: no
2. Mobile terminal hook
The principle of
Mobile terminal Android platform is a relatively open platform. Almost all the software we run can customize its behavior by means of low-level programming hook. For example, wechat message anti-recall, shake dice draw cheating, automatic grab red envelope, and alipay balance & level custom installation force and other functions, are through such as Xposed, VirtualXposed hook framework technology programming.
Similarly, the qr code of wechat and Alipay is automatically generated, including the message detection of successful payment. It can also be programmed by hook. The general process is as follows:
The user initiates the order payment request, and then the mobile terminal hook software detects the payment request and obtains the amount and platform (wechat or Alipay) information. Call the relevant software, inject the relevant TWO-DIMENSIONAL code generation behavior, OK, the two-dimensional code generation success of the relevant amount, and then display to the user.
After the user makes a successful payment, the relevant payment success information will be detected in both wechat and Alipay. Mobile terminal hook software can also be detected. And then the callback. After that, business systems process process logic.
disadvantages
- Need to install mobile hook framework, such as Xposed, VirtualXposed and so on. Among them, xposed software, also requires the system must root.
- Security risks exist. Because hook software can monitor the software behaviors of wechat and Alipay, including your password information, there are certain security risks.
- The account may be controlled by risks. Both wechat and Alipay have zero tolerance for the customization of their own software.
advantages
- Compared with the above method of callback by amount, this method has obvious advantages, that is, it does not need to upload a large number of QR codes in advance, and supports payment processing of any amount.
- It also supports wechat and Alipay.
- Concurrency, can be relatively high.
On behalf of
It has high requirements for software developers to implement payment interface callback based on hook. Therefore, there are few relevant solutions, which are listed as follows:
- Micron rich
Comment: Based on VirtualXposed. Although the site is almost identical to PaySAPI, interface callbacks are implemented in a very different way. In addition, micronefu has another special feature, that is, it has a built-in micro Web server in the mobile terminal hook software, which can directly receive and process users’ payment requests. This also leads to several problems, one is limited to the performance of the mobile web server, concurrent processing, there are certain limitations. Second, the adjustment and definition of payment page need to modify the mobile code. Third, the software configuration process is complex (web server proxy related configuration).
- greenyep
Comment: Based on VirtualXposed. There are some subtle differences between GreenYep and micron. It does not have a built-in Web server in the mobile terminal hook software, but adopts the method of periodic detection to detect the order information in the background service. The advantage of doing so is that there can be a centralized platform to do the scheduling and statistics of orders, and the performance is also better than the way of built-in Web server, there is a certain improvement. Disadvantages are also obvious, it is not convenient to distribute software, do some private deployment.
advice
- If the payment scenario of the site and application is relatively simple and there is no strong demand for wechat payment, platforms such as PaysAPI can be considered to realize interface callback through amount differentiation.
- If you are sensitive to security and risk, paysAPI and other platforms are also recommended.
- If the payment scenario is complex and needs to support any amount, and both wechat and Alipay channels are required, platforms such as Micron-Fu and GreenYEP can be considered.
- If yes, greenYEP platform can be considered if system stability and concurrency are required.
- If you want the convenience of private deployment, consider micron rich platform.
Regular channel category
Is there a product that can meet both personal payment and collection needs? And can support relatively high concurrency, low delay, capital security without risk, but also does not need enterprise qualification, with very low cost to get efficient returns.
The answer is yes: h5ZHIfu.com
To open an account, you only need: 1 ID card, 2 corresponding bank card (for settlement) and 3 corresponding real-name verified wechat account in 10 minutes. You can open an account with a formal personal merchant number and key.
Above humble opinion, welcome clap brick