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


PHP osC_Order类代码示例

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


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

示例1: osC_Checkout_Process

 function osC_Checkout_Process()
 {
     global $osC_Session, $osC_ShoppingCart, $osC_Customer, $osC_NavigationHistory, $osC_Payment;
     if ($osC_ShoppingCart->hasContents() === false) {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, null, 'SSL'));
     }
     // if no shipping method has been selected, redirect the customer to the shipping method selection page
     if ($osC_ShoppingCart->hasShippingMethod() === false && $osC_ShoppingCart->getContentType() != 'virtual') {
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'shipping', 'SSL'));
     }
     if ($osC_ShoppingCart->hasBillingMethod()) {
         // load selected payment module
         include 'includes/classes/payment.php';
         $osC_Payment = new osC_Payment($osC_ShoppingCart->getBillingMethod('id'));
     }
     include 'includes/classes/order.php';
     if ($osC_ShoppingCart->hasBillingMethod()) {
         $osC_Payment->process();
     } else {
         $orders_id = osC_Order::insert();
         osC_Order::process($orders_id, ORDERS_STATUS_PAID);
     }
     $osC_ShoppingCart->reset(true);
     // unregister session variables used during checkout
     unset($_SESSION['comments']);
     osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'success', 'SSL'));
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:27,代码来源:process.php

示例2: osC_Account_Orders

 function osC_Account_Orders()
 {
     global $osC_Services, $osC_Language, $osC_Customer, $osC_Breadcrumb;
     $this->_page_title = $osC_Language->get('orders_heading');
     $osC_Language->load('order');
     if ($osC_Services->isStarted('breadcrumb')) {
         $osC_Breadcrumb->add($osC_Language->get('breadcrumb_my_orders'), osc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
         if (is_numeric($_GET[$this->_module])) {
             $osC_Breadcrumb->add(sprintf($osC_Language->get('breadcrumb_order_information'), $_GET[$this->_module]), osc_href_link(FILENAME_ACCOUNT, $this->_module . '=' . $_GET[$this->_module], 'SSL'));
         }
     }
     if (is_numeric($_GET[$this->_module])) {
         if (osC_Order::getCustomerID($_GET[$this->_module]) !== $osC_Customer->getID()) {
             osc_redirect(osc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
         }
         $this->_page_title = sprintf($osC_Language->get('order_information_heading'), $_GET[$this->_module]);
         $this->_page_contents = 'account_history_info.php';
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:19,代码来源:orders.php

示例3: osC_Account_Orders

 function osC_Account_Orders()
 {
     global $osC_Services, $osC_Language, $osC_Customer, $breadcrumb, $returns_orders;
     $this->_page_title = $osC_Language->get('orders_heading');
     $osC_Language->load('order');
     if ($osC_Services->isStarted('breadcrumb')) {
         $breadcrumb->add($osC_Language->get('breadcrumb_my_orders'), osc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
         if (is_numeric($_REQUEST[$this->_module])) {
             $breadcrumb->add(sprintf($osC_Language->get('breadcrumb_order_information'), $_REQUEST[$this->_module]), osc_href_link(FILENAME_ACCOUNT, $this->_module . '=' . $_REQUEST[$this->_module], 'SSL'));
         }
     }
     if (is_numeric($_GET[$this->_module])) {
         if (osC_Order::getCustomerID($_GET[$this->_module]) !== $osC_Customer->getID()) {
             osc_redirect(osc_href_link(FILENAME_ACCOUNT, $this->_module, 'SSL'));
         }
         $this->_page_title = sprintf($osC_Language->get('order_information_heading'), $_GET[$this->_module]);
         $this->_page_contents = 'account_history_info.php';
     } else {
         if (!empty($_GET[$this->_module])) {
             switch ($_GET[$this->_module]) {
                 case 'list_return_requests':
                     $this->_page_title = $osC_Language->get('orders_returns_heading');
                     $this->_page_contents = 'return_requests_history.php';
                     break;
                 case 'list_credit_slips':
                     $this->_page_title = $osC_Language->get('credit_slips_heading');
                     $this->_page_contents = 'credit_slips_history.php';
                     break;
                 case 'new_return_request':
                     $this->_page_title = sprintf($osC_Language->get('orders_returns_information_heading'), $_GET['orders_id']);
                     $this->_page_contents = 'return_request_process.php';
                     break;
                 case 'save_return_request':
                     $this->_page_title = sprintf($osC_Language->get('orders_returns_information_heading'), $_GET['orders_id']);
                     $this->_page_contents = 'return_request_process.php';
                     $this->_save_orders_returns();
                     break;
             }
         }
     }
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:41,代码来源:orders.php

示例4: process

 function process()
 {
     global $osC_Currencies, $osC_ShoppingCart, $osC_Customer, $osC_Language, $messageStack;
     $currency = $osC_Currencies->getCode();
     if (isset($_POST['cc_owner']) && !empty($_POST['cc_owner']) && isset($_POST['cc_type']) && isset($this->cc_types[$_POST['cc_type']]) && isset($_POST['cc_number_nh-dns']) && !empty($_POST['cc_number_nh-dns'])) {
         $params = array('USER' => MODULE_PAYMENT_PAYPAL_DIRECT_API_USERNAME, 'PWD' => MODULE_PAYMENT_PAYPAL_DIRECT_API_PASSWORD, 'VERSION' => '3.2', 'SIGNATURE' => MODULE_PAYMENT_PAYPAL_DIRECT_API_SIGNATURE, 'METHOD' => 'DoDirectPayment', 'PAYMENTACTION' => MODULE_PAYMENT_PAYPAL_DIRECT_TRANSACTION_METHOD == 'Sale' ? 'Sale' : 'Authorization', 'IPADDRESS' => osc_get_ip_address(), 'AMT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal() - $osC_ShoppingCart->getShippingMethod('cost'), $currency), 'CREDITCARDTYPE' => $_POST['cc_type'], 'ACCT' => $_POST['cc_number_nh-dns'], 'STARTDATE' => $_POST['cc_starts_month'] . $_POST['cc_starts_year'], 'EXPDATE' => $_POST['cc_expires_month'] . $_POST['cc_expires_year'], 'CVV2' => $_POST['cc_cvc_nh-dns'], 'FIRSTNAME' => substr($_POST['cc_owner'], 0, strpos($_POST['cc_owner'], ' ')), 'LASTNAME' => substr($_POST['cc_owner'], strpos($_POST['cc_owner'], ' ') + 1), 'STREET' => $osC_ShoppingCart->getBillingAddress('street_address'), 'CITY' => $osC_ShoppingCart->getBillingAddress('city'), 'STATE' => $osC_ShoppingCart->getBillingAddress('state'), 'COUNTRYCODE' => $osC_ShoppingCart->getBillingAddress('country_iso_code_2'), 'ZIP' => $osC_ShoppingCart->getBillingAddress('postcode'), 'EMAIL' => $osC_Customer->getEmailAddress(), 'PHONENUM' => $osC_ShoppingCart->getBillingAddress('telephone_number'), 'CURRENCYCODE' => $currency, 'BUTTONSOURCE' => 'tomatcart');
         if ($_POST['cc_type'] == 'SWITCH' || $_POST['cc_type'] == 'SOLO') {
             $params['ISSUENUMBER'] = $_POST['cc_issue_nh-dns'];
         }
         if ($osC_ShoppingCart->hasShippingAddress()) {
             $params['SHIPTONAME'] = $osC_ShoppingCart->getShippingAddress('firstname') . ' ' . $osC_ShoppingCart->getShippingAddress('lastname');
             $params['SHIPTOSTREET'] = $osC_ShoppingCart->getShippingAddress('street_address');
             $params['SHIPTOCITY'] = $osC_ShoppingCart->getShippingAddress('city');
             $params['SHIPTOSTATE'] = $osC_ShoppingCart->getShippingAddress('zone_code');
             $params['SHIPTOCOUNTRYCODE'] = $osC_ShoppingCart->getShippingAddress('country_iso_code_2');
             $params['SHIPTOZIP'] = $osC_ShoppingCart->getShippingAddress('postcode');
         }
         $post_string = '';
         foreach ($params as $key => $value) {
             $post_string .= $key . '=' . urlencode(trim($value)) . '&';
         }
         $post_string = substr($post_string, 0, -1);
         $response = $this->sendTransactionToGateway($this->api_url, $post_string);
         $response_array = array();
         parse_str($response, $response_array);
         if ($response_array['ACK'] != 'Success' && $response_array['ACK'] != 'SuccessWithWarning') {
             $messageStack->add_session('checkout', stripslashes($response_array['L_LONGMESSAGE0']), 'error');
             osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout&view=orderConfirmationForm', 'SSL'));
         } else {
             $orders_id = osC_Order::insert();
             $comments = 'PayPal Website Payments Pro (US) Direct Payments [' . 'ACK: ' . $response_array['ACK'] . '; TransactionID: ' . $response_array['TRANSACTIONID'] . ';' . ']';
             osC_Order::process($orders_id, ORDERS_STATUS_PAID, $comments);
         }
     } else {
         $messageStack->add_session('checkout', $osC_Language->get('payment_paypal_direct_error_all_fields_required'), 'error');
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout&view=orderConfirmationForm', 'SSL'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:38,代码来源:paypal_direct.php

示例5: process

 function process()
 {
     global $osC_Database, $osC_Language, $osC_MessageStack;
     $this->_verifyData();
     $params = array('DATA' => $_GET['DATA'], 'SIGNATURE' => $_GET['SIGNATURE']);
     $post_string = '';
     foreach ($params as $key => $value) {
         $post_string .= $key . '=' . urlencode(trim($value)) . '&';
     }
     $post_string = substr($post_string, 0, -1);
     $this->_transaction_response = $this->sendTransactionToGateway('http://support.saferpay.de/scripts/VerifyPayConfirm.asp', $post_string);
     $error = false;
     if (substr($this->_transaction_response, 0, 3) != 'OK:') {
         $error = true;
     }
     /* HPDL; performs capture
           if (substr($this->_transaction_response, 0, 3) == 'OK:') {
             $result = array();
             parse_str(substr($this->_transaction_response, 3), $result);
     
             $params = array('ACCOUNTID' => MODULE_PAYMENT_SAFERPAY_CC_ACCOUNT_ID,
                             'ID' => $result['ID'],
                             'TOKEN' => $result['TOKEN']);
     
             $post_string = '';
     
             foreach ($params as $key => $value) {
               $post_string .= $key . '=' . urlencode(trim($value)) . '&';
             }
     
             $post_string = substr($post_string, 0, -1);
     
             $this->_transaction_response = $this->sendTransactionToGateway('http://support.saferpay.de/scripts/PayComplete.asp', $post_string);
     
             if ($this->_transaction_response != 'OK') {
               $error = true;
             }
           } else {
             $error = true;
           }
     */
     if ($error === false) {
         $osC_XML = new osC_XML($_GET['DATA']);
         $result = $osC_XML->toArray();
         $this->_order_id = $result['IDP attr']['ORDERID'];
         osC_Order::process($this->_order_id, $this->order_status);
         $Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
         $Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
         $Qtransaction->bindInt(':orders_id', $this->_order_id);
         $Qtransaction->bindInt(':transaction_code', 1);
         $Qtransaction->bindValue(':transaction_return_value', $_GET['DATA']);
         $Qtransaction->bindInt(':transaction_return_status', 1);
         $Qtransaction->execute();
     } else {
         osC_Order::remove($this->_order_id);
         $osC_MessageStack->add('checkout_payment', $osC_Language->get('payment_saferpay_vt_error_general'), 'error');
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment', 'SSL'));
     }
 }
开发者ID:heshuai64,项目名称:gamestore,代码行数:59,代码来源:saferpay_vt.php

示例6: getOrdersReturns

 function getOrdersReturns()
 {
     global $toC_Json, $osC_Language, $osC_Database;
     $osC_Order = new osC_Order($Qreturns->valueInt('orders_id'));
     $Qreturns = $osC_Database->query('select r.orders_returns_id, r.orders_id, r.orders_returns_status_id, r.customers_comments, r.date_added, o.customers_name, ors.orders_returns_status_name from :table_orders o, :table_orders_returns r, :table_orders_returns_status ors where r.orders_id = o.orders_id and r.orders_returns_status_id = ors.orders_returns_status_id and r.orders_id = :orders_id and ors.languages_id = :languages_id');
     $Qreturns->bindTable(':table_orders', TABLE_ORDERS);
     $Qreturns->bindTable(':table_orders_returns', TABLE_ORDERS_RETURNS);
     $Qreturns->bindTable(':table_orders_returns_status', TABLE_ORDERS_RETURNS_STATUS);
     $Qreturns->bindInt(':orders_id', $_REQUEST['orders_id']);
     $Qreturns->bindInt(':languages_id', $osC_Language->getID());
     $Qreturns->execute();
     $records = array();
     while ($Qreturns->next()) {
         $orders_returns_id = $Qreturns->value('orders_returns_id');
         $Qproducts = $osC_Database->query("select orders_products_id, products_quantity from :table_orders_returns_products where orders_returns_id = :orders_returns_id");
         $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindTable(':table_orders_returns_products', TABLE_ORDERS_RETURNS_PRODUCTS);
         $Qproducts->bindInt(':orders_returns_id', $orders_returns_id);
         $Qproducts->execute();
         $return_products_ids = array();
         $return_products_qty = array();
         while ($Qproducts->next()) {
             $return_products_ids[] = $Qproducts->valueInt('orders_products_id');
             $return_products_qty[$Qproducts->valueInt('orders_products_id')] = $Qproducts->valueInt('products_quantity');
         }
         $total = 0;
         $quantity = 0;
         $products = array();
         foreach ($osC_Order->getProducts() as $product) {
             if (in_array($product['orders_products_id'], $return_products_ids)) {
                 $product_info = $return_products_qty[$product['orders_products_id']] . ' x ' . $product['name'];
                 if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) {
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('senders_name') . ': ' . $product['senders_name'] . '</i></nobr>';
                     if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('senders_email') . ': ' . $product['senders_email'] . '</i></nobr>';
                     }
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('recipients_name') . ': ' . $product['recipients_name'] . '</i></nobr>';
                     if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('recipients_email') . ': ' . $product['recipients_email'] . '</i></nobr>';
                     }
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('messages') . ': ' . $product['messages'] . '</i></nobr>';
                 }
                 if (isset($product['variants']) && is_array($product['variants']) && sizeof($product['variants']) > 0) {
                     foreach ($product['variants'] as $variants) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $variants['groups_name'] . ': ' . $variants['values_name'] . '</i></nobr>';
                     }
                 }
                 $products[] = $product_info;
                 $total += $return_products_qty[$product['orders_products_id']] * $product['final_price'];
                 $quantity += $return_products_qty[$product['orders_products_id']];
             }
         }
         $records[] = array('orders_returns_id' => $orders_returns_id, 'orders_id' => $Qreturns->valueInt('orders_id'), 'orders_returns_customer' => $Qreturns->value('customers_name'), 'quantity' => $quantity, 'date_added' => osC_DateTime::getShort($Qreturns->value('date_added')), 'status' => $Qreturns->value('orders_returns_status_name'), 'status_id' => $orders_returns_status_id, 'products' => implode('<br />', $products), 'admin_comments' => $Qreturns->value('admin_comments'), 'customers_comments' => $Qreturns->value('customers_comments'), 'total' => $total);
     }
     $response = array(EXT_JSON_READER_TOTAL => $Qreturns->getBatchSize(), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:57,代码来源:invoices.php

示例7: listOrdersReturns

 function listOrdersReturns()
 {
     global $toC_Json, $osC_Language, $osC_Database;
     $start = empty($_REQUEST['start']) ? 0 : $_REQUEST['start'];
     $limit = empty($_REQUEST['limit']) ? MAX_DISPLAY_SEARCH_RESULTS : $_REQUEST['limit'];
     $Qreturns = $osC_Database->query('select r.orders_returns_id, r.orders_id, r.orders_returns_status_id, r.customers_comments, r.admin_comments, r.date_added, o.customers_name, ors.orders_returns_status_name from :table_orders o, :table_orders_returns r, :table_orders_returns_status ors where r.orders_id = o.orders_id and r.orders_returns_status_id = ors.orders_returns_status_id and ors.languages_id = :languages_id');
     if (isset($_REQUEST['orders_id']) && !empty($_REQUEST['orders_id'])) {
         $Qreturns->appendQuery('and r.orders_id = :orders_id ');
         $Qreturns->bindInt(':orders_id', $_REQUEST['orders_id']);
     }
     if (isset($_REQUEST['customers_id']) && !empty($_REQUEST['customers_id'])) {
         $Qreturns->appendQuery('and o.customers_id = :customers_id ');
         $Qreturns->bindInt(':customers_id', $_REQUEST['customers_id']);
     }
     if (isset($_REQUEST['orders_returns_status_id']) && !empty($_REQUEST['orders_returns_status_id'])) {
         $Qreturns->appendQuery('and r.orders_returns_status_id = :orders_returns_status_id ');
         $Qreturns->bindInt(':orders_returns_status_id', $_REQUEST['orders_returns_status_id']);
     }
     $Qreturns->appendQuery('order by r.orders_returns_id desc ');
     $Qreturns->bindTable(':table_orders', TABLE_ORDERS);
     $Qreturns->bindTable(':table_orders_returns', TABLE_ORDERS_RETURNS);
     $Qreturns->bindTable(':table_orders_returns_status', TABLE_ORDERS_RETURNS_STATUS);
     $Qreturns->bindInt(':languages_id', $osC_Language->getID());
     $Qreturns->setExtBatchLimit($start, $limit);
     $Qreturns->execute();
     $records = array();
     while ($Qreturns->next()) {
         $orders_returns_id = $Qreturns->value('orders_returns_id');
         $Qproducts = $osC_Database->query("select orders_products_id, products_quantity from :table_orders_returns_products where orders_returns_id = :orders_returns_id");
         $Qproducts->bindTable(':table_orders_products', TABLE_ORDERS_PRODUCTS);
         $Qproducts->bindTable(':table_orders_returns_products', TABLE_ORDERS_RETURNS_PRODUCTS);
         $Qproducts->bindInt(':orders_returns_id', $orders_returns_id);
         $Qproducts->execute();
         $return_products_ids = array();
         $return_products_qty = array();
         while ($Qproducts->next()) {
             $return_products_ids[] = $Qproducts->valueInt('orders_products_id');
             $return_products_qty[$Qproducts->valueInt('orders_products_id')] = $Qproducts->valueInt('products_quantity');
         }
         $total = 0;
         $quantity = 0;
         $products = array();
         $return_quantity = array();
         $osC_Order = new osC_Order($Qreturns->valueInt('orders_id'));
         foreach ($osC_Order->getProducts() as $product) {
             if (in_array($product['orders_products_id'], $return_products_ids)) {
                 $product_info = $return_products_qty[$product['orders_products_id']] . '&nbsp;x&nbsp;' . $product['name'];
                 if ($product['type'] == PRODUCT_TYPE_GIFT_CERTIFICATE) {
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('senders_name') . ': ' . $product['senders_name'] . '</i></nobr>';
                     if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('senders_email') . ': ' . $product['senders_email'] . '</i></nobr>';
                     }
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('recipients_name') . ': ' . $product['recipients_name'] . '</i></nobr>';
                     if ($product['gift_certificates_type'] == GIFT_CERTIFICATE_TYPE_EMAIL) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('recipients_email') . ': ' . $product['recipients_email'] . '</i></nobr>';
                     }
                     $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $osC_Language->get('messages') . ': ' . $product['messages'] . '</i></nobr>';
                 }
                 if (isset($product['variants']) && is_array($product['variants']) && sizeof($product['variants']) > 0) {
                     foreach ($product['variants'] as $variants) {
                         $product_info .= '<br /><nobr>&nbsp;&nbsp;&nbsp;<i>' . $variants['groups_name'] . ': ' . $variants['values_name'] . '</i></nobr>';
                     }
                 }
                 $products[] = $product_info;
                 $total += $return_products_qty[$product['orders_products_id']] * $product['final_price'] * (1 + $product['tax'] / 100);
                 $quantity += $return_products_qty[$product['orders_products_id']];
                 $return_quantity[] = $product['orders_products_id'] . ':' . $return_products_qty[$product['orders_products_id']];
             }
         }
         $action = array();
         $orders_returns_status_id = $Qreturns->value('orders_returns_status_id');
         if ($orders_returns_status_id == ORDERS_RETURNS_STATUS_REFUNDED_CREDIT_MEMO || $orders_returns_status_id == ORDERS_RETURNS_STATUS_REFUNDED_STORE_CREDIT || $orders_returns_status_id == ORDERS_RETURNS_STATUS_REJECT) {
             $action[] = array('class' => 'icon-edit-gray-record', 'qtip' => $osC_Language->get('icon_edit'));
             $action[] = array('class' => 'icon-credit-slip-gray-record', 'qtip' => $osC_Language->get('icon_credit_slip'));
             $action[] = array('class' => 'icon-store-credit-gray-record', 'qtip' => $osC_Language->get('icon_issue_store_credit'));
         } else {
             $action[] = array('class' => 'icon-edit-record', 'qtip' => $osC_Language->get('icon_edit'));
             $action[] = array('class' => 'icon-credit-slip-record', 'qtip' => $osC_Language->get('icon_credit_slip'));
             $action[] = array('class' => 'icon-store-credit-record', 'qtip' => $osC_Language->get('icon_issue_store_credit'));
         }
         $records[] = array('orders_returns_id' => $orders_returns_id, 'orders_id' => $Qreturns->valueInt('orders_id'), 'orders_returns_customer' => $Qreturns->value('customers_name'), 'quantity' => $quantity, 'date_added' => osC_DateTime::getShort($Qreturns->value('date_added')), 'status' => $Qreturns->value('orders_returns_status_name'), 'status_id' => $orders_returns_status_id, 'products' => implode('<br />', $products), 'return_quantity' => implode(';', $return_quantity), 'billing_address' => osC_Address::format($osC_Order->getBilling(), '<br />'), 'customers_comments' => $Qreturns->value('customers_comments'), 'admin_comments' => $Qreturns->value('admin_comments'), 'total' => number_format($total, 2, '.', ''), 'action' => $action);
     }
     $response = array(EXT_JSON_READER_TOTAL => $Qreturns->getBatchSize(), EXT_JSON_READER_ROOT => $records);
     echo $toC_Json->encode($response);
 }
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:85,代码来源:orders_returns.php

示例8: callback

 function callback()
 {
     global $osC_Database, $osC_Currencies;
     foreach ($_POST as $key => $value) {
         $post_string .= $key . '=' . urlencode($value) . '&';
     }
     $post_string = substr($post_string, 0, -1);
     $this->_transaction_response = $this->sendTransactionToGateway($this->apc_url, $post_string);
     if (strstr($this->_transaction_response, 'AUTHORISED')) {
         if (!isset($_POST["status"]) || strtolower($_POST["status"]) == "live") {
             $comments = 'Nochex payment of ' . sprintf("%01.2f", $_POST["amount"]) . ' received at ' . $_POST['transaction_date'] . ' with transaction ID:' . $_POST['transaction_id'];
         } else {
             $comments = 'TEST PAYMENT of ' . sprintf("%01.2f", $_POST["amount"]) . ' received at ' . $_POST['transaction_date'] . ' with transaction ID:' . $_POST['transaction_id'];
         }
         osC_Order::process($_POST['order_id'], $this->order_status, $comments);
     } else {
         if (!isset($_POST["status"]) || strtolower($_POST["status"]) == "live") {
             $comments = 'Nochex payment of ' . sprintf("%01.2f", $_POST["amount"]) . ' received at ' . $_POST['transaction_date'] . ' with transaction ID:' . $_POST['transaction_id'] . ' is invalid';
         } else {
             $comments = 'TEST PAYMENT of ' . sprintf("%01.2f", $_POST["amount"]) . ' received at ' . $_POST['transaction_date'] . ' with transaction ID:' . $_POST['transaction_id'] . ' is invalid';
         }
         osC_Order::insertOrderStatusHistory($_POST['order_id'], $this->order_status, $comments);
     }
 }
开发者ID:4DvAnCeBoY,项目名称:tomatocart-shoppingcart,代码行数:24,代码来源:nochex.php

示例9: callback

 function callback()
 {
     global $osC_Database;
     if (isset($_POST['invoice']) && is_numeric($_POST['invoice']) && isset($_POST['receiver_email']) && $_POST['receiver_email'] == MODULE_PAYMENT_PAYPAL_IPN_ID && isset($_POST['verify_sign']) && empty($_POST['verify_sign']) === false && isset($_POST['txn_id']) && empty($_POST['txn_id']) === false) {
         if (!osc_empty(MODULE_PAYMENT_PAYPAL_IPN_SECRET_KEY)) {
             if (isset($_GET['secret']) && $_GET['secret'] == MODULE_PAYMENT_PAYPAL_IPN_SECRET_KEY) {
                 $pass = true;
             } else {
                 $pass = false;
             }
         } else {
             $pass = true;
         }
         if ($pass === true && osC_Order::getStatusID($_POST['invoice']) === ORDERS_STATUS_PREPARING) {
             $post_string = 'cmd=_notify-validate&';
             foreach ($_POST as $key => $value) {
                 $post_string .= $key . '=' . urlencode($value) . '&';
             }
             $post_string = substr($post_string, 0, -1);
             $this->_transaction_response = $this->sendTransactionToGateway($this->form_action_url, $post_string);
             $post_array = array('root' => $_POST);
             $post_array['root']['transaction_response'] = trim($this->_transaction_response);
             $osC_XML = new osC_XML($post_array);
             if (strtoupper(trim($this->_transaction_response)) == 'VERIFIED') {
                 osC_Order::process($_POST['invoice'], $this->order_status);
             }
             $Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
             $Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
             $Qtransaction->bindInt(':orders_id', $_POST['invoice']);
             $Qtransaction->bindInt(':transaction_code', 1);
             $Qtransaction->bindValue(':transaction_return_value', $osC_XML->toXML());
             $Qtransaction->bindInt(':transaction_return_status', strtoupper(trim($this->_transaction_response)) == 'VERIFIED' ? 1 : 0);
             $Qtransaction->execute();
         }
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:36,代码来源:paypal_ipn.php

示例10: Copyright

<?php

/*
  $Id: orders_returns_process.php $
  TomatoCart Open Source Shopping Cart Solutions
  http://www.tomatocart.com
  http://www.tomatoshop.ir  Persian Tomatocart v1.1.8.6 / Khordad 1394
  Copyright (c) 2009 Wuxi Elootec Technology Co., Ltd

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
$order = new osC_Order($_GET['orders_id']);
?>

<h1><?php 
echo $osC_Template->getPageTitle();
?>
</h1>

<?php 
if ($messageStack->size('orders') > 0) {
    echo $messageStack->output('orders');
}
?>

<form name="return_request" action="<?php 
echo osc_href_link(FILENAME_ACCOUNT, 'orders=save_return_request&orders_id=' . $order->getID(), 'SSL');
?>
" method="post">
开发者ID:sajad1441,项目名称:TomatoShop-v1,代码行数:31,代码来源:return_request_process.php

示例11: process

 function process()
 {
     global $messageStack;
     if (isset($_GET['TransID']) && isset($_GET['Note'])) {
         $ordID = trim($_GET['Note']);
         $thesuccess = trim($_GET['Status']);
         $theauthcode = trim($_GET['TransID']);
         $md5check = trim($_GET['Crypt']);
         $theamount = trim($_GET['Amount']);
         $md5hash = md5($thesuccess . $theauthcode . $theamount . MODULE_PAYMENT_PAYFAST_SECRET_KEY);
         if ($ordID != '' && $thesuccess == 'Success' && $theauthcode != '' && $md5check == $md5hash) {
             // validated - continue
         } else {
             // problem with order, ecom system says this failed or doesnt recognize it
             // so could be a spoof attempt. Dont process the order.
             //osc_redirect(osc_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'));
             $the_error = 'There is a problem processing your order.';
             if (MODULE_PAYMENT_PAYFAST_SECRET_KEY == '') {
                 $the_error .= ': Secret Key Not set in the Payfast Module :';
             }
             if ($md5check != $md5hash) {
                 $the_error .= ': Secret Keys Do Not Match :';
             }
             if ($ordID == '') {
                 $the_error .= ': Order ID not set :';
             }
             if ($thesuccess != 'Success') {
                 $the_error .= ': Status Code incorrect :';
             }
             if ($theauthcode == '') {
                 $the_error .= ': No auth code specififed:';
             }
             $messageStack->add_session('checkout', $the_error, 'error');
             osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout', 'SSL', true, false));
         }
     } else {
         if (isset($_GET['fail']) && $_GET['fail'] == true) {
             $messageStack->add_session('checkout', "Your card has been declined", 'error');
             osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout', 'SSL'));
         } else {
             $myVars = array('CustomerID' => MODULE_PAYMENT_PAYFAST_CUSTOMER_ID, 'Notes' => $this->payfast_notes);
             // to payfast api to check transaction
             $path = "/paypage/confirm.asp";
             // PORT
             $port = 443;
             // BUILD THE POST STRING
             foreach ($myVars as $key => $val) {
                 $poststring .= urlencode($key) . "=" . urlencode($val) . "&";
             }
             // STRIP OFF THE TRAILING AMPHERSAND
             $poststring = substr($poststring, 0, -1);
             if (MODULE_PAYMENT_PAYFAST_TEST_MODE == 'True') {
                 $host = "https://sandbox.payfast.co.za/eng/process";
             } else {
                 $host = "https://sandbox.payfast.co.za/eng/process";
             }
             // try using fsick for ssl connection, if this doesnt work
             // use curl
             $fp = @fsockopen("ssl://{$host}", $port, $errno, $errstr, $timeout = 30);
             if ($fp) {
                 // SEND THE SERVER REQUEST
                 fputs($fp, "POST {$path} HTTP/1.1\r\n");
                 fputs($fp, "Host: {$host}\r\n");
                 fputs($fp, "Content-type: application/x-www-form-urlencoded\r\n");
                 fputs($fp, "Content-length: " . strlen($poststring) . "\r\n");
                 fputs($fp, "Connection: close\n\n");
                 fputs($fp, $poststring . "\n\n");
                 // LOOP THROUGH THE RESPONSE FROM THE SERVER
                 while (!feof($fp)) {
                     $response .= @fgets($fp, 4096);
                 }
                 // CLOSE FP
                 fclose($fp);
             } else {
                 // ssl not installed so try using curl
                 $ch = curl_init();
                 curl_setopt($ch, CURLOPT_URL, "https://" . $host . $path);
                 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
                 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
                 curl_setopt($ch, CURLOPT_POSTFIELDS, $poststring);
                 curl_setopt($ch, CURLOPT_POST, TRUE);
                 $response = curl_exec($ch);
             }
             if (strpos($response, "SUCCESS")) {
                 // indicates a success transaction, just need to validate amount
                 // everything okay, carry on with processing order
             } else {
                 // problem with order, ecom system says this failed or doesnt recognize it
                 // so could be a spoof attempt. Dont process the order
                 $error = 'problem with order, ecom system says this failed or doesnt recognize it';
                 $messageStack->add_session('checkout', $error, 'error');
                 osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'checkout', 'SSL'));
             }
         }
     }
     $this->_order_id = osC_Order::insert();
     osC_Order::process($this->_order_id, $this->order_status);
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:98,代码来源:payfast.php

示例12: Copyright

<?php

/*
  $Id: orders_edit.php,v 1.2 2004/10/28 19:00:25 hpdl Exp $

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2004 osCommerce

  Released under the GNU General Public License
*/
$osC_Order = new osC_Order($_GET['oID']);
?>

<table border="0" width="100%" cellspacing="0" cellpadding="2">
  <tr>
    <td><h1><?php 
echo HEADING_TITLE;
?>
</h1></td>
    <td class="smallText" align="right"><?php 
echo '<input type="button" value="' . IMAGE_BACK . '" onClick="document.location.href=\'' . tep_href_link(FILENAME_ORDERS, (isset($_GET['search']) ? 'search=' . $_GET['search'] . '&' : '') . (isset($_GET['status']) ? 'status=' . $_GET['status'] . '&' : '') . (isset($_GET['cID']) ? 'cID=' . $_GET['cID'] . '&' : '') . 'page=' . $_GET['page'] . '&oID=' . $_GET['oID']) . '\';" class="operationButton">';
?>
</td>
  </tr>
</table>

<?php 
if ($osC_Order->isValid() === false) {
    $osC_MessageStack->add('orders_edit', sprintf(ERROR_ORDER_DOES_NOT_EXIST, $_GET['oID']), 'error');
开发者ID:itnovator,项目名称:oscommerce_cvs,代码行数:31,代码来源:orders_edit.php

示例13: process

 function process()
 {
     global $osC_Database, $osC_Customer, $osC_Currencies, $osC_ShoppingCart, $osC_Language, $messageStack, $osC_CreditCard;
     $this->_verifyData();
     $this->_order_id = osC_Order::insert();
     $post_string = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<WIRECARD_BXML xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance" xsi:noNamespaceSchemaLocation="wirecard.xsd">' . "\n" . '  <W_REQUEST>' . "\n" . '    <W_JOB>' . "\n" . '      <JobID>Job 1</JobID>' . "\n" . '      <BusinessCaseSignature>' . MODULE_PAYMENT_WIRECARD_CC_BUSINESS_SIGNATURE . '</BusinessCaseSignature>' . "\n" . '      <FNC_CC_PREAUTHORIZATION>' . "\n" . '        <FunctionID>Preauthorization 1</FunctionID>' . "\n" . '        <CC_TRANSACTION mode="' . MODULE_PAYMENT_WIRECARD_CC_TRANSACTION_MODE . '">' . "\n" . '          <TransactionID>' . $this->_order_id . '</TransactionID>' . "\n" . '          <CommerceType>eCommerce</CommerceType>' . "\n" . '          <Amount>' . $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode()) * 100 . '</Amount>' . "\n" . '          <Currency>' . $osC_Currencies->getCode() . '</Currency>' . "\n" . '          <CountryCode>' . osC_Address::getCountryIsoCode2(STORE_COUNTRY) . '</CountryCode>' . "\n" . '          <Usage>' . STORE_NAME . '</Usage>' . "\n" . '          <RECURRING_TRANSACTION>' . "\n" . '            <Type>Single</Type>' . "\n" . '          </RECURRING_TRANSACTION>' . "\n" . '          <CREDIT_CARD_DATA>' . "\n" . '            <CreditCardNumber>' . $osC_CreditCard->getNumber() . '</CreditCardNumber>' . "\n";
     if (MODULE_PAYMENT_WIRECARD_CC_VERIFY_WITH_CVC == '1') {
         $post_string .= '            <CVC2>' . $osC_CreditCard->getCVC() . '</CVC2>' . "\n";
     }
     $post_string .= '            <ExpirationYear>' . $osC_CreditCard->getExpiryYear() . '</ExpirationYear>' . "\n" . '            <ExpirationMonth>' . $osC_CreditCard->getExpiryMonth() . '</ExpirationMonth>' . "\n" . '            <CardHolderName>' . $osC_CreditCard->getOwner() . '</CardHolderName>' . "\n" . '          </CREDIT_CARD_DATA>' . "\n" . '          <CONTACT_DATA>' . "\n" . '            <IPAddress>' . osc_get_ip_address() . '</IPAddress>' . "\n" . '          </CONTACT_DATA>' . "\n" . '          <CORPTRUSTCENTER_DATA>' . "\n" . '            <ADDRESS>' . "\n" . '              <FirstName>' . $osC_ShoppingCart->getBillingAddress('firstname') . '</FirstName>' . "\n" . '              <LastName>' . $osC_ShoppingCart->getBillingAddress('lastname') . '</LastName>' . "\n" . '              <Address1>' . $osC_ShoppingCart->getBillingAddress('street_address') . '</Address1>' . "\n" . '              <City>' . $osC_ShoppingCart->getBillingAddress('city') . '</City>' . "\n" . '              <ZipCode>' . $osC_ShoppingCart->getBillingAddress('postcode') . '</ZipCode>' . "\n";
     if (osc_empty($osC_ShoppingCart->getBillingAddress('zone_code')) === false) {
         $post_string .= '              <State>' . $osC_ShoppingCart->getBillingAddress('zone_code') . '</State>' . "\n";
     }
     $post_string .= '              <Country>' . $osC_ShoppingCart->getBillingAddress('country_iso_code_2') . '</Country>' . "\n" . '              <Phone>' . $osC_ShoppingCart->getBillingAddress('telephone_number') . '</Phone>' . "\n" . '              <Email>' . $osC_Customer->getEmailAddress() . '</Email>' . "\n" . '            </ADDRESS>' . "\n" . '          </CORPTRUSTCENTER_DATA>' . "\n" . '        </CC_TRANSACTION>' . "\n" . '      </FNC_CC_PREAUTHORIZATION>' . "\n" . '    </W_JOB>' . "\n" . '  </W_REQUEST>' . "\n" . '</WIRECARD_BXML>';
     $this->_transaction_response = $this->sendTransactionToGateway($this->_gateway_url, $post_string, array('Content-type: text/xml'));
     if (empty($this->_transaction_response) === false) {
         $osC_XML = new osC_XML($this->_transaction_response);
         $result = $osC_XML->toArray();
     } else {
         $result = array();
     }
     $error = false;
     if (isset($result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['FunctionResult'])) {
         if ($result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['FunctionResult'] != 'ACK') {
             $errno = $result['WIRECARD_BXML']['W_RESPONSE']['W_JOB']['FNC_CC_PREAUTHORIZATION']['CC_TRANSACTION']['PROCESSING_STATUS']['ERROR']['Number'];
             switch ($errno) {
                 case '14':
                 case '20109':
                     $error = $osC_Language->get('payment_wirecard_cc_error_unkown_card');
                     break;
                 case '33':
                 case '20071':
                     $error = $osC_Language->get('payment_wirecard_cc_error_' . (int) $errno);
                     break;
                 default:
                     $error = $osC_Language->get('payment_wirecard_cc_error_general');
                     break;
             }
         }
     } else {
         $error = $osC_Language->get('payment_wirecard_cc_error_general');
     }
     if ($error === false) {
         osC_Order::process($this->_order_id, $this->order_status);
         $Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
         $Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
         $Qtransaction->bindInt(':orders_id', $this->_order_id);
         $Qtransaction->bindInt(':transaction_code', 1);
         $Qtransaction->bindValue(':transaction_return_value', $this->_transaction_response);
         $Qtransaction->bindInt(':transaction_return_status', 1);
         $Qtransaction->execute();
     } else {
         osC_Order::remove($this->_order_id);
         $messageStack->add_session('checkout_payment', $error, 'error');
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment&wirecard_cc_owner=' . $osC_CreditCard->getOwner() . '&wirecard_cc_expires_month=' . $osC_CreditCard->getExpiryMonth() . '&wirecard_cc_expires_year=' . $osC_CreditCard->getExpiryYear() . (MODULE_PAYMENT_WIRECARD_CC_VERIFY_WITH_CVC == '1' ? '&wirecard_cc_cvc=' . $osC_CreditCard->getCVC() : ''), 'SSL'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:57,代码来源:wirecard_cc.php

示例14: process

 function process()
 {
     global $osC_Database, $osC_Customer, $osC_Currencies, $osC_ShoppingCart, $osC_Language, $messageStack;
     $this->_verifyData();
     $this->_order_id = osC_Order::insert();
     $params = array('spPassword' => MODULE_PAYMENT_SAFERPAY_CC_PASSWORD, 'ACCOUNTID' => MODULE_PAYMENT_SAFERPAY_CC_ACCOUNT_ID, 'ORDERID' => $this->_order_id, 'NAME' => $_POST['saferpay_elv_owner'], 'TRACK2' => ';59' . $_POST['saferpay_elv_bank'] . '=' . str_pad($_POST['saferpay_elv_account'], 10, '0', STR_PAD_LEFT), 'AMOUNT' => $osC_Currencies->formatRaw($osC_ShoppingCart->getTotal(), $osC_Currencies->getCode()) * 100, 'CURRENCY' => $osC_Currencies->getCode());
     $post_string = '';
     foreach ($params as $key => $value) {
         $post_string .= $key . '=' . urlencode(trim($value)) . '&';
     }
     $post_string = substr($post_string, 0, -1);
     $this->_transaction_response = $this->sendTransactionToGateway('https://support.saferpay.de/scripts/Execute.asp', $post_string);
     $error = false;
     if (substr($this->_transaction_response, 0, 3) == 'OK:') {
         $this->_transaction_response = trim(substr($this->_transaction_response, 3));
         $osC_XML = new osC_XML($this->_transaction_response);
         $result = $osC_XML->toArray();
         switch ($result_array['IDP attr']['RESULT']) {
             case '0':
                 //success
                 break;
             default:
                 $error = $osC_Language->get('payment_saferpay_elv_error_general');
                 break;
         }
     } else {
         $error = $osC_Language->get('payment_saferpay_elv_error_general');
     }
     if ($error === false) {
         osC_Order::process($this->_order_id, $this->order_status);
         $Qtransaction = $osC_Database->query('insert into :table_orders_transactions_history (orders_id, transaction_code, transaction_return_value, transaction_return_status, date_added) values (:orders_id, :transaction_code, :transaction_return_value, :transaction_return_status, now())');
         $Qtransaction->bindTable(':table_orders_transactions_history', TABLE_ORDERS_TRANSACTIONS_HISTORY);
         $Qtransaction->bindInt(':orders_id', $this->_order_id);
         $Qtransaction->bindInt(':transaction_code', 1);
         $Qtransaction->bindValue(':transaction_return_value', $this->_transaction_response);
         $Qtransaction->bindInt(':transaction_return_status', 1);
         $Qtransaction->execute();
     } else {
         osC_Order::remove($this->_order_id);
         $messageStack->add_session('checkout_payment', $error, 'error');
         osc_redirect(osc_href_link(FILENAME_CHECKOUT, 'payment&saferpay_elv_owner=' . $_POST['saferpay_elv_owner'] . '&saferpay_elv_bank=' . $_POST['saferpay_elv_bank'], 'SSL'));
     }
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:43,代码来源:saferpay_elv.php

示例15: confirmation

 function confirmation()
 {
     $this->_order_id = osC_Order::insert(ORDERS_STATUS_PREPARING);
 }
开发者ID:Doluci,项目名称:tomatocart,代码行数:4,代码来源:cardsave_redirect.php


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