if (!empty($order_info['products'])) { foreach ($order_info['products'] as $v) { $products_string .= ":" . str_replace(':', ' ', $v['product']) . ':' . $v['amount'] . ':' . fn_format_price(($v['subtotal'] - fn_external_discounts($v)) / $v['amount']) . ':::' . fn_format_price($v['subtotal'] - fn_external_discounts($v)); } } if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $v) { $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : $v['amount']; $products_string .= ':' . str_replace(':', ' ', $v['gift_cert_code']) . ':1:' . fn_format_price($v['amount']) . ':::' . fn_format_price($v['amount']); } } if (floatval($order_info['payment_surcharge'])) { $products_string .= ':Payment surcharge:---:---:---:---:' . fn_format_price($order_info['payment_surcharge']); $strings++; } if (fn_order_shipping_cost($order_info)) { $products_string .= ':Shipping cost:---:---:---:---:' . fn_format_price($order_info['shipping_cost']); $strings++; } if (floatval($order_info['subtotal_discount'])) { $desc = __('order_discount'); $pr = fn_format_price($order_info['subtotal_discount']); $products_string .= ":{$desc}:---:---:---:---:-" . fn_format_price($order_info['subtotal_discount']); $strings++; } if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') == 'subtotal') { foreach ($order_info['taxes'] as $tax_id => $tax) { if ($tax['price_includes_tax'] == 'N') { $desc = $tax['description']; $products_string .= ":{$desc}:---:---:---:---:" . fn_format_price($tax['tax_subtotal']); $strings++;
$post_data[$item_name] = "1,{$item_price}"; } } // Gift Certificates if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $k => $v) { $v['gift_cert_code'] = htmlspecialchars($v['gift_cert_code']); $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : fn_format_price($v['amount']); $post_data[$v['gift_cert_code']] = "1,{$v['amount']}"; } } // Payment surcharge if (floatval($order_info['payment_surcharge'])) { $name = __('surcharge'); $payment_surcharge_amount = fn_format_price($order_info['payment_surcharge']); $post_data[$name] = "1,{$payment_surcharge_amount}"; } // Shipping $_shipping_cost = fn_order_shipping_cost($order_info); if (floatval($_shipping_cost)) { $name = __('shipping_cost'); $payment_shipping_cost = fn_format_price($_shipping_cost); $post_data[$name] = "1,{$payment_shipping_cost}"; } } else { $total_description = __('total_product_cost'); $post_data[$total_description] = "1,{$order_info['total']}"; } fn_create_payment_form($submit_url, $post_data, 'DirectOne server', false); exit; }
$product_name = ''; // Products if (!empty($order_info['products'])) { foreach ($order_info['products'] as $v) { $product_name = $product_name . $v['product'] . "; "; } } // Gift Certificates if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $v) { $product_name = $product_name . $v['gift_cert_code'] . "; "; } } $product_name = substr($product_name, 0, 128); $tax_amount = !empty($order_info['tax_subtotal']) ? fn_format_price($order_info['tax_subtotal']) : 0; $shipping_amount = fn_order_shipping_cost($order_info); $current_location = Registry::get('config.current_location'); $return_url = fn_url("payment_notification.notify?payment=epassporte&order_id={$order_id}", AREA, 'current'); $response_post = fn_url("payment_notification.tvp?payment=epassporte&order_id={$order_id}", AREA, 'current'); echo <<<EOT <form method="post" action="https://www.epassporte.com/secure/eppurchase.cgi" name="process"> <input type="hidden" name="acct_num" value="{$processor_data['processor_params']['acct_num']}"> <input type="hidden" name="pi_code" value="{$processor_data['processor_params']['pi_code']}"> <input type="hidden" name="amount" value="{$order_info['subtotal']}"> <input type="hidden" name="return_url" value="{$return_url}"> <input type="hidden" name="response_post" value="{$response_post}"> <input type="hidden" name="product_name" value="{$product_name}"> <input type="hidden" name="tax_amount" value="{$tax_amount}"> <input type="hidden" name="shipping_amount" value="{$shipping_amount}"> EOT;
$pp_response['customer_notes'] = $_REQUEST['memo']; } fn_finish_payment($_REQUEST['order_id'], $pp_response, false); fn_order_placement_routines('route', $_REQUEST['order_id']); } } else { $paypal_account = $processor_data['processor_params']['account']; if ($processor_data['processor_params']['mode'] == 'test') { $paypal_url = "https://www.sandbox.paypal.com/cgi-bin/webscr"; } else { $paypal_url = "https://www.paypal.com/cgi-bin/webscr"; } $paypal_currency = $processor_data['processor_params']['currency']; $paypal_item_name = $processor_data['processor_params']['item_name']; //Order Total $paypal_shipping = fn_order_shipping_cost($order_info); $paypal_total = fn_format_price($order_info['total'] - $paypal_shipping, $paypal_currency); $paypal_shipping = fn_format_price($paypal_shipping, $paypal_currency); $paypal_order_id = $processor_data['processor_params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id); $_phone = preg_replace('/[^\\d]/', '', $order_info['phone']); $_ph_a = $_ph_b = $_ph_c = ''; if ($order_info['b_country'] == 'US') { $_phone = substr($_phone, -10); $_ph_a = substr($_phone, 0, 3); $_ph_b = substr($_phone, 3, 3); $_ph_c = substr($_phone, 6, 4); } elseif ($order_info['b_country'] == 'GB') { if (strlen($_phone) == 11 && in_array(substr($_phone, 0, 2), array('01', '02', '07', '08'))) { $_ph_a = '44'; $_ph_b = substr($_phone, 1); } elseif (substr($_phone, 0, 2) == '44') {
function fn_pp_standart_prepare_products($order_info, $paypal_currency = '', $max_pp_products = MAX_PAYPAL_PRODUCTS) { $post_data = array(); $product_count = 1; if (empty($paypal_currency)) { $paypal_currency = !empty($order_info['payment_method']['processor_params']['currency']) ? $order_info['payment_method']['processor_params']['currency'] : CART_PRIMARY_CURRENCY; } $paypal_shipping = fn_order_shipping_cost($order_info); $paypal_total = fn_format_price($order_info['total'] - $paypal_shipping, $paypal_currency); if (empty($order_info['use_gift_certificates']) && !floatval($order_info['subtotal_discount']) && empty($order_info['points_info']['in_use']) && count($order_info['products']) < MAX_PAYPAL_PRODUCTS) { $i = 1; if (!empty($order_info['products'])) { foreach ($order_info['products'] as $k => $v) { $suffix = '_' . $i++; $v['product'] = htmlspecialchars(strip_tags($v['product'])); $v['price'] = fn_format_price(($v['subtotal'] - fn_external_discounts($v)) / $v['amount'], $paypal_currency); $post_data["item_name{$suffix}"] = $v['product']; $post_data["amount{$suffix}"] = $v['price']; $post_data["quantity{$suffix}"] = $v['amount']; if (!empty($v['product_options'])) { foreach ($v['product_options'] as $_k => $_v) { $_v['option_name'] = htmlspecialchars(strip_tags($_v['option_name'])); $_v['variant_name'] = htmlspecialchars(strip_tags($_v['variant_name'])); $post_data["on{$_k}{$suffix}"] = $_v['option_name']; $post_data["os{$_k}{$suffix}"] = $_v['variant_name']; } } } } if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') == 'subtotal') { foreach ($order_info['taxes'] as $tax_id => $tax) { if ($tax['price_includes_tax'] == 'Y') { continue; } $suffix = '_' . $i++; $item_name = htmlspecialchars(strip_tags($tax['description'])); $item_price = fn_format_price($tax['tax_subtotal'], $paypal_currency); $post_data["item_name{$suffix}"] = $item_name; $post_data["amount{$suffix}"] = $item_price; $post_data["quantity{$suffix}"] = '1'; } } // Gift Certificates if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $k => $v) { $suffix = '_' . $i++; $v['gift_cert_code'] = htmlspecialchars($v['gift_cert_code']); $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : fn_format_price($v['amount'], $paypal_currency); $post_data["item_name{$suffix}"] = $v['gift_cert_code']; $post_data["amount{$suffix}"] = $v['amount']; $post_data["quantity{$suffix}"] = '1'; } } if (fn_allowed_for('MULTIVENDOR') && fn_take_payment_surcharge_from_vendor('')) { $take_surcharge = false; } else { $take_surcharge = true; } // Payment surcharge if ($take_surcharge && floatval($order_info['payment_surcharge'])) { $suffix = '_' . $i++; $name = __('surcharge'); $payment_surcharge_amount = fn_format_price($order_info['payment_surcharge'], $paypal_currency); $post_data["item_name{$suffix}"] = $name; $post_data["amount{$suffix}"] = $payment_surcharge_amount; $post_data["quantity{$suffix}"] = '1'; } $product_count = $i - 1; } elseif ($paypal_total <= 0) { $post_data['item_name_1'] = __('total_product_cost'); $post_data['amount_1'] = fn_format_price($order_info['total'], $paypal_currency); $post_data['quantity_1'] = '1'; $post_data['amount'] = fn_format_price($order_info['total'], $paypal_currency); $post_data['shipping_1'] = 0; } else { $post_data['item_name_1'] = __('total_product_cost'); $post_data['amount_1'] = $paypal_total; $post_data['quantity_1'] = '1'; } return array($post_data, $product_count); }
$website_name = $processor_data["processor_params"]['website_name']; $channel_id = $processor_data["processor_params"]['channel_id']; $current_location = Registry::get('config.current_location'); $mod = $processor_data["processor_params"]['transaction_mode']; $callback = $processor_data["processor_params"]['callback']; $log = $processor_data['processor_params']['log_params']; if ($mod == "test") { $paytm_url = "https://pguat.paytm.com/oltp-web/processTransaction"; } else { $paytm_url = "https://secure.paytm.in/oltp-web/processTransaction"; } //Order Total $paytm_total = fn_format_price($order_info['total']); $amount = $paytm_total; // Should be in Rupees $paytm_shipping = fn_order_shipping_cost($order_info); //var_dump($order_info);exit; $paytm_order_id = ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id) . '-' . time(); $date = date('Y-m-d H:i:s'); $msg = fn_get_lang_var('text_cc_processor_connection'); $msg = str_replace('[processor]', 'paytm', $msg); if (!empty($order_info['items'])) { foreach ($order_info['items'] as $k => $v) { $v['product'] = htmlspecialchars($v['product']); } } if ($mod == "test") { $mode = 0; } else { $mode = 1; }
function fn_paynl_startTransaction($order_id, $order_info, $processor_data, $exchangeUrl, $finishUrl, $paymentOptionSubId = null) { $paynl_setting = Registry::get('addons.paynl_addon'); $currency = CART_PRIMARY_CURRENCY; $payNL = new Pay_Api_Start(); $payNL->setApiToken($processor_data['processor_params']['token_api']); $payNL->setServiceId($processor_data['processor_params']['service_id']); $payNL->setAmount(floatval($order_info['total']) * 100); $payNL->setPaymentOptionId($processor_data['processor_params']['optionId']); if (!empty($paymentOptionSubId)) { $payNL->setPaymentOptionSubId($paymentOptionSubId); } $payNL->setExchangeUrl($exchangeUrl); $payNL->setCurrency($currency); $payNL->setFinishUrl($finishUrl); $payNL->setDescription($order_info['order_id']); $s_address = splitAddress(trim($order_info['s_address'] . ' ' . $order_info['s_address_2'])); $b_address = splitAddress(trim($order_info['b_address'] . ' ' . $order_info['b_address_2'])); $payNL->setEnduser(array('accessCode' => $order_info['user_id'], 'language' => $order_info['lang_code'], 'initials' => $order_info['s_firstname'], 'lastName' => $order_info['s_lastname'], 'phoneNumber' => $order_info['s_phone'], 'dob' => $order_info['birthday'], 'emailAddress' => $order_info['email'], 'address' => array('streetName' => $s_address[0], 'streetNumber' => substr($s_address[1], 0, 4), 'zipCode' => $order_info['s_zipcode'], 'city' => $order_info['s_city'], 'countryCode' => $order_info['s_country']), 'invoiceAddress' => array('initials' => $order_info['b_firstname'], 'lastname' => $order_info['b_lastname'], 'streetName' => $b_address[0], 'streetNumber' => substr($b_address[1], 0, 4), 'zipCode' => $order_info['b_zipcode'], 'city' => $order_info['b_city'], 'countryCode' => $order_info['b_country']))); $payNL->setExtra1($order_id); foreach ($order_info['products'] as $key => $product) { $payNL->addProduct($product['product_id'], $product['product'], floatval($product['price']) * 100, $product['amount'], 'H'); } if (isset($order_info['subtotal_discount']) && $order_info['subtotal_discount'] > 0) { $payNL->addProduct(__('discount'), __('discount'), $order_info['subtotal_discount'] * 100, 1); } if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $k => $v) { $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : $v['amount']; $payNL->addProduct($v['gift_cert_id'], $v['gift_cert_code'], -100 * $v['amount'], 1); } } $surcharge = floatval($order_info['payment_surcharge']); $ship = fn_order_shipping_cost($order_info); if (floatval($order_info['payment_surcharge'])) { $item_name = $order_info['payment_method']['surcharge_title']; $payNL->addProduct(substr($item_name, 0, 24), $item_name, floatval($order_info['payment_surcharge']) * 100, 1); } // Shipping $shipping_cost = floatval($order_info['shipping_cost']) * 100; if (isset($shipping_cost) && $shipping_cost > 0) { $payNL->addProduct('shipping_cost', __('shipping_cost'), $shipping_cost, 1); } //gift if (!empty($order_info['use_gift_certificates'])) { foreach ($order_info['use_gift_certificates'] as $k => $v) { $payNL->addProduct($v['gift_cert_id'], $k, floatval($v['cost']) * -100, 1); } } try { $result = $payNL->doRequest(); return $result; } catch (Exception $ex) { fn_set_notification('E', __('error'), $ex->getMessage()); fn_redirect('/index.php?dispatch=checkout.checkout'); } }
$pp_response['customer_notes'] = $_REQUEST['memo']; } fn_finish_payment($_REQUEST['order_id'], $pp_response); fn_order_placement_routines('route', $_REQUEST['order_id']); } } else { $epayph_account = $processor_data['processor_params']['account']; if ($processor_data['processor_params']['mode'] == 'test') { $epayph_url = "https://epay.ph/checkout/api/"; } else { $epayph_url = "https://epay.ph/checkout/api/"; } $epayph_currency = $processor_data['processor_params']['currency']; $epayph_item_name = $processor_data['processor_params']['item_name']; //Order Total $epayph_shipping = fn_order_shipping_cost($order_info); $epayph_total = fn_format_price($order_info['total'] - $epayph_shipping, $epayph_currency); $epayph_shipping = fn_format_price($epayph_shipping, $epayph_currency); $epayph_order_id = $processor_data['processor_params']['order_prefix'] . ($order_info['repaid'] ? $order_id . '_' . $order_info['repaid'] : $order_id); $_phone = preg_replace('/[^\\d]/', '', $order_info['phone']); $_ph_a = $_ph_b = $_ph_c = ''; if ($order_info['b_country'] == 'US') { $_phone = substr($_phone, -10); $_ph_a = substr($_phone, 0, 3); $_ph_b = substr($_phone, 3, 3); $_ph_c = substr($_phone, 6, 4); } elseif ($order_info['b_country'] == 'GB') { if (strlen($_phone) == 11 && in_array(substr($_phone, 0, 2), array('01', '02', '07', '08'))) { $_ph_a = '44'; $_ph_b = substr($_phone, 1); } elseif (substr($_phone, 0, 2) == '44') {
$v['gift_cert_code'] = htmlspecialchars($v['gift_cert_code']); $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : fn_emerchantpay_format_price($v['amount']); $item_name = htmlspecialchars(__('gift_certificate')); fn_emerchantpay_set_product_params($ps, $i++, $v['gift_cert_code'], 1, $item_name, $payment_currency, $v['amount']); } } // Payment surcharge if (floatval($order_info['payment_surcharge'])) { $item_name = htmlspecialchars(__('surcharge')); $payment_surcharge_amount = fn_emerchantpay_format_price($order_info['payment_surcharge']); fn_emerchantpay_set_product_params($ps, $i++, "PSURCHARGE", 1, $item_name, $payment_currency, $payment_surcharge_amount); } //Shipping_cost if (fn_order_shipping_cost($order_info)) { $item_name = htmlspecialchars(__('shipping_cost')); $item_price = fn_emerchantpay_format_price(fn_order_shipping_cost($order_info)); fn_emerchantpay_set_product_params($ps, $i++, "SHIPPING", 1, $item_name, $payment_currency, $item_price); } } else { $total_description = __('total_product_cost'); $item_price = fn_emerchantpay_format_price($order_info['total']); fn_emerchantpay_set_product_params($ps, $i, $total_description, 1, $total_description, $payment_currency, $item_price); } $requestString = $ps->getQueryString(); $location = $payment_url . '?' . $requestString; fn_echo('<meta http-equiv="Refresh" content="0;URL=' . htmlspecialchars($location) . '" />'); } exit; function fn_emerchantpay_format_price($price) { // allows 8 or 8.00 formats only
// $v['discount'] = empty($v['discount']) ? 0 : $v['discount']; $products_string .= ":" . str_replace(":", " ", $v['product']) . ":" . $v['amount'] . ":" . fn_format_price(($v['subtotal'] - fn_external_discounts($v)) / $v['amount']) . ":::" . fn_format_price($v['subtotal'] - fn_external_discounts($v)); } } if (!empty($order_info['gift_certificates'])) { foreach ($order_info['gift_certificates'] as $v) { $v['amount'] = !empty($v['extra']['exclude_from_calculate']) ? 0 : $v['amount']; $products_string .= ":" . str_replace(":", " ", $v['gift_cert_code']) . ":1:" . fn_format_price($v['amount']) . ":::" . fn_format_price($v['amount']); } } if (floatval($order_info['payment_surcharge'])) { $products_string .= ":Payment surcharge:---:---:---:---:" . fn_format_price($order_info['payment_surcharge']); $strings++; } if (fn_order_shipping_cost($order_info)) { $products_string .= ":Shipping cost:---:---:---:---:" . fn_order_shipping_cost($order_info); $strings++; } if (floatval($order_info['subtotal_discount'])) { $desc = fn_get_lang_var('order_discount'); $pr = fn_format_price($order_info['subtotal_discount']); $products_string .= ":{$desc}:---:---:---:---:-" . fn_format_price($order_info['subtotal_discount']); $strings++; } if (!empty($order_info['taxes']) && Registry::get('settings.General.tax_calculation') == 'subtotal') { foreach ($order_info['taxes'] as $tax_id => $tax) { if ($tax['price_includes_tax'] == 'N') { $desc = $tax['description']; $products_string .= ":{$desc}:---:---:---:---:" . fn_format_price($tax['tax_subtotal']); $strings++; }
function fn_quickbooks_export_orders($orders, $order_products, &$export) { $export[] = "!TRNS\tTRNSTYPE\tDATE\tACCNT\tNAME\tCLASS\tAMOUNT\tDOCNUM\tMEMO\tADDR1\tADDR2\tADDR3\tADDR4\tADDR5\tPAID\tSHIPVIA\tSADDR1\tSADDR2\tSADDR3\tSADDR4\tSADDR5\tTOPRINT"; $export[] = "!SPL\tTRNSTYPE\tDATE\tACCNT\tNAME\tCLASS\tAMOUNT\tDOCNUM\tMEMO\tPRICE\tQNTY\tINVITEM\tTAXABLE\tEXTRA"; $export[] = "!ENDTRNS\t"; $trns = "TRNS\tINVOICE\t%s\tAccounts Receivable\t\"%s, %s\"\t%s\t%s\t%s\tWebsite Order: %s\t%s %s\t%s %s\t\"%s, %s %s\"\t%s\t\t%s\t\t%s %s\t%s %s\t\"%s, %s %s\"\t%s\t\tY"; $spl = "SPL\tINVOICE\t%s\t%s\t\"%s, %s\"\t%s\t%01.2f\t%d\t\"%s%s\"\t%01.2f\t%d\t%s\t%s\t%s"; $accnt_product = Registry::get('addons.quickbooks.accnt_product'); $accnt_tax = Registry::get('addons.quickbooks.accnt_tax'); $accnt_shipping = Registry::get('addons.quickbooks.accnt_shipping'); $accnt_discount = Registry::get('addons.quickbooks.accnt_discount'); $accnt_surcharge = Registry::get('addons.quickbooks.accnt_surcharge'); $trns_class = Registry::get('addons.quickbooks.trns_class'); foreach ($orders as $order) { $order_details = str_replace(array("\r\n", "\n", "\r", "\t"), " ", $order['details']); $order_date = fn_date_format($order['timestamp'], "%m/%d/%Y"); $product_subtotal = 0; if (in_array($order['status'], fn_get_order_paid_statuses())) { $order_paid = 'Y'; } else { $order_paid = 'N'; } $order['s_countryname'] = $order['s_country']; $order['b_countryname'] = $order['b_country']; $export[] = sprintf($trns, $order_date, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, $order['total'], $order['order_id'], $order_details, $order['b_firstname'], $order['b_lastname'], $order['b_address'], $order['b_address_2'], $order['b_city'], $order['b_state'], $order['b_zipcode'], $order['b_country_descr'], $order_paid, $order['s_firstname'], $order['s_lastname'], $order['s_address'], $order['s_address_2'], $order['s_city'], $order['s_state'], $order['s_zipcode'], $order['s_country_descr']); // PRODUCTS foreach ($order['products'] as $product) { $product_id = $product['cart_id']; $product_subtotal = $product['price'] * $product['amount']; $product_select_options = !empty($order_products[$product_id]['selected_options']) ? $order_products[$product_id]['selected_options'] : ''; if ($order_products[$product_id]['product_code']) { $product_code = $order_products[$product_id]['product_code']; } else { $product_code = $order_products[$product_id]['product_id']; } // Check wether product is taxable $_taxable = 'N'; if (!empty($product['tax_value'])) { $_taxable = 'Y'; } elseif (is_array($order['taxes'])) { foreach ($order['taxes'] as $tax_data) { if (!empty($tax_data['applies']['items']['P'][$product_id])) { $_taxable = 'Y'; break; } } } $product_name = fn_quickbooks_escape_field($order_products[$product_id]['product']); $product_select_options = fn_quickbooks_escape_field($product_select_options); $export[] = sprintf($spl, $order_date, $accnt_product, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, -$product_subtotal, $order['order_id'], $product_name, $product_select_options, $product['price'], -$product['amount'], $product_code, $_taxable, ''); } fn_set_hook('quickbooks_export_order', $order, $order_products, $spl, $export); // ********* SHIPPING ********** if ($order['shipping_cost'] > 0) { $shipping_names = array(); $_taxable = 'N'; foreach ($order['shipping'] as $ship) { $shipping_names[] = $ship['shipping']; // Check wether shipping is taxable if (is_array($order['taxes'])) { foreach ($order['taxes'] as $tax_data) { if (!empty($tax_data['applies']['items']['S'][$ship['group_key']][$ship['shipping_id']])) { $_taxable = 'Y'; break; } } } } $shipping_cost = fn_order_shipping_cost($order); $export[] = sprintf($spl, $order_date, $accnt_shipping, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, -$shipping_cost, $order['order_id'], fn_quickbooks_escape_field(implode('; ', $shipping_names)), '', $shipping_cost, -1, 'SHIPPING', $_taxable, ''); } // ********* TAXES ********** foreach ($order['taxes'] as $tax_data) { // Inserted the empty line above the tax #101326561 - do not know what for yet if ($tax_data['price_includes_tax'] == 'N') { $export[] = sprintf($spl, $order_date, $accnt_tax, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, -$tax_data['tax_subtotal'], $order['order_id'], $tax_data['description'], '', $tax_data['tax_subtotal'], -1, 'TAX', 'N', 'AUTOSTAX'); } } // ********** DISCOUNT ********** if ($order['subtotal_discount'] > 0) { $export[] = sprintf($spl, $order_date, $accnt_discount, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, $order['subtotal_discount'], $order['order_id'], 'DISCOUNT', '', -$order['subtotal_discount'] - 1, 'DISCOUNT', 'N', ''); } // ********* SURCHARGE **********} if ($order['payment_surcharge'] > 0) { $export[] = sprintf($spl, $order_date, $accnt_surcharge, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, -$order['payment_surcharge'], $order['order_id'], 'Payment processor surcharge', '', $order['payment_surcharge'] - 1, 'SURCHARGE', 'N', ''); } // ********** AUTO TAX ************ if (!$order['taxes']) { $export[] = sprintf($spl, $order_date, $accnt_tax, fn_quickbooks_escape_field($order['b_lastname']), fn_quickbooks_escape_field($order['b_firstname']), $trns_class, 0, $order['order_id'], 'TAX', '', '', '', '', 'N', 'AUTOSTAX'); } $export[] = "ENDTRNS\t"; } $export[] = ''; return true; }