After successful payment via WeChat scan on the PC, it will automatically jump to the PHP version for code sharing.

小云云
Release: 2023-03-20 06:36:01
Original
2967 people have browsed it

Scenario: PC side WeChat scan code to pay

Result: automatic jump after successful payment

This article mainly introduces in detail the code to automatically jump to the PHP version after the WeChat scan code payment is successful. It has certain reference value. Interested friends can refer to it. I hope it can help everyone.

Implementation idea:

On the payment QR code page, write ajax to request the payment status, request the result, and jump to the corresponding result page regardless of success or failure.

Specific implementation method:

html part:

Payment result status setting: 0 Unpaid 1 Payment successful 2 Payment failed


 
Copy after login

PHP part:


//支付状态检测 public function pay_status_check(){ $order_id = I("order_id"); $result = M('table')->where("order_id = $order_id")->find(); echo $result['pay_status']; }
Copy after login

These are the basic functions. If you want the effect to look better, you can add some styles, such as: If the payment is successful, a check mark animation will be added!

Related recommendations:

Detailed explanation of the PC-side WeChat scan code registration and login example code

The above is the detailed content of After successful payment via WeChat scan on the PC, it will automatically jump to the PHP version for code sharing.. For more information, please follow other related articles on the PHP Chinese website!

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
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!