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


PHP fn_change_order_status函数代码示例

本文整理汇总了PHP中fn_change_order_status函数的典型用法代码示例。如果您正苦于以下问题:PHP fn_change_order_status函数的具体用法?PHP fn_change_order_status怎么用?PHP fn_change_order_status使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了fn_change_order_status函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: apiUpdateOrder

 public static function apiUpdateOrder($order, $response)
 {
     if (!defined('ORDER_MANAGEMENT')) {
         define('ORDER_MANAGEMENT', true);
     }
     if (!empty($order['status'])) {
         $statuses = fn_get_statuses(STATUSES_ORDER, false, true);
         if (!isset($statuses[$order['status']])) {
             $response->addError('ERROR_OBJECT_UPDATE', str_replace('[object]', 'orders', __('twgadmin_wrong_api_object_data')));
         } else {
             fn_change_order_status($order['order_id'], $order['status']);
         }
     }
     $cart = array();
     fn_clear_cart($cart, true);
     $customer_auth = fn_fill_auth(array(), array(), false, 'C');
     fn_form_cart($order['order_id'], $cart, $customer_auth);
     $cart['order_id'] = $order['order_id'];
     // update only profile data
     $profile_data = fn_check_table_fields($order, 'user_profiles');
     $cart['user_data'] = fn_array_merge($cart['user_data'], $profile_data);
     $cart['user_data'] = fn_array_merge($cart['user_data'], $order);
     fn_calculate_cart_content($cart, $customer_auth, 'A', true, 'I');
     if (!empty($order['details'])) {
         db_query('UPDATE ?:orders SET details = ?s WHERE order_id = ?i', $order['details'], $order['order_id']);
     }
     if (!empty($order['notes'])) {
         $cart['notes'] = $order['notes'];
     }
     fn_update_payment_surcharge($cart, $customer_auth);
     list($order_id, $process_payment) = fn_place_order($cart, $customer_auth, 'save');
     return array($order_id, $process_payment);
 }
开发者ID:askzap,项目名称:ultimate,代码行数:33,代码来源:TwigmoOrder.php

示例2: update

 public function update($status)
 {
     $map = $this->getMap();
     $new_status = $this->default_status;
     if (isset($map[$status])) {
         $new_status = $map[$status];
     }
     self::$from_api = true;
     $result = fn_change_order_status($this->order['order_id'], $new_status);
     self::$from_api = false;
     return $result;
 }
开发者ID:ambient-lounge,项目名称:site,代码行数:12,代码来源:OrderStatus.php

示例3: array

             }
             if ($amount == 0) {
                 continue;
             }
             $_data = array('item_id' => $key, 'shipment_id' => $shipment_id, 'order_id' => $_REQUEST['shipment_data']['order_id'], 'product_id' => $order_info['items'][$key]['product_id'], 'amount' => $amount);
             db_query("INSERT INTO ?:shipment_items ?e", $_data);
         }
         $force_notification = fn_get_notification_rules($_REQUEST);
         if (!empty($force_notification['C'])) {
             $shipment = array('shipment_id' => $shipment_id, 'timestamp' => $shipment_data['timestamp'], 'shipping' => db_get_field('SELECT shipping FROM ?:shipping_descriptions WHERE shipping_id = ?i', $shipment_data['shipping_id']), 'tracking_number' => $shipment_data['tracking_number'], 'carrier' => $shipment_data['carrier'], 'comments' => $shipment_data['comments'], 'items' => $_REQUEST['shipment_data']['products']);
             $view_mail->assign('shipment', $shipment);
             $view_mail->assign('order_info', $order_info);
             fn_send_mail($order_info['email'], Registry::get('settings.Company.company_orders_department'), 'shipments/shipment_products_subj.tpl', 'shipments/shipment_products.tpl', '', $order_info['lang_code']);
         }
         if (!empty($shipment_data['order_status'])) {
             fn_change_order_status($_REQUEST['shipment_data']['order_id'], $shipment_data['order_status']);
         }
         fn_set_notification('N', fn_get_lang_var('notice'), fn_get_lang_var('shipment_has_been_created'));
     } else {
         fn_set_notification('E', fn_get_lang_var('error'), fn_get_lang_var('products_for_shipment_not_selected'));
     }
     $suffix = '.details?order_id=' . $_REQUEST['shipment_data']['order_id'];
 } elseif ($mode == 'packing_slip' && !empty($_REQUEST['shipment_ids'])) {
     $html = array();
     $params = $_REQUEST;
     foreach ($params['shipment_ids'] as $k => $v) {
         list($shipment, $order_info) = fn_get_packing_info($v);
         $view_mail->assign('order_info', $order_info);
         $view_mail->assign('shipment', $shipment);
         if (DISPATCH_EXTRA == 'pdf') {
             $html[] = $view_mail->display('orders/print_packing_slip.tpl', false);
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:shipments.php

示例4: fn_update_shipment

/**
 * Create/update shipment
 *
 * @param array $shipment_data Array of shipment data.
 * @param int $shipment_id Shipment identifier
 * @param int $group_key Group number
 * @param bool $all_products
 * @param mixed $force_notification user notification flag (true/false), if not set, will be retrieved from status parameters
 * @return int $shipment_id
 */
function fn_update_shipment($shipment_data, $shipment_id = 0, $group_key = 0, $all_products = false, $force_notification = array())
{
    if (!empty($shipment_id)) {
        $arow = db_query("UPDATE ?:shipments SET tracking_number = ?s, carrier = ?s WHERE shipment_id = ?i", $shipment_data['tracking_number'], $shipment_data['carrier'], $shipment_id);
        if ($arow === false) {
            fn_set_notification('E', __('error'), __('object_not_found', array('[object]' => __('shipment'))), '', '404');
            $shipment_id = false;
        }
    } else {
        if (empty($shipment_data['order_id']) || empty($shipment_data['shipping_id'])) {
            return false;
        }
        $order_info = fn_get_order_info($shipment_data['order_id'], false, true, true);
        $use_shipments = Settings::instance()->getValue('use_shipments', '', $order_info['company_id']) == 'Y' ? true : false;
        if (!$use_shipments && empty($shipment_data['tracking_number']) && empty($shipment_data['tracking_number'])) {
            return false;
        }
        if (!$use_shipments && $all_products) {
            foreach ($order_info['product_groups'] as $group) {
                foreach ($group['products'] as $item_key => $product) {
                    if (!empty($product['extra']['group_key'])) {
                        if ($group_key == $product['extra']['group_key']) {
                            $shipment_data['products'][$item_key] = $product['amount'];
                        }
                    } elseif ($group_key == 0) {
                        $shipment_data['products'][$item_key] = $product['amount'];
                    }
                }
            }
        }
        if (!empty($shipment_data['products']) && fn_check_shipped_products($shipment_data['products'])) {
            fn_set_hook('create_shipment', $shipment_data, $order_info, $group_key, $all_products);
            foreach ($shipment_data['products'] as $key => $amount) {
                if (isset($order_info['products'][$key])) {
                    $amount = intval($amount);
                    if ($amount > $order_info['products'][$key]['amount'] - $order_info['products'][$key]['shipped_amount']) {
                        $shipment_data['products'][$key] = $order_info['products'][$key]['amount'] - $order_info['products'][$key]['shipped_amount'];
                    }
                }
            }
            if (fn_check_shipped_products($shipment_data['products'])) {
                $shipment_data['timestamp'] = time();
                $shipment_id = db_query("INSERT INTO ?:shipments ?e", $shipment_data);
                foreach ($shipment_data['products'] as $key => $amount) {
                    if ($amount == 0) {
                        continue;
                    }
                    $_data = array('item_id' => $key, 'shipment_id' => $shipment_id, 'order_id' => $shipment_data['order_id'], 'product_id' => $order_info['products'][$key]['product_id'], 'amount' => $amount);
                    db_query("INSERT INTO ?:shipment_items ?e", $_data);
                }
                if (fn_check_permissions('orders', 'update_status', 'admin') && !empty($shipment_data['order_status'])) {
                    fn_change_order_status($shipment_data['order_id'], $shipment_data['order_status']);
                }
                /**
                 * Called after new shipment creation.
                 *
                 * @param array $shipment_data Array of shipment data.
                 * @param array $order_info Shipment order info
                 * @param int $group_key Group number
                 * @param bool $all_products
                 * @param int $shipment_id Created shipment identifier
                 */
                fn_set_hook('create_shipment_post', $shipment_data, $order_info, $group_key, $all_products, $shipment_id);
                if (!empty($force_notification['C'])) {
                    $shipment = array('shipment_id' => $shipment_id, 'timestamp' => $shipment_data['timestamp'], 'shipping' => db_get_field('SELECT shipping FROM ?:shipping_descriptions WHERE shipping_id = ?i AND lang_code = ?s', $shipment_data['shipping_id'], $order_info['lang_code']), 'tracking_number' => $shipment_data['tracking_number'], 'carrier' => $shipment_data['carrier'], 'comments' => $shipment_data['comments'], 'items' => $shipment_data['products']);
                    Mailer::sendMail(array('to' => $order_info['email'], 'from' => 'company_orders_department', 'data' => array('shipment' => $shipment, 'order_info' => $order_info), 'tpl' => 'shipments/shipment_products.tpl', 'company_id' => $order_info['company_id']), 'C', $order_info['lang_code']);
                }
                fn_set_notification('N', __('notice'), __('shipment_has_been_created'));
            }
        } else {
            fn_set_notification('E', __('error'), __('products_for_shipment_not_selected'));
        }
    }
    return $shipment_id;
}
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:85,代码来源:fn.cart.php

示例5: fn_delete_order

/**
 * Function delete order
 *
 * @param int $order_id
 */
function fn_delete_order($order_id)
{
    // Log order deletion
    fn_log_event('orders', 'delete', array('order_id' => $order_id));
    fn_change_order_status($order_id, STATUS_INCOMPLETED_ORDER, '', fn_get_notification_rules(array(), false));
    // incomplete to increase inventory
    fn_set_hook('delete_order', $order_id);
    db_query("DELETE FROM ?:new_orders WHERE order_id = ?i", $order_id);
    db_query("DELETE FROM ?:order_data WHERE order_id = ?i", $order_id);
    db_query("DELETE FROM ?:order_details WHERE order_id = ?i", $order_id);
    db_query("DELETE FROM ?:orders WHERE order_id = ?i", $order_id);
    db_query("DELETE FROM ?:product_file_ekeys WHERE order_id = ?i", $order_id);
    db_query("DELETE FROM ?:profile_fields_data WHERE object_id = ?i AND object_type='O'", $order_id);
    db_query("DELETE FROM ?:order_docs WHERE order_id = ?i", $order_id);
}
开发者ID:diedsmiling,项目名称:busenika,代码行数:20,代码来源:fn.cart.php

示例6: fn_get_payment_method_data

     $processor_data = fn_get_payment_method_data($payment_id);
     $order_info = fn_get_order_info($_REQUEST['order_id']);
     $order_number_id = $processor_data['processor_params']['mode'] == 'test' ? '1' : $_REQUEST['order_number'];
     $pp_response = array();
     if (strtoupper(md5($processor_data['processor_params']['secret_word'] . $processor_data['processor_params']['account_number'] . $order_number_id . $order_info['total'])) == $_REQUEST['key'] && $_REQUEST['credit_card_processed'] == 'Y') {
         $pp_response['order_status'] = $processor_data['processor_params']['fraud_verification'] == 'Y' ? $processor_data['processor_params']['fraud_wait'] : 'P';
         $pp_response['reason_text'] = __('order_id') . '-' . $_REQUEST['order_number'];
     } else {
         $pp_response['order_status'] = $_REQUEST['credit_card_processed'] == 'K' ? 'O' : 'F';
         $pp_response['reason_text'] = $_REQUEST['credit_card_processed'] == 'Y' ? "MD5 Hash is invalid" : __('order_id') . '-' . $_REQUEST['order_number'];
     }
     $pp_response['transaction_id'] = !empty($_REQUEST['tcoid']) ? $_REQUEST['tcoid'] : '';
     if (fn_check_payment_script('2checkout.php', $_REQUEST['order_id'])) {
         if ($processor_data['processor_params']['fraud_verification'] == 'Y') {
             fn_update_order_payment_info($_REQUEST['order_id'], $pp_response);
             fn_change_order_status($_REQUEST['order_id'], $pp_response['order_status'], '', false);
         } else {
             fn_finish_payment($_REQUEST['order_id'], $pp_response, false);
         }
         fn_order_placement_routines('route', $_REQUEST['order_id']);
     }
     // Fraud checking notification
 } elseif (!empty($_REQUEST['message_type']) && $_REQUEST['message_type'] == 'FRAUD_STATUS_CHANGED') {
     if (!empty($_REQUEST['vendor_order_id'])) {
         list($order_id) = explode('_', $_REQUEST['vendor_order_id']);
         if (!empty($order_id)) {
             $payment_id = db_get_field("SELECT payment_id FROM ?:orders WHERE order_id = ?i", $order_id);
             $processor_data = fn_get_payment_method_data($payment_id);
             $pp_response = array();
             if ($_REQUEST['fraud_status'] == 'pass') {
                 $pp_response['order_status'] = 'P';
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:2checkout.php

示例7: fn_anti_fraud_remove_status

function fn_anti_fraud_remove_status()
{
    $settings = Registry::get('addons.anti_fraud');
    $o_ids = db_get_fields('SELECT order_id FROM ?:orders WHERE status = ?s', $settings['antifraud_order_status']);
    if (!empty($o_ids)) {
        foreach ($o_ids as $order_id) {
            fn_change_order_status($order_id, 'O');
            // Change order status from "Fraud checking" to "Open"
        }
    }
    fn_delete_status($settings['antifraud_order_status'], 'O');
}
开发者ID:askzap,项目名称:ultimate,代码行数:12,代码来源:func.php

示例8: die

<?php

if (!defined('AREA')) {
    die('Access denied');
}
fn_change_order_status($orderId, 'O');
// Redirect to widget page
$postUrl = fn_url('paymentwall.payment&order_id=' . $order_info['order_id']);
$_SESSION['pw_order_id'] = $order_info['order_id'];
header("Location: {$postUrl}");
// Cancel auto redirect payment
exit;
开发者ID:vukhacdiep,项目名称:module-cscart,代码行数:12,代码来源:paymentwall.php

示例9: array

 }
 if ($process_payment == true) {
     $payment_info = !empty($cart['payment_info']) ? $cart['payment_info'] : array();
     fn_start_payment($order_id, fn_get_notification_rules($_REQUEST), $payment_info);
 }
 if (!empty($_REQUEST['update_order']['details'])) {
     db_query('UPDATE ?:orders SET details = ?s WHERE order_id = ?i', $_REQUEST['update_order']['details'], $order_id);
 }
 $notification_rules = fn_get_notification_rules($_REQUEST);
 // change status if it posted
 if (!empty($_REQUEST['order_status'])) {
     $order_info = fn_get_order_short_info($order_id);
     if ($order_info['status'] != $_REQUEST['order_status']) {
         if ($process_payment == true) {
             fn_set_notification('W', __('warning'), __('status_changed_after_process_payment'));
         } elseif (fn_change_order_status($order_id, $_REQUEST['order_status'], '', $notification_rules)) {
             $order_info = fn_get_order_short_info($order_id);
             $new_status = $order_info['status'];
             if ($_REQUEST['order_status'] != $new_status) {
                 fn_set_notification('W', __('warning'), __('status_changed'));
             }
         } else {
             $error = false;
             if ($order_info['is_parent_order'] == 'Y') {
                 $suborders = fn_get_suborders_info($order_id);
                 if ($suborders) {
                     foreach ($suborders as $suborder) {
                         if ($suborder['status'] != $_REQUEST['order_status']) {
                             $error = true;
                             break;
                         }
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:order_management.php

示例10: fn_get_order_info

    if ($mode == 'notify') {
        $order_id = (int) $_REQUEST['order_id'];
        $order_info = fn_get_order_info($order_id);
        $processor_data = $order_info['payment_method'];
        // We are trying to avoid mess with declined and success urls
        $sign = md5($processor_data['processor_params']['product_id'] . '-' . $order_info['total'] . '-' . $processor_data['processor_params']['sharedsec']);
        // Because the callback comes only after return we have to make sure that this redirect is successful
        if (in_array($order_info['status'], array('D')) || empty($_REQUEST['sign']) || $sign != $_REQUEST['sign']) {
            $pp_response['order_status'] = 'D';
            $pp_response["reason_text"] = __('text_transaction_declined');
            fn_finish_payment($order_id, $pp_response, false);
        } else {
            // Set open status until callback from chronopay service is recieved
            if (fn_check_payment_script('chronopay_form.php', $order_id)) {
                if (isset($order_info['payment_info']['awaiting_callback']) && $order_info['payment_info']['awaiting_callback'] == true) {
                    fn_change_order_status($order_id, 'O', $order_info['status'], false);
                }
            }
        }
        fn_order_placement_routines('route', $order_id);
    }
} else {
    if (!defined('BOOTSTRAP')) {
        die('Access denied');
    }
    $post_url = fn_payment_url('current', 'chronopay_form.php');
    $return_url = fn_url("payment_notification.notify?payment=chronopay_form&order_id={$order_id}", AREA, 'current');
    $country = db_get_field("SELECT code_A3 FROM ?:countries WHERE code = ?s", $order_info['b_country']);
    $product_name = "";
    // Products
    if (!empty($order_info['products'])) {
开发者ID:askzap,项目名称:ultimate,代码行数:31,代码来源:chronopay_form.php

示例11: die

    die('Access denied');
}
$hsbc_errors = array("1" => "The user cancelled the transaction.", "2" => "The processor declined the transaction for an unknown reason.", "3" => "The transaction was declined because of a problem with the card. For example, an invalid card number or expiration date was specified.", "4" => "The processor did not return a response.", "5" => "The amount specified in the transaction was either too high or too low for the processor.", "6" => "The specified currency is not supported by either the processor or the card.", "7" => "The order is invalid because the order ID is a duplicate.", "8" => "The transaction was rejected by FraudShield.", "9" => "The transaction was placed in Review state by FraudShield.", "10" => "The transaction failed because of invalid input data.", "11" => "The transaction failed because the CPI was configured incorrectly.", "12" => "The transaction failed because the Storefront was configured incorrectly.", "13" => "The connection timed out.", "14" => "The transaction failed because the cardholders browser refused a cookie.", "15" => "The customers browser does not support 128-bit encryption.", "16" => "The CPI cannot communicate with the Secure ePayment engine.");
if (defined('PAYMENT_NOTIFICATION')) {
    if ($mode == 'notify') {
        $pp_response = array();
        if (empty($_REQUEST['CpiResultsCode'])) {
            $pp_response["order_status"] = "P";
            $pp_response["reason_text"] = "CpiResultsCode: " . $_REQUEST['CpiResultsCode'];
        } else {
            $pp_response["order_status"] = "F";
            $pp_response["reason_text"] = $hsbc_errors[$_REQUEST['CpiResultsCode']];
        }
        $order_id = $_REQUEST['OrderId'];
        if (fn_check_payment_script('hsbc.php', $order_id)) {
            fn_change_order_status($order_id, $pp_response["order_status"], '', true);
        }
        exit;
    } elseif ($mode == 'invoice') {
        if (empty($_REQUEST['CpiResultsCode'])) {
            $pp_response["order_status"] = "P";
            $pp_response["reason_text"] = "CpiResultsCode: " . $_REQUEST['CpiResultsCode'];
        } else {
            $pp_response["order_status"] = "F";
            $pp_response["reason_text"] = $hsbc_errors[$_REQUEST['CpiResultsCode']];
        }
        $order_id = $_REQUEST['OrderId'];
        if (fn_check_payment_script('hsbc.php', $order_id)) {
            fn_finish_payment($order_id, $pp_response, false);
            fn_order_placement_routines($order_id);
        }
开发者ID:diedsmiling,项目名称:busenika,代码行数:31,代码来源:hsbc.php

示例12: fn_get_ebay_orders

function fn_get_ebay_orders()
{
    $success_orders = $failed_orders = array();
    setlocale(LC_TIME, 'en_US');
    $params = array('OrderStatus' => 'Completed');
    $last_transaction = db_get_field('SELECT timestamp FROM ?:ebay_cached_transactions WHERE type = ?s AND status = ?s ORDER BY timestamp DESC', 'orders', 'C');
    // Need user_id
    if (!empty($last_transaction)) {
        $params['CreateTimeFrom'] = gmstrftime("%Y-%m-%dT%H:%M:%S", $last_transaction);
        $params['CreateTimeTo'] = gmstrftime("%Y-%m-%dT%H:%M:%S", TIME);
    }
    $data = array('timestamp' => TIME, 'user_id' => $_SESSION['auth']['user_id'], 'session_id' => Session::getId(), 'status' => 'A', 'type' => 'orders', 'result' => '', 'site_id' => 0);
    $transaction_id = db_query('INSERT INTO ?:ebay_cached_transactions ?e', $data);
    list(, $ebay_orders) = Ebay::instance()->GetOrders($params);
    $data = array('status' => 'C', 'result' => count($ebay_orders));
    db_query('UPDATE ?:ebay_cached_transactions SET ?u WHERE transaction_id = ?i', $data, $transaction_id);
    if (!empty($ebay_orders)) {
        foreach ($ebay_orders as $k => $v) {
            $item_transactions = $v['TransactionArray'];
            $cart = $products = array();
            if (!is_array($item_transactions)) {
                $item_transactions = array($item_transactions->Transaction);
            }
            $i = 1;
            foreach ($item_transactions as $item) {
                $email = (string) $item->Buyer->Email;
                break;
            }
            $shipping_address = $v['ShippingAddress'];
            $customer_name = explode(' ', (string) $shipping_address->Name);
            $firstname = array_shift($customer_name);
            $lastname = implode(' ', $customer_name);
            $cart = array('user_id' => 0, 'company_id' => Registry::get('runtime.company_id'), 'email' => $email, 'ebay_order_id' => $v['OrderID'], 'status' => 'P', 'timestamp' => strtotime($v['CreatedTime']), 'payment_id' => 0, 'user_data' => array('firstname' => $firstname, 'lastname' => $lastname, 'phone' => (string) $shipping_address->Phone, 's_firstname' => $firstname, 's_lastname' => $lastname, 's_address' => (string) $shipping_address->Street1, 's_city' => (string) $shipping_address->CityName, 's_state' => (string) $shipping_address->StateOrProvince, 's_country' => (string) $shipping_address->Country, 's_phone' => (string) $shipping_address->Phone, 's_zipcode' => (string) $shipping_address->PostalCode, 'b_firstname' => $firstname, 'b_lastname' => $lastname, 'b_address' => (string) $shipping_address->Street1, 'b_city' => (string) $shipping_address->CityName, 'b_state' => (string) $shipping_address->StateOrProvince, 'b_country' => (string) $shipping_address->Country, 'b_phone' => (string) $shipping_address->Phone, 'b_zipcode' => (string) $shipping_address->PostalCode), 'total' => $v['Total'], 'subtotal' => $v['Subtotal'], 'shipping_cost' => (double) $v['ShippingServiceSelected']->ShippingServiceCost);
            foreach ($item_transactions as $item) {
                $_item = (array) $item->Item;
                $product_id = db_get_field('SELECT product_id FROM ?:ebay_template_products WHERE ebay_item_id = ?i', $_item['ItemID']);
                // Need check company_id
                if (!$product_id) {
                    continue;
                }
                $product = fn_get_product_data($product_id, $cart['user_data']);
                $extra = array("product_options" => array());
                $options = db_get_array('SELECT ?:product_options.option_id, ?:product_options_descriptions.option_name, ?:product_option_variants_descriptions.variant_id, ?:product_option_variants_descriptions.variant_name
                FROM ?:product_options
                JOIN ?:product_option_variants ON ?:product_option_variants.option_id = ?:product_options.option_id
                JOIN ?:product_options_descriptions ON ?:product_options_descriptions.option_id = ?:product_options.option_id
                JOIN ?:product_option_variants_descriptions ON ?:product_option_variants_descriptions.variant_id = ?:product_option_variants.variant_id
                WHERE product_id =?i', $product_id);
                if (isset($item->Variation)) {
                    $variations_xml = (array) $item->Variation->VariationSpecifics;
                    if (isset($variations_xml['NameValueList']->Name)) {
                        $variations = (array) $variations_xml['NameValueList'];
                    } else {
                        foreach ($variations_xml['NameValueList'] as $variation) {
                            $variations[] = (array) $variation;
                        }
                    }
                    if (isset($variations)) {
                        if (isset($variations['Name'])) {
                            foreach ($options as $option) {
                                if ($variations['Name'] == $option['option_name'] && $variations['Value'] == $option['variant_name']) {
                                    $extra['product_options'][$option['option_id']] = $option['variant_id'];
                                }
                            }
                        } else {
                            foreach ($variations as $variation) {
                                foreach ($options as $option) {
                                    if ($variation['Name'] == $option['option_name'] && $variation['Value'] == $option['variant_name']) {
                                        $extra['product_options'][$option['option_id']] = $option['variant_id'];
                                    }
                                }
                            }
                        }
                        $variations = array();
                    }
                }
                $products[$i] = array('product_id' => $product_id, 'amount' => (int) $item->QuantityPurchased, 'price' => (double) $item->TransactionPrice, 'base_price' => (double) $item->TransactionPrice, 'is_edp' => $product['is_edp'], 'edp_shipping' => $product['edp_shipping'], 'free_shipping' => $product['free_shipping'], 'stored_price' => 'Y', 'company_id' => Registry::get('runtime.company_id'), 'extra' => $extra);
                unset($product);
                $i += 1;
            }
            if (empty($products)) {
                continue;
            }
            $cart['products'] = $products;
            unset($products);
            $location = fn_get_customer_location($cart['user_data'], $cart);
            $cart['product_groups'] = Shippings::groupProductsList($cart['products'], $location);
            list($order_id, $status) = fn_update_order($cart);
            if (!empty($order_id)) {
                fn_change_order_status($order_id, 'P', $status, fn_get_notification_rules(array(), false));
                $success_orders[] = $order_id;
            } else {
                $failed_orders[] = $cart['ebay_order_id'];
            }
        }
    }
    return array($success_orders, $failed_orders);
}
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:98,代码来源:func.php

示例13: fn_process_epayph_ipn

function fn_process_epayph_ipn($order_id, $data)
{
    $order_info = fn_get_order_info($order_id);
    if (!empty($order_info) && !empty($data['txn_id']) && (empty($order_info['payment_info']['txn_id']) || $data['payment_status'] != 'Completed' || $data['payment_status'] == 'Completed' && $order_info['payment_info']['txn_id'] !== $data['txn_id'])) {
        //Can't check refund transactions.
        if (isset($data['txn_type']) && !fn_validate_epayph_order_info($data, $order_info)) {
            return false;
        }
        $pp_settings = fn_get_epayph_settings();
        $data['payment_status'] = strtolower($data['payment_status']);
        fn_clear_cart($cart, true);
        $customer_auth = fn_fill_auth(array(), array(), false, 'C');
        fn_form_cart($order_id, $cart, $customer_auth);
        if ($pp_settings['override_customer_info'] == 'Y') {
            $cart['user_data'] = fn_epayph_get_customer_info($data);
        }
        $cart['order_id'] = $order_id;
        $cart['payment_info'] = $order_info['payment_info'];
        $cart['payment_info']['protection_eligibility'] = !empty($data['protection_eligibility']) ? $data['protection_eligibility'] : '';
        $cart['payment_id'] = $order_info['payment_id'];
        if (!empty($data['memo'])) {
            //Save customer notes
            $cart['notes'] = $data['memo'];
        }
        if ($data['payment_status'] == 'Completed') {
            //save uniq ipn id to avoid double ipn processing
            $cart['payment_info']['txn_id'] = $data['txn_id'];
        }
        fn_calculate_cart_content($cart, $customer_auth);
        list($order_id, ) = fn_update_order($cart, $order_id);
        if ($order_id) {
            $send_notification = $order_info['status'] == $pp_settings['pp_statuses'][$data['payment_status']] ? false : array();
            $short_order_data = fn_get_order_short_info($order_id);
            fn_change_order_status($order_id, $pp_settings['pp_statuses'][$data['payment_status']], $short_order_data['status'], $send_notification);
        }
        return true;
    }
}
开发者ID:Neuralink,项目名称:epayph_cscart,代码行数:38,代码来源:func.php

示例14: fn_finish_payment

             fn_finish_payment($_REQUEST['order_id'], $pp_response);
         }
     }
     exit;
 } elseif ($mode == 'return') {
     if (fn_check_payment_script('paypal.php', $_REQUEST['order_id'])) {
         $order_info = fn_get_order_info($_REQUEST['order_id'], true);
         if ($order_info['status'] == STATUS_INCOMPLETED_ORDER) {
             fn_change_order_status($_REQUEST['order_id'], 'O', '', false);
         }
         if (fn_allowed_for('MULTIVENDOR')) {
             if ($order_info['status'] == STATUS_PARENT_ORDER) {
                 $child_orders = db_get_hash_single_array("SELECT order_id, status FROM ?:orders WHERE parent_order_id = ?i", array('order_id', 'status'), $_REQUEST['order_id']);
                 foreach ($child_orders as $order_id => $order_status) {
                     if ($order_status == STATUS_INCOMPLETED_ORDER) {
                         fn_change_order_status($order_id, 'O', '', false);
                     }
                 }
             }
         }
     }
     fn_order_placement_routines('route', $_REQUEST['order_id'], false);
 } elseif ($mode == 'cancel') {
     $order_info = fn_get_order_info($_REQUEST['order_id']);
     $pp_response['order_status'] = 'N';
     $pp_response["reason_text"] = __('text_transaction_cancelled');
     if (!empty($_REQUEST['payer_email'])) {
         $pp_response['customer_email'] = $_REQUEST['payer_email'];
     }
     if (!empty($_REQUEST['payer_id'])) {
         $pp_response['client_id'] = $_REQUEST['payer_id'];
开发者ID:OneataBogdan,项目名称:lead_coriolan,代码行数:31,代码来源:paypal.php

示例15: fn_set_hook

         $update_order['payment_surcharge'] = 0;
     }
     //Default change order status back to Open
     $change_order_status = STATUSES_ORDER;
     /**
      * Data change for a repayed order
      * @param array     $order_info Order information
      * @param array     $update_order New order data
      * @param array     $payment  Payment information
      * @param array     $payment_info Payment information received from a user
      * @param string    $change_order_status New order status
      */
     fn_set_hook('repay_order', $order_info, $update_order, $payment, $payment_info, $change_order_status);
     db_query('UPDATE ?:orders SET ?u WHERE order_id = ?i', $update_order, $_REQUEST['order_id']);
     // Change order status and restore amount.
     fn_change_order_status($order_info['order_id'], $change_order_status, $order_info['status'], fn_get_notification_rules(array(), false));
     Tygh::$app['session']['cart']['placement_action'] = 'repay';
     // Process order (payment)
     fn_start_payment($order_info['order_id'], array(), $payment_info);
     fn_order_placement_routines('repay', $order_info['order_id'], array(), true);
     // Request for order tracking
 } elseif ($mode == 'track_request') {
     if (fn_image_verification('track_orders', $_REQUEST) == false) {
         exit;
     }
     $condition = fn_get_company_condition('?:orders.company_id');
     if (!empty($auth['user_id'])) {
         $allowed_id = db_get_field('SELECT user_id ' . 'FROM ?:orders ' . 'WHERE user_id = ?i AND order_id = ?i AND is_parent_order != ?s' . $condition, $auth['user_id'], $_REQUEST['track_data'], 'Y');
         if (!empty($allowed_id)) {
             Tygh::$app['ajax']->assign('force_redirection', fn_url('orders.details?order_id=' . $_REQUEST['track_data']));
             exit;
开发者ID:ambient-lounge,项目名称:site,代码行数:31,代码来源:orders.php


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