コード例 #1
0
        if ($_GET['action'] == 'ideal') {
            // iDeal: set transactionId to history
            $sqlDataArray = array('orders_id' => $xOrderId, 'orders_status_id' => $tmpOrderStatus, 'date_added' => 'sqlcommand:now()', 'customer_notified' => 0, 'comments' => MODULE_PAYMENT_SOFORT_MULTIPAY_TRANSACTION_ID . ': ' . $transactionId);
            xtc_db_query(HelperFunctions::getEscapedInsertInto(TABLE_ORDERS_STATUS_HISTORY, $sqlDataArray));
            $sqlDataArray = array('orders_id' => $xOrderId, 'orders_status_id' => $orderStatus, 'date_added' => 'sqlcommand:now()', 'customer_notified' => 0, 'comments' => addslashes($comment));
            xtc_db_query(HelperFunctions::getEscapedInsertInto(TABLE_ORDERS_STATUS_HISTORY, $sqlDataArray));
            xtc_db_query("UPDATE " . HelperFunctions::escapeSql(TABLE_ORDERS) . " SET orders_status = '" . HelperFunctions::escapeSql($orderStatus) . "', last_modified = NOW() WHERE orders_id = '" . (int) $xOrderId . "'");
        } else {
            $sqlDataArray = array('orders_id' => $xOrderId, 'orders_status_id' => $orderStatus, 'date_added' => 'sqlcommand:now()', 'customer_notified' => 0, 'comments' => addslashes($comment));
            xtc_db_query(HelperFunctions::getEscapedInsertInto(TABLE_ORDERS_STATUS_HISTORY, $sqlDataArray));
            xtc_db_query("UPDATE " . HelperFunctions::escapeSql(TABLE_ORDERS) . " SET orders_status = '" . HelperFunctions::escapeSql($orderStatus) . "', last_modified = NOW() WHERE orders_id = '" . (int) $xOrderId . "'");
        }
        $query = xtc_db_query('SELECT id FROM sofort_orders WHERE orders_id = ' . HelperFunctions::escapeSql($xOrderId));
        $result = xtc_db_fetch_array($query);
        $sofortOrdersId = $result['id'];
        HelperFunctions::updateTimeline($sofortOrdersId, $sofortNotificationStatus, addslashes($comment));
    }
}
function updateShopAdresses($invoiceAddress, $shippingAddress, $orderId)
{
    if (!$orderId) {
        exit("No order_id given to function updateShopAdresses(). Exit!");
    }
    xtc_db_query("\tUPDATE\t" . HelperFunctions::escapeSql(TABLE_ORDERS) . " \n\t\t\t\t\tSET\t\tbilling_name = '" . HelperFunctions::escapeConvert($invoiceAddress['firstname'], 2) . " " . HelperFunctions::escapeConvert($invoiceAddress['lastname'], 2) . "',\n\t\t\t\t\t\t\tbilling_firstname = '" . HelperFunctions::escapeConvert($invoiceAddress['firstname'], 2) . "',\n\t\t\t\t\t\t\tbilling_lastname = '" . HelperFunctions::escapeConvert($invoiceAddress['lastname'], 2) . "', \n\t\t\t\t\t\t\tbilling_company = '', \n\t\t\t\t\t\t\tbilling_street_address = '" . HelperFunctions::escapeConvert($invoiceAddress['street'], 2) . " " . HelperFunctions::escapeConvert($invoiceAddress['street_number'], 2) . "', \n\t\t\t\t\t\t\tbilling_suburb = '" . HelperFunctions::escapeConvert($invoiceAddress['street_additive'], 2) . "', \n\t\t\t\t\t\t\tbilling_city = '" . HelperFunctions::escapeConvert($invoiceAddress['city'], 2) . "', \n\t\t\t\t\t\t\tbilling_postcode = '" . HelperFunctions::escapeConvert($invoiceAddress['zipcode'], 2) . "', \n\t\t\t\t\t\t\tbilling_state = '', \n\t\t\t\t\t\t\tbilling_country = 'Germany',\n\t\t\t\t\t\t\tbilling_country_iso_code_2 = '" . HelperFunctions::escapeConvert($invoiceAddress['country_code'], 2) . "',\n\t\t\t\t\t\t\tlast_modified = now() \n\t\t\t\t\tWHERE\torders_id = '" . (int) $orderId . "'");
    xtc_db_query("\tUPDATE\t" . HelperFunctions::escapeSql(TABLE_ORDERS) . "\n\t\t\t\t\tSET\t\tdelivery_name = '" . HelperFunctions::escapeConvert($shippingAddress['firstname'], 2) . " " . HelperFunctions::escapeConvert($shippingAddress['lastname'], 2) . "',\n\t\t\t\t\t\t\tdelivery_firstname = '" . HelperFunctions::escapeConvert($shippingAddress['firstname'], 2) . "', \n\t\t\t\t\t\t\tdelivery_lastname = '" . HelperFunctions::escapeConvert($shippingAddress['lastname'], 2) . "', \n\t\t\t\t\t\t\tdelivery_company = '', \n\t\t\t\t\t\t\tdelivery_street_address = '" . HelperFunctions::escapeConvert($shippingAddress['street'], 2) . " " . HelperFunctions::escapeConvert($shippingAddress['street_number'], 2) . "', \n\t\t\t\t\t\t\tdelivery_suburb = '" . HelperFunctions::escapeConvert($shippingAddress['street_additive'], 2) . "', \n\t\t\t\t\t\t\tdelivery_city = '" . HelperFunctions::escapeConvert($shippingAddress['city'], 2) . "', \n\t\t\t\t\t\t\tdelivery_postcode = '" . HelperFunctions::escapeConvert($shippingAddress['zipcode'], 2) . "', \n\t\t\t\t\t\t\tdelivery_state = '', \n\t\t\t\t\t\t\tdelivery_country = 'Germany',\n\t\t\t\t\t\t\tdelivery_country_iso_code_2 = '" . HelperFunctions::escapeConvert($shippingAddress['country_code'], 2) . "',\n\t\t\t\t\t\t\tlast_modified = now() \n\t\t\t\t\tWHERE\torders_id = '" . (int) $orderId . "'");
    echo MODULE_PAYMENT_SOFORT_SR_SUCCESS_ADDRESS_UPDATED . "\n";
}
function getStatusId($status)
{
    return $status > 0 ? $status : DEFAULT_ORDERS_STATUS_ID;
}