Exemplo n.º 1
0
function payment_creditcardinline()
{
    global $_MooClass, $dbTablePre, $uid, $pay_sty, $paymoney, $payment_code, $user_arr, $paymoney2, $activitytime1, $activitytime2;
    /*
        $allow_ip = array('220.178.112.174','61.190.44.98','127.0.0.1','220.178.123.74','221.130.166.242','120.193.108.166','61.190.22.14','61.190.10.254','124.73.152.192');
        $cur_ip = GetIP();
        if(in_array($cur_ip,$allow_ip)){
     $paymoney = array(
         'diamond'=>'0.10',   //六个月钻石会员费用
         'vip'=>'0.10',            //三个月高级会员费用
         'citystar'=>'0.10',     //一个月城市之星费用
     );
        }else{
     if(strpos($cur_ip,'192.168') !== FALSE){
         $paymoney = array(
             'diamond'=>'0.10',   //六个月钻石会员费用
             'vip'=>'0.10',            //三个月高级会员费用
             'citystar'=>'0.10',     //一个月城市之星费用
         );
     }
        }
    */
    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'];
    $ispost = MooGetGPC('ispost', 'integer', 'P');
    $channel = MooGetGPC('channel', 'string', 'P');
    $pay = MooGetGPC('pay', 'string', 'P');
    $pay_type = array('pay', 'pay_diamond', 'city_star', 'pay_add_money');
    $time = time();
    $year = date("Y");
    $order = array();
    if (!in_array($channel, $pay_type)) {
        MooMessage('您选择的服务有误。', 'index.php?n=payment');
        exit;
    }
    if (empty($pay)) {
        if ($channel == 'pay_diamond') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel_diamond');
            exit;
        } elseif ($channel == 'city_star') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=city_star');
            exit;
        } elseif ($channel == 'pay_add_money') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=add_money');
        } else {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel');
            exit;
        }
    }
    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'] = "高级会员升级钻石会员";
    }
    //内部测试号 0.01消费
    if ($uid == '20746717' && $user_arr['username'] == '*****@*****.**') {
        $order['order_amount'] = 0.01;
    }
    if ($ispost == '1') {
        require_once 'yeepayeposcommon.php';
        $payment = get_payment($pay);
        $haystack = array('ECITICCREDIT', 'ICBCCREDIT', 'BOSHCREDIT', 'BOCCREDIT', 'CMBCCREDIT', 'GDBCREDIT', 'CIBCREDIT', 'CCBCREDIT', 'HXBCREDIT', 'CMBCHINACREDIT', 'ABCCREDIT', 'PINGANREDIT');
        // 业务类型
        $p0_Cmd = $payment['epossale'];
        // 交易币种
        $p4_Cur = $payment['cny'];
        // 是否需要应答
        $pr_NeedResponse = $payment['needresponse'];
        // 商户编号
        $p1_MerId = $payment['p1_MerId'];
        // 商户密钥,用于生成hmac(hmac的说明详见文档)key为测试
        $merchantKey = $payment['merchantKey'];
        // 正式地址
        $actionURL = $payment['actionURL'];
        // 获取订单号
        $p2_Order = date('YmdHms', $time) . $uid;
        // 获取本地提交消费金额
        $p3_Amt = $order['order_amount'];
        // 获取本地提交商品名称
        $p5_Pid = $order['subject'];
        $p5_Pid = iconv("UTF-8", "GB2312", $p5_Pid);
        // 获取本地提交接收支付结果地址
        $p8_Url = $payment['p8_Url'];
        // 获取本地提交证件类型
        $pa_CredType = MooGetGPC('pa_CredType', 'string', 'P');
        // 获取本地提交证件号码
        $pb_CredCode = MooGetGPC('pb_CredCode', 'string', 'P');
        $pb_CredCode = iconv("UTF-8", "GB2312", $pb_CredCode);
        // 获取本地提交银行编码
        $pd_FrpId = MooGetGPC('pd_FrpId', 'string', 'P');
        $pd_FrpId = trim($pd_FrpId);
        // 获取本地提交消费者手机号
        $pe_BuyerTel = MooGetGPC('pe_BuyerTel', 'string', 'P');
        // 获取本地提交消费者姓名
        $pf_BuyerName = MooGetGPC('pf_BuyerName', 'string', 'P');
        $pf_BuyerName = iconv("UTF-8", "GB2312", $pf_BuyerName);
        // 获取本地提交信用卡卡号
        $pt_ActId = MooGetGPC('pt_ActId', 'string', 'P');
        // 获取本地提交有效期(年)
        $pa2_ExpireYear = MooGetGPC('pa2_ExpireYear', 'string', 'P');
        // 获取本地提交有效期(月)
        $pa3_ExpireMonth = MooGetGPC('pa3_ExpireMonth', 'string', 'P');
        // 获取本地提交信用卡CVV码
        $pa4_CVV = MooGetGPC('pa4_CVV', 'string', 'P');
        if ($pa_CredType == '' || $pb_CredCode == '' || $pd_FrpId == '' || $pe_BuyerTel == '' || $pf_BuyerName == '' || $pt_ActId == '' || $pa2_ExpireYear == '' || $pa3_ExpireMonth == '' || $pa4_CVV == '') {
            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 == 'add_money') {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!in_array($pd_FrpId, $haystack)) {
            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 == 'add_money') {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        //校验身份证号码
        if ($pa_CredType == 'IDCARD') {
            if (!validation_filter_id_card($pb_CredCode)) {
                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 == 'add_money') {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=add_money');
                } else {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=channel');
                }
                exit;
            }
        }
        //校验手机号码
        if (!preg_match("/^(((13[0-9]{1})|14[0-9]{1}|15[0-9]{1}|18[0-9]{1}|)+\\d{8})\$/", $pe_BuyerTel)) {
            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 == 'add_money') {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!($pa2_ExpireYear >= $year && $pa2_ExpireYear <= 2099)) {
            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 == 'add_money') {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!($pa3_ExpireMonth >= 01 && $pa3_ExpireMonth <= 12)) {
            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 == 'add_money') {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!(strlen($pa4_CVV) == 3 || strlen($pa4_CVV) == 4)) {
            if ($channel == 'pay_diamond') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=channel_diamond');
            } elseif ($channel == 'city_star') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=city_star');
            } elseif ($channel == 'add_money') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=add_money');
            } else {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        // 日志文件路径
        $logName = $payment['logyeepayepos'];
        // 构造请求业务处理所需参数数组
        $bizArray = array('p0_Cmd' => $p0_Cmd, 'p1_MerId' => $p1_MerId, 'p2_Order' => $p2_Order, 'p3_Amt' => $p3_Amt, 'p4_Cur' => $p4_Cur, 'p5_Pid' => $p5_Pid, 'p8_Url' => $p8_Url, 'pa_CredType' => $pa_CredType, 'pb_CredCode' => $pb_CredCode, 'pd_FrpId' => $pd_FrpId, 'pe_BuyerTel' => $pe_BuyerTel, 'pf_BuyerName' => $pf_BuyerName, 'pt_ActId' => $pt_ActId, 'pa2_ExpireYear' => $pa2_ExpireYear, 'pa3_ExpireMonth' => $pa3_ExpireMonth, 'pa4_CVV' => $pa4_CVV);
        /*-------------------------------------------------------*/
        // 接入程序员关注部分(此函数可选择使用)
        // 调用您的业务逻辑处理函数,比如:将商品状态改为“下单”
        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}','{$p2_Order}','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}','{$p2_Order}','0','{$order['order_amount']}','{$order['order_type']}','{$sid}','{$time}','{$user_arr['telphone']}')";
        }
        $_MooClass['MooMySQL']->query($sql);
        /*-------------------------------------------------------*/
        // 调用支付业务函数,接入程序员无需关注
        eposSale($bizArray, $actionURL, $merchantKey, $logName);
        exit;
    } else {
        include MooTemplate('public/fillintheinformation', 'module');
    }
}
Exemplo n.º 2
0
function payment_creditcardinline()
{
    global $_MooClass, $dbTablePre, $uid, $pay_sty, $paymoney, $payment_code, $user_arr, $timestamp;
    if (empty($uid)) {
        header("login.html");
    }
    $res_sid = $_MooClass['MooMySQL']->getOne("select sid from {$dbTablePre}members_search where uid='{$uid}'", true);
    $sid = $res_sid['sid'];
    $ispost = MooGetGPC('ispost', 'integer', 'P');
    $channel = MooGetGPC('channel', 'string', 'P');
    $p3_Amt = MooGetGPC('p3_Amt', 'int', 'P');
    //其他支付金额
    $text = MooGetGPC('text', 'string', 'P');
    //其他支付明细
    $pay = MooGetGPC('pay', 'string', 'P');
    $pay_type = array('pay', 'pay_diamond', 'city_star', 'pay_add_money', 'pay_add_money_other', 'pay_platinum', 'pay_sliver', 'pay_xuanyan', 'pay_eyes', 'pay_perfume', 'pay_azlt', 'pay_jiaren', 'pay_wink', 'pay_sing', 'pay_fakeface', 'pay_gourd', 'pay_hand', 'pay_spa', 'pay_yz', 'pay_ruby', 'pay_cs', 'pay_midsummer', 'pay_dusk', 'pay_rlsl');
    $time = time();
    $year = date("Y");
    $order = array();
    if (!in_array($channel, $pay_type)) {
        MooMessage('您选择的服务有误。', 'index.php?n=payment');
        exit;
    }
    if (empty($pay)) {
        if ($channel == 'pay_diamond') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel_diamond');
            exit;
        } elseif ($channel == 'city_star') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=city_star');
            exit;
        } elseif ($channel == 'pay_add_money') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=add_money');
            exit;
        } elseif ($channel == 'pay_add_money_other') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=add_money_2');
            exit;
        } elseif ($channel == 'pay_platinum') {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel_platinum');
            exit;
        } else {
            MooMessage('请选择支付方式。', 'index.php?n=payment&h=channel');
            exit;
        }
    }
    if ($channel == 'pay') {
        //note 高级会员
        $order['order_amount'] = $paymoney['vip'];
        $order['order_type'] = '1';
        //0钻石会员 1高级会员 2城市之星
        $order['subject'] = "真爱一生网高级会员";
    } elseif ($channel == 'city_star') {
        $order['order_amount'] = $paymoney['citystar'];
        $order['order_type'] = '2';
        $order['subject'] = "真爱一生网城市之星";
    } elseif ($channel == 'pay_diamond') {
        $order['order_amount'] = $paymoney['diamond'];
        $order['order_type'] = '0';
        $order['subject'] = "真爱一生网钻石会员";
    } elseif ($channel == 'pay_add_money') {
        $order['order_amount'] = $paymoney['add_money'];
        $order['order_type'] = 5;
        $order['subject'] = "高级会员升级钻石会员";
    } elseif ($channel == 'pay_add_money_other') {
        $order['order_amount'] = $p3_Amt;
        $order['order_type'] = 6;
        $order['subject'] = "补款或预付";
    } elseif ($channel == 'pay_platinum') {
        $order['order_amount'] = $paymoney['platinum'];
        $order['order_type'] = '-1';
        $order['subject'] = "真爱一生网铂金会员";
    }
    if ($ispost == '1') {
        require_once 'yeepayeposcommon.php';
        $payment = get_payment($pay);
        $haystack = array('ECITICCREDIT', 'ICBCCREDIT', 'BOCOCREDIT', 'BOSHCREDIT', 'BOCCREDIT', 'CMBCCREDIT', 'GDBCREDIT', 'CIBCREDIT', 'CCBCREDIT', 'CMBCHINACREDIT', 'ABCCREDIT', 'PINGANREDIT', 'BCCBCREDIT');
        // 业务类型
        $p0_Cmd = $payment['epossale'];
        // 交易币种
        $p4_Cur = $payment['cny'];
        // 是否需要应答
        $pr_NeedResponse = $payment['needresponse'];
        // 商户编号
        $p1_MerId = $payment['p1_MerId'];
        // 商户密钥,用于生成hmac(hmac的说明详见文档)key为测试
        $merchantKey = $payment['merchantKey'];
        // 正式地址
        $actionURL = $payment['actionURL'];
        // 获取订单号
        $p2_Order = date('YmdHms', $time) . $uid;
        // 获取本地提交消费金额
        $p3_Amt = $order['order_amount'];
        // 获取本地提交商品名称
        $p5_Pid = $order['subject'];
        $p5_Pid = iconv("GB2312", "UTF-8", $p5_Pid);
        // 获取本地提交接收支付结果地址
        $p8_Url = $payment['p8_Url'];
        // 获取本地提交证件类型
        $pa_CredType = MooGetGPC('pa_CredType', 'string', 'P');
        // 获取本地提交证件号码
        $pb_CredCode = MooGetGPC('pb_CredCode', 'string', 'P');
        $pb_CredCode = iconv("GB2312", "UTF-8", $pb_CredCode);
        // 获取本地提交银行编码
        $pd_FrpId = MooGetGPC('pd_FrpId', 'string', 'P');
        $pd_FrpId = trim($pd_FrpId);
        // 获取本地提交消费者手机号
        $pe_BuyerTel = MooGetGPC('pe_BuyerTel', 'string', 'P');
        // 获取本地提交消费者姓名
        $pf_BuyerName = MooGetGPC('pf_BuyerName', 'string', 'P');
        $pf_BuyerName = iconv("GB2312", "UTF-8", $pf_BuyerName);
        // 获取本地提交信用卡卡号
        $pt_ActId = MooGetGPC('pt_ActId', 'string', 'P');
        // 获取本地提交有效期(年)
        $pa2_ExpireYear = MooGetGPC('pa2_ExpireYear', 'string', 'P');
        // 获取本地提交有效期(月)
        $pa3_ExpireMonth = MooGetGPC('pa3_ExpireMonth', 'string', 'P');
        // 获取本地提交信用卡CVV码
        $pa4_CVV = MooGetGPC('pa4_CVV', 'string', 'P');
        /* $p3_Amt=MooGetGPC('p3_Amt', 'int','P');
        		$text=MooGetGPC('text', 'string','P'); */
        if ($pa_CredType == '' || $pb_CredCode == '' || $pd_FrpId == '' || $pe_BuyerTel == '' || $pf_BuyerName == '' || $pt_ActId == '' || $pa2_ExpireYear == '' || $pa3_ExpireMonth == '' || $pa4_CVV == '') {
            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 == 'add_money') {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('您有个选项没有填写!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!in_array($pd_FrpId, $haystack)) {
            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 == 'add_money') {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('请输入对应的发卡行英文代号!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        //校验身份证号码
        if ($pa_CredType == 'IDCARD') {
            if (!validation_filter_id_card($pb_CredCode)) {
                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 == 'add_money') {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=add_money');
                } elseif ($channel == 'add_money_2') {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=add_money_2');
                } elseif ($channel == 'pay_platinum') {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=channel_platinum');
                } else {
                    MooMessage('您填写的身份证号码不正确!', 'index.php?n=payment&h=channel');
                }
                exit;
            }
        }
        //校验手机号码
        if (!preg_match("/^(((13[0-9]{1})|14[0-9]{1}|15[0-9]{1}|18[0-9]{1}|)+\\d{8})\$/", $pe_BuyerTel)) {
            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 == 'add_money') {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('您填写的手机号码不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!($pa2_ExpireYear >= $year && $pa2_ExpireYear <= 2099)) {
            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 == 'add_money') {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('您填写的信用卡有效期(年)不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!($pa3_ExpireMonth >= 01 && $pa3_ExpireMonth <= 12)) {
            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 == 'add_money') {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('您填写的信用卡有效期(月)不正确!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        if (!(strlen($pa4_CVV) == 3 || strlen($pa4_CVV) == 4)) {
            if ($channel == 'pay_diamond') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=channel_diamond');
            } elseif ($channel == 'city_star') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=city_star');
            } elseif ($channel == 'add_money') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=add_money');
            } elseif ($channel == 'add_money_2') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=add_money_2');
            } elseif ($channel == 'pay_platinum') {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=channel_platinum');
            } else {
                MooMessage('请输入信用卡背面的3或4位cvv码!', 'index.php?n=payment&h=channel');
            }
            exit;
        }
        // 日志文件路径
        $logName = $payment['logyeepayepos'];
        // 构造请求业务处理所需参数数组
        $bizArray = array('p0_Cmd' => $p0_Cmd, 'p1_MerId' => $p1_MerId, 'p2_Order' => $p2_Order, 'p3_Amt' => $p3_Amt, 'p4_Cur' => $p4_Cur, 'p5_Pid' => $p5_Pid, 'p8_Url' => $p8_Url, 'pa_CredType' => $pa_CredType, 'pb_CredCode' => $pb_CredCode, 'pd_FrpId' => $pd_FrpId, 'pe_BuyerTel' => $pe_BuyerTel, 'pf_BuyerName' => $pf_BuyerName, 'pt_ActId' => $pt_ActId, 'pa2_ExpireYear' => $pa2_ExpireYear, 'pa3_ExpireMonth' => $pa3_ExpireMonth, 'pa4_CVV' => $pa4_CVV);
        /*-------------------------------------------------------*/
        // 接入程序员关注部分(此函数可选择使用)
        // 调用您的业务逻辑处理函数,比如:将商品状态改为“下单”
        if ($user_arr['s_cid'] == '30' && $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}','{$p2_Order}','0','{$order['order_amount']}','1','{$sid}','{$time}','{$user_arr['telphone']}')";
        } else {
            if ($order['order_type'] == '6') {
                $sql = "insert into {$dbTablePre}payment_other (uid,pay_type,pay_bank,order_id,status,pay_money,pay_service,apply_sid,apply_time,contact,note) values('{$uid}','2','{$pay}','{$p2_Order}','0','{$order['order_amount']}','6','{$sid}','{$time}','{$user_arr['telphone']}','{$text}')";
            } 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}','{$p2_Order}','0','{$order['order_amount']}','{$order['order_type']}','{$sid}','{$time}','{$user_arr['telphone']}')";
            }
        }
        $_MooClass['MooMySQL']->query($sql);
        /*-------------------------------------------------------*/
        //*********真爱一生备注*********
        $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**********
        // 调用支付业务函数,接入程序员无需关注
        eposSale($bizArray, $actionURL, $merchantKey, $logName);
        exit;
    } else {
        include MooTemplate('public/fillintheinformation', 'module');
    }
}