Magento2Msp icon indicating copy to clipboard operation
Magento2Msp copied to clipboard

[PLGMAGTWOS-334] Custom total ignored

Open gijsde3de opened this issue 8 years ago • 15 comments

Hi guys,

We have an issue for one of our customers that have a custom total added to some of the quotes. This custom total is implemented fully according to magento guidelines but isn't picked up by your module. This isn't a problem for most payment methods since they rely only on the final order total (which is correct) but banktransfer sends an email to the customer. In this email there is an order overview which doesn't show the missing custom total which causes customers to pay the wrong amount. In turn this causes MSP to not automatically process the payment/order.

We run on MSP version 1.5.1 and in Model/Connect.php I see you only handle very limited support to send additional fees. All the items are fetched, shipping costs are added. There's support for the official multisafepay payment fee extension, fooman surcharge support but that's it. I wonder why not all the order totals are fetched and copied to MSP (in a magento way so custom totals that are implemented using observers are fetched aswell).

gijsde3de avatar Sep 17 '18 18:09 gijsde3de

Hello @gijsde3de thank you for your message. We will look into this internally and will add it to our backlog to investigate. When we have more information we will give you an update.

JonkRuud avatar Sep 19 '18 06:09 JonkRuud

Internal task reference PLGMAGTWOS-334

JonkRuud avatar Nov 13 '18 08:11 JonkRuud

What's the status on this? Our custom total isn't being transferred to the payment page in MSP..

RaphaelBronsveld avatar Oct 28 '19 13:10 RaphaelBronsveld

Hi @RaphaelBronsveld ,

We would like to reproduce the issue in order to fix it, but before we can do that we will need more details about the following:

  • More information about the external module or custom code that is being used for the custom total amount
  • The steps we should take in order to reproduce this issue

vinodsowdagar avatar Oct 29 '19 13:10 vinodsowdagar

Hi @Vinod-MultiSafepay , thanks for the response.

We can't share the code we use, but it's heavily based on the following guide/module: https://belvg.com/blog/how-to-use-total-models-in-magento-2.html

Any total that'll add up to the (base) grand total, is being ignored towards the MSP payment screen.

  • Make sure you have a custom total that adds up to the grand total
  • Grand total would be 499+29 (fee) = 528 in Magento, Multisafepay will only let you pay 499.

RaphaelBronsveld avatar Oct 29 '19 13:10 RaphaelBronsveld

Thank you for the quick feedback @RaphaelBronsveld

Would it be possible for you to deliver a staging or test environment on which we can investigate, test and debug this further? If that is possible, could you send an email to [email protected]?

If it’s not possible we will create a custom total module ourselves based on the guide you gave us. It will take us a bit more time however, before we will have a solution for the issue.

vinodsowdagar avatar Oct 29 '19 15:10 vinodsowdagar

Hi @Vinod-MultiSafepay ,

Unfortunately it's not possible for us to share the staging environment, but I'll be here for any questions :).

It should be fairly straight forward with the given module, but if you have any questions, please let me know.

Thanks in advance!

RaphaelBronsveld avatar Oct 31 '19 15:10 RaphaelBronsveld

Hi, Apologies for asking again, but what's the status? We need this for our customer :)

Can you give me an estimate for when this feature is implemented?

Thanks in advance!

RaphaelBronsveld avatar Nov 18 '19 09:11 RaphaelBronsveld

Hi @RaphaelBronsveld , We have been working on a fix and i expect to have a separate branch ready by the end of the day. When it is ready, i will link it to this issue with some instructions on how to implement it with your own custom totals.

vinodsowdagar avatar Nov 18 '19 10:11 vinodsowdagar

We have added support for custom totals in the following commit: 9a4b199

To make sure the custom total is added to the shopping cart on the MultiSafepay payment page, please do the following:

  1. Add the custom total code to the following field in the admin backend: Stores > Configuration > MultiSafepay > MultiSafepay Settings > Advanced Settings > Add custom totals
  2. The code is the custom total code that has been set in the class of your custom total, following the guidelines of the guide that you provided us.
  3. We have also added support for multiple custom totals, you can add multiple custom total codes with a semicolon separator.
  4. The custom total(s) should now be visible on our payment page.

Please note that this is not a release and the feature has not yet been fully tested. If you have any further questions or feedback, please feel free to contact us!

vinodsowdagar avatar Nov 18 '19 14:11 vinodsowdagar

Just wanted to let you know that we are currently testing this implementation. I'm curious to why you decided to implement this as a configuration solution.

Why not fetch all the totals from the quote and exclude the one's that are already being used?

Payment provider should, in my opinion, include the whole cart automatically. Is there a reason why you chose for this solution instead?

RaphaelBronsveld avatar Nov 25 '19 08:11 RaphaelBronsveld

Hi @RaphaelBronsveld ,

Thank you for the feedback.

In the first instance we tried to do it the way you described without the configuration option, but we found that there were some cases where extensions would add a calculation to specific cart items and also show the value as a total on the frontend. We tried to be safe by not reading and adding any totals that the merchant does not want to be shown on the MultiSafepay payment page by adding a configuration option for the merchant. Thus, giving the merchant more control over which totals should be displayed and added to the MultiSafepay order.

We still think it is a good idea to fetch the totals and exclude the one’s that are already being used. After some further investigation we want to change the functionality to do this indeed. We will still provide the configurable option, but only to add totals that need to be blacklisted in case the total should not be sent to MultiSafepay. This will be more in line with how you described the solution.

We will have a second branch ready as soon as possible.

vinodsowdagar avatar Nov 25 '19 09:11 vinodsowdagar

Hi @RaphaelBronsveld ,

We have made a new branch containing the solution based on your feedback. 89ff076

The custom totals are now automatically added to the cart and shown on the MultiSafepay payment page. If there are totals that should be excluded, they can be added to the advanced configuration option field.

Let us know if you have any further questions or suggestions.

vinodsowdagar avatar Nov 26 '19 12:11 vinodsowdagar

Hi @Vinod-MultiSafepay , everything seems to be working fine on our end. We had one issue where we had a condition based total, based on customer input, so we had to make a plugin class to get around that.

RaphaelBronsveld avatar Dec 02 '19 14:12 RaphaelBronsveld

Hi @RaphaelBronsveld ,

We have added the solution for custom totals in the latest release.

Thank you for reporting this and providing us with feedback. For now i will close this issue.

vinodsowdagar avatar Mar 05 '20 10:03 vinodsowdagar