Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

微信支付退款ret:-1 #24

Open
LGinC opened this issue Nov 22, 2018 · 10 comments
Open

微信支付退款ret:-1 #24

LGinC opened this issue Nov 22, 2018 · 10 comments

Comments

@LGinC
Copy link

LGinC commented Nov 22, 2018

image
msg:当前请求出错,错误码: ZADYYQW
ZADYYQW是随机的,下次请求会变

@LGinC
Copy link
Author

LGinC commented Nov 22, 2018

预支付调用成功。
证书密码和证书路径已配,out_trade_no 传入正确

@KevinWG
Copy link
Owner

KevinWG commented Nov 29, 2018

这个错误码是内部的,看下项目目录下有个log文件夹,里面有具体错误

@LGinC
Copy link
Author

LGinC commented Nov 29, 2018

2018-11-22 21:22:03 Code:GAEVYQW Key:RestCommon Detail:基类请求出错,错误信息:系统找不到指定的文件。

2018-11-22 21:23:40 Code:ZADYYQW Key:RestCommon Detail:基类请求出错,错误信息:系统找不到指定的文件。

所以是找不到哪个文件啊.........

@KevinWG
Copy link
Owner

KevinWG commented Nov 30, 2018

用到的文件只有证书文件,如果是windows服务器,请检查证书是否已经在系统注册,然后在检查证书路径是否正确

@KevinWG
Copy link
Owner

KevinWG commented Nov 30, 2018

退款时需要双向证书支持,windows的证书要安装一下的

@LGinC
Copy link
Author

LGinC commented Dec 3, 2018

@KevinWG 证书路径是填证书文件所在的绝对路径还是直接填写证书名,如"SN=xxx,CN=xxx,OU=MMPay,O=Tencent,L=Shenzhen,S=Guangdong,C=CN" 这种

@KevinWG
Copy link
Owner

KevinWG commented Dec 4, 2018

    /// <summary>
    /// 证书路径,  请填写绝对路径,为了安全,请不要将证书放在网站目录下
    /// </summary>
    public string CertPath { get; set; }

物理地址路径(D:\xx\xx.cert 这种),不是这个

@LGinC
Copy link
Author

LGinC commented Dec 4, 2018

winserver, 路径填的E:\xx\xx.p12
改为E:/xx/xx.p12 和E:/xx/xx.pem都不行
改为xx.pem 后报错信息变为
2018-12-04 17:24:30 Code:NQ22GPX Key:RestCommon Detail:基类请求出错,错误信息:An error occurred while sending the request.

@KevinWG
Copy link
Owner

KevinWG commented Dec 5, 2018

这个你需要注意证书密码是否正确,.net 使用的应该是 .p12 的
如果还是不行,你可以在系统启动的时候直接注册底层的方法:
WxPayConfigProvider.HttpClientProvider=(config,isneedCert)=>{
处理HttpClient;
返回HttpClient;
}

@LGinC
Copy link
Author

LGinC commented Dec 5, 2018

证书密码默认就是商户号Id,没改的
在startup里配置了HttpClient后还需要在config里添加证书路径吗?
现在添加HttpClient配置后预支付请求失败
日志:
2018-12-05 11:40:06 Code:G17RERX Key:RestCommon Detail:基类请求出错,错误信息:Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

对了,环境是.net core 2.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants