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 d24d1bc6 authored by Pablo Giralt's avatar Pablo Giralt Committed by GitHub

add setting for payment origin (for pwa integrations) (#786)

* add setting for payment origin (for pwa integrations)

* Improve payment origin field tooltip
Co-authored-by: default avatarÁngel Campos <acampos1916@gmail.com>

* Add missing parameter to getOrigin

Missing parameter $storeId in Helper/Data getOrigin to add external payment origin
Co-authored-by: default avatarAttila Kiss <42297201+cyattilakiss@users.noreply.github.com>

* Add @param to getOrigin docs

* Fix typo in field comment
Co-authored-by: default avatarAlessio Zampatti <gigendh@gmail.com>

* Add $storeId parameter to getOrigin call
Co-authored-by: default avatarAttila Kiss <42297201+cyattilakiss@users.noreply.github.com>
Co-authored-by: default avatarÁngel Campos <acampos1916@gmail.com>
Co-authored-by: default avatarAlessio Zampatti <gigendh@gmail.com>
parent 2364cde1
......@@ -1541,10 +1541,14 @@ class Data extends AbstractHelper
}
/**
* @param null|int|string $storeId
* @return string
*/
public function getOrigin()
public function getOrigin($storeId)
{
if ( $paymentOriginUrl = $this->getAdyenAbstractConfigData("payment_origin_url", $storeId) ) {
return $paymentOriginUrl;
}
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$state = $objectManager->get(\Magento\Framework\App\State::class);
$baseUrl = $this->storeManager->getStore()->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_WEB);
......
......@@ -319,7 +319,7 @@ class Requests extends AbstractHelper
{
if ($this->adyenHelper->isCreditCardThreeDS2Enabled($storeId)) {
$request['additionalData']['allow3DS2'] = true;
$request['origin'] = $this->adyenHelper->getOrigin();
$request['origin'] = $this->adyenHelper->getOrigin($storeId);
$request['channel'] = 'web';
$request['browserInfo']['screenWidth'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_WIDTH];
$request['browserInfo']['screenHeight'] = $additionalData[AdyenCcDataAssignObserver::SCREEN_HEIGHT];
......@@ -334,7 +334,7 @@ class Requests extends AbstractHelper
}
} else {
$request['additionalData']['allow3DS2'] = false;
$request['origin'] = $this->adyenHelper->getOrigin();
$request['origin'] = $this->adyenHelper->getOrigin($storeId);
$request['channel'] = 'web';
}
......
......@@ -48,6 +48,7 @@
<include path="Adyen_Payment::system/adyen_boleto.xml"/>
<include path="Adyen_Payment::system/adyen_apple_pay.xml"/>
<include path="Adyen_Payment::system/adyen_google_pay.xml"/>
<include path="Adyen_Payment::system/adyen_pwa.xml"/>
</group>
</section>
</system>
......
<?xml version="1.0"?>
<!--
/**
* ######
* ######
* ############ ####( ###### #####. ###### ############ ############
* ############# #####( ###### #####. ###### ############# #############
* ###### #####( ###### #####. ###### ##### ###### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ##### ######
* ###### ###### #####( ###### #####. ###### ##### ##### ######
* ############# ############# ############# ############# ##### ######
* ############ ############ ############# ############ ##### ######
* ######
* #############
* ############
*
* Adyen Payment module (https://www.adyen.com/)
*
* Copyright (c) 2015 Adyen BV (https://www.adyen.com/)
* See LICENSE.txt for license details.
*
* Author: Adyen <magento@adyen.com>
*/
-->
<include xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module:Magento_Config:etc/system_include.xsd">
<group id="adyen_pwa" translate="label" type="text" sortOrder="95" showInDefault="1" showInWebsite="1" showInStore="1">
<label><![CDATA[Advanced: PWA]]></label>
<frontend_model>Magento\Config\Block\System\Config\Form\Fieldset</frontend_model>
<comment>
<![CDATA[
<p>
These settings are specific for PWA integrations
</p>
]]>
</comment>
<field id="payments_origin_url" translate="label" type="text" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Payment Origin URL</label>
<tooltip>Only relevant if you process payments from an external URL different to that of Magento</tooltip>
<config_path>payment/adyen_abstract/payment_origin_url</config_path>
</field>
</group>
</include>
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