I am getting below error on rest api call on this method
public function handleDecline($order)
{
$result = $this->forterConfig->getDeclinePost();
if ($result == '1') {
$this->customerSession->setForterMessage($this->forterConfig->getPostThanksMsg());
if ($order->canHold()) {
$order->setCanSendNewEmailFlag(false);
$this->decline->holdOrder($order);
$this->setMessageToQueue($order, 'decline');
}
} elseif ($result == '2') {
$order->setCanSendNewEmailFlag(false);
$this->decline->markOrderPaymentReview($order);
}
throw new PaymentException($this->forterConfig->getPostThanksMsg());
}
TypeError: Argument 1 passed to Magento\Framework\Exception\LocalizedException::__construct() must be an instance of Magento\Framework\Phrase, string given, called in
Any thoughts how this can be solved ?
I think this is related to type of "$this->forterConfig->getPostThanksMsg()"