You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
payment/app/Controller/Payment/PayController.php

81 lines
2.5 KiB
PHTML

2 years ago
<?php
declare(strict_types=1);
namespace App\Controller\Payment;
use Hyperf\HttpServer\Contract\RequestInterface;
use App\Service\PaymentService;
2 years ago
use App\Service\UserService;
use Hyperf\Context\Context;
2 years ago
class PayController extends AbstractController
{
2 years ago
private UserService $userService;
2 years ago
private PaymentService $paymentService;
2 years ago
public function __construct(PaymentService $paymentService, UserService $userService)
2 years ago
{
2 years ago
$this->userService = $userService;
2 years ago
$this->paymentService = $paymentService;
}
2 years ago
public function register(RequestInterface $request)
2 years ago
{
2 years ago
$requestLog = Context::get('requestLog');
$url = $this->userService->register($request->all(), $requestLog->request_token);
return $this->success(['url' => $url]);
2 years ago
}
2 years ago
public function bindCard(RequestInterface $request)
2 years ago
{
2 years ago
$requestLog = Context::get('requestLog');
$url = $this->userService->bindCard($request->all(), $requestLog->request_token);
return $this->success(['url' => $url]);
2 years ago
}
2 years ago
public function unbindCard(RequestInterface $request)
2 years ago
{
2 years ago
$data = $this->userService->unbindCard($request->all());
2 years ago
return $this->success($data);
2 years ago
}
2 years ago
public function bindCardPay(RequestInterface $request)
2 years ago
{
2 years ago
$requestLog = Context::get('requestLog');
$data = $this->paymentService->bindCardPay($request->all(), $requestLog->request_token);
return $this->success($data);
2 years ago
}
public function protocolPayConfirm(RequestInterface $request)
{
2 years ago
$data = $this->paymentService->protocolPayConfirm($request->all());
return $this->success($data);
2 years ago
}
public function refund(RequestInterface $request) {
2 years ago
$data = $this->paymentService->refund($request->all());
return $this->success($data);
2 years ago
}
2 years ago
public function refundQuery(RequestInterface $request) {
2 years ago
$data = $this->paymentService->refundQuery($request->all());
return $this->success($data);
2 years ago
}
2 years ago
public function paymentQuery(RequestInterface $request) {
2 years ago
$data = $this->paymentService->paymentQuery($request->all());
return $this->success($data);
2 years ago
}
2 years ago
2 years ago
public function query(RequestInterface $request) {
$data = $this->paymentService->query($request->all());
return $this->success($data);
}
2 years ago
public function payment(RequestInterface $request) {
$data = $this->paymentService->payment($request->all());
return $this->success($data);
}
2 years ago
}