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 90a3e5d6 authored by cyattilakiss's avatar cyattilakiss Committed by GitHub

Merge pull request #365 from stkams/develop

The UCD needs to get the customer ID via a different way
parents 4c911479 f3df54a6
...@@ -27,6 +27,7 @@ namespace Adyen\Payment\Model; ...@@ -27,6 +27,7 @@ namespace Adyen\Payment\Model;
use Adyen\Payment\Api\AdyenInitiateTerminalApiInterface; use Adyen\Payment\Api\AdyenInitiateTerminalApiInterface;
use Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider; use Adyen\Payment\Model\Ui\AdyenPosCloudConfigProvider;
use Adyen\Util\Util; use Adyen\Util\Util;
use Magento\Quote\Model\Quote;
class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
{ {
...@@ -105,7 +106,6 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -105,7 +106,6 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$serviceID = date("dHis"); $serviceID = date("dHis");
$initiateDate = date("U"); $initiateDate = date("U");
$timeStamper = date("Y-m-d") . "T" . date("H:i:s+00:00"); $timeStamper = date("Y-m-d") . "T" . date("H:i:s+00:00");
$customerId = $quote->getCustomerId();
$request = [ $request = [
'SaleToPOIRequest' => 'SaleToPOIRequest' =>
...@@ -147,6 +147,8 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -147,6 +147,8 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
], ],
]; ];
$customerId = $this->getCustomerId($quote);
// If customer exists add it into the request to store request // If customer exists add it into the request to store request
if (!empty($customerId)) { if (!empty($customerId)) {
$shopperEmail = $quote->getCustomerEmail(); $shopperEmail = $quote->getCustomerEmail();
...@@ -195,4 +197,13 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -195,4 +197,13 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$quote->save(); $quote->save();
return $response; return $response;
} }
/**
* @param Quote $quote
* @return mixed
*/
public function getCustomerId(Quote $quote)
{
return $quote->getCustomerId();
}
} }
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