|
|
|
@ -75,6 +75,17 @@ class PaymentController extends AbstractController
|
|
|
|
|
return $this->success(['url' => $url]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function getBalance(RequestInterface $request)
|
|
|
|
|
{
|
|
|
|
|
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
|
|
|
|
|
$user = User::where('app_id', $app->app_id)->where('user_id', $data['userId'])->first();
|
|
|
|
|
if (empty($user)) {
|
|
|
|
|
throw new BusinessException('用户不存在');
|
|
|
|
|
}
|
|
|
|
|
$result = $this->userService->getBalance($user->member_id);
|
|
|
|
|
return $this->success(['result' => $result]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public function payment(RequestInterface $request) {
|
|
|
|
|
[$app, $data, $token] = $this->parseReqest($request, UnbindCardRequest::class);
|
|
|
|
|
$data = $this->paymentService->payment($data, $app, $token);
|
|
|
|
|