當前位置: 首頁>>代碼示例>>PHP>>正文


PHP payment::order_set方法代碼示例

本文整理匯總了PHP中payment::order_set方法的典型用法代碼示例。如果您正苦於以下問題:PHP payment::order_set方法的具體用法?PHP payment::order_set怎麽用?PHP payment::order_set使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在payment的用法示例。


在下文中一共展示了payment::order_set方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: get_order_detail

/**
 *  獲取指訂單的詳情
 *
 * @access  public
 * @param   int         $order_id       訂單ID
 * @param   int         $user_id        用戶ID
 *
 * @return   arr        $order          訂單所有信息的數組
 */
function get_order_detail($order_id, $user_id = 0)
{
    include_once ROOT_PATH . 'includes/lib_order.php';
    $order_id = intval($order_id);
    if ($order_id <= 0) {
        $GLOBALS['err']->add($GLOBALS['_LANG']['invalid_order_id']);
        return false;
    }
    $order = order_info($order_id);
    //檢查訂單是否屬於該用戶
    if ($user_id > 0 && $user_id != $order['user_id']) {
        $GLOBALS['err']->add($GLOBALS['_LANG']['no_priv']);
        return false;
    }
    /* 對發貨號處理 */
    if (!empty($order['invoice_no'])) {
        $shipping_code = $GLOBALS['db']->GetOne("SELECT shipping_code FROM " . $GLOBALS['ecs']->table('shipping') . " WHERE shipping_id = '{$order['shipping_id']}'");
        $plugin = ROOT_PATH . 'includes/modules/shipping/' . $shipping_code . '.php';
        if (file_exists($plugin)) {
            include_once $plugin;
            $shipping = new $shipping_code();
            $order['invoice_no'] = $shipping->query($order['invoice_no']);
        }
    }
    /* 隻有未確認才允許用戶修改訂單地址 */
    if ($order['order_status'] == OS_UNCONFIRMED) {
        $order['allow_update_address'] = 1;
        //允許修改收貨地址
    } else {
        $order['allow_update_address'] = 0;
    }
    /* 獲取訂單中實體商品數量 */
    $order['exist_real_goods'] = exist_real_goods($order_id);
    /* 如果是未付款狀態,生成支付按鈕 */
    if ($order['pay_status'] == PS_UNPAYED && ($order['order_status'] == OS_UNCONFIRMED || $order['order_status'] == OS_CONFIRMED)) {
        /*
         * 在線支付按鈕
         */
        //支付方式信息
        /*修改於2014-04-02 by hg begin*/
        /* $payment_info = array();
        			$payment_info = payment_info($order['pay_id']);*/
        /*end*/
        //無效支付方式
        if (empty($order['pay_num'])) {
            $order['pay_online'] = '';
            if ($order['txd_pay_token_id']) {
                $order['pay_online'] = '<input type="button" value="前往支付" onclick="window.location.href=' . "'flow.php?step=txd_pay&order_id={$order['order_id']}'\"" . '>';
            }
        } else {
            /*修改於2014-04-02 by hg begin*/
            /*  //取得支付信息,生成支付代碼
                        $payment = unserialize_config($payment_info['pay_config']);
            
                        //獲取需要支付的log_id
                        $order['log_id']    = get_paylog_id($order['order_id'], $pay_type = PAY_ORDER);
                        $order['user_name'] = $_SESSION['user_name'];
                        $order['pay_desc']  = $payment_info['pay_desc'];
            
                        /* 調用相應的支付方式文件 
                        include_once(ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php');*/
            /* 取得在線支付方式的支付按鈕 
               $pay_obj    = new $payment_info['pay_code']; 
               $order['pay_online'] = $pay_obj->get_code($order, $payment);*/
            include_once ROOT_PATH . 'includes/modules/payment/payment.php';
            $pay_obj = new payment();
            $pay_num_static = strstr($order['pay_num'], '--');
            if ($pay_num_static) {
                $pay_obj->order_set($order['pay_num']);
                $order['pay_num'] = $pay_obj->order_pay_num($order['pay_num']);
                $order['pay_online'] = $pay_obj->get_code($order);
            }
            /*end*/
        }
    } else {
        $order['pay_online'] = '';
    }
    /* 無配送時的處理 */
    $order['shipping_id'] == -1 and $order['shipping_name'] = $GLOBALS['_LANG']['shipping_not_need'];
    /* 其他信息初始化 */
    $order['how_oos_name'] = $order['how_oos'];
    $order['how_surplus_name'] = $order['how_surplus'];
    /* 虛擬商品付款後處理 */
    if ($order['pay_status'] != PS_UNPAYED) {
        /* 取得已發貨的虛擬商品信息 */
        $virtual_goods = get_virtual_goods($order_id, true);
        $virtual_card = array();
        foreach ($virtual_goods as $code => $goods_list) {
            /* 隻處理虛擬卡 */
            if ($code == 'virtual_card') {
                foreach ($goods_list as $goods) {
//.........這裏部分代碼省略.........
開發者ID:dlpc,項目名稱:ecshop,代碼行數:101,代碼來源:lib_transaction.php

示例2: payment

     $order['order_amount'] = $order['surplus_amount'] + $payment_info['pay_fee'];
     //如果支付費用改變了,也要相應的更改pay_log表的order_amount
     $order_amount = $db->getOne("SELECT order_amount FROM " . $ecs->table('pay_log') . " WHERE log_id = '{$order['log_id']}'");
     if ($order_amount != $order['order_amount']) {
         $db->query("UPDATE " . $ecs->table('pay_log') . " SET order_amount = '{$order['order_amount']}' WHERE log_id = '{$order['log_id']}'");
     }
     /*2014-04-08 by hg*/
     /* /* 調用相應的支付方式文件 
        include_once(ROOT_PATH . 'includes/modules/payment/' . $payment_info['pay_code'] . '.php');*/
     /* 取得在線支付方式的支付按鈕
        $pay_obj = new $payment_info['pay_code'];
        $payment_info['pay_button'] = $pay_obj->get_code($order, $payment); */
     include_once 'includes/modules/payment/payment.php';
     $pay_obj = new payment();
     $order['pay_num'] = $payment_id;
     $pay_obj->order_set($order['pay_num']);
     $order['pay_num'] = $pay_obj->order_pay_num($order['pay_num']);
     $pay_online = $pay_obj->get_code($order);
     $payment_info['pay_button'] = $pay_obj->get_code($order);
     /*end*/
     /* 模板賦值 */
     $smarty->assign('payment', $payment_info);
     $smarty->assign('order', $order);
     $smarty->assign('pay_fee', price_format($payment_info['pay_fee'], false));
     $smarty->assign('amount', price_format($order['surplus_amount'], false));
     $smarty->assign('action', 'act_account');
     $smarty->display('user_transaction.dwt');
 } else {
     include_once ROOT_PATH . 'includes/lib_clips.php';
     $smarty->assign('payment', get_online_payment_list());
     $smarty->assign('order', $order);
開發者ID:dlpc,項目名稱:ecshop,代碼行數:31,代碼來源:user.php


注:本文中的payment::order_set方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。