12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667 |
- <?php
- namespace api\cfloat\controller;
- use api\common\controller\CFloatBaseController;
- use huolib\pay\Pay;
- use think\Config;
- class AlipayController extends CFloatBaseController {
- function _initialize() {
- parent::_initialize();
- Config::set('default_return_type', 'html');
- }
-
- public function returnUrl() {
- $_pay_class = Pay::ins()->get('alipay');
- $_pay_rs = $_pay_class->returnUrl();
- $this->assign('info', $_pay_rs);
- $_msg = "支付成功!";
- if ("3" == $_pay_rs['status']) {
- $_msg = "支付失败!";
- $this->assign('msg', $_msg);
- return $this->fetch('order/failed');
- }
- $this->assign('msg', $_msg);
- return $this->fetch('order/success');
- }
-
- public function showUrl() {
- $_order_id = $this->request->param('order_id');
- if (empty($_order_id)) {
- $_msg = '未支付';
- $this->assign('msg', $_msg);
- return $this->fetch('order/failed');
- }
- $_msg = '玩家取消支付,请重新下单';
- $this->assign('msg', $_msg);
- return $this->fetch('order/failed');
- }
- }
|