Checks the terms of the selected JSAPI, H5, Native or application of the payment product. The order of service-end access is set below; the specific fields and the mode of transfer are still performed according to the official document of the selected product.
Prepare business and applications
Checks the number of the business, the connection of the APPID and the rights of the selected product.
- Configure domain names, directories or other necessary conditions according to the actual product.
- Prepares an accessible HTTPS notification address.
The business and application configuration meets the payment product requirements.
Install PHP SDK
The installation of the WeChat Pay official PHP library in your business project to check the operating environment against the warehouse description.
- Configure business private key, business certificate serial number and applicable WeChat Pay public key or platform certificate.
- APIv3 keys are held in separate custody for the corresponding notification decryption process.
composer require wechatpay/wechatpay
The service provider is able to initialize the client and use the correct signature information.
List and Save Association
When a local order is created, you will call the next line interface for the selected product.
- Checks the apid, mchid, out_trade_no with the order.
- Nature uses the example of amount.total as an integer fraction; other fields are processed by the corresponding product document.
Returning payment entry or prepayment mark can correspond to local order.
Check and decrypt notifications
The official bank is used to verify the notification on the basis of the header and original submission and then declassify the resource content in accordance with the product rules.
- Select the correct authentication material according to the public key ID or certificate identifier.
- The verification of the business, application, purchase order amount and payment status cannot be made solely through the approval of a signature.
Notifications that are forged, altered or not matched by orders do not update the status of payments.
Quite a bit of processing and active checking.
Only payment records and transactions are used to prevent duplicate processing; authentication of a service-end check when no notification is received.
- Returns the response to the notification according to the selected interface rule.
- The business order results are read after the front-end payment operation is completed and are not shipped directly.
Repeated calls are processed only once, and the notification omits a checklist to compensate.
Validate uplink and refunds
Check payments, deliveries, refunds and queries separately; check permissions, keys and notification domain names again at production switching.
- Test user cancellation, delay in notification, failure to sign and delivery of retest.
- The first orders were manually reviewed and the basis for reconciliation retained.
Successes, failures and unusual orders can be tracked and reconciled.