16 use Magento\Vault\Api\Data\PaymentTokenSearchResultsInterfaceFactory;
70 private $dateTimeFactory;
99 $this->dateTimeFactory = $dateTimeFactory;
114 $entities = $this->paymentTokenRepository->getList(
115 $this->searchCriteriaBuilder
148 ->setConditionType(
'gt')
150 $this->dateTimeFactory->create(
152 new \DateTimeZone(
'UTC')
153 )->format(
'Y-m-d 00:00:00')
157 $this->searchCriteriaBuilder->addFilters($customerFilter);
158 $this->searchCriteriaBuilder->addFilters($visibleFilter);
159 $this->searchCriteriaBuilder->addFilters($isActiveFilter);
161 $searchCriteria = $this->searchCriteriaBuilder->addFilters($expiresAtFilter)->create();
163 return $this->paymentTokenRepository->getList(
$searchCriteria)->getItems();
174 $tokenData = $this->paymentTokenResourceModel->getByOrderPaymentId($paymentId);
175 $tokenModel = !empty($tokenData) ? $this->paymentTokenFactory->create([
'data' => $tokenData]) :
null;
189 $tokenData = $this->paymentTokenResourceModel->getByGatewayToken(
$token, $paymentMethodCode,
$customerId);
190 $tokenModel = !empty($tokenData) ? $this->paymentTokenFactory->create([
'data' => $tokenData]) :
null;
203 $tokenData = $this->paymentTokenResourceModel->getByPublicHash($hash,
$customerId);
204 $tokenModel = !empty($tokenData) ? $this->paymentTokenFactory->create([
'data' => $tokenData]) :
null;
220 if (!empty($tokenDuplicate)) {
221 if (
$token->getIsVisible() || $tokenDuplicate->getIsVisible()) {
222 $token->setEntityId($tokenDuplicate->getEntityId());
223 $token->setIsVisible(
true);
224 }
elseif (
$token->getIsVisible() === $tokenDuplicate->getIsVisible()) {
225 $token->setEntityId($tokenDuplicate->getEntityId());
228 $this->encryptor->getHash(
235 $this->paymentTokenRepository->save(
$token);
251 return $this->paymentTokenResourceModel->addLinkToOrderPayment($paymentTokenId, $orderPaymentId);
__construct(PaymentTokenRepositoryInterface $repository, PaymentTokenResourceModel $paymentTokenResourceModel, PaymentTokenFactory $paymentTokenFactory, FilterBuilder $filterBuilder, SearchCriteriaBuilder $searchCriteriaBuilder, PaymentTokenSearchResultsInterfaceFactory $searchResultsFactory, EncryptorInterface $encryptor, DateTimeFactory $dateTimeFactory)
elseif(isset( $params[ 'redirect_parent']))
saveTokenWithPaymentLink(PaymentTokenInterface $token, OrderPaymentInterface $payment)
getVisibleAvailableTokens($customerId)
getByPublicHash($hash, $customerId)
getListByCustomerId($customerId)
getByPaymentId($paymentId)
addLinkToOrderPayment($paymentTokenId, $orderPaymentId)
getByGatewayToken($token, $paymentMethodCode, $customerId)
$paymentTokenResourceModel