如果您使用的ShopWind电商系统V3.4.1版本,在确认AppID、AppSecret、商户号、APIv3秘钥、商户证书号,商户证书文件、微信证书文件 都正确填写并无误的情况下,
打开文件:common\plugins\payment\wxapppay\SDK.php
将代码:
public function getParameters($prepay_id)
{
$params["appid"] = $this->appId;
$params["timestamp"] = (string)Formatter::timestamp(),
$params["noncestr"] = Formatter::nonce(),
$params["package"] = "Sign=WXPay";
$params["partnerid"] = $this->mchId;
$params["prepayid"] = $prepay_id;
$params["sign"] = 'MD5';//$this->getSign($params),// Wechat SDK BUG
return $params;
}
修改为:
public function getParameters($prepay_id)
{
$params["appid"] = $this->appId;
$params["timestamp"] = (string)Formatter::timestamp(),
$params["noncestr"] = Formatter::nonce(),
$params["prepayid"] = $prepay_id;
// 参数[appid、timestamp、noncestr、prepayid]参与签名, 如果发现签名失败,可以取值为MD5试试
$params["sign"] = $this->getSign($params),
$params["package"] = "Sign=WXPay";
$params["partnerid"] = $this->mchId;
return $params;
}