Commit ec1ef2c8 authored by attilak's avatar attilak

Add applicationInformation info for the Client constructor so we can

send it with every request
parent 2dce8d69
......@@ -69,6 +69,11 @@ class TransactionAuthorization implements ClientInterface
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
$client->setAdyenPaymentSource($this->_adyenHelper->getModuleName(), $this->_adyenHelper->getModuleVersion());
$productMetadata = new \Magento\Framework\App\ProductMetadata();
$client->setExternalPlatform($productMetadata->getName(), $productMetadata->getVersion());
if ($this->_adyenHelper->isDemoMode()) {
$client->setEnvironment(\Adyen\Environment::TEST);
} else {
......
......@@ -64,6 +64,11 @@ class TransactionCancel implements ClientInterface
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
$client->setAdyenPaymentSource($this->_adyenHelper->getModuleName(), $this->_adyenHelper->getModuleVersion());
$productMetadata = new \Magento\Framework\App\ProductMetadata();
$client->setExternalPlatform($productMetadata->getName(), $productMetadata->getVersion());
if ($this->_adyenHelper->isDemoMode()) {
$client->setEnvironment(\Adyen\Environment::TEST);
} else {
......
......@@ -64,6 +64,11 @@ class TransactionCapture implements ClientInterface
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
$client->setAdyenPaymentSource($this->_adyenHelper->getModuleName(), $this->_adyenHelper->getModuleVersion());
$productMetadata = new \Magento\Framework\App\ProductMetadata();
$client->setExternalPlatform($productMetadata->getName(), $productMetadata->getVersion());
if ($this->_adyenHelper->isDemoMode()) {
$client->setEnvironment(\Adyen\Environment::TEST);
} else {
......
......@@ -64,6 +64,11 @@ class TransactionRefund implements ClientInterface
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
$client->setAdyenPaymentSource($this->_adyenHelper->getModuleName(), $this->_adyenHelper->getModuleVersion());
$productMetadata = new \Magento\Framework\App\ProductMetadata();
$client->setExternalPlatform($productMetadata->getName(), $productMetadata->getVersion());
if ($this->_adyenHelper->isDemoMode()) {
$client->setEnvironment(\Adyen\Environment::TEST);
} else {
......
......@@ -30,7 +30,7 @@ use Magento\Framework\App\Helper\AbstractHelper;
*/
class Data extends AbstractHelper
{
const MODULE_NAME = 'adyen-magento2';
const TEST = 'test';
const LIVE = 'live';
......@@ -729,6 +729,21 @@ class Data extends AbstractHelper
return $sepaCountries;
}
/**
* Get adyen magento module's name sent to Adyen
*
* @return string
*/
public function getModuleName()
{
return (string)self::MODULE_NAME;
}
/**
* Get adyen magento module's version
*
* @return string
*/
public function getModuleVersion()
{
return (string)$this->_moduleList->getOne("Adyen_Payment")['setup_version'];
......
......@@ -88,6 +88,11 @@ class PaymentRequest extends DataObject
$client->setUsername($webserviceUsername);
$client->setPassword($webservicePassword);
$client->setAdyenPaymentSource($this->_adyenHelper->getModuleName(), $this->_adyenHelper->getModuleVersion());
$productMetadata = new \Magento\Framework\App\ProductMetadata();
$client->setExternalPlatform($productMetadata->getName(), $productMetadata->getVersion());
if ($this->_adyenHelper->isDemoMode($storeId)) {
$client->setEnvironment(\Adyen\Environment::TEST);
} else {
......
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