Summary and sharing of the PHP version process of WeChat payment

小云云
Release: 2023-03-22 21:46:01
Original
2063 people have browsed it

This article mainly shares with you the PHP version process of WeChat payment. With the widespread use of mobile services, as a PHPer, you need to understand some payment-related technologies. Below I will sort out a PHP version of the payment process for you.

1. WeChat public platform configuration

##1.1Loginhttps://mp.weixin.qq.com

Open WeChat payment(300)

##2.

Merchant configuration

2.1 Log in to the merchant platform##https://pay.weixin.qq.com/index. php/partner/public/home

If the merchant platform login user binds a WeChat ID,

:## will appear

2.2

Basic configuration

##Pay for configuration options you may encounter.

Install certificate

2.3 Configure security API (required for development)

#Set a 32-length API key.

Download the certificate(The premise is that the control and certificate have been installed

)3. DevelopmentDemo(ThinkPHP

, modified according to the official version

)3.1 Directory structure

##3.2File details(lib

Library)

##3.2.1

Configuration file

##

3.2.2The code calls

3.2.2.1 in the constructor of the controller Introduced in

##3.2.2.2 Code request to generate QR code

##3.2. 2.3Handling callbacks

The specific processing logic of callbacks is in the core library , if the payment is completed, modify the status of the order in the database to 1

. (WeChat callback)

##3.2.2.3

Custom callback to detect order status

After generating the QR code, we don’t know whether the user pays The method is to judge directly. We can judge by the status value of the order in WeChat's callback function. If it is

1, the payment is successful, and you can customize the operation at this time.

Query the status of the order in the background,

Related recommendations:


PHP How to implement WeChat payment

WeChat payment refund function development

PHP development examples of WeChat payment and Alipay payment

The above is the detailed content of Summary and sharing of the PHP version process of WeChat payment. 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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template