Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
CcForm.php
Go to the documentation of this file.
1 <?php
7 
16 
18 {
22  protected $_template = 'Magento_Paypal::transparent/form.phtml';
23 
27  private $paymentDataHelper;
28 
35  public function __construct(
36  Context $context,
37  Config $paymentConfig,
38  Session $checkoutSession,
39  array $data = []
40  ) {
41  parent::__construct($context, $paymentConfig, $checkoutSession, $data);
42  }
43 
48  public function isVaultEnabled()
49  {
50  $storeId = $this->_storeManager->getStore()->getId();
51  $vaultPayment = $this->getVaultPayment();
52  return $vaultPayment->isActive($storeId);
53  }
54 
60  protected function shouldRender()
61  {
62  return true;
63  }
64 
68  protected function initializeMethod()
69  {
70  return;
71  }
72 
77  private function getVaultPayment()
78  {
79  return $this->getPaymentDataHelper()->getMethodInstance(Transparent::CC_VAULT_CODE);
80  }
81 
87  private function getPaymentDataHelper()
88  {
89  if ($this->paymentDataHelper === null) {
90  $this->paymentDataHelper = ObjectManager::getInstance()->get(Data::class);
91  }
92  return $this->paymentDataHelper;
93  }
94 }
__construct(Context $context, Config $paymentConfig, Session $checkoutSession, array $data=[])
Definition: CcForm.php:35