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 cc63d478 authored by rikterbeek's avatar rikterbeek

correct name private variable and paypal fix

parent 866863ba
...@@ -106,11 +106,10 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -106,11 +106,10 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
*/ */
protected $_adyenHelper; protected $_adyenHelper;
/** /**
* @var \Magento\Store\Model\StoreManagerInterface * @var \Magento\Store\Model\StoreManagerInterface
*/ */
protected $storeManager; protected $_storeManager;
/** /**
* @var \Magento\Framework\UrlInterface * @var \Magento\Framework\UrlInterface
...@@ -120,7 +119,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -120,7 +119,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
/** /**
* @var ResolverInterface * @var ResolverInterface
*/ */
protected $resolver; protected $_resolver;
/** /**
* @var \Adyen\Payment\Logger\AdyenLogger * @var \Adyen\Payment\Logger\AdyenLogger
...@@ -181,8 +180,8 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -181,8 +180,8 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$this->_paymentRequest = $paymentRequest; $this->_paymentRequest = $paymentRequest;
$this->_urlBuilder = $urlBuilder; $this->_urlBuilder = $urlBuilder;
$this->_adyenHelper = $adyenHelper; $this->_adyenHelper = $adyenHelper;
$this->storeManager = $storeManager; $this->_storeManager = $storeManager;
$this->resolver = $resolver; $this->_resolver = $resolver;
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
$this->_request = $request; $this->_request = $request;
} }
...@@ -336,7 +335,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -336,7 +335,7 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$browserInfo = $_SERVER['HTTP_USER_AGENT']; $browserInfo = $_SERVER['HTTP_USER_AGENT'];
$deliveryDays = $this->getConfigData('delivery_days'); $deliveryDays = $this->getConfigData('delivery_days');
$shopperLocale = trim($this->getConfigData('shopper_locale')); $shopperLocale = trim($this->getConfigData('shopper_locale'));
$shopperLocale = (!empty($shopperLocale)) ? $shopperLocale : $this->resolver->getLocale(); $shopperLocale = (!empty($shopperLocale)) ? $shopperLocale : $this->_resolver->getLocale();
$countryCode = trim($this->getConfigData('country_code')); $countryCode = trim($this->getConfigData('country_code'));
$countryCode = (!empty($countryCode)) ? $countryCode : false; $countryCode = (!empty($countryCode)) ? $countryCode : false;
...@@ -368,18 +367,25 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa ...@@ -368,18 +367,25 @@ class Hpp extends \Magento\Payment\Model\Method\AbstractMethod implements Gatewa
$formFields['shopperEmail'] = $shopperEmail; $formFields['shopperEmail'] = $shopperEmail;
// recurring // recurring
$recurringType = trim($this->_adyenHelper->getAdyenAbstractConfigData('recurring_type')); $recurringType = trim($this->_adyenHelper->getAdyenAbstractConfigData('recurring_type'));
$brandCode = $order->getPayment()->getAdditionalInformation("brand_code");
// Paypal does not allow ONECLICK,RECURRING only RECURRING
if ($brandCode == "paypal" && $recurringType == 'ONECLICK,RECURRING') {
$recurringType = "RECURRING";
}
$formFields['recurringContract'] = $recurringType; $formFields['recurringContract'] = $recurringType;
$formFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId; $formFields['shopperReference'] = (!empty($customerId)) ? $customerId : self::GUEST_ID . $realOrderId;
//blocked methods //blocked methods
$formFields['blockedMethods'] = ""; $formFields['blockedMethods'] = "";
$baseUrl = $this->storeManager->getStore($this->getStore()) $baseUrl = $this->_storeManager->getStore($this->getStore())
->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK); ->getBaseUrl(\Magento\Framework\UrlInterface::URL_TYPE_LINK);
$formFields['resURL'] = $baseUrl . 'adyen/process/result'; $formFields['resURL'] = $baseUrl . 'adyen/process/result';
$hmacKey = $this->_adyenHelper->getHmac(); $hmacKey = $this->_adyenHelper->getHmac();
$brandCode = $order->getPayment()->getAdditionalInformation("brand_code");
if ($brandCode) { if ($brandCode) {
$formFields['brandCode'] = $brandCode; $formFields['brandCode'] = $brandCode;
} }
......
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