We will work on Apr 26th (Saturday) and will be off from Apr 30th (Wednesday) until May 2nd (Friday) for public holiday in our country

Commit 7af0ab37 authored by Rik ter Beek's avatar Rik ter Beek

Fixes #114 Fix ReceiptOrderLines for Adyen POS

parent 8aad0088
......@@ -49,6 +49,12 @@ class Pos extends \Magento\Payment\Block\Form
*/
protected $_adyenLogger;
/**
* Currency factory
*
* @var \Magento\Directory\Model\CurrencyFactory
*/
protected $_currencyFactory;
/**
* Pos constructor.
......@@ -66,7 +72,8 @@ class Pos extends \Magento\Payment\Block\Form
\Magento\Sales\Model\OrderFactory $orderFactory,
\Magento\Checkout\Model\Session $checkoutSession,
\Adyen\Payment\Helper\Data $adyenHelper,
\Adyen\Payment\Logger\AdyenLogger $adyenLogger
\Adyen\Payment\Logger\AdyenLogger $adyenLogger,
\Magento\Directory\Model\CurrencyFactory $currencyFactory
) {
$this->_orderFactory = $orderFactory;
$this->_checkoutSession = $checkoutSession;
......@@ -75,6 +82,7 @@ class Pos extends \Magento\Payment\Block\Form
$this->_request = $context->getRequest();
$this->_adyenHelper = $adyenHelper;
$this->_adyenLogger = $adyenLogger;
$this->_currencyFactory = $currencyFactory;
if (!$this->_order) {
$incrementId = $this->_getCheckout()->getLastRealOrderId();
......@@ -97,7 +105,7 @@ class Pos extends \Magento\Payment\Block\Form
{
$launchlink = "";
try {
if($this->_order->getPayment())
if ($this->_order->getPayment())
{
$realOrderId = $this->_order->getRealOrderId();
......@@ -134,9 +142,10 @@ class Pos extends \Magento\Payment\Block\Form
$paymentAmount. "&originalCustomMerchantReference=".
$merchantReference . "&originalCustomSessionId=".session_id());
$launchlink = "adyen://payment?sessionId=".session_id()."&amount=".$paymentAmount.
"&currency=".$currencyCode."&merchantReference=".$merchantReference. $recurringParams .
$receiptOrderLines . "&callback=".$callbackUrl . $extraParamaters;
// Cash you can trigger by adding transactionType=CASH
$launchlink = "adyen://payment?sessionId=".session_id() .
"&amount=".$paymentAmount."&currency=".$currencyCode."&merchantReference=".$merchantReference .
$recurringParams . $receiptOrderLines . "&callback=".$callbackUrl . $extraParamaters;
// cash not working see ticket
// https://youtrack.is.adyen.com/issue/IOS-130#comment=102-20285
......@@ -250,6 +259,7 @@ class Pos extends \Magento\Payment\Block\Form
"====== YOUR PAYMENT DETAILS ======||CB\n".
"---||C\n";
return $myReceiptOrderLines;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment