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 bc1ed8e4 authored by attilak's avatar attilak

fixes based on code review

parent ae4a6d04
...@@ -65,8 +65,7 @@ class CheckoutPaymentsDetailsHandler implements HandlerInterface ...@@ -65,8 +65,7 @@ class CheckoutPaymentsDetailsHandler implements HandlerInterface
$payment->setTransactionId($response['pspReference']); $payment->setTransactionId($response['pspReference']);
} }
if (!empty($response['additionalData']) && if (!empty($response['additionalData']['recurring.recurringDetailReference'])
!empty($response['additionalData']['recurring.recurringDetailReference'])
) { ) {
$order = $payment->getOrder(); $order = $payment->getOrder();
......
...@@ -74,8 +74,7 @@ class PaymentPosCloudHandler implements HandlerInterface ...@@ -74,8 +74,7 @@ class PaymentPosCloudHandler implements HandlerInterface
// do not send order confirmation mail // do not send order confirmation mail
$payment->getOrder()->setCanSendNewEmailFlag(false); $payment->getOrder()->setCanSendNewEmailFlag(false);
if (!empty($paymentResponse['Response']) && if (!empty($paymentResponse['Response']['AdditionalResponse'])
!empty($paymentResponse['Response']['AdditionalResponse'])
) { ) {
$pairs = explode('&', $paymentResponse['Response']['AdditionalResponse']); $pairs = explode('&', $paymentResponse['Response']['AdditionalResponse']);
......
...@@ -61,7 +61,7 @@ class CheckoutResponseValidator extends AbstractValidator ...@@ -61,7 +61,7 @@ class CheckoutResponseValidator extends AbstractValidator
$errorMessages = []; $errorMessages = [];
// validate result // validate result
if ($response && isset($response['resultCode'])) { if (isset($response['resultCode'])) {
switch ($response['resultCode']) { switch ($response['resultCode']) {
case "Authorised": case "Authorised":
$payment->setAdditionalInformation('pspReference', $response['pspReference']); $payment->setAdditionalInformation('pspReference', $response['pspReference']);
...@@ -97,15 +97,15 @@ class CheckoutResponseValidator extends AbstractValidator ...@@ -97,15 +97,15 @@ class CheckoutResponseValidator extends AbstractValidator
case "RedirectShopper": case "RedirectShopper":
$payment->setAdditionalInformation('3dActive', true); $payment->setAdditionalInformation('3dActive', true);
if (!empty($paReq = $response['redirect']['data']['PaReq']) && if (!empty($response['redirect']['data']['PaReq']) &&
!empty($md = $response['redirect']['data']['MD']) && !empty($response['redirect']['data']['MD']) &&
!empty($issuerUrl = $response['redirect']['url']) && !empty($response['redirect']['url']) &&
!empty($paymentData = $response['paymentData']) !empty($response['paymentData'])
) { ) {
$payment->setAdditionalInformation('issuerUrl', $issuerUrl); $payment->setAdditionalInformation('issuerUrl', $response['redirect']['url']);
$payment->setAdditionalInformation('paRequest', $paReq); $payment->setAdditionalInformation('paRequest', $response['redirect']['data']['PaReq']);
$payment->setAdditionalInformation('md', $md); $payment->setAdditionalInformation('md', $response['redirect']['data']['MD']);
$payment->setAdditionalInformation('paymentData', $paymentData); $payment->setAdditionalInformation('paymentData', $response['paymentData']);
} else { } else {
$isValid = false; $isValid = false;
$errorMsg = __('3D secure is not valid.'); $errorMsg = __('3D secure is not valid.');
......
...@@ -1383,10 +1383,12 @@ class Data extends AbstractHelper ...@@ -1383,10 +1383,12 @@ class Data extends AbstractHelper
$client = $this->initializeAdyenClient($storeId); $client = $this->initializeAdyenClient($storeId);
$service = $this->createAdyenCheckoutUtilityService($client); $service = $this->createAdyenCheckoutUtilityService($client);
$respone = $service->originKeys($params); $response = $service->originKeys($params);
if (empty($originKey = $respone['originKeys'][$url])) { $originKey = "";
$originKey = "";
if (!empty($response['originKeys'][$url])) {
$originKey = $response['originKeys'][$url];
} }
return $originKey; return $originKey;
...@@ -1428,6 +1430,10 @@ class Data extends AbstractHelper ...@@ -1428,6 +1430,10 @@ class Data extends AbstractHelper
return self::CHECKOUT_COMPONENT_JS_LIVE; return self::CHECKOUT_COMPONENT_JS_LIVE;
} }
/**
* @param $order
* @param $additionalData
*/
public function createAdyenBillingAgreement($order, $additionalData) public function createAdyenBillingAgreement($order, $additionalData)
{ {
if (!empty($additionalData['recurring.recurringDetailReference'])) { if (!empty($additionalData['recurring.recurringDetailReference'])) {
......
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