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 4a4f0e48 authored by Rik ter Beek's avatar Rik ter Beek

fix for klarna_account

parent 80266bd7
...@@ -464,7 +464,7 @@ class Data extends AbstractHelper ...@@ -464,7 +464,7 @@ class Data extends AbstractHelper
{ {
return $this->getConfigData($field, 'adyen_apple_pay', $storeId); return $this->getConfigData($field, 'adyen_apple_pay', $storeId);
} }
/** /**
* @param null $storeId * @param null $storeId
* @return mixed * @return mixed
...@@ -849,13 +849,13 @@ class Data extends AbstractHelper ...@@ -849,13 +849,13 @@ class Data extends AbstractHelper
{ {
if (strlen($paymentMethod) >= 9 && substr($paymentMethod, 0, 9) == 'afterpay_') { if (strlen($paymentMethod) >= 9 && substr($paymentMethod, 0, 9) == 'afterpay_') {
return true; return true;
} else { } elseif (strlen($paymentMethod) >= 6 && substr($paymentMethod, 0, 6) == 'klarna') {
if ($paymentMethod == 'klarna' || $paymentMethod == 'ratepay') { return true;
return true; } elseif (strlen($paymentMethod) >= 7 && substr($paymentMethod, 0, 7) == 'ratepay') {
} else { return true;
return false;
}
} }
return false;
} }
public function getRatePayId() public function getRatePayId()
......
...@@ -210,7 +210,8 @@ class Cron ...@@ -210,7 +210,8 @@ class Cron
\Adyen\Payment\Model\Order\PaymentFactory $adyenOrderPaymentFactory, \Adyen\Payment\Model\Order\PaymentFactory $adyenOrderPaymentFactory,
\Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory, \Adyen\Payment\Model\Resource\Order\Payment\CollectionFactory $adyenOrderPaymentCollectionFactory,
AreaList $areaList AreaList $areaList
) { )
{
$this->_scopeConfig = $scopeConfig; $this->_scopeConfig = $scopeConfig;
$this->_adyenLogger = $adyenLogger; $this->_adyenLogger = $adyenLogger;
$this->_notificationFactory = $notificationFactory; $this->_notificationFactory = $notificationFactory;
...@@ -235,7 +236,7 @@ class Cron ...@@ -235,7 +236,7 @@ class Cron
{ {
try { try {
$this->execute(); $this->execute();
} catch(\Exception $e) { } catch (\Exception $e) {
$this->_adyenLogger->addAdyenNotificationCronjob($e->getMessage() . "\n" . $e->getTraceAsString()); $this->_adyenLogger->addAdyenNotificationCronjob($e->getMessage() . "\n" . $e->getTraceAsString());
throw $e; throw $e;
} }
...@@ -536,11 +537,7 @@ class Cron ...@@ -536,11 +537,7 @@ class Cron
} }
// if payment method is klarna, ratepay or openinvoice/afterpay show the reservartion number // if payment method is klarna, ratepay or openinvoice/afterpay show the reservartion number
if (($this->_paymentMethod == "klarna" || $this->_paymentMethod == "afterpay_default" || if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod($this->_paymentMethod) && !empty($this->_klarnaReservationNumber)) {
$this->_paymentMethod == "openinvoice" || $this->_paymentMethod == "ratepay"
) && ($this->_klarnaReservationNumber != null &&
$this->_klarnaReservationNumber != "")
) {
$klarnaReservationNumberText = "<br /> reservationNumber: " . $this->_klarnaReservationNumber; $klarnaReservationNumberText = "<br /> reservationNumber: " . $this->_klarnaReservationNumber;
} else { } else {
$klarnaReservationNumberText = ""; $klarnaReservationNumberText = "";
...@@ -1298,6 +1295,11 @@ class Cron ...@@ -1298,6 +1295,11 @@ class Cron
$manualCaptureAllowed = null; $manualCaptureAllowed = null;
$paymentMethod = $this->_paymentMethod; $paymentMethod = $this->_paymentMethod;
// For all openinvoice methods manual capture is the default
if ($this->_adyenHelper->isPaymentMethodOpenInvoiceMethod($paymentMethod)) {
return true;
}
switch ($paymentMethod) { switch ($paymentMethod) {
case 'cup': case 'cup':
case 'cartebancaire': case 'cartebancaire':
...@@ -1314,17 +1316,10 @@ class Cron ...@@ -1314,17 +1316,10 @@ class Cron
case 'jcb': case 'jcb':
case 'laser': case 'laser':
case 'paypal': case 'paypal':
case 'klarna':
case 'afterpay_default':
case 'ratepay':
case 'sepadirectdebit': case 'sepadirectdebit':
$manualCaptureAllowed = true; $manualCaptureAllowed = true;
break; break;
default: default:
// To be sure check if it payment method starts with afterpay_ then manualCapture is allowed
if (strlen($this->_paymentMethod) >= 9 && substr($this->_paymentMethod, 0, 9) == "afterpay_") {
$manualCaptureAllowed = true;
}
$manualCaptureAllowed = false; $manualCaptureAllowed = false;
} }
......
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