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

#27 fix capture mode set to manual is now triggered again

parent 64aacc5e
...@@ -167,7 +167,7 @@ class Cron ...@@ -167,7 +167,7 @@ class Cron
$dateStart = new \DateTime(); $dateStart = new \DateTime();
$dateStart->modify('-1 day'); $dateStart->modify('-1 day');
$dateEnd = new \DateTime(); $dateEnd = new \DateTime();
$dateEnd->modify('-0 minute'); $dateEnd->modify('-2 minute');
$dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true]; $dateRange = ['from' => $dateStart, 'to' => $dateEnd, 'datetime' => true];
// create collection // create collection
...@@ -880,38 +880,48 @@ class Cron ...@@ -880,38 +880,48 @@ class Cron
$captureModePayPal = trim($this->_getConfigData('paypal_capture_mode', 'adyen_abstract', $this->_order->getStoreId())); $captureModePayPal = trim($this->_getConfigData('paypal_capture_mode', 'adyen_abstract', $this->_order->getStoreId()));
// if you are using authcap the payment method is manual. There will be a capture send to indicate if payment is succesfull // if you are using authcap the payment method is manual. There will be a capture send to indicate if payment is succesfull
if(($_paymentCode == "adyen_sepa" || $this->_paymentMethod = "sepadirectdebit") && $sepaFlow == "authcap") { if(($_paymentCode == "adyen_sepa" || $this->_paymentMethod == "sepadirectdebit") && $sepaFlow == "authcap") {
$this->_adyenLogger->addAdyenNotificationCronjob('Manual Capture is applied for sepa because it is in authcap flow');
return false; return false;
} }
// payment method ideal, cash adyen_boleto or adyen_pos has direct capture // payment method ideal, cash adyen_boleto or adyen_pos has direct capture
if ($_paymentCode == "adyen_pos" || (($_paymentCode == "adyen_sepa" || $this->_paymentMethod = "sepadirectdebit") && $sepaFlow != "authcap")) { if ($_paymentCode == "adyen_pos" || (($_paymentCode == "adyen_sepa" || $this->_paymentMethod == "sepadirectdebit") && $sepaFlow != "authcap")) {
$this->_adyenLogger->addAdyenNotificationCronjob('This payment method does not allow manual capture.(2) paymentCode:' . $_paymentCode . ' paymentMethod:' . $this->_paymentMethod);
return true; return true;
} }
// if auto capture mode for openinvoice is turned on then use auto capture // if auto capture mode for openinvoice is turned on then use auto capture
if ($captureModeOpenInvoice == true && (strcmp($this->_paymentMethod, 'openinvoice') === 0 || strcmp($this->_paymentMethod, 'afterpay_default') === 0 || strcmp($this->_paymentMethod, 'klarna') === 0)) { if ($captureModeOpenInvoice == true && (strcmp($this->_paymentMethod, 'openinvoice') === 0 || strcmp($this->_paymentMethod, 'afterpay_default') === 0 || strcmp($this->_paymentMethod, 'klarna') === 0)) {
$this->_adyenLogger->addAdyenNotificationCronjob('This payment method is configured to be working as auto capture ');
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 && $captureModePayPal != "") {
if(strcmp($captureModePayPal, 'auto') === 0 ) { if(strcmp($captureModePayPal, 'auto') === 0 ) {
$this->_adyenLogger->addAdyenNotificationCronjob('This payment method is paypal and configured to work as auto capture');
return true; return true;
} elseif(strcmp($captureModePayPal, 'manual') === 0 ) { } elseif(strcmp($captureModePayPal, 'manual') === 0 ) {
$this->_adyenLogger->addAdyenNotificationCronjob('This payment method is paypal and configured to work as manual capture');
return false; return false;
} }
} }
if (strcmp($captureMode, 'manual') === 0) { if (strcmp($captureMode, 'manual') === 0) {
$this->_adyenLogger->addAdyenNotificationCronjob('Capture mode for this payment is set to manual');
return false; return false;
} }
//online capture after delivery, use Magento backend to online invoice (if the option auto capture mode for openinvoice is not set) //online capture after delivery, use Magento backend to online invoice (if the option auto capture mode for openinvoice is not set)
if (strcmp($this->_paymentMethod, 'openinvoice') === 0 || strcmp($this->_paymentMethod, 'afterpay_default') === 0 || strcmp($this->_paymentMethod, 'klarna') === 0) { if (strcmp($this->_paymentMethod, 'openinvoice') === 0 || strcmp($this->_paymentMethod, 'afterpay_default') === 0 || strcmp($this->_paymentMethod, 'klarna') === 0) {
$this->_adyenLogger->addAdyenNotificationCronjob('Capture mode for klarna is by default set to manual');
return false; return false;
} }
$this->_adyenLogger->addAdyenNotificationCronjob('Capture mode is set to auto capture');
return true; return true;
} else { } else {
// does not allow manual capture so is always immediate capture // does not allow manual capture so is always immediate capture
$this->_adyenLogger->addAdyenNotificationCronjob('This payment method does not allow manual capture');
return true; return true;
} }
......
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