queuedPayment = $queuedPayment; } /** * @copydoc Validation::descriptions() */ public static function descriptions(): array { return [ self::PAYMENT_NAME => __('emailTemplate.variable.queuedPayment.itemName'), self::PAYMENT_AMOUNT => __('emailTemplate.variable.queuedPayment.itemCost'), self::PAYMENT_CURRENCY_CODE => __('emailTemplate.variable.queuedPayment.itemCurrencyCode'), ]; } /** * @copydoc Validation::values() */ public function values(string $locale): array { return [ self::PAYMENT_NAME => htmlspecialchars($this->getItemName()), self::PAYMENT_AMOUNT => (string) $this->getItemCost(), self::PAYMENT_CURRENCY_CODE => (string) $this->getItemCurrencyCode(), ]; } protected function getItemName(): string { $context = $this->getContext(); $paymentManager = Application::getPaymentManager($context); return $paymentManager->getPaymentName($this->queuedPayment); } /** * @return float|int|string|null */ protected function getItemCost() { return $this->queuedPayment->getAmount(); } protected function getItemCurrencyCode(): ?string { return $this->queuedPayment->getCurrencyCode(); } }