修改支付回调
This commit is contained in:
parent
50dd519e09
commit
223ffb8fe3
@ -77,14 +77,12 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "问诊微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "问诊微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance()->info("问诊微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance()->info("问诊微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
@ -245,15 +243,13 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance("CallBackController-wxPayInquiryRefundCallBack")->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance("CallBackController-wxPayInquiryRefundCallBack")->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
@ -392,15 +388,12 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "药品微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "药品微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance()->info("药品微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance()->info("药品微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
@ -549,15 +542,13 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance("CallBackController-wxPayProductRefundCallBack")->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance("CallBackController-wxPayProductRefundCallBack")->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
@ -1159,14 +1150,12 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "问诊微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "问诊微信支付回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance()->info("检测微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance()->info("检测微信支付回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
@ -1251,15 +1240,13 @@ class CallBackController extends AbstractController
|
|||||||
$app = $WechatPay->createApp();
|
$app = $WechatPay->createApp();
|
||||||
$server = $app->getServer();
|
$server = $app->getServer();
|
||||||
|
|
||||||
$message = $server->getRequestMessage();
|
// 获取解密消息
|
||||||
|
$message = $server->getDecryptedMessage();
|
||||||
if (empty($message)) {
|
if (empty($message)) {
|
||||||
Db::rollBack();
|
Db::rollBack();
|
||||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
}
|
}
|
||||||
|
|
||||||
// 验证推送消息签名
|
|
||||||
$app->getValidator()->validate($app->getRequest());
|
|
||||||
|
|
||||||
Log::getInstance()->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
Log::getInstance()->info("微信退款回调数据:" . json_encode($message->toArray(), JSON_UNESCAPED_UNICODE));
|
||||||
|
|
||||||
if (empty($message['out_trade_no'])) {
|
if (empty($message['out_trade_no'])) {
|
||||||
|
|||||||
@ -114,7 +114,7 @@ class WechatPay
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
$app = new Application($config);
|
$app = new Application($config);
|
||||||
$request = ApplicationContext::getContainer()->get(RequestInterface::class);
|
$request = \Hyperf\Context\ApplicationContext::getContainer()->get(RequestInterface::class);
|
||||||
$app->setRequest($request);
|
$app->setRequest($request);
|
||||||
return $app;
|
return $app;
|
||||||
} catch (InvalidArgumentException $e) {
|
} catch (InvalidArgumentException $e) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user