1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-22 11:41:27 +08:00
xiaochong0302 93b0071c87 去掉第三方登录
增强关闭交易健壮性
去除.phalcon目录
2020-04-18 19:51:43 +08:00

75 lines
1.5 KiB
PHP

<?php
namespace App\Http\Web\Controllers;
use App\Services\Pay\Alipay as AlipayService;
use App\Services\Pay\Wxpay as WxpayService;
use App\Traits\Response as ResponseTrait;
class PayController extends \Phalcon\Mvc\Controller
{
use ResponseTrait;
/**
* @Post("/alipay/notify", name="web.alipay.notify")
*/
public function alipayNotifyAction()
{
$alipayService = new AlipayService();
$response = $alipayService->notify();
if (!$response) exit;
$response->send();
exit;
}
/**
* @Post("/wxpay/notify", name="web.wxpay.notify")
*/
public function wxpayNotifyAction()
{
$wxpayService = new WxpayService();
$response = $wxpayService->notify();
if (!$response) exit;
$response->send();
exit;
}
/**
* @Post("/alipay/status", name="web.alipay.status")
*/
public function alipayStatusAction()
{
$sn = $this->request->getPost('sn');
$alipayService = new AlipayService();
$status = $alipayService->status($sn);
return $this->jsonSuccess(['status' => $status]);
}
/**
* @Post("/wxpay/status", name="web.wxpay.status")
*/
public function wxpayStatusAction()
{
$sn = $this->request->getPost('sn');
$wxpayService = new WxpayService();
$status = $wxpayService->status($sn);
return $this->jsonSuccess(['status' => $status]);
}
}