Anyway, the v3 version of WeChat Pay has just been launched. In view of the vague urine of WeChat official, the forum is still full of mourning. It went well all the way to the pit. I will share the process with you for your reference ~
Find API security on WeChat merchant platform. This step can be done according to the official prompt, which is relatively simple and will not be repeated here.
Note that there are three files in the certificate exported in step 1. In my experience, only apiclient_key.pem is useful, but apiclient_cert.pem is useless (I didn't find it useful). After obtaining the path of apiclient_key.pem:
These are official orders. Here:
ApiV3key = Set the v3 key.
MchId = merchant number
Path of mchprivatekeyfilepath = apiclient _ key.pem.
MchSerialNo = serial number of the merchant API certificate.
OutputFilePath = storage path of WeChat payment platform certificate.
You may ask, what should I fill in the -c parameter? What needs to be mentioned here is that this parameter is used to verify the certificate, and the path of the WeChat payment platform certificate is filled in. Because this is the first time we create a certificate, we don't need to fill in the -c parameter, so we need to pay special attention.
This will ensure that all the payment examples injected above have the same payment and callback methods.
Some methods are not included in the text, but have been used in my personal project, so I will keep them for the time being.
The notice part will be changed later, and even the Dragon Boat Festival will arrive tomorrow. Friends who need it can leave a message, and I will try to make it up as soon as possible ~