ECSHOP2.7实现补款程序

2009-10-23 12:30 来源:www.chinab4c.com 作者:ecshop专家

<?php


define('IN_ECS', true);

require(dirname(__FILE__) . '/includes/init.php');
require(ROOT_PATH . 'includes/lib_order.php');


if ((DEBUG_MODE & 2) != 2)
{
    $smarty->caching = true;
}

if(isset($_REQUEST['act'])&&$_REQUEST['act']){
 $act = $_REQUEST['act'];
}else{
 $act = 'default';
}

if($act == 'default'){
 $payment_list = available_payment_list(1, $cod_fee);
    foreach ($payment_list as $key => $payment)
    {
        if ($payment['is_cod'] == '1')
        {
            $payment_list[$key]['format_pay_fee'] = '<span id="ECS_CODFEE">' . $payment['format_pay_fee'] . '</span>';
        }
        /* 如果有易宝神州行支付 如果订单金额大于300 则不显示 */
        if ($payment['pay_code'] == 'yeepayszx' && $total['amount'] > 300)
        {
            unset($payment_list[$key]);
        }
        /* 如果有余额支付 */
        if ($payment['pay_code'] == 'balance')
        {
            /* 如果未登录,不显示 */
            if ($_SESSION['user_id'] == 0)
            {
                unset($payment_list[$key]);
            }
            else
            {
                if ($_SESSION['flow_order']['pay_id'] == $payment['pay_id'])
                {
                    $smarty->assign('disable_surplus', 1);
                }
            }
        }
    }
  $smarty->assign('payment_list', $payment_list);
  $smarty -> display('order_repair.dwt');
}else if($act == 'sub'){
  include_once('includes/lib_clips.php');
    include_once('includes/lib_payment.php');
 $order['order_amount'] = intval($_REQUEST['count']);
 $order['order_id'] =1;
 $order['order_sn'] =  get_order_sn();
 $order['pay_id'] = $_REQUEST['payment'];
 
  if ($order['order_amount'] > 0)
    {
        $payment = payment_info($order['pay_id']);

        include_once('includes/modules/payment/' . $payment['pay_code'] . '.php');

        $pay_obj    = new $payment['pay_code'];

        $pay_online = $pay_obj->get_code($order, unserialize_config($payment['pay_config']));

        $order['pay_desc'] = $payment['pay_desc'];

        $smarty->assign('pay_online', $pay_online);
    }
  $payment = payment_info($order['pay_id']);
     $order['pay_name'] = addslashes($payment['pay_name']);
  $smarty -> assign('order',$order);
  user_uc_call('add_feed', array($order['order_id'], BUY_GOODS)); //推送feed到uc
    unset($_SESSION['flow_consignee']); // 清除session中保存的收货人信息
    unset($_SESSION['flow_order']);
    unset($_SESSION['direct_shopping']);
 $smarty -> display('sub.dwt');
 

}
?>

 相关文章:

  直接将支付宝放在详细页

  分析ecshop支付流程

来源:中国B4C电子商务