Ejemplo n.º 1
0
             xtc_php_mail(EMAIL_BILLING_ADDRESS, EMAIL_BILLING_NAME, $check_status['customers_email_address'], $check_status['customers_name'], '', EMAIL_BILLING_REPLY_ADDRESS, EMAIL_BILLING_REPLY_ADDRESS_NAME, '', '', EMAIL_BILLING_SUBJECT, $html_mail, $txt_mail);
             $customer_notified = '1';
         }
         xtc_db_query("insert into " . TABLE_ORDERS_STATUS_HISTORY . " (orders_id, orders_status_id, date_added, customer_notified, comments) values ('" . xtc_db_input($oID) . "', '" . xtc_db_input($status) . "', now(), '" . $customer_notified . "', '" . xtc_db_input($comments) . "')");
         $order_updated = true;
     }
     if ($order_updated) {
         $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
     } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
     }
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'deleteconfirm':
     $oID = xtc_db_prepare_input($_GET['oID']);
     xtc_remove_order($oID, $_POST['restock']);
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action'))));
     break;
     // BMC Delete CC info Start
     // Remove CVV Number
 // BMC Delete CC info Start
 // Remove CVV Number
 case 'deleteccinfo':
     $oID = xtc_db_prepare_input($_GET['oID']);
     xtc_db_query("update " . TABLE_ORDERS . " set cc_cvv = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'oID=' . $_GET['oID'] . '&action=edit'));
     break;
 function remove_order($orders_id)
 {
     $check_query = xtc_db_query("SELECT * \n                                   FROM " . TABLE_ORDERS . " \n                                  WHERE orders_id = '" . (int) $orders_id . "'");
     if (xtc_db_num_rows($check_query) > 0) {
         $check = xtc_db_fetch_array($check_query);
         if ($_SESSION['customer_id'] == $check['customers_id']) {
             require_once DIR_FS_INC . 'xtc_remove_order.inc.php';
             xtc_remove_order((int) $orders_id, STOCK_LIMITED == 'true' ? 'on' : false);
         }
     }
 }
Ejemplo n.º 3
0
             //  $message_body_plain
             xtc_db_query("update " . TABLE_ORDERS . " set ibn_pdfnotifydate = now() where orders_id = '" . $oID . "'");
         }
     }
     // EOF - Fishnet Services - Nicolas Gemsjäger
     if ($order_updated) {
         $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
     } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
     }
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'resendordermail':
     break;
 case 'deleteconfirm':
     xtc_remove_order($oID, xtc_db_prepare_input($_POST['restock']));
     // --- bof -- ipdfbill --------
     $pdffile = get_pdf_invoice_filename($oID);
     if (file_exists($pdffile)) {
         unlink($pdffile);
     }
     // --- eof -- ipdfbill --------
     // Paypal Express Modul
     if (isset($_POST['paypaldelete'])) {
         $query = xtc_db_query("-- /admin/orders.php\n                             SELECT *\n                               FROM " . TABLE_PAYPAL . "\n                              WHERE xtc_order_id = " . $oID);
         while ($values = xtc_db_fetch_array($query)) {
             xtc_db_query("-- /admin/orders.php\n                      DELETE FROM " . TABLE_PAYPAL_STATUS_HISTORY . "\n                            WHERE paypal_ipn_id = '" . $values['paypal_ipn_id'] . "'\n                     ");
         }
         xtc_db_query("-- /admin/orders.php\n                    DELETE FROM " . TABLE_PAYPAL . "\n                          WHERE xtc_order_id = " . $oID);
     }
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action'))));
    bpLog('bitpay callback error: ' . $response);
} else {
    $order_id = $response['posData'];
    switch ($response['status']) {
        case 'paid':
        case 'confirmed':
        case 'complete':
            if (function_exists('xtc_db_query')) {
                xtc_db_query("update " . TABLE_ORDERS . " set orders_status = " . MODULE_PAYMENT_BITPAY_PAID_STATUS_ID . " where orders_id = " . intval($order_id));
            } else {
                bpLog('FATAL: tep_db_query function is missing. Cannot update order_id = ' . $order_id . ' as ' . $response['status']);
            }
            break;
        case 'invalid':
        case 'expired':
            if (function_exists('xtc_remove_order')) {
                xtc_remove_order($order_id, $restock = true);
            } else {
                bpLog('FATAL: tep_remove_order function is missing. Cannot update order_id = ' . $order_id . ' as ' . $response['status']);
            }
            break;
        case 'new':
            break;
        default:
            bpLog('INFO: Receieved unknown IPN status of ' . $response['status'] . ' for order_id = ' . $order_id);
            break;
    }
}
?>

 function _remove_order($order_id)
 {
     $check_query = xtc_db_query("SELECT * FROM " . TABLE_ORDERS . " WHERE orders_id = '" . (int) $order_id . "'");
     if (xtc_db_num_rows($check_query) > 0) {
         $check = xtc_db_fetch_array($check_query);
         if ($_SESSION['customer_id'] == $check['customers_id']) {
             require_once DIR_FS_INC . 'xtc_remove_order.inc.php';
             require_once DIR_FS_INC . 'xtc_restock_order.inc.php';
             xtc_remove_order((int) $order_id, true);
         }
     }
 }
 function after_process()
 {
     global $insert_id, $order;
     require_once DIR_FS_CATALOG . 'callback/bitpay/library/bp_lib.php';
     $lut = array("High-0 Confirmations" => 'high', "Medium-1 Confirmations" => 'medium', "Low-6 Confirmations" => 'low');
     $network = array("Live" => 'Live', "Test" => 'Test');
     // change order status to value selected by merchant
     xtc_db_query("update " . TABLE_ORDERS . " set orders_status = " . intval(MODULE_PAYMENT_BITPAY_UNPAID_STATUS_ID) . " where orders_id = " . intval($insert_id));
     $options = array('physical' => $order->content_type == 'physical' ? 'true' : 'false', 'currency' => $order->info['currency'], 'buyerName' => $order->customer['firstname'] . ' ' . $order->customer['lastname'], 'fullNotifications' => 'true', 'notificationURL' => xtc_href_link('callback/bitpay/bitpay_callback.php', '', 'SSL', true, true), 'redirectURL' => xtc_href_link('account'), 'transactionSpeed' => $lut[MODULE_PAYMENT_BITPAY_TRANSACTION_SPEED], 'apiKey' => MODULE_PAYMENT_BITPAY_APIKEY, 'network' => $network[MODULE_PAYMENT_BITPAY_NETWORK]);
     $decimal_place = xtc_db_fetch_array(xtc_db_query("SELECT decimal_point FROM " . TABLE_CURRENCIES . " WHERE  code = '" . $order->info['currency'] . "'"));
     $thousands_place = xtc_db_fetch_array(xtc_db_query("SELECT thousands_point FROM " . TABLE_CURRENCIES . " WHERE code = '" . $order->info['currency'] . "'"));
     $decimal_place = $decimal_place['decimal_point'];
     $thousands_place = $thousands_place['thousands_point'];
     $priceString = preg_replace('/[^0-9' . $decimal_place . ']/', '', $order->info['total']);
     if ($decimal_place != '.') {
         $priceString = preg_replace('/[' . $decimal_place . ']/', '.', $priceString);
     }
     $price = floatval($priceString);
     $invoice = bpCreateInvoice($insert_id, $price, $insert_id, $options);
     if (is_array($invoice) && array_key_exists('error', $invoice)) {
         // error
         bpLog('Error creating invoice: ' . var_export($invoice, true));
         xtc_remove_order($insert_id, $restock = true);
         xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode($invoice['error']['message']), 'SSL'));
     } else {
         if (!is_array($invoice)) {
             // error
             bpLog('Error creating invoice: ' . var_export($this->invoice, true));
             xtc_remove_order($insert_id, $restock = true);
             xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was a problem processing your payment: invalid response returned from gateway.'), 'SSL'));
         } else {
             if (is_array($invoice) && array_key_exists('url', $invoice)) {
                 // success
                 $_SESSION['cart']->reset(true);
                 xtc_redirect($invoice['url']);
             } else {
                 // unknown problem
                 bpLog('Error creating invoice: ' . var_export($invoice, true));
                 xtc_remove_order($insert_id, $restock = true);
                 xtc_redirect(xtc_href_link(FILENAME_CHECKOUT_PAYMENT, 'error_message=' . urlencode('There was a problem processing your payment: unknown error or response.'), 'SSL'));
             }
         }
     }
     return false;
 }
Ejemplo n.º 7
0
         $order_updated = true;
     }
     if ($order_updated) {
         include_once DIR_FS_DOCUMENT_ROOT . '/shopgate/plugins/gambiogx/update_order.php';
         setShopgateOrderStatus($oID, $status);
         $messageStack->add_session(SUCCESS_ORDER_UPDATED, 'success');
     } else {
         $messageStack->add_session(WARNING_ORDER_NOT_UPDATED, 'warning');
     }
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('action')) . 'action=edit'));
     break;
 case 'resendordermail':
     break;
 case 'deleteconfirm':
     $oID = xtc_db_prepare_input($_GET['oID']);
     xtc_remove_order($oID, $_POST['restock'], false, $_POST['reshipp']);
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, xtc_get_all_get_params(array('oID', 'action'))));
     break;
     // BMC Delete CC info Start
     // Remove CVV Number
 // BMC Delete CC info Start
 // Remove CVV Number
 case 'deleteccinfo':
     $oID = xtc_db_prepare_input($_GET['oID']);
     xtc_db_query("update " . TABLE_ORDERS . " set cc_cvv = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_number = '0000000000000000' where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_expires = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_start = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_db_query("update " . TABLE_ORDERS . " set cc_issue = null where orders_id = '" . xtc_db_input($oID) . "'");
     xtc_redirect(xtc_href_link(FILENAME_ORDERS, 'oID=' . $_GET['oID'] . '&action=edit'));
     break;