We will be off from 27/1 (Monday) to 31/1 (Friday) (GMT +7) for our Tet Holiday (Lunar New Year) in our country

Commit 99f4ac9b authored by Rik ter Beek's avatar Rik ter Beek Committed by Aleffio

optimize checks and use array instead of json

parent 98f8bc09
...@@ -153,14 +153,13 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface ...@@ -153,14 +153,13 @@ class AdyenInitiateTerminalApi implements AdyenInitiateTerminalApiInterface
$shopperEmail = $quote->getCustomerEmail(); $shopperEmail = $quote->getCustomerEmail();
$recurringContract = $this->_adyenHelper->getAdyenPosCloudConfigData('recurring_type'); $recurringContract = $this->_adyenHelper->getAdyenPosCloudConfigData('recurring_type');
if (!empty($recurringContract)) { if (!empty($recurringContract) && !empty($shopperEmail) && !empty($customerId)) {
$jsonValue = '{ $recurringDetails = [
"shopperEmail": "' . $shopperEmail . '", ['shopperEmail'] => $shopperEmail,
"shopperReference": "' . $customerId . '", ['shopperReference'] => $customerId,
"recurringContract": "' . $recurringContract . '" ['recurringContract'] => $recurringContract
}'; ];
$request['SaleToPOIRequest']['PaymentRequest']['SaleData']['SaleToAcquirerData'] = base64_encode(json_encode($recurringDetails));
$request['SaleToPOIRequest']['PaymentRequest']['SaleData']['SaleToAcquirerData'] = base64_encode($jsonValue);
} }
} }
......
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