Beispiel #1
0
function check_money($order_id, $money)
{
    $pay = get_pay_one($order_id);
    if ($pay['money'] != $money) {
        return false;
    } else {
        return true;
    }
}
Beispiel #2
0
function payment_onlinepay()
{
    global $_MooClass, $dbTablePre, $uid, $pay_sty, $payment_code, $user_arr, $paymoney, $paymoney2, $activitytime1, $activitytime2;
    if (empty($uid)) {
        header("location:index.php?n=login");
    }
    $res_sid = $_MooClass['MooMySQL']->getOne("select sid from {$dbTablePre}members where uid='{$uid}'");
    $sid = $res_sid['sid'];
    $channel = MooGetGPC('channel', 'string', 'P');
    $pay = MooGetGPC('pay', 'string', 'P');
    $pay_type = array('pay', 'pay_diamond', 'city_star', 'pay_add_money');
    $time = time();
    $order = array();
    if (!in_array($channel, $pay_type)) {
        MooMessage('您选择的服务有误。', 'index.php?n=payment');
    }
    if (empty($pay)) {
        if ($channel == 'pay_diamond') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel_diamond');
        } elseif ($channel == 'city_star') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=city_star');
        } elseif ($channel == 'pay_add_money') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=add_money');
        } else {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel');
        }
    }
    if ($channel == 'pay') {
        //note 高级会员
        if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) {
            $order['order_amount'] = $paymoney2['vip'];
        } else {
            $order['order_amount'] = $paymoney['vip'];
        }
        $order['order_type'] = '1';
        //0钻石会员 1高级会员 2城市之星
        $order['subject'] = "真爱一生网高级会员";
    } elseif ($channel == 'city_star') {
        if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) {
            $order['order_amount'] = $paymoney2['citystar'];
        } else {
            $order['order_amount'] = $paymoney['citystar'];
        }
        $order['order_type'] = '2';
        $order['subject'] = "真爱一生网城市之星";
    } elseif ($channel == 'pay_diamond') {
        if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) {
            $order['order_amount'] = $paymoney2['diamond'];
        } else {
            $order['order_amount'] = $paymoney['diamond'];
        }
        $order['order_type'] = '0';
        $order['subject'] = "真爱一生网钻石会员";
    } elseif ($channel == 'pay_add_money') {
        if ($time >= strtotime($activitytime1) && $time < strtotime($activitytime2)) {
            $order['order_amount'] = $paymoney2['add_money'];
        } else {
            $order['order_amount'] = $paymoney['add_money'];
        }
        $order['order_type'] = 5;
        $order['subject'] = "高级会员升级钻石会员";
    }
    $order['order_sn'] = date('YmdHms', $time) . $uid;
    $payment = get_payment($pay);
    $plugin_file = "module/payment/" . $pay . ".php";
    if (file_exists($plugin_file)) {
        /* 根据支付方式代码创建支付类的对象并调用其响应操作方法 */
        include_once $plugin_file;
        $pays = new $pay();
        $order['order_amount'] += (double) $payment['m_fee'] * $order['order_amount'] / 100;
        $order['order_amount'] = round($order['order_amount'], 2);
        //支付金额保留两位小数
        if ($user_arr['s_cid'] == '1' && $order['order_type'] == '1') {
            $sql = "insert into {$dbTablePre}payment_new (uid,pay_type,pay_bank,order_id,status,pay_money,pay_service,apply_sid,apply_time,contact) values('{$uid}','2','{$pay}','{$order['order_sn']}','0','{$order['order_amount']}','3','{$sid}','{$time}','{$user_arr['telphone']}')";
        } else {
            $sql = "insert into {$dbTablePre}payment_new (uid,pay_type,pay_bank,order_id,status,pay_money,pay_service,apply_sid,apply_time,contact) values('{$uid}','2','{$pay}','{$order['order_sn']}','0','{$order['order_amount']}','{$order['order_type']}','{$sid}','{$time}','{$user_arr['telphone']}')";
        }
        $_MooClass['MooMySQL']->query($sql);
        $o = get_pay_one($order['order_sn']);
        $order['log_id'] = $o['pid'];
        $reqUrl = $pays->get_code($order, $payment);
    }
    //      echo $reqUrl;exit;
    if (!empty($reqUrl)) {
        if ($pay != 'yeepay') {
            echo '<script language="JavaScript">self.location=\'' . $reqUrl . '\';</script>';
        } else {
            echo $reqUrl;
        }
    } else {
        MooMessage('您的请求有误请重新提交请求。', 'index.php?n=payment');
    }
}
Beispiel #3
0
function payment_onlinepay()
{
    global $_MooClass, $dbTablePre, $uid, $payment_code, $user_arr, $paymoney, $timestamp;
    if (empty($uid)) {
        header("login.html");
    }
    $flag = true;
    $res_sid = $_MooClass['MooMySQL']->getOne("select sid from {$dbTablePre}members_search where uid='{$uid}'", true);
    $sid = $res_sid['sid'];
    $channel = MooGetGPC('channel', 'string', 'P');
    $pay_type = array('pay_validateID', 'pay', 'pay_diamond', 'city_star', 'pay_add_money', 'pay_add_money_other', 'pay_platinum');
    $time = time();
    $order = array();
    if (!in_array($channel, $pay_type)) {
        MooMessage('您选择的服务有误。', 'index.php?n=payment');
    }
    switch ($channel) {
        case 'pay':
            //note 高级会员
            $order['order_amount'] = $paymoney['vip'];
            $order['order_type'] = '1';
            //0钻石会员 1高级会员 2城市之星
            $order['subject'] = "真爱一生网高级会员";
            $order['memo'] = "您即将升级成为{$order['subject']},3个月服务费: {$order['order_amount']}";
            break;
        case 'city_star':
            $order['order_amount'] = $paymoney['citystar'];
            $order['order_type'] = '2';
            $order['subject'] = "真爱一生网城市之星";
            $order['memo'] = "您即将升级成为{$order['subject']},1个月服务费: {$order['order_amount']}";
            break;
        case 'pay_diamond':
            $order['order_amount'] = $paymoney['diamond'];
            $order['order_type'] = '0';
            $order['subject'] = "真爱一生网钻石会员";
            $order['memo'] = "您即将升级成为{$order['subject']},6个月服务费: {$order['order_amount']}";
            break;
        case 'pay_add_money':
            $order['order_amount'] = $paymoney['add_money'];
            $order['order_type'] = 5;
            $order['subject'] = "高级会员升级为钻石会员";
            $order['memo'] = "您即将从真爱一生网的{$order['subject']},3个月服务费: {$order['order_amount']}";
            break;
        case 'pay_add_money_other':
            $p3_Amt = MooGetGPC('p3_Amt', 'integer', 'P');
            $order['subject'] = MooGetGPC('text', 'string', 'P');
            $order['order_amount'] = $p3_Amt;
            $order['order_type'] = 6;
            break;
        case 'pay_platinum':
            $order['order_amount'] = $paymoney['platinum'];
            $order['order_type'] = '-1';
            $order['subject'] = "真爱一生网铂金会员";
            $order['memo'] = "您即将升级成为{$order['subject']},6个月服务费: {$order['order_amount']}";
            break;
        case 'pay_validateID':
            $order['order_amount'] = 5.0;
            $order['order_type'] = '100';
            $order['subject'] = "身份通认证";
            $flag = false;
            break;
        default:
            //note 高级会员
            $order['order_amount'] = $paymoney['vip'];
            $order['order_type'] = '1';
            //0钻石会员 1高级会员 2城市之星
            $order['subject'] = "真爱一生网高级会员";
            $order['memo'] = "您即将升级成为{$order['subject']},3个月服务费: {$order['order_amount']}";
            break;
    }
    //$title=iconv('utf-8', 'gbk',$order['subject']);
    $title = $order['subject'];
    $memo = $order['memo'];
    $pay = MooGetGPC('pay', 'string', 'P');
    if ($pay == 'zhifubao') {
        //$url="https://shenghuo.alipay.com/send/payment/fill.htm?optEmail=1557334568@qq.com&payAmount={$order['order_amount']}&title={$order['subject']}&smsNo=15156018341&isSend=true";
        echo "<script> \n\t\tdocument.write('<meta  charset=\"gbk\" />');\n\t\tdocument.write('<form action=\"https://shenghuo.alipay.com/send/payment/fill.htm\" method=\"post\" name=\"formzfb\" style=\"display:none\" accept-charset=\"gbk\" onsubmit=\"document.charset=gbk\" >');\n\t\tdocument.write('<input type=\"hidden\" name=\"optEmail\" value=\"1557334568@qq.com\" />');\n\t\tdocument.write('<input type=\"hidden\" name=\"payAmount\" value=\"{$order['order_amount']}\" />');\n\t\tdocument.write('<input type=\"hidden\" name=\"title\" value=\"{$title}\" />');\n\t\tdocument.write('<input type=\"hidden\" name=\"memo\" value=\"{$memo}\" />');\n\t\tdocument.write('<input type=\"hidden\" name=\"smsNo\" value=\"15156018341\" />');\n\t\tdocument.write('<input type=\"hidden\" name=\"isSend\" value=\"true\" />');\n\t\t\n\t\tdocument.write('</form>');\n\t\tdocument.formzfb.submit();\n\t\t</script>";
    } elseif ($pay == 'tenpay') {
        echo "<script> \n\t\tdocument.write('<form action=\"https://www.tenpay.com/v2/account/pay/index.shtml\" method=\"post\" name=\"formtenpay\" style=\"display:none\">');\n\t\tdocument.write('</form>');\n\t\tdocument.formtenpay.submit();\n\t    </script>";
    } elseif ($pay == 'yeepay') {
        $order['order_sn'] = date('YmdHms', $time) . $uid;
        $payment = get_payment($pay);
        $plugin_file = "module/payment/" . $pay . ".php";
        // echo $plugin_file;exit;
        if (file_exists($plugin_file)) {
            /* 根据支付方式代码创建支付类的对象并调用其响应操作方法 */
            include_once $plugin_file;
            $pays = new $pay();
            $order['order_amount'] += (double) $payment['m_fee'] * $order['order_amount'] / 100;
            $order['order_amount'] = round($order['order_amount'], 2);
            //支付金额保留两位小数
            if ($order['order_type'] == '6' || ($order['order_type'] = '100')) {
                $sql = "insert into {$dbTablePre}payment_other(uid,pay_type,pay_bank,order_id,pay_money,pay_service,apply_sid,apply_time,contact,note) values('{$uid}','2','{$pay}','{$order['order_sn']}','{$order['order_amount']}','{$order['order_type']}','{$sid}','{$time}','{$user_arr['telphone']}','{$order['subject']}')";
            } else {
                $sql = "insert into {$dbTablePre}payment_new (uid,pay_type,pay_bank,order_id,pay_money,pay_service,apply_sid,apply_time,contact,note) values('{$uid}','2','{$pay}','{$order['order_sn']}','{$order['order_amount']}','{$order['order_type']}','{$sid}','{$time}','{$user_arr['telphone']}','{$order['subject']}')";
            }
            $_MooClass['MooMySQL']->query($sql);
            $o = get_pay_one($order['order_sn']);
            $order['log_id'] = $o['pid'];
            $reqUrl = $pays->get_code($order, $payment);
        }
        //echo $reqUrl.'ddd';exit;
        if (!empty($reqUrl)) {
            if ($pay != 'yeepay') {
                echo '<script language="JavaScript">self.location=\'' . $reqUrl . '\';</script>';
            } else {
                echo $reqUrl;
            }
            //*********真爱一生备注*********
            $sid = $user_arr['sid'];
            $title = '您的会员' . $uid . '正在支付 ';
            //$order['subject']
            $awoketime = $timestamp + 3600;
            $sql_remark = "insert into {$dbTablePre}admin_remark set sid='{$sid}',title='{$title}',content='{$title}',awoketime='{$awoketime}',dateline='{$timestamp}'";
            $res = $_MooClass['MooMySQL']->query($sql_remark);
            //**********end**********
        } else {
            MooMessage('您的请求有误请重新提交请求。', 'index.php?n=payment');
        }
    }
}
Beispiel #4
0
function payment_001(){//此方法用来测试支付by alipay
  global $_MooClass,$dbTablePre,$uid,$pay_sty,$payment_code,$user_arr;
  $code=MooGetGPC('code', 'string','G');
  $time = time();
  $order['subject']="真爱一生网会员认证费用";
  $order['order_sn']=date('YmdHms',$time).$uid;
  $order['order_amount']=0.01;
 
  //查找该会员的客服号,以便及时提醒
  //$server=$_MooClass['MooMySQL']->getOne("SELECT `sid` FROM ".$dbTablePre."members WHERE `uid`=".uid);
  $server = $user_arr;
  if(!in_array($code,$pay_sty)){
  
    include MooTemplate('public/payment_printgreencardinfo03', 'module');
  }
  else{
    $payment=get_payment($code);
	
	//print_r($payment);
	//exit;
    $plugin_file ="module/payment/".$code.".php";
	if (file_exists($plugin_file))
        {
            /* 根据支付方式代码创建支付类的对象并调用其响应操作方法 */
            include_once($plugin_file);
            $pays = new $code();
			 $order['order_amount']+= (float)$payment['m_fee']*$order['order_amount']/100;
			 $order['order_amount']=round($order['order_amount'],2); //支付金额保留两位小数
			  //echo $order['order_amount'];
			  $sql="insert into {$dbTablePre}payment (uid,code,order_id,staus,money,payfor) values('$uid','$code','{$order['order_sn']}','0','{$order['order_amount']}','1')";
			  $_MooClass['MooMySQL']->query($sql);
			  $o=get_pay_one($order['order_sn']);
			  $order['log_id']=$o['pid'];
			$buton= $pays->get_code($order,$payment);
		}
	 include MooTemplate('public/payment_confirm', 'module');         
  }	
}