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

Use 3DS2 toggle configuration fix (#604)

The 3DS2 toggle setting is ignored since version 5.0.0 because of a
major change. Add the check back in the Request buildThreeDS2Data()
parent 0efb78c7
...@@ -62,8 +62,9 @@ class ThreeDS2DataBuilder implements BuilderInterface ...@@ -62,8 +62,9 @@ class ThreeDS2DataBuilder implements BuilderInterface
/** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */ /** @var \Magento\Payment\Gateway\Data\PaymentDataObject $paymentDataObject */
$paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject); $paymentDataObject = \Magento\Payment\Gateway\Helper\SubjectReader::readPayment($buildSubject);
$payment = $paymentDataObject->getPayment(); $payment = $paymentDataObject->getPayment();
$order = $paymentDataObject->getOrder();
$additionalInformation = $payment->getAdditionalInformation(); $additionalInformation = $payment->getAdditionalInformation();
$request['body'] = $this->adyenRequestsHelper->buildThreeDS2Data([], $additionalInformation); $request['body'] = $this->adyenRequestsHelper->buildThreeDS2Data([], $additionalInformation, $order->getStoreId());
return $request; return $request;
} }
} }
...@@ -298,26 +298,33 @@ class Requests extends AbstractHelper ...@@ -298,26 +298,33 @@ class Requests extends AbstractHelper
/** /**
* @param array $request * @param array $request
* @param $payment * @param $additionalData
* @param $store * @param $storeId
* @return array * @return array
*/ */
public function buildThreeDS2Data($request = [], $additionalData) public function buildThreeDS2Data($request = [], $additionalData, $storeId)
{ {
$request['additionalData']['allow3DS2'] = true; if ($this->adyenHelper->isCreditCardThreeDS2Enabled($storeId)) {
$request['origin'] = $this->adyenHelper->getOrigin(); $request['additionalData']['allow3DS2'] = true;
$request['channel'] = 'web'; $request['origin'] = $this->adyenHelper->getOrigin();
$request['browserInfo']['screenWidth'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_WIDTH]; $request['channel'] = 'web';
$request['browserInfo']['screenHeight'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_HEIGHT]; $request['browserInfo']['screenWidth'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_WIDTH];
$request['browserInfo']['colorDepth'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_COLOR_DEPTH]; $request['browserInfo']['screenHeight'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_HEIGHT];
$request['browserInfo']['timeZoneOffset'] = $additionalData[AdyenCcDataAssignObserver::TIMEZONE_OFFSET]; $request['browserInfo']['colorDepth'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_COLOR_DEPTH];
$request['browserInfo']['language'] = $additionalData[AdyenCcDataAssignObserver::LANGUAGE]; $request['browserInfo']['timeZoneOffset'] = $additionalData[AdyenCcDataAssignObserver::TIMEZONE_OFFSET];
$request['browserInfo']['language'] = $additionalData[AdyenCcDataAssignObserver::LANGUAGE];
if ($javaEnabled = $additionalData[AdyenCcDataAssignObserver::JAVA_ENABLED]) {
$request['browserInfo']['javaEnabled'] = $javaEnabled; if ($javaEnabled = $additionalData[AdyenCcDataAssignObserver::JAVA_ENABLED]) {
$request['browserInfo']['javaEnabled'] = $javaEnabled;
} else {
$request['browserInfo']['javaEnabled'] = false;
}
} else { } else {
$request['browserInfo']['javaEnabled'] = false; $request['additionalData']['allow3DS2'] = false;
$request['origin'] = $this->adyenHelper->getOrigin();
$request['channel'] = 'web';
} }
return $request; return $request;
} }
......
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