pfpayments / magento-2.2

PostFinance Checkout integration for Magento 2.2
https://www.postfinance-checkout.ch
Apache License 2.0
1 stars 1 forks source link

Api issue with transaction meta_data limit #2

Open arditza opened 10 months ago

arditza commented 10 months ago

Hello there,

We are currently estimating postfinance payment method on Magento for a few of our customers and we noticed some issues while testing it on test mode.

In one of our projects we have currently 38 order attributes which are created through Amasty_Orderattr extension. These are for internal usage and are not required to be exported into Postfinance, although the postfinance magento extension seems to load all of them as meta data when calling the postfinance api through the sdk library as you can see in this line https://github.com/pfpayments/magento-2.2/blob/ae50884e557d68bc013774ebdd081e1dadfd84e1/Observer/CollectOrderAttributeMetaData.php#L54

The api responds with an error stating that the maximum meta data items is 25. In our case we had 38 order attributes, some of which where set to null, therefore the result was that the functionality was terminated without completing its full cycle and not allowing us to place an order.

In case you manage to replicate the issue, I would suggest that the extension filters out the amasty order attributes if they have a value and if they are configured for the current/quote store.

We are currently patching this on our own but would appreciate it a lot if we had this fixed on the main extension.

Thank you for taking the time to consider this issue. Kind Regards, Ardit

theodorspringwallee commented 10 months ago

Dear arditza

Thanks for your input.

If you don't need the metadata at all, you also could remove this code block here: https://github.com/pfpayments/magento-2.2/blob/ae50884e557d68bc013774ebdd081e1dadfd84e1/Model/Service/Order/TransactionService.php#L322

We will take a look at this with our portal and plugin team.

Would you prefer to increase the metadata amount or is it also ok for you, that we just don't transmit more than the current limit allows?

Best regards