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

申请退款有问题 #328

Closed
royen-go opened this issue Mar 8, 2016 · 2 comments
Closed

申请退款有问题 #328

royen-go opened this issue Mar 8, 2016 · 2 comments

Comments

@royen-go
Copy link

royen-go commented Mar 8, 2016

我用的环境

PHP 版本:5.5.9
overtrue/wechat 版本:3.0.4

问题及现象

$result = $payment->refund($orderNo, 1, 1);

返回值为
`uzzleHttp\Exception\ConnectException: cURL error 52: Empty reply from server (see http://curl.haxx.se/libcurl/c/libcurl-errors.html)

/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:186
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:150
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/CurlFactory.php:103
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/CurlHandler.php:43
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:28
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Handler/Proxy.php:51
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Core/AbstractAPI.php:163
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/RetryMiddleware.php:66
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Middleware.php:127
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/PrepareBodyMiddleware.php:72
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Middleware.php:30
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/RedirectMiddleware.php:68
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Middleware.php:59
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/HandlerStack.php:67
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Client.php:268
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Client.php:123
/var/sites/Code/pingdan/vendor/guzzlehttp/guzzle/src/Client.php:129
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Core/Http.php:199
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Core/Http.php:78
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Payment/API.php:382
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Payment/API.php:200
/var/sites/Code/pingdan/vendor/overtrue/wechat/src/Payment/Payment.php:262`

初步定位是没有传 out_refund_no ( 商户退款单号) 参数

@overtrue
Copy link
Collaborator

overtrue commented Mar 8, 2016

@sxpd7788 加我QQ: 44294631

overtrue added a commit that referenced this issue Mar 8, 2016
overtrue added a commit to EasyWeChat/docs that referenced this issue Mar 8, 2016
@royen-go
Copy link
Author

royen-go commented Mar 8, 2016

找到原因了,请求的时候没有传CURLOPT_SSLCERT,CURLOPT_SSLKEY。当然out_refund_no这个参数还是要传的。
我测试的时候修改了EasyWeChat\Core\Http的post方法后申请退款成功。 看看这个这两个参数怎么传吧。😄

 public function post($url, $options = [])
    {
        $key = is_array($options) ? 'form_params' : 'body';
        return $this->request($url, 'POST', [$key => $options ,'cert'=>'/var/sites/cert.pem' , 'ssl_key'=>'/var/sites/key.pem']);
    }

overtrue added a commit that referenced this issue Mar 9, 2016
@overtrue overtrue closed this as completed Mar 9, 2016
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