public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //$user_id = intval($GLOBALS['user_info']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/deal.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         //充值已支付
         $root['incharge_count'] = $GLOBALS['db']->getOne("SELECT sum(money) FROM " . DB_PREFIX . "payment_notice where  is_paid = 1 and user_id = " . $user_id . " ");
         $root['incharge_count'] = format_price($root['incharge_count']);
         //提现成功
         $root['carry_money'] = $GLOBALS['db']->getOne("SELECT sum(money) FROM " . DB_PREFIX . "user_carry where  status = 1 and user_id = " . $user_id . " ");
         $root['carry_money'] = format_price($root['carry_money']);
         //已付管理费
         $root['true_repay_manage_money'] = $GLOBALS['db']->getOne("SELECT sum(true_repay_manage_money) FROM " . DB_PREFIX . "deal_load_repay where  has_repay = 1 and user_id = " . $user_id . " ");
         $root['true_repay_manage_money'] = format_price($root['true_repay_manage_money']);
         $user_statistics = sys_user_status($user_id);
         $root['user_statistics'] = $user_statistics;
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "理财统计";
     output($root);
 }
 public function export_csv($page = 1)
 {
     set_time_limit(0);
     $limit = ($page - 1) * intval(app_conf("BATCH_PAGE_SIZE")) . "," . intval(app_conf("BATCH_PAGE_SIZE"));
     $map['ecv_type_id'] = intval($_REQUEST['ecv_type_id']);
     $list = M(MODULE_NAME)->where($map)->limit($limit)->findAll();
     if ($list) {
         register_shutdown_function(array(&$this, 'export_csv'), $page + 1);
         $ecv_value = array('sn' => '""', 'password' => '""', 'money' => '""', 'use_limit' => '""', 'begin_time' => '""', 'end_time' => '""');
         if ($page == 1) {
             $content = iconv("utf-8", "gbk", "序列号,密码,面额,使用数量,生效时间,过期时间");
             $content = $content . "\n";
         }
         foreach ($list as $k => $v) {
             $ecv_value['sn'] = '"' . iconv('utf-8', 'gbk', $v['sn']) . '"';
             $ecv_value['password'] = '******' . iconv('utf-8', 'gbk', $v['password']) . '"';
             $ecv_value['money'] = '"' . iconv('utf-8', 'gbk', format_price($v['money'])) . '"';
             $ecv_value['use_limit'] = '"' . iconv('utf-8', 'gbk', $v['use_limit']) . '"';
             $ecv_value['begin_time'] = '"' . iconv('utf-8', 'gbk', to_date($v['begin_time'])) . '"';
             $ecv_value['end_time'] = '"' . iconv('utf-8', 'gbk', to_date($v['end_time'])) . '"';
             $content .= implode(",", $ecv_value) . "\n";
         }
         header("Content-Disposition: attachment; filename=voucher_list.csv");
         echo $content;
     } else {
         if ($page == 1) {
             $this->error(L("NO_RESULT"));
         }
     }
 }
Example #3
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $root['is_faved'] = $GLOBALS['db']->getOne("SELECT count(*) FROM " . DB_PREFIX . "deal_collect WHERE deal_id = " . $id . " AND user_id=" . $user_id);
         $root['user_money'] = $user['money'];
         $root['user_money_format'] = format_price($user['money']);
         //用户金额
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 function tuijian_goods($list = 8)
 {
     $w = "(g.is_best='1' OR g.is_new='1' OR g.is_hot='1' OR g.is_promote='1')";
     $sql = "SELECT g.goods_id,g.goods_sn,g.goods_bianhao,g.goods_name,g.market_price,g.shop_price,g.promote_price,g.goods_thumb,g.goods_img,g.promote_price, g.promote_start_date, g.promote_end_date,g.is_promote,g.sale_count,b.brand_name FROM `{$this->App->prefix()}goods` AS g LEFT JOIN `{$this->App->prefix()}brand` AS b ON g.brand_id=b.brand_id WHERE g.is_on_sale='1' AND g.is_alone_sale='1' AND {$w} ORDER BY RAND() DESC LIMIT {$list}";
     $rt = $this->App->find($sql);
     $rts = array();
     if (!empty($rt)) {
         foreach ($rt as $k => $row) {
             $rts[$k] = $row;
             $rts[$k]['goods_thumb'] = SITE_URL . $row['goods_thumb'];
             $rts[$k]['goods_img'] = SITE_URL . $row['goods_img'];
             $rts[$k]['url'] = get_url($row['goods_name'], $row['goods_id'], SITE_URL . 'product.php?id=' . $row['goods_id'], 'goods', array('product', 'index', $row['goods_id']));
             if ($row['is_promote'] == '1') {
                 //促销 价格
                 if ($row['promote_start_date'] < mktime() && $row['promote_end_date'] > mktime()) {
                     $row['promote_price'] = format_price($row['promote_price']);
                 } else {
                     $row['promote_price'] = "0.00";
                 }
             } else {
                 $row['promote_price'] = "0.00";
             }
             $rts[$k]['promote_price'] = $row['promote_price'];
         }
         unset($rt);
     }
     return $rts;
 }
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
Example #6
0
 public function index()
 {
     // 检查用户,用户密码
     $user = $GLOBALS['user_info'];
     $user_id = intval($user['id']);
     $root = array();
     $root['return'] = 1;
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['user_name'] = $user['user_name'];
         $root['user_money'] = $user['money'];
         $root['user_money_format'] = format_price($user['money']);
         // 用户金额
         $root['user_score'] = $user['score'];
         // 用户积分
         $coupon_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_coupon where user_id = " . $user_id . " and is_delete = 0 and is_valid = 1 ");
         $root['coupon_count'] = $coupon_count;
         $youhui_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "youhui_log as yl left join " . DB_PREFIX . "youhui as yh on yh.id = yl.youhui_id where yl.user_id={$user_id} ");
         $root['youhui_count'] = $youhui_count;
         $not_pay_order_count = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal_order where user_id = " . $user_id . " and type = 0 and is_delete = 0 and pay_status <> 2");
         $root['not_pay_order_count'] = $not_pay_order_count;
         output($root);
     } else {
         $root['user_login_status'] = 0;
     }
     output($root);
 }
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $subject = $payment_notice['deal_name'] == "" ? "充值" . format_price($payment_notice['money']) : $payment_notice['deal_name'];
     $data_return_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=AlipayBank';
     $data_notify_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=AlipayBank';
     $service = 'create_direct_pay_by_user';
     /* 银行类型 */
     $bank_type = $payment_notice['bank_id'];
     $parameter = array('service' => $service, 'partner' => $payment_info['config']['alipay_partner'], '_input_charset' => 'utf-8', 'notify_url' => $data_notify_url, 'return_url' => $data_return_url, 'subject' => $subject, 'out_trade_no' => $payment_notice['notice_sn'], 'price' => $money, 'quantity' => 1, 'payment_type' => 1, 'logistics_type' => 'EXPRESS', 'logistics_fee' => 0, 'logistics_payment' => 'BUYER_PAY_AFTER_RECEIVE', 'extend_param' => 'isv^fanwe11', 'seller_email' => $payment_info['config']['alipay_account'], 'defaultbank' => $bank_type, 'payment' => 'bankPay');
     ksort($parameter);
     reset($parameter);
     $param = '';
     $sign = '';
     foreach ($parameter as $key => $val) {
         $param .= "{$key}=" . urlencode($val) . "&";
         $sign .= "{$key}={$val}&";
     }
     $param = substr($param, 0, -1);
     $sign = substr($sign, 0, -1) . $payment_info['config']['alipay_key'];
     $sign_md5 = md5($sign);
     $payLinks = '<form action="https://www.alipay.com/cooperate/gateway.do?' . $param . '&sign=' . $sign_md5 . '&sign_type=MD5" id="jumplink" method="post">正在连接支付接口...</form>';
     $payLinks .= '<script type="text/javascript">document.getElementById("jumplink").submit();</script>';
     return $payLinks;
 }
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order = $GLOBALS['db']->getRow("select order_sn,bank_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     //订单号
     $BillNo = $order['order_sn'];
     // 总金额
     $Amount = round($payment_notice['money'], 2);
     $ReturnURL = SITE_DOMAIN . APP_ROOT . '/95epay_response.php';
     //后台通知
     $NotifyURL = SITE_DOMAIN . APP_ROOT . '/95epay_notify.php';
     //支付方式
     $PayType = "CSPAY";
     $PaymentType = $order['bank_id'];
     $MerRemark = $payment_notice_id;
     /* 数字签名 */
     $MerNo = $payment_info['config']['merno'];
     $MD5key = $payment_info['config']['md5key'];
     $MD5info = $this->getSignature($MerNo, $BillNo, $Amount, $ReturnURL, $MD5key);
     /*交易参数*/
     $parameter = array('MerNo' => $MerNo, 'Amount' => $Amount, 'BillNo' => $BillNo, 'ReturnURL' => $ReturnURL, 'NotifyURL' => $NotifyURL, 'MD5info' => $MD5info, 'SubMerNo' => '', 'PayType' => $PayType, 'PaymentType' => $PaymentType, 'MerRemark' => $MerRemark, 'products' => '');
     $def_url = '<form style="text-align:center;" action="https://www.95epay.cn/sslpayment" target="_blank" style="margin:0px;padding:0px" method="post" >';
     foreach ($parameter as $key => $val) {
         $def_url .= "<input type='hidden' name='{$key}' value='{$val}' />";
     }
     $def_url .= "<input type='submit' class='paybutton' value='前往双乾支付' />";
     $def_url .= "</form>";
     $def_url .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($Amount) . "</div>";
     return $def_url;
 }
Example #9
0
 public function index()
 {
     $city_name = strim($GLOBALS['request']['city_name']);
     //城市名称
     $root = array();
     $user_data = $GLOBALS['user_info'];
     //logUtils::log_obj($user_data);
     $user_id = intval($user_data['id']);
     if ($user_id == 0) {
         $root['user_login_status'] = 0;
         $root['info'] = "请先登陆";
         $root['page_title'] = "登陆";
     } else {
         $root['user_login_status'] = 1;
         $root['info'] = "用户中心";
         $root['page_title'] = "用户中心";
         $root['uid'] = $user_data['id'];
         $root['user_name'] = $user_data['user_name'];
         $root['user_email'] = $user_data['email'];
         $root['user_money'] = $user_data['money'];
         $root['user_money_format'] = format_price($user_data['money']);
         //用户金额
         $root['user_avatar'] = get_abs_img_root(get_muser_avatar($user_data['id'], "big"));
     }
     $root['mana_page_title'] = '经理中心';
     $root['user'] = $user_data;
     $root['city_name'] = $city_name;
     output($root);
 }
 public function get_payment_code($payment_notice_id)
 {
     define('REAL_APP_ROOT', str_replace('/mapi', "", APP_ROOT));
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order_sn = $payment_notice['notice_sn'];
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $sql = "select name " . "from " . DB_PREFIX . "deal " . "where id =" . intval($payment_notice['deal_id']);
     $title_name = $GLOBALS['db']->getOne($sql);
     $subject = $order_sn;
     //$data_return_url = get_domain().APP_ROOT.'/../shop.php?ctl=payment&act=response&class_name=Walipay';
     //$notify_url = get_domain().APP_ROOT.'/../shop.php?ctl=payment&act=notify&class_name=Walipay';
     $notify_url = get_domain() . REAL_APP_ROOT . "/alipay_web/alipayapi.php?order_id=" . intval($payment_notice['order_id']) . "&out_trade_no=" . $order_sn;
     //."&out_trade_no={$data.walipay.out_trade_no}";
     $pay = array();
     $pay['subject'] = $title_name;
     $pay['body'] = $subject;
     $pay['total_fee'] = $money;
     $pay['total_fee_format'] = format_price($money);
     $pay['out_trade_no'] = $payment_notice['notice_sn'];
     $pay['notify_url'] = $notify_url;
     $pay['partner'] = $payment_info['config']['alipay_partner'];
     //合作商户ID
     $pay['seller'] = $payment_info['config']['alipay_account'];
     //账户ID
     $pay['key'] = $payment_info['config']['alipay_key'];
     //支付宝(RSA)公钥
     $pay['is_wap'] = 1;
     $pay['pay_code'] = 'walipay';
     //,支付宝;mtenpay,财付通;mcod,货到付款
     return $pay;
 }
Example #11
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $sql = "select name " . "from " . DB_PREFIX . "deal_order_item " . "where order_id =" . intval($payment_notice['order_id']);
     $title_name = $GLOBALS['db']->getOne($sql);
     $subject = msubstr($title_name, 0, 40);
     $data_return_url = SITE_DOMAIN . APP_ROOT . '/index.php.php?ctl=payment&act=response&class_name=Wtenpay';
     $notify_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Wtenpay';
     $pay = array();
     $pay['subject'] = $subject;
     $pay['body'] = $title_name;
     $pay['total_fee'] = $money;
     $pay['total_fee_format'] = format_price($money);
     $pay['out_trade_no'] = $payment_notice['notice_sn'];
     $pay['notify_url'] = $notify_url;
     $pay['partner'] = $payment_info['config']['tenpay_partner'];
     //合作商户ID
     $pay['key'] = $payment_info['config']['tenpay_key'];
     //支付宝(RSA)公钥
     $pay['pay_code'] = 'wtenpay';
     //,支付宝;mtenpay,财付通;mcod,货到付款
     return $pay;
 }
Example #12
0
function get_supplier_info($id)
{
    $supplier_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier where is_effect = 1 and id=" . $id);
    if ($supplier_info) {
        $main_location = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "supplier_location where supplier_id = " . $supplier_info['id'] . " and is_main = 1");
        $supplier_info['tel'] = $main_location['tel'];
        $supplier_info['address'] = $main_location['address'];
        $supplier_info['contact'] = $main_location['contact'];
        $supplier_info['brief'] = $main_location['brief'];
        $supplier_info['deal_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "deal where supplier_id = " . $supplier_info['id'] . " and is_effect = 1 and is_delete = 0 and buy_type <> 1 and time_status > 0");
        $max_price = $GLOBALS['db']->getOne("select max(current_price) from " . DB_PREFIX . "deal where supplier_id = " . $supplier_info['id'] . " and is_effect = 1 and is_delete = 0 and buy_type <> 1");
        $min_price = $GLOBALS['db']->getOne("select min(current_price) from " . DB_PREFIX . "deal where supplier_id = " . $supplier_info['id'] . " and is_effect = 1 and is_delete = 0 and buy_type <> 1");
        if ($max_price == $min_price) {
            $supplier_info['deal_price'] = format_price($max_price);
        } else {
            $supplier_info['deal_price'] = format_price($min_price) . " - " . format_price($max_price);
        }
        $supplier_info['comment_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "message where rel_table='supplier' and rel_id = " . $supplier_info['id']);
        $supplier_info['comment1_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "message where rel_table='supplier' and rel_id = " . $supplier_info['id'] . " and point = 1");
        //差
        $supplier_info['comment2_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "message where rel_table='supplier' and rel_id = " . $supplier_info['id'] . " and point = 2");
        //中
        $supplier_info['comment3_count'] = $GLOBALS['db']->getOne("select count(*) from " . DB_PREFIX . "message where rel_table='supplier' and rel_id = " . $supplier_info['id'] . " and point = 3");
        //好
        $supplier_info['location_list'] = $GLOBALS['db']->getAll("select * from " . DB_PREFIX . "supplier_location where supplier_id = " . $supplier_info['id']);
    }
    return $supplier_info;
}
Example #13
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     $root['user_id'] = $user_id;
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $bank_list = $GLOBALS['db']->getAll("SELECT u.id, u.bankcard,u.real_name, b.name as bank_name, b.id as bank_id FROM " . DB_PREFIX . "user_bank u left join " . DB_PREFIX . "bank b on b.id = u.bank_id where u.user_id=" . $user_id . " ORDER BY u.id ASC");
         foreach ($bank_list as $k => $v) {
             $bank_list[$k]['bankcode'] = str_replace(" ", "", $v['bankcard']);
             $bank_list[$k]['img'] = str_replace("/mapi", "", SITE_DOMAIN . APP_ROOT . '/public/bank/' . $v['bank_id'] . '.jpg');
         }
         $root['item'] = $bank_list;
         //手续费
         $fee_config = load_auto_cache("user_carry_config");
         $json_fee = array();
         foreach ($fee_config as $k => $v) {
             $json_fee[] = $v;
             $fee_config[$k]['fee_format'] = format_price($v['fee']);
         }
         $root['fee_config'] = $fee_config;
         //$root['json_fee'] = json_encode($json_fee);
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['idno'] = $user['idno'];
         //身份证号
         $root['real_name'] = $user['real_name'];
         //第三方托管标
         if (!empty($user['ips_acct_no']) && intval(app_conf("OPEN_IPS")) > 0) {
             $result = GetIpsUserMoney($user_id, 0);
             $root['ips_money'] = $result['pBalance'];
             //提现 http://p2p.fanwe.net/index.php?ctl=collocation&act=DoDwTrade&user_type=0&from=app&user_id=44&pTrdAmt=10
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=DoDwTrade&user_type=0&pTrdAmt=parm_amt&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['dw_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
         } else {
             //申请
             $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
             $root['acct_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
             $root['ips_money'] = 0;
         }
         $root['ips_money_format'] = format_price($root['ips_money']);
         //预留 提现金额
         $root['ips_money_fee'] = 0;
         //预留 提现费用
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "提现";
     output($root);
 }
Example #14
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $data_return_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=AlipayBank';
     $data_notify_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=AlipayBank';
     $service = 'create_direct_pay_by_user';
     /* 银行类型 */
     $bank_type = $GLOBALS['db']->getOne("select bank_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $parameter = array('service' => $service, 'partner' => $payment_info['config']['alipay_partner'], '_input_charset' => 'utf-8', 'notify_url' => $data_notify_url, 'return_url' => $data_return_url, 'subject' => $order_sn, 'out_trade_no' => $payment_notice['notice_sn'], 'price' => $money, 'quantity' => 1, 'payment_type' => 1, 'logistics_type' => 'EXPRESS', 'logistics_fee' => 0, 'logistics_payment' => 'BUYER_PAY_AFTER_RECEIVE', 'seller_email' => $payment_info['config']['alipay_account'], 'defaultbank' => $bank_type, 'payment' => 'bankPay');
     ksort($parameter);
     reset($parameter);
     $param = '';
     $sign = '';
     foreach ($parameter as $key => $val) {
         $param .= "{$key}=" . urlencode($val) . "&";
         $sign .= "{$key}={$val}&";
     }
     $param = substr($param, 0, -1);
     $sign = substr($sign, 0, -1) . $payment_info['config']['alipay_key'];
     $sign_md5 = md5($sign);
     $payLinks = '<form action="https://mapi.alipay.com/gateway.do?' . $param . '&sign=' . $sign_md5 . '&sign_type=MD5" target="_blank" method="post" ><button type="submit" class="ui-button paybutton" rel="blue">前往支付宝在线支付</button></form>';
     $code = '<div style="text-align:center">' . $payLinks . '</div>';
     $code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $data_return_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=AlipayBank';
     $data_notify_url = get_domain() . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=AlipayBank';
     $service = 'create_direct_pay_by_user';
     /* 银行类型 */
     $bank_type = $GLOBALS['db']->getOne("select bank_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $parameter = array('service' => $service, 'partner' => $payment_info['config']['alipay_partner'], '_input_charset' => 'utf-8', 'notify_url' => $data_notify_url, 'return_url' => $data_return_url, 'subject' => $order_sn, 'out_trade_no' => $payment_notice['notice_sn'], 'price' => $money, 'quantity' => 1, 'payment_type' => 1, 'logistics_type' => 'EXPRESS', 'logistics_fee' => 0, 'logistics_payment' => 'BUYER_PAY_AFTER_RECEIVE', 'seller_email' => $payment_info['config']['alipay_account'], 'defaultbank' => $bank_type, 'payment' => 'bankPay');
     ksort($parameter);
     reset($parameter);
     $param = '';
     $sign = '';
     foreach ($parameter as $key => $val) {
         $param .= "{$key}=" . urlencode($val) . "&";
         $sign .= "{$key}={$val}&";
     }
     $param = substr($param, 0, -1);
     $sign = substr($sign, 0, -1) . $payment_info['config']['alipay_key'];
     $sign_md5 = md5($sign);
     $payLinks = '<a href="https://www.alipay.com/cooperate/gateway.do?' . $param . '&sign=' . $sign_md5 . '&sign_type=MD5" target="_blank"><span class="paybutton" name="buy">' . sprintf($this->payment_lang['GO_TO_PAY'], $this->get_name($bank_type)) . '</span></a>';
     if (!empty($payment_info['logo'])) {
         $payLinks = '<a href="https://www.alipay.com/cooperate/gateway.do?' . $param . '&sign=' . $sign_md5 . '&sign_type=MD5" target="_blank" class="payLink"><img src=' . APP_ROOT . $payment_info['logo'] . ' style="border:solid 1px #ccc;" /></a><div class="blank"></div>' . $payLinks;
     }
     $code = '<div style="text-align:center">' . $payLinks . '</div>';
     $code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
Example #16
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $page = intval($GLOBALS['request']['page']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/uc_func.php';
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         if ($page == 0) {
             $page = 1;
         }
         $limit = ($page - 1) * app_conf("PAGE_SIZE") . "," . app_conf("PAGE_SIZE");
         $result = get_user_log($limit, $GLOBALS['user_info']['id'], 'money');
         $list = $result['list'];
         foreach ($list as $k => $v) {
             $list[$k]['log_time_format'] = to_date($v['log_time'], "Y-m-d H:i:s");
             $list[$k]['money_format'] = format_price($v['money']);
             $list[$k]['lock_money_format'] = format_price($v['lock_money']);
         }
         $root['item'] = $list;
         $root['page'] = array("page" => $page, "page_total" => ceil($result['count'] / app_conf("PAGE_SIZE")));
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Example #17
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     //$order_sn = $GLOBALS['db']->getOne("select order_sn from ".DB_PREFIX."deal_order where id = ".$payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     //$sql = "select name from ".DB_PREFIX."deal_order_item where order_id =". intval($payment_notice['order_id']);
     //$title_name = $GLOBALS['db']->getOne($sql);
     $subject = $payment_notice['order_sn'];
     //$data_return_url = SITE_DOMAIN.APP_ROOT.'/index.php?ctl=payment&act=response&class_name=Walipay';
     $notify_url = SITE_DOMAIN . APP_ROOT . '/alipay_web/alipayapi.php?order_id=' . $payment_notice['order_id'];
     $notify_url = str_replace("/mapi", "", $notify_url);
     $pay = array();
     $pay['subject'] = $subject;
     $pay['body'] = '会员充值';
     $pay['total_fee'] = $money;
     $pay['total_fee_format'] = format_price($money);
     $pay['out_trade_no'] = $payment_notice['notice_sn'];
     $pay['notify_url'] = $notify_url;
     $pay['partner'] = '';
     //$payment_info['config']['alipay_partner'];//合作商户ID
     $pay['seller'] = '';
     //$payment_info['config']['alipay_account'];//账户ID
     $pay['key'] = '';
     //$payment_info['config']['alipay_key'];//支付宝(RSA)公钥
     $pay['is_wap'] = 1;
     //
     $pay['pay_code'] = 'walipay';
     //,支付宝;mtenpay,财付通;mcod,货到付款
     return $pay;
 }
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order = $GLOBALS['db']->getRow("select order_sn,bank_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $_TransID = $order['order_sn'];
     $_OrderMoney = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $_Merchant_url = SITE_DOMAIN . APP_ROOT . '/baofoo_callback.php?act=response';
     $_Return_url = SITE_DOMAIN . APP_ROOT . '/baofoo_callback.php?act=notify';
     /* 交易日期 */
     $_TradeDate = to_date($payment_notice['create_time'], 'YmdHis');
     $_MerchantID = $payment_info['config']['baofoo_account'];
     $_PayID = $order['bank_id'];
     if (intval($_PayID) == 1000 || intval($_PayID) == 0) {
         $_PayID = "";
     }
     $_NoticeType = 1;
     $_Md5Key = $payment_info['config']['baofoo_key'];
     $_TerminalID = $payment_info['config']['baofoo_terminal'];
     $_AdditionalInfo = $payment_notice_id;
     $_Md5_OrderMoney = $_OrderMoney * 100;
     $MARK = "|";
     $_Signature = md5($_MerchantID . $MARK . $_PayID . $MARK . $_TradeDate . $MARK . $_TransID . $MARK . $_Md5_OrderMoney . $MARK . $_Merchant_url . $MARK . $_Return_url . $MARK . $_NoticeType . $MARK . $_Md5Key);
     /*交易参数*/
     $parameter = array('MemberID' => $_MerchantID, 'TransID' => $_TransID, 'PayID' => $_PayID, 'TradeDate' => $_TradeDate, 'OrderMoney' => $_OrderMoney * 100, 'ProductName' => $_TransID, 'Amount' => 1, 'ProductLogo' => '', 'Username' => '', 'AdditionalInfo' => $_AdditionalInfo, 'PageUrl' => $_Merchant_url, 'ReturnUrl' => $_Return_url, 'NoticeType' => $_NoticeType, 'Signature' => $_Signature, 'TerminalID' => $_TerminalID, 'InterfaceVersion' => "4.0", 'KeyType' => "1");
     $def_url = '<form style="text-align:center;" action="http://gw.baofoo.com/payindex" target="_blank" style="margin:0px;padding:0px" method="POST" >';
     foreach ($parameter as $key => $val) {
         $def_url .= "<input type='hidden' name='{$key}' value='{$val}' />";
     }
     $def_url .= "<input type='submit' class='paybutton' value='前往" . $this->payment_lang['baofoo_gateway_' . intval($_PayID)] . "' />";
     $def_url .= "</form>";
     $def_url .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($_OrderMoney) . "</div>";
     return $def_url;
 }
Example #19
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     //$order_sn = $GLOBALS['db']->getOne("select order_sn from ".DB_PREFIX."deal_order where id = ".$payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     /* 银行类型 */
     //$bank_id = $GLOBALS['db']->getOne("select bank_id from ".DB_PREFIX."deal_order where id = ".$payment_notice['order_id']);
     $bank_id = $payment_notice['bank_id'];
     $payChannel = $this->config['sdo_paychannel'];
     $defaultChannel = $this->config['sdo_defaultchannel'];
     if ($bank_id == '0' || trim($bank_id) == 'SDO1' || trim($bank_id) == 'SDO') {
         $bank_id = '';
     }
     $postBackURL = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Sdo';
     //付款完成后的跳转页面
     $notifyURL = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Sdo';
     //通知发货页面
     $shengpay = new shengpay();
     $array = array('Name' => 'B2CPayment', 'Version' => 'V4.1.1.1.1', 'Charset' => 'UTF-8', 'MsgSender' => $payment_info['config']['sdo_account'], 'SendTime' => to_date(get_gmtime(), 'YmdHis'), 'OrderTime' => to_date(get_gmtime(), 'YmdHis'), 'PayType' => 'PT001', 'PayChannel' => '14,18,19,20', 'InstCode' => $bank_id, 'PageUrl' => $postBackURL, 'NotifyUrl' => $notifyURL, 'ProductName' => $payment_notice_id, 'BuyerContact' => '', 'BuyerIp' => '', 'Ext1' => '', 'Ext2' => '', 'SignType' => 'MD5');
     $shengpay->init($array);
     $shengpay->setKey($payment_info['config']['sdo_key']);
     /*
     /*
     	商家自行检测传入的价格与数据库订单需支付金额是否相同
     */
     $code = $shengpay->takeOrder($payment_notice_id, $money, $payment_info);
     $code .= "<br /><span class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</span>";
     return $code;
 }
Example #20
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order_sn = $GLOBALS['db']->getOne("select order_sn from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $data_vid = trim($payment_info['config']['chinabank_account']);
     $data_orderid = $payment_notice['notice_sn'];
     $data_vamount = $money;
     $data_vmoneytype = 'CNY';
     $data_vpaykey = trim($payment_info['config']['chinabank_key']);
     $data_vreturnurl = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Chinabank';
     $data_notify_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Chinabank';
     $MD5KEY = $data_vamount . $data_vmoneytype . $data_orderid . $data_vid . $data_vreturnurl . $data_vpaykey;
     $MD5KEY = strtoupper(md5($MD5KEY));
     $payLinks = '<form style="text-align:center;" method=post action="https://pay3.chinabank.com.cn/PayGate" target="_blank">';
     $payLinks .= "<input type=HIDDEN name='v_mid' value='" . $data_vid . "'>";
     $payLinks .= "<input type=HIDDEN name='v_oid' value='" . $data_orderid . "'>";
     $payLinks .= "<input type=HIDDEN name='v_amount' value='" . $data_vamount . "'>";
     $payLinks .= "<input type=HIDDEN name='v_moneytype'  value='" . $data_vmoneytype . "'>";
     $payLinks .= "<input type=HIDDEN name='v_url'  value='" . $data_vreturnurl . "'>";
     $payLinks .= "<input type=HIDDEN name='v_md5info' value='" . $MD5KEY . "'>";
     $payLinks .= "<input type=HIDDEN name='remark1' value=''>";
     $payLinks .= "<input type=HIDDEN name='remark2' value='[url:=" . $data_notify_url . "]'>";
     if (!empty($payment_info['logo'])) {
         $payLinks .= "<input type='image' src='" . APP_ROOT . $payment_info['logo'] . "' style='border:solid 1px #ccc;'><div class='blank'></div>";
     }
     $payLinks .= "<input type='submit' class='paybutton' value='前往网银在线支付'>";
     $payLinks .= "</form>";
     $code = '<div style="text-align:center">' . $payLinks . '</div>';
     $code .= "<br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
Example #21
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $sql = "select name " . "from " . DB_PREFIX . "deal_order_item " . "where order_id =" . intval($payment_notice['order_id']);
     $title_name = $GLOBALS['db']->getOne($sql);
     $subject = msubstr($title_name, 0, 40);
     //$data_return_url = get_domain().APP_ROOT.'/../payment.php?act=return&class_name=Malipay';
     $notify_url = get_domain() . APP_ROOT . '/../shop.php?ctl=payment&act=response&class_name=Malipay';
     $pay = array();
     $pay['subject'] = $subject;
     $pay['body'] = $title_name;
     $pay['total_fee'] = $money;
     $pay['total_fee_format'] = format_price($money);
     $pay['out_trade_no'] = $payment_notice['notice_sn'];
     $pay['notify_url'] = $notify_url;
     $pay['partner'] = $payment_info['config']['alipay_partner'];
     //合作商户ID
     $pay['seller'] = $payment_info['config']['alipay_account'];
     //账户ID
     $pay['rsa_alipay_public'] = $payment_info['config']['alipay_rsa_public'];
     //支付宝(RSA)公钥
     $pay['pay_code'] = 'malipay';
     //,支付宝;mtenpay,财付通;mcod,货到付款
     $order_spec = '';
     $order_spec .= 'partner="' . $pay['partner'] . '"';
     //合作商户ID
     $order_spec .= '&seller="' . $pay['seller'] . '"';
     //账户ID
     $order_spec .= '&out_trade_no="' . $pay['out_trade_no'] . '"';
     $order_spec .= '&subject="' . $pay['subject'] . '"';
     $order_spec .= '&body="' . $pay['body'] . '"';
     $order_spec .= '&total_fee="' . $pay['total_fee'] . '"';
     $order_spec .= '&notify_url="' . $pay['notify_url'] . '"';
     $pay['order_spec'] = $order_spec;
     $sign = $this->sign($order_spec);
     $pay['sign'] = urlencode($sign);
     $pay['sign_type'] = 'RSA';
     /*
     $pubkey = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQC6IQ/HH06GbTIhKNN/YSQXxllnP7cNERMuN16GgZDfuf9NrY/Bw2ZINkq1RMNlbP66Vu5y0gwYPC/7PbO5l6pbnl3N4rw5VY3U6rtIC0f8ADDLrIZwShYUitaFq+Ao7rhk/GbpfSD7vgnugQz74fVewi17S3Apujq4U4LAxFmVowIDAQAB';
     $pubkey = $this->getPublicKeyFromX509($pubkey);
     
     $res = openssl_pkey_get_public($pubkey);		
     $sign = base64_decode($sign);
     $verify = openssl_verify($order_spec, $sign, $res);
     if ($verify == 1)
     {
     	$pay['openssl_verify'] = 'ok';
     }else{
     	$pay['openssl_verify'] = 'error';
     }		
     */
     //
     //		print_r($payment_info['config']);
     //		print_r($pay);exit;
     return $pay;
 }
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         require APP_ROOT_PATH . 'app/Lib/deal.php';
         $root['user_login_status'] = 1;
         $deal = get_deal($id);
         $root['deal'] = $deal;
         //还款列表
         $loan_list = $GLOBALS['db']->getAll("SELECT * FROM " . DB_PREFIX . "deal_repay where deal_id={$id} ORDER BY repay_time ASC");
         $manage_fee = 0;
         $impose_money = 0;
         $repay_money = 0;
         foreach ($loan_list as $k => $v) {
             $manage_fee += $v['manage_money'];
             $impose_money += $v['impose_money'];
             $repay_money += $v['repay_money'];
             //还款日
             $loan_list[$k]['repay_time_format'] = to_date($v['repay_time'], 'Y-m-d');
             $loan_list[$k]['true_repay_time_format'] = to_date($v['true_repay_time'], 'Y-m-d');
             //待还本息
             $loan_list[$k]['repay_money_format'] = format_price($v['repay_money']);
             //借款管理费
             $loan_list[$k]['manage_money_format'] = format_price($v['manage_money']);
             //逾期费用
             $loan_list[$k]['impose_money_format'] = format_price($v['impose_money']);
             //状态
             if ($v['status'] == 0) {
                 $loan_list[$k]['status_format'] = '提前还款';
             } elseif ($v['status'] == 1) {
                 $loan_list[$k]['status_format'] = '准时还款';
             } elseif ($v['status'] == 2) {
                 $loan_list[$k]['status_format'] = '逾期还款';
             } elseif ($v['status'] == 3) {
                 $loan_list[$k]['status_format'] = '严重逾期';
             }
         }
         $root['manage_fee'] = $manage_fee;
         $root['impose_money'] = $impose_money;
         $root['repay_money'] = $repay_money;
         $root['loan_list'] = $loan_list;
         $inrepay_info = $GLOBALS['db']->getRow("SELECT * FROM " . DB_PREFIX . "deal_inrepay_repay WHERE deal_id={$id}");
         $root['inrepay_info'] = $inrepay_info;
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     $root['program_title'] = "提前还款";
     output($root);
 }
Example #23
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $code = "请汇款至以下账户<br /><br />收款账号:" . $payment_info['config']['pay_account'] . "<br /><br />" . "收款人:" . $payment_info['config']['pay_account_name'];
     $code .= "<br /><br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
function get_tax($price = NULL, $percentage = NULL)
{
    if (!$price) {
        return format_price(0);
    }
    if (!$percentage) {
        return format_price(0);
    }
    return format_price($price * ($percentage / 100));
}
 public function get_display_code()
 {
     $user_id = intval($GLOBALS['user_info']['id']);
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id . " and is_effect = 1 and is_delete = 0");
     if ($user_info && $user_info['money'] > 0) {
         $html = "<p>帐户余额:<strong>" . format_price($user_info['money']) . "</strong>," . $GLOBALS['payment_lang']['use_user_money'] . " <input type='text' style='width: 50px;' value='' name='account_money' class='f-input' id='account_money'>," . "<label><input type='checkbox' checked='checked' id='check-all-money' name='all_account_money'>全额支付</label></p>";
         return $html;
     } else {
         return '';
     }
 }
Example #26
0
 public function get_display_code()
 {
     $user_id = intval($GLOBALS['user_info']['id']);
     $user_info = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "user where id = " . $user_id . " and is_effect = 1 and is_delete = 0");
     if ($user_info && $user_info['money'] > 0) {
         $html = "<p>帐户余额:<b>" . format_price($user_info['money']) . "</b>,使用余额支付" . " <input type='text' style='width: 50px; margin-bottom:-5px;' value='' name='account_money' class='ui-textbox' id='account_money'>," . "<label class='ui-checkbox' rel='common_cbo'><input type='checkbox' checked='checked' id='check-all-money' name='all_account_money'>全额支付</label></p>";
         return $html;
     } else {
         return '';
     }
 }
Example #27
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $bank_id = (int) $GLOBALS['db']->getOne("select bank_id from " . DB_PREFIX . "deal_order where id=" . intval($payment_notice['order_id']));
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $code = "收款帐号:" . $payment_info['config']['pay_account'][$bank_id] . "<br /><br />开户行:" . $payment_info['config']['pay_bank'][$bank_id] . "<br /><br />收款人:" . $payment_info['config']['pay_account_name'][$bank_id];
     /*if($payment_notice['memo'])
     		$code .= "<br /><br />银行流水号:".$payment_notice['memo'];*/
     $code .= "<br /><br /><div style='text-align:center' class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</div>";
     return $code;
 }
Example #28
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     $id = intval($GLOBALS['request']['id']);
     $type = intval($GLOBALS['request']['type']);
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $root['response_code'] = 1;
         $root['open_ips'] = intval(app_conf("OPEN_IPS"));
         $root['ips_acct_no'] = $user['ips_acct_no'];
         $root['idno'] = $user['idno'];
         //身份证号
         $root['real_name'] = $user['real_name'];
         $app_url = APP_ROOT . "/index.php?ctl=collocation&act=CreateNewAcct&user_type=0&user_id=" . $user_id . "&from=" . $GLOBALS['request']['from'];
         $root['acct_url'] = str_replace("/mapi", "", SITE_DOMAIN . $app_url);
         if ($type == 0) {
             $deal_id = $id;
         } else {
             if ($type == 1) {
                 $deal_id = $GLOBALS['db']->getOne("SELECT deal_id FROM " . DB_PREFIX . "deal_load_transfer WHERE id = " . $id);
             }
         }
         $ips_bill_no = $GLOBALS['db']->getOne("SELECT ips_bill_no FROM " . DB_PREFIX . "deal WHERE id = " . $deal_id);
         $root['ips_bill_no'] = $ips_bill_no;
         if (!empty($root['ips_bill_no'])) {
             //第三方托管标
             if (!empty($user['ips_acct_no'])) {
                 $result = GetIpsUserMoney($user_id, 0);
                 $root['user_money'] = $result['pBalance'];
             } else {
                 $root['user_money'] = 0;
             }
         } else {
             $root['user_money'] = $user['money'];
         }
         $root['user_money_format'] = format_price($root['user_money']);
         //用户金额
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }
Example #29
0
 public function get_payment_code($payment_notice_id)
 {
     $payment_notice = $GLOBALS['db']->getRow("select * from " . DB_PREFIX . "payment_notice where id = " . $payment_notice_id);
     $order = $GLOBALS['db']->getRow("select order_sn,user_id from " . DB_PREFIX . "deal_order where id = " . $payment_notice['order_id']);
     $money = round($payment_notice['money'], 2);
     $payment_info = $GLOBALS['db']->getRow("select id,config,logo from " . DB_PREFIX . "payment where id=" . intval($payment_notice['payment_id']));
     $payment_info['config'] = unserialize($payment_info['config']);
     $order_sn = $order['order_sn'];
     $user_id = $order['user_id'];
     include "yeepay/yeepayMPay.php";
     $yeepay = new yeepayMPay($payment_info['config']['merchantaccount'], $payment_info['config']['merchantPublicKey'], $payment_info['config']['merchantPrivateKey'], $payment_info['config']['yeepayPublicKey']);
     //print_r($payment_info['config']);exit;
     $data_return_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=response&class_name=Yjpay';
     $data_notify_url = SITE_DOMAIN . APP_ROOT . '/index.php?ctl=payment&act=notify&class_name=Yjpay';
     $order_id = $payment_notice['notice_sn'];
     //网页支付的订单在订单有效期内可以进行多次支付请求,但是需要注意的是每次请求的业务参数都要一致,交易时间也要保持一致。否则会报错“订单与已存在的订单信息不符”
     $transtime = get_gmtime();
     // time();//交易时间,是每次支付请求的时间,注意此参数在进行多次支付的时候要保持一致。
     $product_catalog = '1';
     //商品类编码是我们业管根据商户业务本身的特性进行配置的业务参数。
     $identity_id = $user_id;
     //用户身份标识,是生成绑卡关系的因素之一,在正式环境此值不能固定为一个,要一个用户有唯一对应一个用户标识,以防出现盗刷的风险且一个支付身份标识只能绑定5张银行卡
     $identity_type = 2;
     //支付身份标识类型码
     $user_ip = get_client_ip();
     //此参数不是固定的商户服务器IP,而是用户每次支付时使用的网络终端IP,否则的话会有不友好提示:“检测到您的IP地址发生变化,请注意支付安全”。
     $user_ua = $_SERVER['HTTP_USER_AGENT'];
     //'NokiaN70/3.0544.5.1 Series60/2.8 Profile/MIDP-2.0 Configuration/CLDC-1.1';//用户ua
     $callbackurl = $data_notify_url;
     //商户后台系统回调地址,前后台的回调结果一样
     $fcallbackurl = $data_return_url;
     //商户前台系统回调地址,前后台的回调结果一样
     $product_name = '订单号-' . $order_sn;
     //出于风控考虑,请按下面的格式传递值:应用-商品名称,如“诛仙-3 阶成品天琊”
     $product_desc = '';
     //商品描述
     $terminaltype = 3;
     $terminalid = '';
     //其他支付身份信息
     $amount = $money * 100;
     //订单金额单位为分,支付时最低金额为2分,因为测试和生产环境的商户都有手续费(如2%),易宝支付收取手续费如果不满1分钱将按照1分钱收取。
     $url = $yeepay->pcWebPay($order_id, $transtime, $amount, $product_catalog, $identity_id, $identity_type, $user_ip, $user_ua, $callbackurl, $fcallbackurl, $currency = 156, $product_name, $product_desc, $terminaltype, $terminalid, $orderexp_date = 60);
     $arr = explode("&", $url);
     $encrypt = explode("=", $arr[1]);
     $data = explode("=", $arr[2]);
     $code = "<a target='' href={$url}>一键支付</a>";
     $code .= "<br /><span class='red'>" . $GLOBALS['lang']['PAY_TOTAL_PRICE'] . ":" . format_price($money) . "</span>";
     return $code;
 }
Example #30
0
 public function index()
 {
     $root = array();
     $email = strim($GLOBALS['request']['email']);
     //用户名或邮箱
     $pwd = strim($GLOBALS['request']['pwd']);
     //密码
     //检查用户,用户密码
     $user = user_check($email, $pwd);
     $user_id = intval($user['id']);
     if ($user_id > 0) {
         $root['user_login_status'] = 1;
         $user['group_name'] = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "user_group where id = " . $user['group_id'] . " ");
         $province_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $user['province_id']);
         $city_str = $GLOBALS['db']->getOne("select name from " . DB_PREFIX . "region_conf where id = " . $user['city_id']);
         if ($province_str . $city_str == '') {
             $user_location = $GLOBALS['lang']['LOCATION_NULL'];
         } else {
             $user_location = $province_str . " " . $city_str;
         }
         $user['user_location'] = $user_location;
         $user['money_format'] = format_price($user['money']);
         //可用资金
         $user['lock_money_format'] = format_price($user['lock_money']);
         //冻结资金
         $user['total_money'] = intval($user['money']) + intval($user['lock_money']);
         //资金余额
         $user['total_money_format'] = format_price($user['total_money']);
         //资金余额
         $user['create_time_format'] = to_date($user['create_time'], 'Y-m-d');
         //注册时间
         $root['response_code'] = 1;
         $root['user_location'] = $user['user_location'];
         $root['user_name'] = $user['user_name'];
         $root['group_name'] = $user['group_name'];
         $root['money_format'] = $user['money_format'];
         $root['money'] = $user['money'];
         $root['lock_money_format'] = $user['lock_money_format'];
         $root['lock_money'] = $user['lock_money'];
         $root['total_money'] = $user['total_money'];
         $root['total_money_format'] = $user['total_money_format'];
         $root['create_time_format'] = $user['create_time_format'];
     } else {
         $root['response_code'] = 0;
         $root['show_err'] = "未登录";
         $root['user_login_status'] = 0;
     }
     output($root);
 }