The error message

The UNIAPP error message is as follows

  "errMsg": "RequestPayment :fail [payment wechat :-1]General errors"."errCode": - 100.."code": - 100.
Copy the code

It can be seen from the error message that the error code returned by wechat is -1. Check the official document of wechat to know the possible reason:

  1. The signature is incorrect.
  2. The APPID is not registered.
  3. The APPID of the project is incorrect.
  4. The registered APPID does not match the set.
  5. Other exceptions.

Thinking of the February

  1. Check whether the wechat AppID configured in menifest. Json is consistent with the appID of the wechat Open Platform application and the AppID used by the server.
  2. Android version cloud packaging, digital signature, the same as wechat open platform configuration, open platform to fill in the application signature to remove the colon, lowercase. It takes a period of time for the application signature to take effect.
  3. The format of the data returned by the server, note the field name or case.
{
    "appid": ""."partnerid": ""./ / merchant ID
    "prepayid": "".// Prepay ID
    "noncestr": "".// This parameter should be the same as the value used to invoke the payment interface
    "timestamp":,"package": "Sign=WXPay"./ / a fixed value
    "sign": "" // This signature is obtained by using the parameter above, and is inconsistent with the signature of the single interface
}
Copy the code
  1. Check whether the signature type in Awaken Payment Interface is the same as that in Unified Order Interface. If the key is 32 bits, the signature is GENERALLY MD5.
  2. Wechat exit and restart. In this case, we tried to clear the cache first. After the test is invalid, we can log out of the account and log in again.

The problem

1. When applying for wechat open platform, the application signature and application package name are filled into the package name, which should be handled in step 2 according to the investigation.2. After modifying the signature correctly, the test still failed. We have been investigating all kinds of suspicious problems

reference

Wechat Open community Knowledge base