globalpayments / php-sdk

GNU General Public License v2.0
49 stars 66 forks source link

Issue with Placing Order in Magento #35

Closed soumyamol-mathew closed 2 years ago

soumyamol-mathew commented 5 years ago

Hello,

When I try to place an order with credit/debit card via Global Payments extension, I am getting the following error:

webapi-5da06b5728929; Message: Property "DisableTmpl" does not have accessor method "getDisableTmpl" in class "Magento\Quote\Api\Data\PaymentInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5da06b5728929; Message: Property "DisableTmpl" does not have accessor method "getDisableTmpl" in class "Magento\Quote\Api\Data\PaymentInterface". at /vendor/magento/framework/Webapi/ErrorProcessor.php:208, LogicException(code: 0): Property "DisableTmpl" does not have accessor method "getDisableTmpl" in class "Magento\Quote\Api\Data\PaymentInterface". at /vendor/magento/framework/Reflection/NameFinder.php:100)"} []

I have recently upgraded Magento from 2.3.1 to 2.3.3. Global Payments Extension version : 3.0.0 PHP Version: 7.2.22

slogsdon commented 5 years ago

@rxp-developers Have we had any integrators experience this issue to date? magento/magento2#24986 has some more troubleshooting information.

soumyamol-mathew commented 5 years ago

@slogsdon

I have checked the Global Payments extension with a fresh magento installation ( M2.3.3 CE ). I could replicate the issue there also.

soumyamol-mathew commented 5 years ago

@slogsdon

I have deleted __disableTmpl property from paymentData. I deleted this property by adding the following in /app/code/RealexPayments/HPP/view/frontend/web/js/action/set-payment-method.js

if (Object.prototype.hasOwnProperty.call(paymentData, '__disableTmpl')) { delete paymentData.__disableTmpl; }

eeeduuu commented 5 years ago

Hello @soumyamol-mathew, I have exactly the same problem. I've tried to modify the file you indicate but it's not in the path you indicate. It only appears in this path: vendor/realexpayments/hpp/view/frontend/web/js/action/set-payment-method.js

Since there is no other file with the same name, I've added the code you indicate in this one, but it didn't work.

Thanks in advance

soumyamol-mathew commented 5 years ago

@eeeduuu

You should not edit any code inside the vendor folder. If you want to continue development of an existing module you add your files to app/code/vendor-name/module.

https://magento.stackexchange.com/questions/145536/explanation-of-app-code-vs-vendor-directories-please

This is where I have placed the code in set-payment-method.js.

/** Checkout for guest and registered customer. */
            if (!customer.isLoggedIn()) {
                serviceUrl = urlBuilder.createUrl('/guest-carts/:quoteId/payment-information', {
                    quoteId: quote.getQuoteId()
                });
                payload = {
                    cartId: quote.getQuoteId(),
                    email: quote.guestEmail,
                    paymentMethod: paymentData,
                    billingAddress: quote.billingAddress()
                };
            } else {
                serviceUrl = urlBuilder.createUrl('/carts/mine/payment-information', {});
                payload = {
                    cartId: quote.getQuoteId(),
                    paymentMethod: paymentData,
                    billingAddress: quote.billingAddress()
                };
            }

            if (Object.prototype.hasOwnProperty.call(paymentData, '__disableTmpl')) { delete paymentData.__disableTmpl; }
eeeduuu commented 5 years ago

@soumyamol-mathew

Thank you for your directions.

I created the directory tree, copied the "set-payment-method.js" file, added the line you indicated, emptied caches and reassigned permissions, just in case.

Unfortunately it didn't work.

I don't know if the new file is overwriting the original or if I have to do something else to make the change effective.

With this change did you get the Magento 2.3.3 extension to work?

I thank you again for your help and advice. The truth is that I am a bit lost.

The error that saved the log file is as follows: [2019-10-30 08:52:57] main.CRITICAL: Report ID: webapi-5db94f6919cfa; Message: Property "DisableTmpl" does not have accessor method "getDisableTmpl" in class "Magento\Quote\Api\Data\PaymentInterface". {"exception":"[object] (Exception(code: 0): Report ID: webapi-5db94f6919cfa; Message: Property \"DisableTmpl\" does not have accessor method \"getDisableTmpl\" in class \"Magento\\Quote\\Api\\Data\\PaymentInterface\". at /var/www/html/vhosts/dev.XXXXX.com/www/vendor/magento/framework/Webapi/ErrorProcessor.php:208, LogicException(code: 0): Property \"DisableTmpl\" does not have accessor method \"getDisableTmpl\" in class \"Magento\\Quote\\Api\\Data\\PaymentInterface\". at /var/www/html/vhosts/dev.XXXXX.com/www/vendor/magento/framework/Reflection/NameFinder.php:100)"} []

soumyamol-mathew commented 5 years ago

@eeeduuu Have you checked the global payments extension with a fresh magento installation?

Please check this : https://github.com/magento/magento2/issues/24986 also

eeeduuu commented 5 years ago

The installation is completely new. Only the following is installed/configured:

eeeduuu commented 5 years ago

@soumyamol-mathew

The installation is completely new. Only the following is installed/configured:

eeeduuu commented 5 years ago

Hello again @soumyamol-mathew, I have the problem when I overwrite the .JS file in the "code/..." folder. If I modify the file in the "vendor/..." folder, the problem is solved. I'm sorry. I'm new at this. I will follow the link you indicated before to see how to correctly overwrite the module. Thanks for everything!

soumyamol-mathew commented 5 years ago

@eeeduuu , Have you resolved the issue?

eeeduuu commented 5 years ago

@soumyamol-mathew, l still don't know how to override the .JS file, but I'll investigate how to do it. Thank you very much for your help.