Beispiel #1
0
 public function __construct()
 {
     global $kekezu;
     $cfg = kekezu::get_payment_config('wxpay');
     $this->_appid = $cfg['appid'];
     $this->_appsecert = $cfg['appsecert'];
     $this->_mchid = $cfg['mchid'];
     $this->_key = $cfg['key'];
     $this->_sslcert_path = S_ROOT . '/include/payment/wxpay/cert/apiclient_cert.pem';
     $this->_sslkey_path = S_ROOT . '/include/payment/wxpay/cert/apiclient_key.pem';
 }
 public function return_notify($pay_mode, $response = array())
 {
     global $_K;
     global $_lang;
     $pay_config = kekezu::get_payment_config($pay_mode);
     if (empty($response)) {
         $response['title'] = $_lang['operate_notice'];
         $response['content'] = $_lang['pay'] . $_lang['fail'];
         $response['url'] = $_K['siteurl'];
         $response['type'] = 'warning';
     } else {
         $response['title'] = $_lang['operate_notice'];
         $response['type'] == 'success';
         $response['content'] = $pre . $response['content'];
     }
     header('Location:' . $response['url']);
 }
Beispiel #3
0
<?php

define("IN_KEKE", true);
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'app_comm.php';
require_once "alipay_notify.class.php";
$_input_charset = strtoupper(CHARSET);
$payment_config = kekezu::get_payment_config('alipayjs');
$payment_config or die("支付配置错误,支付无法完成,请联系管理员。");
$alipay_config['partner'] = $payment_config['seller_id'];
$alipay_config['key'] = $payment_config['safekey'];
$alipay_config['sign_type'] = strtoupper('MD5');
$alipay_config['input_charset'] = strtolower(CHARSET);
$alipay_config['cacert'] = getcwd() . '\\cacert.pem';
$alipay_config['transport'] = 'http';
$alipayNotify = new AlipayNotify($alipay_config);
$verify_result = $alipayNotify->verifyNotify();
KEKE_DEBUG and file_put_contents(S_ROOT . 'data/log/alipayjs_notify_log.txt', var_export($_POST, 1), FILE_APPEND);
$echomsg = 'fail';
if ($verify_result) {
    if ($_POST['trade_status'] == 'TRADE_FINISHED' || $_POST['trade_status'] == 'TRADE_SUCCESS') {
        $out_trade_no = $_POST['out_trade_no'];
        $total_fee = $_POST['total_fee'];
        list($_, $charge_type, $uid, $obj_id, $order_id, $model_id, $url) = explode('-', $out_trade_no, 6);
        $fac_obj = new pay_return_fac_class($charge_type, $model_id, $uid, $obj_id, $order_id, $total_fee, 'alipayjs', $out_trade_no);
        $response = $fac_obj->load();
        $echomsg = 'success';
    }
}
echo $echomsg;
die;
<?php

defined('ADMIN_KEKE') or exit('Access Denied');
kekezu::admin_check_role(2);
$pay_api_obj = keke_table_class::get_instance("witkey_pay_api");
$payment_config = kekezu::get_payment_config($payname, $type);
$pay_config = unserialize($payment_config['config']);
$payment_exist = db_factory::get_count(" select payment from " . TABLEPRE . "witkey_pay_api where payment='{$payname}' and type='{$type}'");
$payment_config or kekezu::admin_show_msg($_lang['wrong_model_directory'], "index.php?do=config&view=pay", 3, '', 'warning');
$temp = array();
foreach (explode(";", $payment_config['initparam']) as $item) {
    $it = explode(":", $item);
    $temp[] = array('k' => $it['0'], 'name' => $it['1'], 'v' => $payment_config[$it['0']]);
}
$items = $temp;
if (isset($sbt_edit)) {
    $pay_config = array();
    $pay_config['pay_status'] = $fds['pay_status'];
    switch ($payname) {
        case 'alipayjs':
            $pay_config['account'] = $fds['account'];
            $pay_config['seller_id'] = $fds['seller_id'];
            $pay_config['safekey'] = $fds['safekey'];
            $pay_config['account_name'] = $fds['account_name'];
            break;
        case 'alipaydual':
            $pay_config['account'] = $fds['account'];
            $pay_config['seller_id'] = $fds['seller_id'];
            $pay_config['safekey'] = $fds['safekey'];
            $pay_config['account_name'] = $fds['account_name'];
            break;
        $service = db_factory::query($sql . $s_sql . $f_sql . ' group by model_id', 1, 3600);
        $payitem = db_factory::get_one($sql . sprintf(' from %switkey_finance where fina_type="out"
						 and fina_action="payitem" ', TABLEPRE) . $f_sql, 1, 3600);
        break;
    case 'profit':
        $sql = sprintf(' select sum(site_profit) c from %switkey_finance where site_profit>0 ', TABLEPRE);
        $task = db_factory::get_count($sql . ' and obj_type="task" ' . $f_sql, 0, 'c', 3600);
        $service = db_factory::get_count($sql . ' and obj_type="service" ' . $f_sql, 0, 'c', 3600);
        $payitem = db_factory::get_count($sql . ' and obj_type="payitem" ' . $f_sql, 0, 'c', 3600);
        $auth = db_factory::get_count($sql . ' and INSTR(obj_type,"_auth")>0 ' . $f_sql, 0, 'c', 3600);
        $withdraw = db_factory::get_count(sprintf(' select sum(fee) c from %switkey_withdraw
					where withdraw_status=2 ', TABLEPRE) . $w_sql, 0, 'c', 3600);
        $p_all = floatval($task + $service + $payitem + $auth + $withdraw);
        break;
    case 'withdraw':
        $list = db_factory::query(sprintf(' select sum(withdraw_cash) cash,sum(fee) fee,
					count(withdraw_id) count,pay_type from %switkey_withdraw where 1 = 1 ', TABLEPRE) . $w_sql . ' group by pay_type', 1, 3600);
        $list && ($list = kekezu::get_arr_by_key($list, 'pay_type'));
        $bank_arr = keke_glob_class::get_bank();
        $pay_online = kekezu::get_payment_config('', 'online');
        break;
    case 'charge':
        $sql = ' select sum(fina_cash) cash,sum(fina_credit) credit,count(fina_id) count ';
        $r_sql = sprintf(' ,obj_type from %switkey_finance
						 where INSTR(obj_type,"_charge")>0  and fina_type = "in"', TABLEPRE);
        $charge = db_factory::query($sql . $r_sql . $f_sql . ' group by obj_type ', 1, 3600);
        $charge = kekezu::get_arr_by_key($charge, 'obj_type');
        $fina_type = keke_glob_class::get_fina_charge_type();
        break;
}
require keke_tpl_class::template(ADMIN_DIRECTORY . '/tpl/admin_finance_revenue');
Beispiel #6
0
<?php

define("IN_KEKE", true);
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'app_comm.php';
$payment_config = kekezu::get_payment_config('yeepay');
include 'yeepayCommon.php';
##支付成功回调有两次,都会通知到在线支付请求参数中的p8_Url上:浏览器重定向;服务器点对点通讯.
$return = getCallBackValue($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac);
#	判断返回签名是否正确(True/False)
$bRet = CheckHmac($r0_Cmd, $r1_Code, $r2_TrxId, $r3_Amt, $r4_Cur, $r5_Pid, $r6_Order, $r7_Uid, $r8_MP, $r9_BType, $hmac);
list($_, $charge_type, $uid, $obj_id, $order_id, $model_id) = explode('-', $r8_MP, 6);
$fac_obj = new pay_return_fac_class($charge_type, $model_id, $uid, $obj_id, $order_id, $r3_Amt, 'yeepay', $r8_MP);
if ($bRet) {
    if ($r1_Code == "1") {
        if ($r9_BType == "1") {
            echo "交易成功";
            echo "<br />在线支付页面返回";
            $response = $fac_obj->load();
            if ($charge_type == 'user_charge') {
                $show_url = 'index.php?do=recharge&cash=' . $r3_Amt . '&status=1';
            } elseif ($charge_type == 'payitem_charge') {
                if (!in_array($model_id, array(6, 7))) {
                    $show_url = 'index.php?do=task&id=' . $obj_id;
                } else {
                    $show_url = 'index.php?do=goods&id=' . $obj_id;
                }
            } else {
                if (!in_array($model_id, array(6, 7))) {
                    $arrOrderDetail = keke_order_class::get_order_detail($order_id);
                    if ($arrOrderDetail[0]['obj_type'] == 'hosted') {
                        $show_url = 'index.php?do=task&id=' . $obj_id;
 public function __construct($pay_mode)
 {
     $this->_pay_mode = $pay_mode;
     $this->_pay_config = kekezu::get_payment_config($pay_mode);
 }
Beispiel #8
0
<?php

define("IN_KEKE", true);
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'app_comm.php';
$pay_arr = kekezu::get_payment_config('chinabank');
@extract($pay_arr);
$key = $safekey;
KEKE_DEBUG and file_put_contents(S_ROOT . 'data/log/chinabank_log.txt', var_export($_POST, 1), FILE_APPEND);
$v_oid = trim($_POST['v_oid']);
$v_pmode = trim($_POST['v_pmode']);
$v_pstatus = trim($_POST['v_pstatus']);
$v_pstring = trim($_POST['v_pstring']);
$v_amount = trim($_POST['v_amount']);
$v_moneytype = trim($_POST['v_moneytype']);
$remark1 = trim($_POST['remark1']);
$remark2 = trim($_POST['remark2']);
$v_md5str = trim($_POST['v_md5str']);
$text = "{$v_oid}{$v_pstatus}{$v_amount}{$v_moneytype}{$key}";
$md5string = strtoupper(md5($text));
list($_, $charge_type, $uid, $obj_id, $order_id, $model_id) = explode('-', $v_oid, 6);
if ($v_md5str == $md5string) {
    if ($v_pstatus == "20" && $_ == 'charge') {
        $fac_obj = new pay_return_fac_class($charge_type, $model_id, $uid, $obj_id, $order_id, $v_amount, 'chinabank', $v_oid);
        $response = $fac_obj->load();
        if ($charge_type == 'user_charge') {
            $show_url = 'index.php?do=recharge&cash=' . $v_amount . '&status=1';
            $_SESSION['chargecash'] = $v_amount;
        } elseif ($charge_type == 'payitem_charge') {
            if (!in_array($model_id, array(6, 7))) {
                $show_url = 'index.php?do=task&id=' . $obj_id;
            } else {
Beispiel #9
0
$strUrl = 'index.php?do=pay&type=' . $type . '&cash=' . $cash;
if (isset($formhash) && kekezu::submitcheck($formhash)) {
    if ($type == 'task') {
        $payTitle = $_K['html_title'] . ' - 发布任务 - ' . $title;
    } elseif ($type == 'payitem') {
        $payTitle = $_K['html_title'] . ' - 增值工具 - ' . $title;
    } else {
        if ($type == 'order') {
            $payTitle = $_K['html_title'] . ' - 购买服务 - ' . $title;
        } else {
            if ($type == 'hosted') {
                $payTitle = $_K['html_title'] . ' - 托管金额 - ' . $title;
            }
        }
    }
    $bankConfig = kekezu::get_payment_config($bank);
    require S_ROOT . "/include/payment/" . $bank . "/order.php";
    if ($type == 'payitem') {
        $form = get_pay_url('payitem_charge', $cash, $bankConfig, $payTitle, $orderId, $modelId, $objId, NULL, 'MD5', 'form');
    } else {
        $form = get_pay_url('order_charge', $cash, $bankConfig, $payTitle, $orderId, $modelId, $objId, NULL, 'MD5', 'form');
    }
    if ($bank == 'wxpay') {
        $wxpayUrl = $form['url'];
        $wxpayOrderId = $form['out_trade_no'];
        $_SESSION['wxpay'] = 1;
    } else {
        echo $form;
        die;
    }
}
Beispiel #10
0
 case "config":
     $pay_config = kekezu::get_table_data("*", "witkey_pay_config", '', '', "", '', 'k');
     break;
 case "online":
     $payment_list = kekezu::get_payment_config();
     break;
 case "trust":
     if ($ac == 'edit') {
         require S_ROOT . "payment/" . $pay_dir . "/admin/admin_edit.php";
     } else {
         $payment_list = kekezu::get_payment_config('', $op);
     }
     break;
 case "offline":
     $bank_arr = keke_glob_class::get_bank();
     $payment_list = kekezu::get_payment_config('', $op);
     if ($ac) {
         $pay = $payment_list[$payment];
         $pay['config'] and $pay_config = unserialize(stripslashes($pay['config']));
         $pay_api_obj = new Keke_witkey_pay_api_class();
         if ($ac == 'del') {
             $pay_api_obj->setWhere(" payment='{$payment}'");
             $res = $pay_api_obj->del_keke_witkey_pay_api();
             $res and kekezu::admin_show_msg($_lang['delete_success'], "index.php?do=config&view=pay&op=offline", "3", '', 'success') or kekezu::admin_show_msg($_lang['delete_fail'], "index.php?do=config&view=pay&op=offline", "3", '', 'warning');
         } elseif ($confirm) {
             $config = serialize($conf);
             if ($ac == 'edit') {
                 $pay_api_obj->setWhere(" payment='{$payment}'");
                 $pay_api_obj->setConfig(kekezu::k_input($config));
                 $res = $pay_api_obj->edit_keke_witkey_pay_api();
                 kekezu::admin_system_log($_lang['edit'] . $payment);
Beispiel #11
0
<?php

define("IN_KEKE", true);
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'app_comm.php';
require_once "alipay_notify.class.php";
$_input_charset = strtoupper(CHARSET);
$payment_config = kekezu::get_payment_config('alipaydual');
$payment_config or die("支付配置错误,支付无法完成,请联系管理员。");
$alipay_config['partner'] = $payment_config['seller_id'];
$alipay_config['key'] = $payment_config['safekey'];
$alipay_config['sign_type'] = strtoupper('MD5');
$alipay_config['input_charset'] = strtolower(CHARSET);
$alipay_config['cacert'] = getcwd() . '\\cacert.pem';
$alipay_config['transport'] = 'http';
$alipayNotify = new AlipayNotify($alipay_config);
$verify_result = $alipayNotify->verifyReturn();
KEKE_DEBUG and file_put_contents(S_ROOT . 'data/log/alipaydual_log.txt', var_export($_GET, 1), FILE_APPEND);
if ($verify_result) {
    if ($_GET['trade_status'] == 'TRADE_FINISHED' || $_GET['trade_status'] == 'TRADE_SUCCESS' || $_GET['trade_status'] == 'WAIT_SELLER_SEND_GOODS') {
        $out_trade_no = $_GET['out_trade_no'];
        $total_fee = $_GET['total_fee'];
        list($_, $charge_type, $uid, $obj_id, $order_id, $model_id, $url) = explode('-', $out_trade_no, 6);
        $fac_obj = new pay_return_fac_class($charge_type, $model_id, $uid, $obj_id, $order_id, $total_fee, 'alipaydual', $out_trade_no);
        $response = $fac_obj->load();
        if ($charge_type == 'user_charge') {
            $show_url = 'index.php?do=recharge&cash=' . $total_fee . '&status=1';
        } elseif ($charge_type == 'payitem_charge') {
            if (!in_array($model_id, array(6, 7))) {
                $show_url = 'index.php?do=task&id=' . $obj_id;
            } else {
                $show_url = 'index.php?do=goods&id=' . $obj_id;
Beispiel #12
0
             }
             $_SESSION['withdraw_cash'] = $intWithdrawCash;
             kekezu::show_msg('', $strUrl . "&strStep=2&intWithdrawCash={$intWithdrawCash}&ver=1#userCenter", NULL, NULL, 'ok');
         } else {
             kekezu::show_msg('输入金额不正确', NULL, NULL, NULL, 'error');
         }
     }
     break;
 case "2":
     if ($intWithdrawCash != $_SESSION['withdraw_cash']) {
         kekezu::show_msg($_lang['alert_return_rewrite'], $strUrl . "&step=step1&intReset=1#userCenter", "3", "", "warning");
     }
     $arrBankauthInfo = keke_auth_fac_class::auth_check("bank", $gUid);
     $arrBindLists = kekezu::get_table_data("*", "witkey_auth_bank", "uid='{$gUid}' and auth_status=1", "", "", "", "bank_id", null);
     $arrBank = keke_glob_class::get_bank();
     $arrOfflineLists = kekezu::get_payment_config('', 'offline', 1);
 case "3":
     switch ($paymode) {
         case "online":
             $arrPayInfo = $arrPaymentLists[$pay_type];
             break;
         case "offline":
             $arrBankInfo = db_factory::get_one(" select * from " . TABLEPRE . "witkey_auth_bank  where uid ='{$uid}' and auth_status=1 and bank_name='{$pay_type}'");
             $arrUserBankInfo = kekezu::get_table_data("*", "witkey_member_bank", 'uid=' . $uid, '', "", '', '');
             break;
     }
     break;
 case "4":
     if ($intSbtWithdraw) {
         $objWithdrawM = new Keke_witkey_withdraw_class();
         if (isset($formhash) && kekezu::submitcheck($formhash)) {
Beispiel #13
0
<?php

define("IN_KEKE", true);
require_once dirname(dirname(dirname(dirname(__FILE__)))) . DIRECTORY_SEPARATOR . 'app_comm.php';
require_once "PayResponseHandler.php";
$pay_arr = kekezu::get_payment_config("tenpay");
@extract($pay_arr);
$key = $safekey;
$resHandler = new PayResponseHandler();
$resHandler->setKey($key);
KEKE_DEBUG and file_put_contents(S_ROOT . '/data/log/tenpay_log.txt', var_export($_GET, 1), FILE_APPEND);
$v_void = $resHandler->getParameter("sp_billno");
$v_attach = $resHandler->getParameter("attach");
$v_amount = $resHandler->getParameter("total_fee");
$v_amount = $v_amount * 0.01;
$pay_result = $resHandler->getParameter("pay_result");
list($_, $charge_type, $uid, $obj_id, $order_id, $model_id) = explode('-', $v_attach, 6);
if ($resHandler->isTenpaySign()) {
    if ("0" == $pay_result && $_ == 'charge') {
        $fac_obj = new pay_return_fac_class($charge_type, $model_id, $uid, $obj_id, $order_id, $v_amount, 'tenpay', $v_attach);
        $response = $fac_obj->load();
        if ($charge_type == 'user_charge') {
            $total_fee /= 100;
            $show_url = 'index.php?do=recharge&cash=' . $total_fee . '&status=1';
        } elseif ($charge_type == 'payitem_charge') {
            if (!in_array($model_id, array(6, 7))) {
                $show_url = 'index.php?do=task&id=' . $obj_id;
            } else {
                $show_url = 'index.php?do=goods&id=' . $obj_id;
            }
        } else {