• Resolved stephenblender

    (@stephenblender)


    With an otherwise functioning PayPal advanced gateway i was receiving errors when I added fees to an order.

    Fees were added via WC->cart->add_fee() and otherwise worked as expected. However, when a customer goes to pay PayPal Advanced throws this error:

    Error: “Field format error: 10413-The totals of the cart item amounts do not match order amounts.”

    Looking through the angelleye plugin code I found at line 494 in wc-gateway-paypal-advanced-angelleye.php a choice is made whether to send a list of items or a grand total. It appears if there are discounts or tax issues a total is sent. It did not look like the itemized list of items was being fee adjusted so did not match the total amount of the order.

    By adding a test here for fees the plugin works again:

    if (($is_prices_include_tax || $order->get_total_discount() > 0 || $length_error > 1) && $order->get_subtotal() > 0) {

    becomes

    if (($is_prices_include_tax || $order->get_total_discount() > 0 || $length_error > 1)|| count($order->get_fees()) && $order->get_subtotal() > 0) {

    Notes:

    1. this is not fully tested
    2. i may not correctly understand the uses of fees
Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Contributor angelleye

    (@angelleye)

    Thanks for the details. We’ll look into this and see if we need to make any adjustments or if there’s a tip we can give you, but it looks like you’re on the right track. We’ll get back to you with info ASAP!

    Plugin Contributor angelleye

    (@angelleye)

    We will be releasing a 1.4.5.1 update shortly that resolves this issue. Please keep your eye out for the update and let us know if you still have problems afterwards. Thanks!

    Thread Starter stephenblender

    (@stephenblender)

    Sorry it has taken so long for me to look at this. This still appears to be a problem in the latest version of the plugin. It appears PayPal does not support fees. The plugin is sending itemized list which does not total correctly as the fees are not being considered.

    Similar to taxes included in item prices, solution is to send order total only.

    In the current version, 1.4.6.5, the line that requires a fee test is now 531 in file wc-gateway-paypal-advanced-angelleye.php . My suggested solution in original post seems to work.

    Plugin Contributor angelleye

    (@angelleye)

    Hmmm, okay. We’ll take a closer look. I’ve got this re-opened on GitHub so we’ll be looking at it in our next release. Thanks for the feedback.

    Plugin Contributor angelleye

    (@angelleye)

    This has been resolved in our GitHub repo and the fix will be included in the 1.4.7 update we’ll be releasing soon.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘PayPal Advanced error when fees included in total’ is closed to new replies.