• Resolved zorensen

    (@zorensen)


    Hi,

    I’m using the PayPal Express plugin and it works perfectly for my site. However, recently I’ve been playing with coupons to give my costumers discount on their orders. As soon as I apply a coupon to the order and try to checkout with PayPal I get this error message;

    10413 - The totals of the cart item amounts do not match order amounts.

    I’ve been reading through your support forums and can see that other users have the same issue. However I haven’t found any way to fix this. This error is only present for me as soon as I apply a coupon to my order. If no coupon is added, the checkout process works perfectly.

    Can you please help me to fix this as soon as possible, as coupons are important to me?

    https://www.ads-software.com/plugins/paypal-for-woocommerce/

Viewing 15 replies - 1 through 15 (of 22 total)
  • Plugin Contributor angelleye

    (@angelleye)

    The issue comes from the way WooCommerce handles rounding and provides the data within the code.

    We are working hard to get this done, and I’ve just recently assigned somebody to focus on this plugin full time, so we’ll be able to get a lot more updates done more quickly.

    In the mean-time, if you can get by with flat-rate discounts those shouldn’t cause any problems. I’m assuming you’re working with percentage based discounts now..??

    Do you have logging enabled? If you can send me the log file so I can review the request that generated the error that would help.

    Thread Starter zorensen

    (@zorensen)

    Yes, you are right. I’m working with precentage based discounts. I can’t really user flat-rate discounts on my shop, I’m afraid.

    Here is the log for the error;

    05-04-2015 @ 11:46:50 – Start Express Checkout
    05-04-2015 @ 11:46:51 – Test Mode: no
    05-04-2015 @ 11:46:51 – Endpoint: https://api-3t.paypal.com/nvp
    05-04-2015 @ 11:46:51 – Request: Array
    (
    [USER] => *****
    [PWD] => *****
    [VERSION] => 112.0
    [BUTTONSOURCE] => AngellEYE_SP_WooCommerce
    [SIGNATURE] => *****
    [METHOD] => SetExpressCheckout
    [RETURNURL] => https://www.xxxxx.no/kassen/se-gjennom-bestilling/?pp_action=revieworder
    [CANCELURL] => https://www.xxxxx.no/handlekurv/
    [ADDROVERRIDE] => 1
    [BRANDNAME] => hundenmin.no
    [CUSTOMERSERVICENUMBER] => 47 416 10 616
    [SOLUTIONTYPE] => Sole
    [LANDINGPAGE] => Billing
    [USERSELECTEDFUNDINGSOURCE] => CreditCard
    [PAYMENTREQUEST_0_AMT] => 135.00
    [PAYMENTREQUEST_0_CURRENCYCODE] => NOK
    [PAYMENTREQUEST_0_SHIPPINGAMT] => 0.00
    [PAYMENTREQUEST_0_TAXAMT] => 0.00
    [PAYMENTREQUEST_0_SHIPTONAME] => John Doe
    [PAYMENTREQUEST_0_SHIPTOSTREET] => Streetname
    [PAYMENTREQUEST_0_SHIPTOCITY] => Townname
    [PAYMENTREQUEST_0_SHIPTOZIP] => 0000
    [PAYMENTREQUEST_0_SHIPTOCOUNTRYCODE] => NO
    [PAYMENTREQUEST_0_SHIPTOPHONENUM] => 12345678
    [PAYMENTREQUEST_0_PAYMENTACTION] => Sale
    [L_PAYMENTREQUEST_0_NAME0] => Treningsgodbiter – Smak godbiter: Kylling

    [L_PAYMENTREQUEST_0_AMT0] => 270.00
    [L_PAYMENTREQUEST_0_QTY0] => 1
    [L_PAYMENTREQUEST_0_NAME1] => Cart Discount
    [L_PAYMENTREQUEST_0_NUMBER1] => anders
    [L_PAYMENTREQUEST_0_QTY1] => 1
    [L_PAYMENTREQUEST_0_AMT1] => -108.00
    [PAYMENTREQUEST_0_ITEMAMT] => 162
    )

    05-04-2015 @ 11:46:51 – Response: Array
    (
    [TIMESTAMP] => 2015-05-04T09:46:51Z
    [CORRELATIONID] => 1b0970b895d23
    [ACK] => Failure
    [VERSION] => 112.0
    [BUILD] => 16493693
    [L_ERRORCODE0] => 10413
    [L_SHORTMESSAGE0] => Transaction refused because of an invalid argument. See additional error messages for details.
    [L_LONGMESSAGE0] => The totals of the cart item amounts do not match order amounts.
    [L_SEVERITYCODE0] => Error
    )

    05-04-2015 @ 11:46:51 – SetExpressCheckout API call failed.
    05-04-2015 @ 11:46:51 – Detailed Error Message: The totals of the cart item amounts do not match order amounts.
    05-04-2015 @ 11:46:51 – Short Error Message: Transaction refused because of an invalid argument. See additional error messages for details.
    05-04-2015 @ 11:46:51 – Error Code: 10413
    05-04-2015 @ 11:46:51 – Error Severity Code: Error

    Any way I can use a quickfix for this, so I can get this running? ??

    Plugin Contributor angelleye

    (@angelleye)

    Ok, so in the request it’s sending an AMT of 135.00. The line item is for 270.00 and then it shows a discount of 108, so that would be 162.00, which is what it’s sending for the ITEMAMT.

    I can’t see why it’s only sending 135.00 for the total AMT, though. Typically, ITEMAMT + SHIPPINGAMT + TAXAMT + HANDLINGAMT = AMT. In this case, though, the shipping and tax are showing 0.00, yet somehow the full order total is getting dropped all the way to 135.00 when the item subtotal iself is 162.00.

    Do you have any idea where it’s losing that extra $27?

    Thread Starter zorensen

    (@zorensen)

    Yes, actually I do know what those 27 is.
    It’s the tax (VAT) on the product. All my prices are displayed with tax included, and all prices are included tax. (VAT).

    Those 27 are the tax on the product.

    Plugin Contributor angelleye

    (@angelleye)

    Ok, so yeah, that’s the problem. The WC object in code is only returning the total price without tax, so it’s getting entered as 135.00 instead of 162.00.

    That’s one of the quirky things that keeps changing in WC. One version will send us the pricing with tax included, and then the next version won’t, and then the next version will again. It’s been very annoying.

    Essentially we’re just going to have add all sorts of checks and balances to get this working.

    Another option would be to disable the line items from getting passed to PayPal. Then the PayPal transaction details wouldn’t have the line item break down, but it would have the WC order #, and you could find the item details in that order, of course.

    If you want to give that a shot open up the file at /paypal-for-woocommerce/classes/wc-gateway-paypal-express-angelleye.php

    Go to line 1360 and you’ll see the following.

    $Payment['order_items'] = $PaymentOrderItems;

    Comment that line out. Also, at line 1366 you’ll see…

    $Payment['itemamt'] = $total_items+$total_discount;

    Go ahead and comment that line out as well. Upload that change and run a test to see if the problem goes away.

    Thread Starter zorensen

    (@zorensen)

    I will test this right away ??
    Will let you know how it works out.

    Thanks!

    Thread Starter zorensen

    (@zorensen)

    I just tried this now, and now I get to the PayPal checkout page. However, my order is empty. No products in the overview on PayPal, not prices – nothing… Then the costumer are asked to pay for nothing ??

    Plugin Contributor angelleye

    (@angelleye)

    It should show the price, but yeah, all of the item details would go away. Did you continue and return back to the review page on your site? The pricing would be broken down there, and then the final call would submit the pricing to PayPal.

    On that note, we need to make the same adjustment to that final call. So I would have you do the same thing on lines 1769 and 1788…comment those out.

    With those changes, completing the full order should result in the order amount and order ID getting sent to PayPal correctly, but then you’d have to refer to the WC order to see the actual items.

    Thread Starter zorensen

    (@zorensen)

    It didn’t show the price at all, I’m afraid.
    No items and no total price on the order.

    Isn’t there a more smooth way to fix this? ??

    Plugin Contributor angelleye

    (@angelleye)

    I guess I’ll have to run some tests on that. That doesn’t make sense you wouldn’t be seeing a price. The price is still getting sent in the request (and is required to move forward). Can you send me a screenshot of the PayPal page you’re seeing when you get there?

    Yes, the smooth way to fix it is add a bunch of checks and balances in the code logic to ensure the PayPal request gets generated correctly regardless of how the WooCommerce settings are configured. There are all sorts of ifs/ands/buts involved in that logic.

    We’re working to get it resolved. What I was explaining to you would be a temporary work-around.

    Thread Starter zorensen

    (@zorensen)

    I’ll try again just to be sure here ?? Really want this to work as it should ?? I’ll send you a screenshot of how it looks on the PayPal page.

    Thanks for all the help with this. Any idea on when the update will be ready with the “real” fix? ??

    Thread Starter zorensen

    (@zorensen)

    Here’s the screenshot from PayPal after commeting out those four lines you asked me to. No total price is stated on that page…

    PayPal Screenshot

    Thread Starter zorensen

    (@zorensen)

    No word on this?

    Plugin Contributor angelleye

    (@angelleye)

    @zorensen,

    I’m sorry for the delay getting back with you. For some reason I wasn’t seeing notifications on the responses to this ticket.

    Our 1.1.6.3 update is going to be released very soon (hopefully within a week or two at the most) and it should resolve this issue based on the testing we’ve been doing. We’ve made quite a few adjustments that should handle data regardless of how WC feeds it (which seems to change quite often with their updates) so this shouldn’t happen anymore.

    Please keep your eye out for that update here soon. I’m going to go ahead and close this thread, but let me know if you have any other questions or concerns.

    Hi, just jumping in here but we’ve found that we’re getting the same error code with some discounted products. we discounted with a category-wide 10%-off option and then tried deactivating that and adding the special prices to the required products in their own page.

    we’ve found it’s only affecting credit card payments through paypal. paypal account purchases are working no problems.

    we’re using version 1.1.6.3.1

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘Error 10413 on checkout’ is closed to new replies.