当前位置: 首页>>代码示例>>PHP>>正文


PHP payment::order_pay_num方法代码示例

本文整理汇总了PHP中payment::order_pay_num方法的典型用法代码示例。如果您正苦于以下问题:PHP payment::order_pay_num方法的具体用法?PHP payment::order_pay_num怎么用?PHP payment::order_pay_num使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在payment的用法示例。


在下文中一共展示了payment::order_pay_num方法的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

     //如果支付费用改变了,也要相应的更改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);
     $smarty->assign('action', 'account_deposit');
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:user.php


注:本文中的payment::order_pay_num方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。