/** * Get payment token by token Id. * * @param int $paymentId The payment token ID. * @return PaymentTokenInterface|null Payment token interface. */ public function getByPaymentId($paymentId) { $tokenData = $this->paymentTokenResourceModel->getByOrderPaymentId($paymentId); $tokenModel = !empty($tokenData) ? $this->paymentTokenFactory->create(['data' => $tokenData]) : null; return $tokenModel; }