When I try to pay with Mastercard credit card module I get an error

bad request 400

If I go to my var/log/exception.log file I receive the following error:

main.CRITICAL: The HOME or COMPOSER_HOME environment variable must be set for composer to run correctly at /var/www/html/emall/vendor/composer/composer/src/Composer/Factory.php:641)"} []

I have tried many commands found in Internet, but I don´t know if the problem is with composer or with the module itself. This is the module that im using: https://marketplace.magento.com/ontap-module-mastercard.html

Hope someone can help. Thank you and regards!

  • Your magento version please. Commented Jun 30, 2019 at 15:56
  • Hello. I`m using Magento 2.2. Commented Jun 30, 2019 at 22:50
  • Have you enabled debug mode and can you able to see the request and response details in payment log? Commented Jul 1, 2019 at 3:46
  • sorry its a little bit late. But yes, i have enabled debug mode and in Payment Log I see Authentication_Successful. It connects with Mastercard successfully , but it does not perform the transaction. Commented Jul 11, 2019 at 14:18
  • So can you please check the configurations on both side to see if there is no error in configuration Commented Jul 11, 2019 at 14:26

1 Answer 1


after trying a lot of thing I found the solution, in case you have the same problem than me.

I just setEnv the composer variable in .htaccess of the store. Add this line at the top of your MagentoRootfolder/.htaccess file


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.