Current location - Quotes Website - Signature design - Principle and Implementation of WeChat Payment
Principle and Implementation of WeChat Payment
Schematic diagram:

2) Then we will write an adjustment.

3) Then there is the callback.

Use of 4.4. Software Development Kit (software development kit)

1) Finally, use payment where WeChat payment is needed in the project (this is the most important part of the whole payment process and the place that needs the most attention).

First of all, you should make a network request, send your product information to the background through the background interface, generate an order and return it. Return information must contain at least six parameters through which payment can be started.

Import # import "wxapi.h "

5. Common exception handling

1) The common problem is that the adjustment of WeChat payment is unsuccessful, and only one page with a return confirmation button can be adjusted at a time.

Reason: Wrong parameters, pay special attention to parameters (signature), and the parameters returned in the background are incorrect.

Solution: Check the parameters one by one. The signature can be encrypted locally. Don't rely on the signature returned by the background. Sometimes the signature returned by the background is incorrect.