1

never seen this problem before on any other website but when we try to checkout via paypal express when trying to use a discount code we get an error

Transaction refused because of an invalid argument. See additional error messages for details.(10413)

I enabled paypal logging but the long message just says:

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

I have checked the magento configuration but I can't see anywhere I can remove this check like I can with other payment providers, any advice?

Theres an option to transfer cart line items over to paypal but that's set to "no"

please help.

5
  • Change that product price for testing and check again. Commented Jun 7, 2018 at 13:13
  • tried all sorts of products it's not product specific, im thinking it could be something to do with tax? I know there's a really old issue with magento calculations with tax vs paypal calculation?
    – Danielle
    Commented Jun 7, 2018 at 13:15
  • Try my solution and check again Commented Jun 7, 2018 at 13:19
  • Have you tried? Commented Jun 7, 2018 at 13:36
  • Have you got any solution? Commented Jun 8, 2018 at 4:55

1 Answer 1

0

You will have to create a custom module

Create an observer

        <paypal_prepare_line_items>
            <observers>
                <your_customdiscount_paypal_prepare_line_items>
                    <type>singleton</type>
                    <class>Your_Customdiscount_Model_Observer</class>
                    <method>addDiscountToPayPal</method>
                </your_customfee_paypal_prepare_line_items>
            </observers>
        </paypal_prepare_line_items>

Here is the function to add to the observer:

  public function addDiscountToPayPal($observer) {

        $paypalCart = $observer->getPaypalCart();

        if ($paypalCart) {
            $order = $paypalCart->getSalesEntity();
            $discountAmount = $order->getDiscountAmount();
            $paypalCart->updateTotal(Mage_Paypal_Model_Cart::TOTAL_DISCOUNT, $discountAmount);

        }

}
1
  • Thanks for the advice, will try this and see if it works for us.
    – Danielle
    Commented Jun 8, 2018 at 8:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.