cancel
Showing results for 
Search instead for 
Did you mean: 

The argument values for 'instance' and 'apiSecret'. are not passed in Magento 2.1.2

The argument values for 'instance' and 'apiSecret'. are not passed in Magento 2.1.2

Hi All

When we creating the Payrexx object we are passing argument values for 'instance' and 'apiSecret'.


In Magento the following code is working fine in Latest versions but it is not working in Magento version 2.1.12 i.e.) the parameter values does not pass during the object creation in version 2.1.12

$this->payrexxFactory->create([
    'instance' => $config['instance_name'],
    'apiSecret' => $config['api_secret']
]);

 

We are getting teh error message:

Error:

Warning: Missing argument 2 for Payrexx\Payrexx::__construct(), called in /var/www/html/magento2112/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/html/magento2112/vendor/payrexx/payrexx/lib/Payrexx/Payrexx.php on line 29

 

We were creating a Plugin for a payment gateway called  'Payrexx'. When we uploaded the Plugin to Market place, it was rejected on the following grounds:.

Code Issues: Testing: Errors were discovered during testing and will be listed in the Additional Comments section below. Once these issues are corrected, please reupload your package.

Additional Comments:

Tested on: 

  • Magento 2.1.12 Community Edition (PHP 5.6.34)
  • Magento 2.2.4 Open Source (PHP 7.1.17)

Reasons for failure:

  • This error occurred in Magento 2.1.12 Community Edition (PHP 5.6.34). The customer runs into errors when attempting to place an order with the configured payment method. I have copied the first few lines of the error and pasted it below. Note: The payment method was configured with invalid credentials. Magento 2.2 handles this error gracefully by presenting the user with an appropriate error message and a cancelled order in the admin panel.

a:4:{i:0;s:252:"Warning: Missing argument 2 for Payrexx\Payrexx::__construct(), called in /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /var/www/html/vendor/payrexx/payrexx/lib/Payrexx/Payrexx.php on line 29";i:1;s:9886:"#0 /var/www/html/vendor/payrexx/payrexx/lib/Payrexx/Payrexx.php(29): Magento\Framework\App\ErrorHandler->handler(2, 'Missing argumen...', '/var/www/html/v...', 29, Array)
#1 /var/www/html/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php(93): Payrexx\Payrexx->__construct(Object(Magento\Framework\ObjectManager\ObjectManager))
#2 /var/www/html/vendor/magento/framework/ObjectManager/Factory/Compiled.php(88): Magento\Framework\ObjectManager\Factory\AbstractFactory->createObject('Payrexx\Payrexx', Array)
#3 /var/www/html/vendor/magento/framework/ObjectManager/ObjectManager.php(57): Magento\Framework\ObjectManager\Factory\Compiled->create('Payrexx\Payrexx', Array)
#4 /var/www/html/var/generation/Payrexx/PayrexxFactory.php(43): Magento\Framework\ObjectManager\ObjectManager->create('\Payrexx\Payrex...', Array)

Any suggestions how to overcome this issue?