/**
  * Generate vault payment public hash
  *
  * @param PaymentTokenInterface $paymentToken
  * @return string
  */
 protected function generatePublicHash(PaymentTokenInterface $paymentToken)
 {
     $hashKey = $paymentToken->getGatewayToken();
     if ($paymentToken->getCustomerId()) {
         $hashKey = $paymentToken->getCustomerId();
     }
     $hashKey .= $paymentToken->getPaymentMethodCode() . $paymentToken->getType() . $paymentToken->getTokenDetails();
     return $this->encryptor->getHash($hashKey);
 }
 /**
  * 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;
 }
 /**
  * @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;
 }
 /**
  * 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;
 }