Results 1 to 5 of 5
  1. #1
    Join Date
    May 2014
    Posts
    68
    Plugin Contributions
    0

    Default ID missing after capture transaction

    I know ZC156 is outdated, but I am still testing for ZC157, but still have to keep old site for time being.

    The host migrating to new server with new PHP 7.4, but due to the old ZC156 does not fully support 7.4, I asked host to stay with the old server PHP version until testing is fully complete. However, while the old site is running... when customer checked out, it gave out this error on backend.

    (Customer would be asked to refresh, it would ended up have this error 3 times before "timed out.")

    Code:
    1048 Column 'id' cannot be null
    in:
    [INSERT INTO authorizenet (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) VALUES (NULL, 3661, 14939, 1, '(TESTMODE) This transaction has been approved.', 'auth_capture', '', 'Array\n(\n [x_login] => *******\n [x_tran_key] => *******\n [x_relay_response] => FALSE\n [x_delim_data] => TRUE\n [x_delim_char] => |\n [x_encap_char] => *\n [x_version] => 3.1\n [x_solution_id] => A1000003\n [x_method] => CC\n [x_amount] => 20.08\n [x_currency_code] => USD\n [x_market_type] => 0\n [x_card_num] => XXXXXXXXXXXXX0027\n [x_exp_date] => ... )]
    *removed the rest due to sensitive data

    So for some reasons, I tried to find out why 'id' is all sudden became 'null' when it supposed to be +1 from the database. I am trying to find out where the trigger is, but I'm not positive if whether it is in authorizenet.php or in other files that deal with SQL connection.

  2. #2
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,693
    Plugin Contributions
    9

    Default Re: ID missing after capture transaction

    Quote Originally Posted by PanZC2020 View Post
    I know ZC156 is outdated, but I am still testing for ZC157, but still have to keep old site for time being.

    The host migrating to new server with new PHP 7.4, but due to the old ZC156 does not fully support 7.4, I asked host to stay with the old server PHP version until testing is fully complete. However, while the old site is running... when customer checked out, it gave out this error on backend.

    (Customer would be asked to refresh, it would ended up have this error 3 times before "timed out.")

    Code:
    1048 Column 'id' cannot be null
    in:
    [INSERT INTO authorizenet (id, customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) VALUES (NULL, 3661, 14939, 1, '(TESTMODE) This transaction has been approved.', 'auth_capture', '', 'Array\n(\n [x_login] => *******\n [x_tran_key] => *******\n [x_relay_response] => FALSE\n [x_delim_data] => TRUE\n [x_delim_char] => |\n [x_encap_char] => *\n [x_version] => 3.1\n [x_solution_id] => A1000003\n [x_method] => CC\n [x_amount] => 20.08\n [x_currency_code] => USD\n [x_market_type] => 0\n [x_card_num] => XXXXXXXXXXXXX0027\n [x_exp_date] => ... )]
    *removed the rest due to sensitive data

    So for some reasons, I tried to find out why 'id' is all sudden became 'null' when it supposed to be +1 from the database. I am trying to find out where the trigger is, but I'm not positive if whether it is in authorizenet.php or in other files that deal with SQL connection.
    i would venture a guess that you are now on a server where mysql is in strict mode. i would look at this line of code:

    https://github.com/zencart/zencart/b...zenet.php#L656

    remove the 'id' and the 'NULL' from the line. it should now look like:

    PHP Code:
    $sql "insert into " TABLE_AUTHORIZENET "  (customer_id, order_id, response_code, response_text, authorization_type, transaction_id, sent, received, time, session_id) values (:custID, :orderID, :respCode, :respText, :authType, :transID, :sentData, :recvData, :orderTime, :sessID )"
    report back if that works. id is an index that auto increments, so it is not necessary on an insert statement.

    best.
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

  3. #3
    Join Date
    May 2014
    Posts
    68
    Plugin Contributions
    0

    Default Re: ID missing after capture transaction

    That work around does work. However, I did have to change on the authorizenet_aim.php file, which also have that SQL statement since the site using the one with (AIM) and not (SIM) one.

    Now, at least customer can orders while I'm working on the upgrade!

  4. #4
    Join Date
    May 2014
    Posts
    68
    Plugin Contributions
    0

    Default Re: ID missing after capture transaction

    While we at it, I do wonder why Zen Cart developers did not use this SQL instead of the one with 'NULL' as it seems that the one that you suggested is more proper for SQL statements and able to get through even host using strict mode.

  5. #5
    Join Date
    Nov 2005
    Location
    los angeles
    Posts
    2,693
    Plugin Contributions
    9

    Default Re: ID missing after capture transaction

    Quote Originally Posted by PanZC2020 View Post
    While we at it, I do wonder why Zen Cart developers did not use this SQL instead of the one with 'NULL' as it seems that the one that you suggested is more proper for SQL statements and able to get through even host using strict mode.
    that line of code goes back 10 years. mysql and php were completely different languages back then.

    the code that you are using also makes use of the 2 value pairs, which authorize has deprecated many moons ago. as to when that code will cease to work.... who knows...

    my biased opinion would be to move to my plugin here:

    https://www.zen-cart.com/downloads.php?do=file&id=2272

    card on file transactions and using a more current version of the authorize sdk....

    but your call...
    author of square Webpay.
    mxWorks has premium plugins. donations: venmo or paypal accepted.
    premium consistent excellent support. available for hire.

 

 

Similar Threads

  1. Order status changes after batch capture on PayPal website
    By Three Sisters in forum PayPal Express Checkout support
    Replies: 21
    Last Post: 10 Mar 2017, 11:55 AM
  2. v151 An occasional missing capture payment ability
    By d0ugparker in forum General Questions
    Replies: 4
    Last Post: 26 Aug 2016, 04:36 AM
  3. Transaction Amount Missing
    By Lazar in forum Addon Payment Modules
    Replies: 1
    Last Post: 11 Oct 2011, 02:35 PM
  4. set order status to processing after capture (AIM)
    By patternman in forum Built-in Shipping and Payment Modules
    Replies: 7
    Last Post: 27 Aug 2009, 01:54 AM
  5. Trying to refund a capture - error 10009 - You cannot refund this type of transaction
    By oboeonetwothree in forum PayPal Website Payments Pro support
    Replies: 8
    Last Post: 31 Dec 2008, 08:05 PM

Bookmarks

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
Zen-Cart, Internet Selling Services, Klamath Falls, OR