-
Notifications
You must be signed in to change notification settings - Fork 101
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
Call to undefined method think\\exception\\ErrorException::getResponse() #8
Comments
把 |
退款成功 也是进otherwise
…------------------ 原始邮件 ------------------
发件人: "James ***@***.***>;
发送时间: 2021年6月28日(星期一) 下午4:54
收件人: ***@***.***>;
抄送: ***@***.***>; ***@***.***>;
主题: Re: [wechatpay-apiv3/wechatpay-php] Call to undefined method think\\exception\\ErrorException::getResponse() (#8)
把 $exception 直接打印出来看看,是个啥?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
------------------ 原始邮件 ------------------
发件人: "wechatpay-apiv3/wechatpay-php" ***@***.***>;
发送时间: 2021年6月28日(星期一) 下午4:54
***@***.***>;
***@***.******@***.***>;
主题: Re: [wechatpay-apiv3/wechatpay-php] Call to undefined method think\\exception\\ErrorException::getResponse() (#8)
把 $exception 直接打印出来看看,是个啥?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
进了otherwise 也是退款成功了 但是第一次进会报错 第二次提示退款成功
…------------------ 原始邮件 ------------------
发件人: "wechatpay-apiv3/wechatpay-php" ***@***.***>;
发送时间: 2021年6月28日(星期一) 下午4:54
***@***.***>;
***@***.******@***.***>;
主题: Re: [wechatpay-apiv3/wechatpay-php] Call to undefined method think\\exception\\ErrorException::getResponse() (#8)
把 $exception 直接打印出来看看,是个啥?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
要给请求的URI, if ($exception instanceof \Think\Exception\ ErrorException) {//不一定对,不熟悉TP
echo $exception->getTraceAsString(), PHP_EOL;
} else if ($exception instanceof \Psr\Http\Message\ResponseInterface) {
$body = $exception->getResponse()->getBody();
echo $body->getContents();
// echo $exception->getTraceAsString(), PHP_EOL;
} |
谢谢 |
加上这个判断是不报Call to undefined method think\exception\ErrorException::getResponse()这个错误了 但是退款成功还是进otherwise |
贴一下你的初始化 |
public function fenZhangTuiKuan(Request $request)
|
你给的 |
你好 非常感谢您这么耐心的解答问题 我能退款成功 我想拿到退款成功的标识 但是现在退款成功报错 |
你用错了,需要先获取 |
'certs' => [ 我直接copy的例子中的 这样不对吗 |
|
建议升级至 |
你好 我使用./bin/CertificateDownloader.php的文件 给到YYYYYYYYYY 还是报错 是不是还需要设置什么 |
配置文件改成 |
->then(function($response) {
// 正常逻辑回调处理
echo $response->getBody()->getContents();
return $response;
})
->otherwise(function($exception) {
// 异常错误处理
$body = $exception->getResponse()->getBody();
echo $body->getContents();
// echo $exception->getTraceAsString(), PHP_EOL;
})
每次都进入otherwise
提示Call to undefined method think\exception\ErrorException::getResponse()
The text was updated successfully, but these errors were encountered: