1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-20 19:07:03 +08:00
koogua cbc2e5762a !11 阶段性合并
* 根据app需要作出相应调整
* 路由增加命名name,增加app应用管理
* 完成基本API,增加h5和小程序支付定义
2020-11-10 10:25:16 +08:00

79 lines
1.7 KiB
PHP

<?php
namespace App\Http\Api\Controllers;
use App\Services\Logic\Refund\RefundCancel as RefundCancelService;
use App\Services\Logic\Refund\RefundConfirm as RefundConfirmService;
use App\Services\Logic\Refund\RefundCreate as RefundCreateService;
use App\Services\Logic\Refund\RefundInfo as RefundInfoService;
/**
* @RoutePrefix("/api/refund")
*/
class RefundController extends Controller
{
/**
* @Get("/confirm", name="api.refund.confirm")
*/
public function confirmAction()
{
$sn = $this->request->getQuery('sn', 'string');
$service = new RefundConfirmService();
$confirm = $service->handle($sn);
return $this->jsonSuccess(['confirm' => $confirm]);
}
/**
* @Get("/info", name="api.refund.info")
*/
public function infoAction()
{
$sn = $this->request->getQuery('sn', 'string');
$service = new RefundInfoService();
$refund = $service->handle($sn);
return $this->jsonSuccess(['refund' => $refund]);
}
/**
* @Post("/create", name="api.refund.create")
*/
public function createAction()
{
$service = new RefundCreateService();
$refund = $service->handle();
$service = new RefundInfoService();
$refund = $service->handle($refund->sn);
return $this->jsonSuccess(['refund' => $refund]);
}
/**
* @Post("/cancel", name="api.refund.cancel")
*/
public function cancelAction()
{
$sn = $this->request->getPost('sn', 'string');
$service = new RefundCancelService();
$service->handle($sn);
$service = new RefundInfoService();
$refund = $service->handle($sn);
return $this->jsonSuccess(['refund' => $refund]);
}
}