5
This commit is contained in:
parent
9c9859a727
commit
13d14b1a55
@ -20,6 +20,7 @@ class CallBackController extends AbstractController
|
||||
*/
|
||||
public function patientWxPayCallBack(): ResponseInterface
|
||||
{
|
||||
dump(111);
|
||||
try {
|
||||
// 处理支付结果事件
|
||||
$WechatPay = new WechatPay(1);
|
||||
@ -36,6 +37,7 @@ class CallBackController extends AbstractController
|
||||
|
||||
return $server->serve();
|
||||
}catch (\Exception $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => $e->getMessage()], JSON_UNESCAPED_UNICODE))));
|
||||
}
|
||||
}
|
||||
@ -43,6 +45,7 @@ class CallBackController extends AbstractController
|
||||
// 医生端微信支付回调
|
||||
public function doctorWxPayCallBack(): ResponseInterface
|
||||
{
|
||||
dump(222);
|
||||
try {
|
||||
// 处理支付结果事件
|
||||
$WechatPay = new WechatPay(2);
|
||||
@ -59,6 +62,7 @@ class CallBackController extends AbstractController
|
||||
|
||||
return $server->serve();
|
||||
}catch (\Exception $e) {
|
||||
throw new BusinessException($e->getMessage());
|
||||
return $this->response->withStatus(500)->withBody(new SwooleStream(strval(json_encode(['code' => 'ERROR', 'message' => $e->getMessage()], JSON_UNESCAPED_UNICODE))));
|
||||
}
|
||||
}
|
||||
|
||||
@ -76,7 +76,7 @@ class UserController extends AbstractController
|
||||
|
||||
// 获取预支付交易会话标识
|
||||
$total = 0.01 * 100;
|
||||
$prepay = $WechatPay->getJsapiPrepayId("123460",$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
||||
$prepay = $WechatPay->getJsapiPrepayId("123461",$total,"o9gYG441zEAHuYoNX7lwFKiQBzKE");
|
||||
if (empty($prepay)){
|
||||
return fail(HttpEnumCode::SERVER_ERROR, "订单创建失败");
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user