增加医生端支付回调
This commit is contained in:
parent
34420b4445
commit
21027e3584
@ -43,7 +43,24 @@ class CallBackController extends AbstractController
|
|||||||
// 医生端微信支付回调
|
// 医生端微信支付回调
|
||||||
public function doctorWxPayCallBack(): ResponseInterface
|
public function doctorWxPayCallBack(): ResponseInterface
|
||||||
{
|
{
|
||||||
return $this->response->json([]);
|
try {
|
||||||
|
// 处理支付结果事件
|
||||||
|
$WechatPay = new WechatPay(2);
|
||||||
|
$app = $WechatPay->createApp();
|
||||||
|
$server = $app->getServer();
|
||||||
|
|
||||||
|
$message = $server->getRequestMessage();
|
||||||
|
if (empty($message)){
|
||||||
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => "回调数据为空"], JSON_UNESCAPED_UNICODE))));
|
||||||
|
}
|
||||||
|
|
||||||
|
dump($message);
|
||||||
|
|
||||||
|
|
||||||
|
return $server->serve();
|
||||||
|
}catch (\Exception $e) {
|
||||||
|
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => $e->getMessage()], JSON_UNESCAPED_UNICODE))));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// im回调
|
// im回调
|
||||||
|
|||||||
@ -76,7 +76,7 @@ class UserController extends AbstractController
|
|||||||
|
|
||||||
// 获取预支付交易会话标识
|
// 获取预支付交易会话标识
|
||||||
$total = 0.01 * 100;
|
$total = 0.01 * 100;
|
||||||
$prepay = $WechatPay->getJsapiPrepayId("123457",$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
$prepay = $WechatPay->getJsapiPrepayId("123459",$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
||||||
if (empty($prepay)){
|
if (empty($prepay)){
|
||||||
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user