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 48fbfd7a authored by Bas Maassen's avatar Bas Maassen Committed by GitHub

Fix PayPal capture mode (#239)

* Fix PayPal capture mode

* Changed variable name to manualCapturePayPal
parent 66988071
...@@ -1208,7 +1208,7 @@ class Cron ...@@ -1208,7 +1208,7 @@ class Cron
$captureModeOpenInvoice = $this->_getConfigData( $captureModeOpenInvoice = $this->_getConfigData(
'auto_capture_openinvoice', 'adyen_abstract', $this->_order->getStoreId() 'auto_capture_openinvoice', 'adyen_abstract', $this->_order->getStoreId()
); );
$captureModePayPal = trim($this->_getConfigData( $manualCapturePayPal = trim($this->_getConfigData(
'paypal_capture_mode', 'adyen_abstract', $this->_order->getStoreId()) 'paypal_capture_mode', 'adyen_abstract', $this->_order->getStoreId())
); );
...@@ -1245,18 +1245,19 @@ class Cron ...@@ -1245,18 +1245,19 @@ class Cron
); );
return true; return true;
} }
// if PayPal capture modues is different from the default use this one // if PayPal capture modues is different from the default use this one
if (strcmp($this->_paymentMethod, 'paypal') === 0 && $captureModePayPal != "") { if (strcmp($this->_paymentMethod, 'paypal') === 0) {
if (strcmp($captureModePayPal, 'auto') === 0) { if ($manualCapturePayPal) {
$this->_adyenLogger->addAdyenNotificationCronjob(
'This payment method is paypal and configured to work as auto capture'
);
return true;
} elseif (strcmp($captureModePayPal, 'manual') === 0) {
$this->_adyenLogger->addAdyenNotificationCronjob( $this->_adyenLogger->addAdyenNotificationCronjob(
'This payment method is paypal and configured to work as manual capture' 'This payment method is paypal and configured to work as manual capture'
); );
return false; return false;
} else {
$this->_adyenLogger->addAdyenNotificationCronjob(
'This payment method is paypal and configured to work as auto capture'
);
return true;
} }
} }
if (strcmp($captureMode, 'manual') === 0) { if (strcmp($captureMode, 'manual') === 0) {
...@@ -1604,4 +1605,6 @@ class Cron ...@@ -1604,4 +1605,6 @@ class Cron
$path = 'payment/' . $paymentMethodCode . '/' . $field; $path = 'payment/' . $paymentMethodCode . '/' . $field;
return $this->_scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId); return $this->_scopeConfig->getValue($path, \Magento\Store\Model\ScopeInterface::SCOPE_STORE, $storeId);
} }
} }
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