Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2006
    Posts
    113
    Plugin Contributions
    0

    Default Total amount without commas for order processing

    We are running zencart 1.3.8 with just a few mods including the NAB Module for credit card payments to the NAB bank through our merchant facility. I have just become aware that amounts larger than $1000 are being rejected because zencart is adding a comma as the thousand divider and the NAB payment gateway is rejecting these as an invalid number.

    I am trying to chase up my developer now about it as it is somewhat urgent but I also like to try and understand what is going on also so hoping someone can give me a few clues.

    I have taken the comma out of all the currencies I accept so amounts are being displayed as $3450.00 for example instead of $3,450.00 but it seems this is just a display thing because the number being sent to the bank still has the comma inserted which is causing the payment to fail.

    I am not sure that it is a problem with the NAB Module as a test order with PayPal also clearly showed that the amount being sent to them had a comma (although I didnt take the order through to the end because I couldnt send money to myself).

    When I look at the sql database table for order_total, it has a field for value which shows a number with no comma but 4 decimal places and a field for "text" which shows the currency code and a $amount that includes the comma (+2 decimal places). I'm presuming that it is the text field that is being sent for further payment processing but dont know anything about code so not sure where to go next.

    I have searched through all the settings and I cant see where else to alter this formatting.

    Any advice would be gratefully received
    Leah Lane
    www.aussiesapphire.com.au

  2. #2
    Join Date
    Feb 2005
    Location
    Lansing, Michigan USA
    Posts
    20,021
    Plugin Contributions
    3

    Default Re: Total amount without commas for order processing

    These involve a different payment processor, but might give you some info:


    http://www.zen-cart.com/forum/showthread.php?t=48398

    http://www.zen-cart.com/forum/showthread.php?t=41952

  3. #3
    Join Date
    Jan 2004
    Posts
    66,444
    Plugin Contributions
    279

    Default Re: Total amount without commas for order processing

    If you're using the NAB module from the downloads area, it should already be unformatted.

    ie: lines 80-92:
    Code:
        function process_button() {
    	    global $_POST;  global $db, $order_totals, $order;
    //	  $total=$order->info['order_totals'];             
          $amt=$order->info['total'];             
    // Calculate the next expected order id
        $last_order_id = $db->Execute("select * from " . TABLE_ORDERS . " order by orders_id desc limit 1");
        $new_order_id = $last_order_id->fields['orders_id'];
        $new_order_id = ($new_order_id + 1);
    	
         $process_button_string = zen_draw_hidden_field('merchid', 'B5768139B28F28B5D760B7DC415447500B66639247B568983D48349F5662C392') .
    //      zen_draw_hidden_field('mtid', $new_order_id) . 
    	zen_draw_hidden_field('mtid', '10003') . 
    	zen_draw_hidden_field('amt', $amt) .
    $order->info['total'] is already an unformatted value
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

 

 

Similar Threads

  1. shipping cost for total order amount over $200
    By george_usa in forum Built-in Shipping and Payment Modules
    Replies: 5
    Last Post: 17 Dec 2010, 11:35 AM
  2. Replies: 8
    Last Post: 27 Apr 2010, 07:19 PM
  3. Replies: 2
    Last Post: 11 Jul 2007, 01:56 AM
  4. Keywords without commas on 1.3.5?
    By bigjoed in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 23 Sep 2006, 04:14 AM
  5. Shipping charge as a % of the total order amount
    By JayZhen in forum Built-in Shipping and Payment Modules
    Replies: 2
    Last Post: 25 May 2006, 05:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg