diff --git a/niucloud/app/api/controller/pay/Pay.php b/niucloud/app/api/controller/pay/Pay.php index 2577459f..4b68528f 100644 --- a/niucloud/app/api/controller/pay/Pay.php +++ b/niucloud/app/api/controller/pay/Pay.php @@ -16,6 +16,7 @@ use core\base\BaseApiController; use think\db\exception\DataNotFoundException; use think\db\exception\DbException; use think\db\exception\ModelNotFoundException; +use think\facade\Log; use think\Response; /** @@ -94,4 +95,24 @@ class Pay extends BaseApiController ]); return success('SUCCESS',(new PayService())->close($data['type'], $data['out_trade_no'])); } + + /** + * 获取支付二维码 + */ + public function getQrcode(){ + $data = $this->request->params([ + ['trade_type', ''], + ['trade_id', ''], + ['type', ''], + ]); + return success('SUCCESS',(new PayService())->getQrcode($data['type'], $data['trade_type'], $data['trade_id'])); + } + + public function qrcodeNotify() + { + // todo + Log::debug('qrcodeNotify'); + Log::debug(json_encode($this->request->param())); + return success('SUCCESS'); + } } diff --git a/niucloud/app/api/route/pay.php b/niucloud/app/api/route/pay.php index aa87da01..4d41f42d 100644 --- a/niucloud/app/api/route/pay.php +++ b/niucloud/app/api/route/pay.php @@ -19,6 +19,11 @@ Route::any('pay/notify/:channel/:type/:action', 'pay.Pay/notify') ->middleware(ApiChannel::class) ->middleware(ApiCheckToken::class) ->middleware(ApiLog::class); + +Route::any('pay/qrcodenotify', 'pay.Pay/qrcodeNotify') + ->middleware(ApiChannel::class) + ->middleware(ApiCheckToken::class) + ->middleware(ApiLog::class); /** * 路由 */ diff --git a/niucloud/app/service/api/pay/PayService.php b/niucloud/app/service/api/pay/PayService.php index f1e8c580..6fced6a9 100644 --- a/niucloud/app/service/api/pay/PayService.php +++ b/niucloud/app/service/api/pay/PayService.php @@ -148,4 +148,18 @@ class PayService extends BaseApiService public function getPayTypeByTrade(string $trade_type){ return $this->core_pay_service->getPayTypeByTrade($trade_type, $this->channel); } + + public function getQrcode() + { + // todo + + } + + /** + * 二维码支付回调 + */ + public function qrcodeNotify() + { + // todo + } }