0

I'm using the theme -

https://themeforest.net/item/multistores-magento-2-megashop-theme-support-multiple-stores/19211690?s_rank=17

I purchased the theme from themeforest and had the application set up on a hosting. I'm using Magento ver. 2.1.1. After adding products into the shopping cart, when I clicked checkout, it threw an exception:

Cannot instantiate interface Magento\Vault\Api\Data\PaymentTokenInterfaceFactory in /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/Dynamic/Developer.php on line 73

I tried to resolve the same by putting this line in app/etc/di.xml:

< preference for="Magento\Vault\Api\Data\PaymentTokenInterfaceFactory" type="Magento\Framework\ObjectManager\Factory\Dynamic\Developer" />

Thereafter, the fatal error went away, but now I get the following error in var/log/system.log:

Argument 15 passed to Magento\Paypal\Model\Payflow\Transparent::__construct() must implement interface Magento\Vault\Api\Data\PaymentTokenInterfaceIFactory,

instance of Magento\Framework\ObjectManager\Factory\Dynamic\Developer given, called in /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php

on line 93 and defined in /home/shopegiv/public_html/dev/vendor/magento/module-paypal/Model/Payflow/Transparent.php on line 99 [] []

The output displayed on the screen was Object DOMDocument should be created.

I assume I'm not going the right direction to specify the preference or specify concrete factory such as AccountPaymentTokenFactory or CreditCardTokenFactory.

If someone could advice the workarounds split into steps, I shall be thankful.

I would greatly appreciate any help on this.

  • are you using any third party payment module? – Sunil Patel May 12 '17 at 10:24
  • Hi @sunilpatel I appreciate you taking time to look into my concern. I haven't incorporated any third party payment module additionally yet, just have put up the theme on Magento ver. 2.1.1. – Aiden Parker May 12 '17 at 11:19
  • removed var/generation and var/cache.var/di switched to developer mode to recompile – Sunil Patel May 12 '17 at 11:26
  • I just followed what you suggested @sunilpatel but I get this on the screen after I click on the "Cart" link. Argument 15 passed to Magento\Paypal\Model\Payflow\Transparent::__construct() must implement interface Magento\Vault\Api\Data\PaymentTokenInterfaceFactory, instance of Magento\Framework\ObjectManager\Factory\Dynamic\Developer given, called in /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /home/shopegiv/public_html/dev/vendor/magento/module-paypal/Model/Payflow/Transparent.php on line 100 – Aiden Parker May 12 '17 at 12:21
0

Compare your file with https://github.com/magento/magento2/blob/2.1.6/app/code/Magento/Paypal/Model/Payflow/Transparent.php

and copy same file and check it.

  • I copied the file you suggested into vendor/magento/module-paypal/Model/Payflow/Transparent.php Still I get this error: Argument 15 passed to Magento\Paypal\Model\Payflow\Transparent::__construct() must implement interface Magento\Vault\Api\Data\PaymentTokenInterfaceFactory, instance of Magento\Framework\ObjectManager\Factory\Dynamic\Developer given, called in /home/shopegiv/public_html/dev/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /home/shopegiv/public_html/dev/vendor/magento/module-paypal/Model/Payflow/Transparent.php on line 89 – Aiden Parker May 12 '17 at 13:55
  • after copy please remove var/cache.var/generation, var/di – Sunil Patel May 12 '17 at 14:30
  • Even thereafter, it's the same exception that comes up. Removed the items from var/ just as you suggested. – Aiden Parker May 12 '17 at 14:40
0

Finally, I could figure it out myself.

There's no need to set the preference in app/etc/di.xml.

In /home/shopegiv/public_html/dev/vendor/magento/module-paypal/Model/Payflow/Transparent.php, instead of using \Magento\Vault\Api\Data\PaymentTokenInterfaceFactory in the constructor, rather use \Magento\Vault\Model\PaymentTokenFactory and it solves the issue.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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