I added a Module that adds an extra Fee (via Discount) when I order products for less than 50€. That module works for invoice payment. When i want to pay via PayPal, I get an error like "there is a mistake"...

How can archive that? My idea was to create an observer that modifies the Paypal-Information... But how exactly i can make that?

I tried the following code:

public function paypalPrepareLineItems($observer)
        /* @var $cart Mage_Paypal_Model_Cart */
        $cart = $observer->getEvent()->getPaypalCart();
        $address = $cart->getSalesEntity()->getIsVirtual() ?
            $cart->getSalesEntity()->getBillingAddress() : $cart->getSalesEntity()->getShippingAddress();
        $feeAmount = $address->getExtraFeeRuleAmount();
        $cart->updateTotal(Mage_Paypal_Model_Cart::TOTAL_DISCOUNT, $feeAmount);

Thank you, Chris

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.