开发小程序时调起支付一直提示
{err_code: "2" , err_desc: "支付验证签名失败" , errMsg: "requestPayment:fail" } |
我是以服务商模式发起的支付,统一下单什么都成功了,但是一到调起支付的时候就验证签名失败。我服务端返回的6个参数如下:
Array ( [appId] => wxc21534f70356ba05 //这里是服务商的appid,不是小程序的 [nonceStr] => bangkkwrslpveua69dek54k344r5coz7 [package] => prepay_id=wx201710101537105ea7593fcb0689926766 [signType] => MD5 [timeStamp] => 1507621030 [paySign] => E5C4A3BC291A45EDBD3FF131E93E5280 ) |
根据服务商模式的小程序支付文档:服务商模式下应为当前调起支付的小程序的appid,貌似问题就出在这个这个appid上,而在我的小程序是第三方平台的模板小程序,特约商户授权后的extAppid:为"wx1ce0dfce6268ceac",也就是当前小程序的appid。
附上统一下单的整个过程的参数,烦请各位帮忙看看问题是出在哪儿。
统一下单参数: { "appid" : "wxc21534f70356ba05" ,//服务商appid "attach" : "" , "body" : "asdfasdfasdfa" , "goods_tag" : "" , "mch_id" : "1481143442" ,//服务商mch_id "nonce_str" : "sb0q2rzoxu4e40kl5y9lf9pqzhzaw03m" , "notify_url" : "https://pay.zsmart.me/wxpay/notify" , "out_trade_no" : "2017092209341118572" , "spbill_create_ip" : "220.172.54.174" , "sub_appid" : "wx1ce0dfce6268ceac" ,//授权的小程序 "sub_mch_id" : "1489086632" ,//特约商户号 "sub_openid" : "obQb60MPr_xxtiLNeg6iLZ-Itahg" ,//与sub_appid对应的sub_openid "time_expire" : "20171010154710" , "time_start" : "20171010153710" , "total_fee" : "7000" , "trade_type" : "JSAPI" , "sign" : "51CD7C77D29515FE007B9E5ADD1D8DBD" } 统一下单成功返回预付单: Array ( [appid] => wxc21534f70356ba05 [mch_id] => 1481143442 [nonce_str] => MXP4KyE43Jqwufgk [prepay_id] => wx201710101537105ea7593fcb0689926766 [result_code] => SUCCESS [return_code] => SUCCESS [return_msg] => OK [sign] => FC4576C71554FB56512C2E65C91882B7 [sub_appid] => wx1ce0dfce6268ceac [sub_mch_id] => 1489086632 [trade_type] => JSAPI ) 预付单再次签名后的jsApiParamter Array ( [appId] => wxc21534f70356ba05 //为什么 [nonceStr] => bangkkwrslpveua69dek54k344r5coz7 [package] => prepay_id=wx201710101537105ea7593fcb0689926766 [signType] => MD5 [timeStamp] => 1507621030 [paySign] => E5C4A3BC291A45EDBD3FF131E93E5280 ) |
拜托拜托
错误代码
{err_code:
"2"
, err_desc:
"支付验证签名失败"
, errMsg:
"requestPayment:fail"
}
提示错误代码是什么啊、