Current location - Quotes Website - Signature design - How to realize WeChat payment with Java?
How to realize WeChat payment with Java?
Technology stack SpringbootjavaXML (wechat in. chi dori . wx pay;

Initiate a unified order, and the front-end calls out the necessary parameters of WeChat payment. The core of callback result processing is to check whether the encryption signature matches when the payment instruction is called back, so as to prevent the simulation success notice.

Note that the signature of the unified order and the signature of the subsequent front-end pull WeChat payment need to be unified, that is, both are encrypted with MD5. If it is not the same, the front-end pull WeChat payment will fail, which is a huge pit. For this reason, WeChat does not clearly indicate the signature verification method of unified orders in the document, which needs to be consistent with the signature verification of front-end pull WeChat payment. The source code in WeChat sdk needs to be adjusted to solve this problem. The adjustment is as follows: The WXPay class needs to modify the encryption judgment.

After the conclusion, the back-end logic of WeChat payment is still very clear, but it is very painful in the development process. It is not clear where each technical term is configured on WeChat, and the encryption method is very confusing.