| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 | <?php/** * AlipayController.php UTF-8 * 支付宝对外处理页面 * * @date    : 2018/2/8 15:42 * * @license 这不是一个自由软件,未经授权不许任何使用和传播。 * @author  : wuyonghong <wyh@huosdk.com> * @version : HUOSDK 8.0 */namespace api\apple\controller;use api\common\controller\AppleApiBaseController;use huo\controller\pay\Notify;use huolib\pay\Pay;use think\Config;class ShengpayController extends AppleApiBaseController {    function _initialize() {        parent::_initialize();        \think\Log::write($this->request->getContent(), 'error');        Config::set('default_return_type', 'html');    }    /**     * 盛付通支付回调地址     * shengpay/notify     */    public function notifyUrl() {        $_class = new Notify();        if (!isset($_REQUEST['Ext1'])) {            exit('fail');        }        $_ext1 = $_REQUEST['Ext1'];        $_ext1 = htmlspecialchars_decode($_ext1);        $_ext = json_decode($_ext1, true);        $_product_id = $_ext['product_id'];        $_class->notifyUrl('shengpay', $_product_id);    }    /**     * 盛付通支付成功后通知地址     * shengpay/return     *     * @return mixed     * @throws \think\Exception     */    public function returnUrl() {        $_pay_class = Pay::ins()->get('shengpay');        $_pay_rs = $_pay_class->returnUrl();        $this->assign('info', $_pay_rs);        $_msg = "支付成功!";        $this->assign('return_url', '');        if ("3" == $_pay_rs['status']) {            $_msg = "支付失败!";            $this->assign('msg', $_msg);            return $this->fetch('order/failed');        }        $this->assign('msg', $_msg);        return $this->fetch('order/success');    }}
 |