Support » Plugin: Authorize.Net Payment Gateway WooCommerce Addon » Line item 1 is invalid

  • Resolved camexmetals

    (@camexmetals)


    Regardless of whether I am in test mode or live mode, I continue to receive the following message when I hit place order: “Line item 1 is invalid.” Per the plugin directory, this has not been tested with my template so that may be the issue, however, I would like to confirm that is the problem. I am currently using Storevilla.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author nazrulhassanmca

    (@nazrulhassanmca)

    If you go to plugin main file line 432 to 442 you would fild following code

    
    $i =1;
    		foreach ( WC()->cart->get_cart() as $cart_item ) {
    	
    		   $item_name       = $cart_item['data']->get_title();
    		   $item_quantity   = $cart_item['quantity'];
    		   $item_unit_price = $cart_item['data']->get_price();
    
    		   $sale->addLineItem($i, $item_name, $item_name, $item_quantity, $item_unit_price,'N');
    
    		   $i++;
    		}

    Can you try after commenting it out

    However this code has been tested with latest woocommerce 3.1.2 and wordpress 4.8 with default twentyfourteen theme and seems to work fine

    Aaron

    (@aaronholistechsystemscom)

    That fixed it for me. Can you update the plugin with those changes? Thanks!

    Plugin Author nazrulhassanmca

    (@nazrulhassanmca)

    Actually those are intended to be in there because that sends the lineitems to receipt received from authorize.net

    Aaron

    (@aaronholistechsystemscom)

    There is still the issue of long product title names over 30 characters causing the error unless I comment out the above code block. Please update the plugin accordingly so that it no longer errors out and sending receipt received still works with Authorize.net.

    Plugin Author nazrulhassanmca

    (@nazrulhassanmca)

    I have just updated the code to fix that issue and also address if item is taxable or not

    however i have not released it as new version which i would do in couple of days

    Thanks for figuring it out so seriously.

    Aaron

    (@aaronholistechsystemscom)

    Thank you so much for taking the time to make the changes!

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Line item 1 is invalid’ is closed to new replies.