Home > Backend Development > PHP Tutorial > Developing Alipay, Tenpay, and WeChat payment parameter errors based on OpenCart, opencart Pay_PHP tutorial

Developing Alipay, Tenpay, and WeChat payment parameter errors based on OpenCart, opencart Pay_PHP tutorial

WBOY
Release: 2016-07-12 09:07:57
Original
1052 people have browsed it

Based on OpenCart to develop Alipay, Tenpay, and WeChat payment parameter errors, opencart Pay

Recently integrating Alipay, Tenpay and WeChat scan code payment for OpenCart, in fact These plug-ins are available for sale, but they are quite expensive. It is better to develop and integrate them yourself to save money. However, some pitfalls were discovered during the integration process, including pitfalls with opencart and pitfalls with payment of SDK, which wasted a lot of time. Here are a few pitfalls for those who need them.

1. The notify_url address in WeChat native mode 2 must be a public address

2. Alipay’s notify_url cannot be in the form of query string, such as xxx/notify.php? route=a/b, can only be xxx/notify.php

3. In the synchronous callback processing in Alipay and Tenpay in OpenCart, it is best to unset ($_GET['route']) before doing payment callback verification, otherwise the callback verification will not be successful because this redundant parameter is involved in the verification.

4. When WeChat calls back notify, it sends a data stream, so GET and POST cannot obtain the data notified asynchronously after payment. When using the official SDK, you can change it like this:

$GLOBALS["HTTP_RAW_POST_DATA"] = file_get_contents("php://input", "r");
$notify = new PayNotifyCallBack();
$notify->Handle(false);
Copy after login

5. When accessing Alipay on PC browser with an ios device, the Alipay client will pop up for payment. In this way, asynchronous and synchronous notifications cannot be received, so you need to determine whether the access device is a mobile terminal or a client. If so, For mobile devices, you must use Alipay’s wap method to pay

6. Tenpay payment QQ browser payment always has wrong parameters, I haven’t found the reason yet.

Remind everyone to be careful when using OpenCart to develop Alipay, Tenpay, and WeChat payments. Thank you friends for paying attention to the Bangkejia website. Here, the editor of Script Scaffold wishes everyone a happy National Day.

www.bkjia.comtruehttp: //www.bkjia.com/PHPjc/1058155.htmlTechArticleDeveloping Alipay, Tenpay, and WeChat payment parameter errors based on OpenCart. OpenCart Pay has recently integrated Alipay into OpenCart , Tenpay and WeChat scan code payment, in fact these plug-ins are...
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