I need to be able to view the tax charged when I go into my paypal and braintree accounts. Magento is not sending this information to them. We are tring using 2.2.5 and 2.3.1 Enterprise. Please help


you need to do following things to add fee into paypal.

  1. app\code\Vendor\Extension\etc\events.xml

    <?xml version="1.0"?>
    <config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:Event/etc/events.xsd">
      <event name="payment_cart_collect_items_and_amounts">
       <observer name="vendor_extension_payment_collect_total" instance="Vendor\Extension\Observer\AddCustomAmountItem" />
  2. app\code\Vendor\Extension\Observer\AddCustomAmountItem.php

    namespace Vendor\Extension\Observer;
    use Magento\Framework\Event\Observer;
    use Magento\Framework\Event\ObserverInterface;
    use Magento\Store\Model\StoreManagerInterface;
    class AddCustomAmountItem implements ObserverInterface
        public function execute(Observer $observer)
            $cart = $observer->getEvent()->getCart();
            $customAmount = 100;
            $cart->addCustomItem(__('Custom Amount'), 1, -1.00 * $customAmount, 'customfee');
  • I do not have app\code\Vendor\Extension\Observer\AddCustomAmountItem.php in my magento installation of 2.3.1. I don't need a custom fee I just need to send the tax info. Thank you for your help! – arfouquette May 8 '19 at 14:37
  • I will provide you way. And this is custom code that you need to do. – Dhiren Vasoya May 8 '19 at 17:16
  • sounds great thank you! – arfouquette May 9 '19 at 16:03
  • @DhirenVasoya, can you help me setting custom tax_amount for quote item? – jafar pinjar May 15 '19 at 11:07

Your Answer

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

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