Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
InstanceFactory.php
Go to the documentation of this file.
1 <?php
7 
9 
14 {
18  private $helper;
19 
23  public function __construct(
24  \Magento\Payment\Helper\Data $helper
25  ) {
26  $this->helper = $helper;
27  }
28 
35  public function create(PaymentMethodInterface $paymentMethod)
36  {
37  $methodInstance = $this->helper->getMethodInstance($paymentMethod->getCode());
38  $methodInstance->setStore($paymentMethod->getStoreId());
39 
40  return $methodInstance;
41  }
42 }
$helper
Definition: iframe.phtml:13
create(PaymentMethodInterface $paymentMethod)
__construct(\Magento\Payment\Helper\Data $helper)