Git Product home page Git Product logo

mageprince / magento2-paymentfee Goto Github PK

View Code? Open in Web Editor NEW
25.0 4.0 17.0 74 KB

Magento 2 Payment Fee by MagePrince helps admin to set payment fees to charge customers for selecting a specific payment method to complete their order from all available payment methods.

PHP 88.55% HTML 3.86% CSS 0.57% JavaScript 7.01%
magento2 magento2-extension-free paymentfee extrafee order checkout free free-module free-extension magento2-free-extension

magento2-paymentfee's Introduction

Magento 2 Payment Fee

Payment Fee extension for Magento 2 allows adding extra charges for specific payment methods and displays them on the cart page, checkout page, invoice, and credit memo. Also, payment fees display in the sales email like new order, invoice, and credit memo. Admin can also set the payment fee in order creation from admin.

According to the payment method, there are several options for counting payment fees by percentage price, fixed price, per row and per item. The payment fee title and description are configurable from admin. Payment fees can be disabled after a specified maximum order amount. You can set the payment fee is refundable or not from the configurations settings. You can also set a default payment fee which acts as an extra fee on order. Payment fees may also be restricted only to specific stores or customer groups. Admin can access the payment fee configuration from Admin->Configuration->MagePrince->Payment Fee.

Magento Marketplace :

Extension Link

User Guide

New Features

  • Multi-store support
  • Multi-currency support
  • Support tax calculation on the payment fee
  • Allow admin to select tax class for the payment fee
  • Allow admin to select tax display type(Incl.,Excl.,both)
  • Customer group restrictions
  • Admin can set the sort order of payment fee
  • Calculate discount or shipping amount in subtotal

Features

  • Enable or disable extension from the admin configuration
  • Admin can add payment fees on specific payment methods
  • Supports major of common payment methods like Cash on Delivery, PayPal, etc.
  • Can add payment fees in:
    • Percentage Price
    • Fixed Price
    • Per Row
    • Per Item
  • Admin can set custom payment fee title and description for easy understanding
  • Displays payment fee on the checkout page, Order page, Sales Email
  • Enable or disable refund of payment fees on credit memo from admin configuration
  • Admin can disable payment fees on the maximum order amount by adding the max order amount from the admin configuration

Demo

Frontend | Backend

Installation Instruction

  • Copy the content of the repo to the Magento 2 app/code/Mageprince/Paymentfee
  • Run command: php bin/magento setup:upgrade
  • Run Command: php bin/magento setup:static-content:deploy
  • Now Flush Cache: php bin/magento cache:flush

Contribution

Want to contribute to this extension? The quickest way is to open a pull request on GitHub.

Support

If you encounter any problems or bugs, please open an issue on GitHub.

Screenshots

Checkout Page

Configuration

magento2-paymentfee's People

Contributors

coosos avatar mageprince avatar princektpl avatar sfritzsche avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

magento2-paymentfee's Issues

payment fee is always showing excluding tax

I have set up the module and it seems to calculate the fee correctly however I have an issue with how it's displayed.

In my country when dealing with retail customers we have to show prices including tax however the fee is always showing up without tax. The tax amount is always added as an extra.

For example in checkout I have

Cart Subtotal 32,00 €
Shipping Flat Rate - Fixed 5,00 €
Payment Fee 3,00 €
Tax 7,88 €
Order Total Incl. Tax 40,72 €
Order Total Excl. Tax 32,84 €

You will notice that the amounts are correct because it's adding 0.72€ to the payment fee however because it's showing without tax the customer is confused. He expects the total to be 32 + 5 + 3 = 40 but he sees 40.72.

Is it possible to add a setting for the display of the fee to show including or excluding tax? Or how can I change the display for it?

[Question] What are the minimum requirements

Hi Mageprince,

I would like to know the versions of PHP and magento that we must respect at least for the contribution 😄
(I should push an MR to use web apis instead of a controller)

It would also be interesting if it was specified in the composer.json 👍

Thank you, Good day

Multicurrency issue & tax amount at invoicing

Hi,
Thank you for all improvements made in the latest versions.
Unfortunately I still do have 2 issues:

1. in multi-currency store, there is no amount in base currency if the order is placed in other than base currency - see screenshot:
Order
Payment fee should be 3€ and 81 Kč (base currency, fx rate = 27 Kč/€)

2. when an order is invoiced, tax is handled incorrectly (regardless of currency) - see screenshot:
Order-invoiced
See only calculation in €:
Total paid = 97.98€ = 92.0 + 3.5 + 3/1.21 [Tax rate is 21%]
So obviously the invoiced amount does not include VAT on the payment fee.

My store set up:
Currency: 1€ = 27Kč
Base currency = Kč
Tax rate = 21%
Payment fee = 66.94 Kč [2.48 €] => incl. tax = 81 Kč [3.00 €]
Calculate Tax = Yes
Display Payment Fee = Including Tax
I am using the latest version of the extension

The payment fee is always displayed excluding tax regardles of the price display settings

Extension works well, but it does not respect tax display setting:
Stores --> Settings --> Configuration: Sales --> Tax -->
Price Display Settings /
Shopping Cart Display Settings /
Orders, Invoices, Credit Memos Display Settings
--> Display Shipping Amount: Including Tax / Excluding Tax

Price is always shown without tax regardless of the settings.
I would appreciate, if the extension can be modified to respect the above price display settings.
The tax calculation is correct, the problem is only with the display of the price.

Steps to reproduce:
1. Create Payment Method Payment Fee - fixed amount $10
2. Set Tax Settings --> Calculate Tax: Yes
3. Set Tax Settings --> Tax Class: select a tax with 20% tax rate
4. Stores --> Settings --> Configuration: Sales --> Tax --> Price Display Settings / Shopping Cart Display Settings set 'Display Shipping Prices' to 'Including Tax'
5. Place an order
6. Check Order Summary on the Checkout Page, Order confirmation email, etc.

Expected result:
Payment fee: $12 [i.e. $10 + 20% tax]

Actual result:
Payment fee: $10

store configuration crashes in 2.4.3-p2

With the module enables, opening stores->settings->configuration makes the store crash with a report.
disabling the module it works again.

{"0":"Notice: Undefined index: id in ..../vendor\/magento\/module-config\/Model\/Config\/Structure\/Element\/Iterator.php on line 63","1":"#1 Magento\\Config\\Model\\Config\\Structure\\Element\\Iterator->setElements() called at [vendor\/magento\/module-config\/Model\/Config\/Structure.php:146]\n#2 Magento\\Config\\Model\\Config\\Structure->getTabs() called at [generated\/code\/Magento\/Config\/Model\/Config\/Structure\/Interceptor.php:23]\n#3 Magento\\Config\\Model\\Config\\Structure\\Interceptor->getTabs() called at [vendor\/magento\/module-config\/Model\/Config\/Structure.php:209]\n#4 Magento\\Config\\Model\\Config\\Structure->getFirstSection() called at [generated\/code\/Magento\/Config\/Model\/Config\/Structure\/Interceptor.php:59]\n#5 Magento\\Config\\Model\\Config\\Structure\\Interceptor->getFirstSection() called at [vendor\/magento\/module-config\/Controller\/Adminhtml\/System\/AbstractConfig.php:63]\n#6 Magento\\Config\\Controller\\Adminhtml\\System\\AbstractConfig->dispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:58]\n#7 Magento\\Config\\Controller\\Adminhtml\\System\\Config\\Index\\Interceptor->___callParent() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:138]\n#8 Magento\\Config\\Controller\\Adminhtml\\System\\Config\\Index\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/module-backend\/App\/Action\/Plugin\/Authentication.php:143]\n#9 Magento\\Backend\\App\\Action\\Plugin\\Authentication->aroundDispatch() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:135]\n#10 Magento\\Config\\Controller\\Adminhtml\\System\\Config\\Index\\Interceptor->Magento\\Framework\\Interception\\{closure}() called at [vendor\/magento\/framework\/Interception\/Interceptor.php:153]\n#11 Magento\\Config\\Controller\\Adminhtml\\System\\Config\\Index\\Interceptor->___callPlugins() called at [generated\/code\/Magento\/Config\/Controller\/Adminhtml\/System\/Config\/Index\/Interceptor.php:32]\n#12 Magento\\Config\\Controller\\Adminhtml\\System\\Config\\Index\\Interceptor->dispatch() called at [vendor\/magento\/framework\/App\/FrontController.php:245]\n#13 Magento\\Framework\\App\\FrontController->getActionResponse() called at [vendor\/magento\/framework\/App\/FrontController.php:212]\n#14 Magento\\Framework\\App\\FrontController->processRequest() called at [vendor\/magento\/framework\/App\...

Refund issues

When we refund an order that has a payment fee, the refund isn't the same as the amount actually refunded on Paypal. For example, this transaction was to be refunded $33.38, but the amount refunded on Paypal was $38.58 (see attached files).

Sans titre-2
Sans titre-1

This is a transaction with a currency conversion.

Also, the payment fee is always refunded in full, so we have to make a negative adjustment refund. Would it be possible to calculate the payment fee to be refunded automatically instead? For example, if we have a $200 transaction with a 3% fee and we want to refund just $100, by default the system will refund $6 rather than $3.

Issue: Payment fee is not added if VAT field is filled out

If a customer adds his VAT information in the checkout, the payment fee does not get added.

Tested with Magento Version 2.3.2 and 2.3.6
Tested with both default and custom payment methods
Changing the tax settings in backend does not seem to change this result

Tax Calculation issue Magento 2.3.4

Hello

Tax Calculation is not working. If I mark yes or no, there is no difference, at all. The fee is calculated from the net price. I am using Magento 2.3.4 and your module version 2.0.3

Regards

Payment Fee is added on each partial invoice.

Steps to reproduce:

  1. Place order with at least two products.
  2. Create to separate invoices

Expected result:
Payment fee is taken into account once.

Actual result:
Payment fee is applied to each invoice causing a mismatch in totals.
image

PayPal gateway has rejected request

Paypal error when configuring payment fee of 3.5%
https://www.awesomescreenshot.com/video/9288473?key=0bfbb6e4f0e91e6d89ac8d1c7d8e7e9e

image_2022_06_06T00_26_04_206Z
image_2022_06_06T00_27_51_733Z
Screenshot 2022-06-06 at 22 43 19

[2022-06-06 00:31:50] main.DEBUG: array ( 'url' => 'https://api-3t.sandbox.paypal.com/nvp', 'DoExpressCheckoutPayment' => array ( 'TOKEN' => 'EC-04Y308123P8151732', 'PAYERID' => '468TM7EUAJXNJ', 'PAYMENTACTION' => 'Sale', 'AMT' => '771.57', 'CURRENCYCODE' => 'AUD', 'BUTTONSOURCE' => 'Magento_2_Community', 'NOTIFYURL' => 'https://unitronicau.local/paypal/ipn/', 'RETURNFMFDETAILS' => 1, 'SHIPPINGAMT' => '4.55', 'ITEMAMT' => '694.74', 'TAXAMT' => '69.92', 'BUSINESS' => NULL, 'EMAIL' => '[email protected]', 'FIRSTNAME' => 'test', 'LASTNAME' => 'test', 'MIDDLENAME' => NULL, 'SALUTATION' => NULL, 'SUFFIX' => NULL, 'COUNTRYCODE' => 'AU', 'STATE' => 'ACT', 'CITY' => 'test', 'STREET' => '1 test', 'ZIP' => '1234', 'PHONENUM' => '1523523523', 'SHIPTOCOUNTRYCODE' => 'AU', 'SHIPTOSTATE' => 'ACT', 'SHIPTOCITY' => 'test', 'SHIPTOSTREET' => '1 test', 'SHIPTOZIP' => '1234', 'SHIPTOPHONENUM' => '1523523523', 'SHIPTOSTREET2' => '', 'STREET2' => '', 'SHIPTONAME' => 'test test', 'ADDROVERRIDE' => 1, 'METHOD' => 'DoExpressCheckoutPayment', 'VERSION' => '72.0', 'USER' => '****', 'PWD' => '****', 'SIGNATURE' => '****', ), 'response' => array ( 'TOKEN' => 'EC-04Y308123P8151732', 'SUCCESSPAGEREDIRECTREQUESTED' => 'false', 'TIMESTAMP' => '2022-06-06T00:31:50Z', 'CORRELATIONID' => '542fd9f568713', 'ACK' => 'Failure', 'VERSION' => '72.0', 'BUILD' => '56929629', 'L_ERRORCODE0' => '10413', 'L_SHORTMESSAGE0' => 'Transaction refused because of an invalid argument. See additional error messages for details.', 'L_LONGMESSAGE0' => 'The totals of the cart item amounts do not match order amounts.', 'L_SEVERITYCODE0' => 'Error', ), ) [] []

Paypal I can't put extra charge

Hello,

Plugin is working fine to me, but paypal option is not showing me,

Magneto Version 2.3.4, paypal configuration is with the version incluided in magento, anything strange.

thank you
90309686-e4c43980-deea-11ea-9c38-5a09c9c1831d

Fee is applied after login

PayPal fee is applied but no payment method selected on checkout.

Steps to reproduce:
1- Start a purchase, go to checkout and select paypal as payment method.
2- Logout
3- Login again and go to cart
4- Proceed to checkout to billing step

Expected result:
Fee is applied when paypal payment method is selected and no fee is applied when logout and login again because no payment method must be selected when login again.

Actual result:
After login, the fee is applied in cart. When the user proceed to checkout, no payment method is selected but paypal fee is applied.
The fee is applied even when login again using private navigation.

Percentage fee broken

Selecting Price Type = Percentage Price and Fee Amount=0,01
for an shopping cart of 175€ it calculates a fee of 0.01€ instead of 1,75€

Compilation Error on Module Enable

Hello,

I've just tried to install the module on Magento 2.3 with PHP 7.1 and i'm getting this error when i'm trying to compile:

PHP Parse error: syntax error, unexpected 'State' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST) in /home/***/www/vendor/prince/magento2-paymentfee/Helper/Data.php on line 59

Problem that causes a lot of extra loading time

Hi there!
We have been using your extension for a long time now and are really thankful for this solution.
Although, we've ran into the problem that at least five calls are being done on our checkout page to gather the fee information, even when there's no extra fee rule active for the current store.

image
On this image you can see the amount of calls and the seconds it takes to do this.

Is there a possibility you could look into this problem? I'm wondering if any call is necessary when there's no extra fee rule active for the current store? Also, why are there so many calls to the same endpoint with the same result?
Thank you in advance!

Best regards,
Lesley

Install php error CalculatorInterface not found

Hi,

When trying to install (2.1.0 or 2.1.1) with magento 2.3.4, i got this error:

Repositories code generation... 1/7 [====>-----------------------]  14% < 1 sec 98.5 MiBPHP Fatal error:  Interface 'Mageprince\Paymentfee\Model\Calculation\Calculator\CalculatorInterface' 

Edited: Solvem path corrected, thanks for your reply.

Tax Calculation in frontend

Tax is calculated in the grand total but not in tax details in the front-end checkout. while there's no issue in the backend

Expected result:
Tax is calculated in tax details and grand total

Not working with Amasty Checkout

If I install the module on my project that has Amasty Checkout. The checkout loads to infinity without ever completing itself completely

Tax not applied when editing order from admin

Hello,

Payment fee is not working when I try to edit an order in admin. It is working very good when adding an order to frontend, but in admin is not working when editing an order to adding a new order via admin panel. I've tried with guest and customer.

Failed to create Order Request: Warning: Division by zero in

Hi,

We installed the extension and configured it. But somehow on a payment provider which we did not apply the extension on is now giving issues. See attached logging.

[2021-10-01 11:42:08] MultiSafepay.ERROR: (Order ID: 195857 ) Failed to create Order Request: Warning: Division by zero in /home/xxxxx/public_html/vendor/multisafepay/magento2-core/Model/Api/Builder/OrderRequestBuilder/ShoppingCartBuilder/CustomTotalBuilder.php on line 156 [] []

Removed?

I was going to test your latest additions but see you have removed the code. Is that on purpose?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.