/**
  * Get UI component for token
  * @param PaymentTokenInterface $paymentToken
  * @return TokenUiComponentInterface
  */
 public function getComponentForToken(PaymentTokenInterface $paymentToken)
 {
     $jsonDetails = json_decode($paymentToken->getTokenDetails() ?: '{}', true);
     $component = $this->componentFactory->create(['config' => ['code' => ConfigProvider::CC_VAULT_CODE, 'nonceUrl' => $this->getNonceRetrieveUrl(), TokenUiComponentProviderInterface::COMPONENT_DETAILS => $jsonDetails, TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash()], 'name' => 'Magento_Braintree/js/view/payment/method-renderer/vault']);
     return $component;
 }
 /**
  * @inheritdoc
  */
 public function getComponentForToken(PaymentTokenInterface $paymentToken)
 {
     $data = json_decode($paymentToken->getTokenDetails() ?: '{}', true);
     $component = $this->componentFactory->create(['config' => [TokenUiComponentProviderInterface::COMPONENT_DETAILS => $data, TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash(), 'template' => 'Magento_Paypal::payflowpro/vault.phtml'], 'name' => Template::class]);
     return $component;
 }
 /**
  * @param PaymentTokenInterface $token
  * @param OrderPaymentInterface $payment
  * @return bool
  */
 public function saveTokenWithPaymentLink(PaymentTokenInterface $token, OrderPaymentInterface $payment)
 {
     $tokenDuplicate = $this->getByPublicHash($token->getPublicHash(), $token->getCustomerId());
     if (!empty($tokenDuplicate)) {
         if ($token->getIsVisible() || $tokenDuplicate->getIsVisible()) {
             $token->setEntityId($tokenDuplicate->getEntityId());
             $token->setIsVisible(true);
         } elseif ($token->getIsVisible() === $tokenDuplicate->getIsVisible()) {
             $token->setEntityId($tokenDuplicate->getEntityId());
         } else {
             $token->setPublicHash($this->encryptor->getHash($token->getPublicHash() . $token->getGatewayToken()));
         }
     }
     $this->paymentTokenRepository->save($token);
     $result = $this->addLinkToOrderPayment($token->getEntityId(), $payment->getEntityId());
     return $result;
 }
 /**
  * @inheritdoc
  */
 public function getComponentForToken(PaymentTokenInterface $paymentToken)
 {
     $data = json_decode($paymentToken->getTokenDetails() ?: '{}', true);
     $component = $this->componentFactory->create(['config' => ['nonceUrl' => $this->getNonceRetrieveUrl(), TokenUiComponentProviderInterface::COMPONENT_DETAILS => $data, TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash(), 'template' => 'Magento_BraintreeTwo::form/vault.phtml'], 'name' => Template::class]);
     return $component;
 }
 /**
  * @param PaymentTokenInterface $token
  * @param OrderPaymentInterface $payment
  * @return bool
  */
 public function saveTokenWithPaymentLink(PaymentTokenInterface $token, OrderPaymentInterface $payment)
 {
     $tokenDuplicate = $this->getByPublicHash($token->getPublicHash(), $token->getCustomerId());
     if (!empty($tokenDuplicate)) {
         $token->setEntityId($tokenDuplicate->getEntityId());
         $token->setIsVisible($token->getIsActive());
     }
     $this->paymentTokenRepository->save($token);
     $result = $this->addLinkToOrderPayment($token->getEntityId(), $payment->getEntityId());
     return $result;
 }
 /**
  * Get UI component for token
  * @param PaymentTokenInterface $paymentToken
  * @return TokenUiComponentInterface
  */
 public function getComponentForToken(PaymentTokenInterface $paymentToken)
 {
     $jsonDetails = json_decode($paymentToken->getTokenDetails() ?: '{}', true);
     $component = $this->componentFactory->create(['config' => [TokenUiComponentProviderInterface::COMPONENT_DETAILS => $jsonDetails, TokenUiComponentProviderInterface::COMPONENT_PUBLIC_HASH => $paymentToken->getPublicHash()], 'name' => 'Magento_Paypal/js/view/payment/method-renderer/payflowpro/vault']);
     return $component;
 }