Available in more than 200 markets & trusted by 200 million customers around the world, Paypal enables consumers and merchants to send & receive money in more than different currencies, PayPal is a worth considering option when it comes to choosing a payment Gateway for business. And, PayPal Express Checkout offered by PayPal allows the store customer to perform faster checkout in an ecommerce store with an enhanced layer of security. During the checkout, the customer is redirected to the secure PayPal webpage to complete the payment information. And once the transaction is completed, the customer is redirected back to your store. Adding PayPal Express Checkout to your Magento 2 store showcase the familiar PayPal button on your store, which has been reported to increase sales.
But several times it happens that while charging some extra fees on order doesn’t match with PayPal order total and it throws an error and doesn’t allow the customers to proceed further. To fix this issue, you need to manage this custom amount with PayPal Express Checkout by adding a piece of code in your Magento 2 store.
To do the same, first, we need to create an “events.xml” file inside our custom extension folder.
app\code\Vendor\Extension\etc\events.xml

Now, we need to create one more file, for adding a custom amount in Paypal Checkout and display in subtotal.
app\code\Vendor\Extension\Observer\AddCustomAmountItem.php

That’s it! You have successfully manage your custom amount with Paypal Express Checkout.

If you found this blog helpful, don’t forget to share it with your colleagues and Magento Friends.

And, Let us know if you are facing an issue while implementing this code.

Happy Coding!

Click to rate this post!
[Total: 8 Average: 3.6]