123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- <?php
- namespace h5wap\wap\controller;
- use h5wap\common\controller\V2BaseController;
- use huo\controller\pay\Notify;
- use huolib\pay\Pay;
- use think\Config;
- class WxpayController extends V2BaseController {
- function _initialize() {
- parent::_initialize();
- Config::set('default_return_type', 'html');
- }
-
- public function notifyUrl() {
- $_class = new Notify();
- $_class->notifyUrl('wxpay');
- }
-
- public function returnUrl() {
- $_pay_class = Pay::ins()->get('wxpay');
- $_pay_rs = $_pay_class->returnUrl();
- $this->assign('info', $_pay_rs);
- $_msg = "支付成功!";
- if ("3" == $_pay_rs['status'] || empty($_pay_rs)) {
- $_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');
- }
- }
|