Exemplo n.º 1
0
 /**
  * @inheritdoc
  */
 public function build(array $buildSubject)
 {
     $result = [];
     $isActiveVaultModule = $this->vaultPayment->isActiveForPayment(ConfigProvider::CODE);
     if ($isActiveVaultModule) {
         $result[self::OPTIONS][self::STORE_IN_VAULT_ON_SUCCESS] = true;
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * @inheritdoc
  */
 public function handle(array $handlingSubject, array $response)
 {
     $isActiveVaultModule = $this->vaultPayment->isActiveForPayment(ConfigProvider::CODE);
     if (!$isActiveVaultModule) {
         return;
     }
     $paymentDO = $this->subjectReader->readPayment($handlingSubject);
     $transaction = $this->subjectReader->readTransaction($response);
     $payment = $paymentDO->getPayment();
     // add vault payment token entity to extension attributes
     $paymentToken = $this->getVaultPaymentToken($transaction);
     if (null !== $paymentToken) {
         $extensionAttributes = $this->getExtensionAttributes($payment);
         $extensionAttributes->setVaultPaymentToken($paymentToken);
     }
 }
Exemplo n.º 3
0
 /**
  * Check if vault enabled
  * @return bool
  */
 public function isVaultEnabled()
 {
     return $this->vaultService->isActiveForPayment(ConfigProvider::CODE);
 }
Exemplo n.º 4
0
 /**
  * Check if vault enabled
  * @return bool
  */
 public function isVaultEnabled()
 {
     return $this->vaultService->isActiveForPayment(\Magento\Paypal\Model\Config::METHOD_PAYFLOWPRO);
 }