苹果CMS个人收款扫码收款插件 闪电收款

苹果CMS_V10版

sdpay.php

 trim($GLOBALS['config']['pay']['sdpay']['appid']),//你的闪电收款appid
            'order_no'     => date('YmdHis') . mt_rand(1000, 9999),
            'trade_name'   => '在线充值',//可自定义
            'pay_type'     => $pay_type,
            'order_amount' => $order['order_price'],//订单金额
            'order_uid'    => $order['order_code'], //唯一标识 可以是用户ID,用户名,session_id(),订单ID,付款后原样返回
        ];

        $data['sign'] = md5(urldecode(http_build_query($data)) . '&' . trim($GLOBALS['config']['pay']['sdpay']['appkey']));

        $url = 'https://api.sdpay.cc/pay?' . http_build_query($data); //支付页面

        mac_redirect($url);
    }

    public function notify()
    {
        $param = $_POST;
        $data  = [
            'no'           => $param['no'],
            'order_no'     => $param['order_no'],
            'trade_name'   => $param['trade_name'],
            'pay_type'     => $param['pay_type'],
            'order_amount' => $param['order_amount'],
            'pay_amount'   => $param['pay_amount'],
            'order_uid'    => $param['order_uid'],
        ];

        $GLOBALS['config']['pay'] = config('maccms.pay');

        if (md5(urldecode(http_build_query($data)) . '&' . trim($GLOBALS['config']['pay']['sdpay']['appkey'])) != $param['sign']) {
            echo 'fail';
        } else {
            $res = model('Order')->notify($param['order_uid'], 'sdpay');
            if ($res['code'] > 1) {
                echo 'fail2';
            } else {
                echo 'success';
            }
        }
        exit;
    }
}

sdpay.html

闪电收款设置 点击进入注册
1:微信;2:支付宝;(多个用逗号分隔)

 

请将sdpay.php移动到/application/common/extend/pay/下
请将sdpay.html移动到/application/admin/view/extend/pay/下

/template/default_pc/html/user/pay.html第58行和第69行
/template/default_wap/html/user/pay.html第75行和第86行
添加对应的类型
具体参考pay-pc.html和pay-wap.html两个文件

1、参照https://www.sdpay.cc/doc.html设置,其中通知地址和跳转地址:你的网址/index.php/payment/notify/pay_type/sdpay
    
2、苹果cms控制台->系统->在线支付配置->闪电收款 配置参数

插件下载:MacCMS_V10.zip

专注个人免签约收款QQ:240384000

你可能感兴趣的:(个人收款)