API:APP下单API“https://api.mch.weixin.qq.com/v3/pay/transactions/app”
完整的请求:
Authorization: WECHATPAY2-SHA256-RSA2048 mchid="1638890864",nonce_str="zySEXB9TDbkYnWCr9SVkeDUO2NqBKQGe",timestamp="1678088201",serial_no="200BB8B8BB2F28D8B444365A3ECE3B651C5B771D",signature="eTngU9SVwLWtH+vmshsQtzStPnSgLvRlkrYZPfnhVjRJVhjM+5bPxuEnBbBQOHBnDdP29L9Y25xERf+lY9kSwAtoEqS847JNYqh3r4XHllSJ93rWxVTuX5TS1xpCgJVga+i52HDnCsNU+EOOzelBbiBp1C5jh0k4kns1sqtiATlh4D3/BQm/IMVHEMvHXLsiUqCVtVrM+fVS6KMhteuEQCzfz/tE4DidcynrTUO0I0wpD9hh/DxkTXDd8YPVC749kgZNOEO+tlYuqoBEULPb/g9ztE1GxsaYouPS2oBRChrnXfPOeTxtJfHHAwBNg3QD9OeEvd3SZrBr68xq1x4T5w=="
{"out_trade_no":"20230302095935497839","description":"卫生间防水","amount":{"total":1},"notify_url":"https:\/\/zhongbaozs\/payment\/wechatPay","appid":"wxc31faeb053e984d2","mchid":"1638890864"}
返回:
{"code":"SIGN_ERROR","detail":{"detail":{"issue":"sign not match"},"field":"signature","location":"authorization","sign_information":{"method":"POST","sign_message_length":289,"truncated_sign_message":"POST\n/v3/pay/transactions/app\n1678023077\nIDxpDGJbfG2AvC7u6lJ22RZehBg5Ctu5\n{\"out_tr\n","url":"/v3/pay/transactions/app"}},"message":"商户证书序列号有误。"}
用的是V3密钥,重置过密钥和证书依旧没解决问题。希望能大神给予解答
去看看你商户后台API证书处的证书序列号是不是“200BB8B8BB2F28D8B444365A3ECE3B651C5B771D”,重新申请证书还会报错说明是你自己配置错了