From 6ac4110048c4b98f1a813c2bc3ff2f7ffa2c20c4 Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Thu, 25 Apr 2024 09:00:35 +0200
Subject: [PATCH 1/7] PLUG-3379 - Add chargeback functionality
---
Controller/Checkout/Exchange.php | 14 ++++++++++++++
Model/Config.php | 8 ++++++++
Model/PayPayment.php | 19 +++++++++++++++++++
etc/adminhtml/system.xml | 8 ++++++++
4 files changed, 49 insertions(+)
diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php
index 0692f725..9a156125 100755
--- a/Controller/Checkout/Exchange.php
+++ b/Controller/Checkout/Exchange.php
@@ -182,6 +182,20 @@ public function execute()
}
}
+ if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
+ if ($this->config->chargebackFromPay() && $order->getTotalDue() == 0) {
+ if ($order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
+ return $this->result->setContents('TRUE|Order total already 0');
+ }
+ try {
+ $response = $this->payPayment->chargebackOrder($orderEntityId);
+ } catch (Exception $e) {
+ $response = $e->getMessage();
+ }
+ return $this->result->setContents($response === true ? 'TRUE|ChargeBack success' : 'FALSE|' . $response);
+ }
+ }
+
if ($order->getTotalDue() <= 0) {
$this->payHelper->logDebug($action . '. Ignoring - already paid: ' . $orderEntityId);
if (!$this->config->registerPartialPayments()) {
diff --git a/Model/Config.php b/Model/Config.php
index 0d007f20..27953239 100755
--- a/Model/Config.php
+++ b/Model/Config.php
@@ -571,6 +571,14 @@ public function refundFromPay()
return $this->store->getConfig('payment/paynl/allow_refund_from_pay');
}
+ /**
+ * @return string|null
+ */
+ public function chargebackFromPay()
+ {
+ return $this->store->getConfig('payment/paynl/allow_chargeback_from_pay');
+ }
+
/**
* @param string $paymentProfileId
* @return mixed|void
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index 574e01c6..9df6c526 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -191,6 +191,25 @@ public function uncancelOrder(Order $order)
$this->updateCouponUsages->execute($order, true);
}
$this->eventManager->dispatch('order_uncancel_after', ['order' => $order]);
+ }
+
+ /**
+ * @param integer $orderEntityId
+ * @return true
+ * @throws \Exception
+ */
+ public function chargebackOrder($orderEntityId)
+ {
+ try {
+ $order = $this->orderRepository->get($orderEntityId);
+ $creditmemo = $this->cmFac->createByOrder($order);
+ $this->cmService->refund($creditmemo);
+
+ $order->addStatusHistoryComment(__('PAY. - Chargeback initiated by customer'))->save();
+ } catch (\Exception $e) {
+ throw new \Exception('Could not chargeback');
+ }
+ return true;
}
/**
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index 1d0aa67b..f3e0bffe 100755
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -139,6 +139,14 @@ On - via Sherpa - Capture automatically via Sherpa.
Paynl\Payment\Model\Config\Source\OffOnpayment/paynl/allow_refund_from_pay
+
+
+
+
+
+ Paynl\Payment\Model\Config\Source\OffOn
+ payment/paynl/allow_chargeback_from_pay
+
From 5b09b01ff910416b4ea06e2c0fab5197f538de48 Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Thu, 25 Apr 2024 09:04:35 +0200
Subject: [PATCH 2/7] Code Polish
---
Model/PayPayment.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index 9df6c526..b95a52a2 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -191,7 +191,7 @@ public function uncancelOrder(Order $order)
$this->updateCouponUsages->execute($order, true);
}
$this->eventManager->dispatch('order_uncancel_after', ['order' => $order]);
- }
+ }
/**
* @param integer $orderEntityId
From 3d6b1fc2b73fffaf54de381f91d492ba878a2c92 Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Mon, 29 Apr 2024 14:08:42 +0200
Subject: [PATCH 3/7] Code Polish
---
Controller/Checkout/Exchange.php | 15 +++------------
Model/Config.php | 2 +-
Model/PayPayment.php | 9 ++++++---
3 files changed, 10 insertions(+), 16 deletions(-)
diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php
index 9a156125..8f4656c2 100755
--- a/Controller/Checkout/Exchange.php
+++ b/Controller/Checkout/Exchange.php
@@ -182,18 +182,9 @@ public function execute()
}
}
- if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
- if ($this->config->chargebackFromPay() && $order->getTotalDue() == 0) {
- if ($order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
- return $this->result->setContents('TRUE|Order total already 0');
- }
- try {
- $response = $this->payPayment->chargebackOrder($orderEntityId);
- } catch (Exception $e) {
- $response = $e->getMessage();
- }
- return $this->result->setContents($response === true ? 'TRUE|ChargeBack success' : 'FALSE|' . $response);
- }
+ if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
+ $response = $this->payPayment->chargebackOrder($orderEntityId);
+ return $this->result->setContents($response);
}
if ($order->getTotalDue() <= 0) {
diff --git a/Model/Config.php b/Model/Config.php
index 27953239..92ea6fa1 100755
--- a/Model/Config.php
+++ b/Model/Config.php
@@ -574,7 +574,7 @@ public function refundFromPay()
/**
* @return string|null
*/
- public function chargebackFromPay()
+ public function chargebackFromPayEnabled()
{
return $this->store->getConfig('payment/paynl/allow_chargeback_from_pay');
}
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index b95a52a2..fd127396 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -202,14 +202,17 @@ public function chargebackOrder($orderEntityId)
{
try {
$order = $this->orderRepository->get($orderEntityId);
+ if (!$this->config->chargebackFromPayEnabled() || $order->getTotalDue() != 0 || $order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
+ return 'TRUE|Ignoring chargeback';
+ }
$creditmemo = $this->cmFac->createByOrder($order);
$this->cmService->refund($creditmemo);
-
$order->addStatusHistoryComment(__('PAY. - Chargeback initiated by customer'))->save();
} catch (\Exception $e) {
- throw new \Exception('Could not chargeback');
+ $this->payHelper->logDebug('Chargeback failed:', ['error' => $e->getMessage(), 'orderEntityId' => $orderEntityId]);
+ return 'FALSE|Could not chargeback';
}
- return true;
+ return 'TRUE|ChargeBack success';
}
/**
From e0991872c357ccbe8346ec12c3addad50d50884f Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Mon, 29 Apr 2024 14:11:17 +0200
Subject: [PATCH 4/7] Code Polish
---
Model/PayPayment.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index fd127396..d4148f80 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -204,7 +204,7 @@ public function chargebackOrder($orderEntityId)
$order = $this->orderRepository->get($orderEntityId);
if (!$this->config->chargebackFromPayEnabled() || $order->getTotalDue() != 0 || $order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
return 'TRUE|Ignoring chargeback';
- }
+ }
$creditmemo = $this->cmFac->createByOrder($order);
$this->cmService->refund($creditmemo);
$order->addStatusHistoryComment(__('PAY. - Chargeback initiated by customer'))->save();
From 27c4d64c7a287841fd58ebc20e68ab7b64d60da3 Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Mon, 29 Apr 2024 14:13:57 +0200
Subject: [PATCH 5/7] Code Polish
---
Controller/Checkout/Exchange.php | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php
index 8f4656c2..4b81d520 100755
--- a/Controller/Checkout/Exchange.php
+++ b/Controller/Checkout/Exchange.php
@@ -182,8 +182,8 @@ public function execute()
}
}
- if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
- $response = $this->payPayment->chargebackOrder($orderEntityId);
+ if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
+ $response = $this->payPayment->chargebackOrder($orderEntityId);
return $this->result->setContents($response);
}
From aaed35c645f489f9aa96331afc50f2151cf7214c Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Tue, 30 Apr 2024 16:06:05 +0200
Subject: [PATCH 6/7] Translations and Improvements
---
Controller/Checkout/Exchange.php | 8 ++++++--
Model/PayPayment.php | 14 +++++++-------
etc/adminhtml/system.xml | 3 ++-
i18n/de_AT.csv | 3 ++-
i18n/de_CH.csv | 5 ++++-
i18n/de_DE.csv | 5 ++++-
i18n/de_LU.csv | 5 ++++-
i18n/en_US.csv | 5 ++++-
i18n/fr_BE.csv | 5 ++++-
i18n/fr_CA.csv | 5 ++++-
i18n/fr_CH.csv | 5 ++++-
i18n/fr_FR.csv | 5 ++++-
i18n/fr_LU.csv | 5 ++++-
i18n/nl_BE.csv | 5 ++++-
i18n/nl_NL.csv | 5 ++++-
15 files changed, 61 insertions(+), 22 deletions(-)
diff --git a/Controller/Checkout/Exchange.php b/Controller/Checkout/Exchange.php
index 4b81d520..ce46a481 100755
--- a/Controller/Checkout/Exchange.php
+++ b/Controller/Checkout/Exchange.php
@@ -183,8 +183,12 @@ public function execute()
}
if ($transaction->isChargeBack() && substr($action, 0, 10) == 'chargeback') {
- $response = $this->payPayment->chargebackOrder($orderEntityId);
- return $this->result->setContents($response);
+ try {
+ $response = $this->payPayment->chargebackOrder($orderEntityId);
+ } catch (Exception $e) {
+ $response = $e->getMessage();
+ }
+ return $this->result->setContents($response === true ? 'TRUE|Chargeback success' : 'FALSE|' . $response);
}
if ($order->getTotalDue() <= 0) {
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index d4148f80..3ed462a7 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -200,19 +200,19 @@ public function uncancelOrder(Order $order)
*/
public function chargebackOrder($orderEntityId)
{
- try {
- $order = $this->orderRepository->get($orderEntityId);
- if (!$this->config->chargebackFromPayEnabled() || $order->getTotalDue() != 0 || $order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
- return 'TRUE|Ignoring chargeback';
- }
+ $order = $this->orderRepository->get($orderEntityId);
+ if (!$this->config->chargebackFromPayEnabled() || $order->getTotalDue() != 0 || $order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
+ throw new \Exception("Ignoring chargeback");
+ }
+ try {
$creditmemo = $this->cmFac->createByOrder($order);
$this->cmService->refund($creditmemo);
$order->addStatusHistoryComment(__('PAY. - Chargeback initiated by customer'))->save();
} catch (\Exception $e) {
$this->payHelper->logDebug('Chargeback failed:', ['error' => $e->getMessage(), 'orderEntityId' => $orderEntityId]);
- return 'FALSE|Could not chargeback';
+ throw new \Exception('Could not chargeback');
}
- return 'TRUE|ChargeBack success';
+ return true;
}
/**
diff --git a/etc/adminhtml/system.xml b/etc/adminhtml/system.xml
index f3e0bffe..445b5b87 100755
--- a/etc/adminhtml/system.xml
+++ b/etc/adminhtml/system.xml
@@ -140,10 +140,11 @@ On - via Sherpa - Capture automatically via Sherpa.
payment/paynl/allow_refund_from_pay
-
+
+ When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.Paynl\Payment\Model\Config\Source\OffOnpayment/paynl/allow_chargeback_from_pay
diff --git a/i18n/de_AT.csv b/i18n/de_AT.csv
index 42854bdd..3310e75a 100644
--- a/i18n/de_AT.csv
+++ b/i18n/de_AT.csv
@@ -174,4 +174,5 @@ On - via Sherpa - Capture automatically via Sherpa.","Aus – Keine automatische
Ein – Zahlungen mit dem Status AUTORISIEREN automatisch erfassen, wenn eine Sendung in Magento erstellt wird (Picqer wird dabei auch unterstützt).
Ein – über Wuunder – Automatische Erfassung über Wuunder.
Ein – über Sherpa – Automatische Erfassung über Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.",""
\ No newline at end of file
diff --git a/i18n/de_CH.csv b/i18n/de_CH.csv
index 556de4e4..0cf37203 100644
--- a/i18n/de_CH.csv
+++ b/i18n/de_CH.csv
@@ -174,4 +174,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Aus – Keine automatische
Ein – Zahlungen mit dem Status AUTORISIEREN automatisch erfassen, wenn eine Sendung in Magento erstellt wird (Picqer wird dabei auch unterstützt).
Ein – über Wuunder – Automatische Erfassung über Wuunder.
Ein – über Sherpa – Automatische Erfassung über Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
+"Chargebacks","Rückbuchungen"
+"Set to `on` to accept chargebacks initiated from Pay.","Setzen Sie diese Option auf "Ein", um von Pay initiierte Rückbuchungen zu akzeptieren."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Wenn diese Einstellung aktiviert ist, werden Rückbuchungen, die von Kunden initiiert wurden, in Magento erstattet."
\ No newline at end of file
diff --git a/i18n/de_DE.csv b/i18n/de_DE.csv
index 556de4e4..0cf37203 100644
--- a/i18n/de_DE.csv
+++ b/i18n/de_DE.csv
@@ -174,4 +174,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Aus – Keine automatische
Ein – Zahlungen mit dem Status AUTORISIEREN automatisch erfassen, wenn eine Sendung in Magento erstellt wird (Picqer wird dabei auch unterstützt).
Ein – über Wuunder – Automatische Erfassung über Wuunder.
Ein – über Sherpa – Automatische Erfassung über Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
+"Chargebacks","Rückbuchungen"
+"Set to `on` to accept chargebacks initiated from Pay.","Setzen Sie diese Option auf "Ein", um von Pay initiierte Rückbuchungen zu akzeptieren."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Wenn diese Einstellung aktiviert ist, werden Rückbuchungen, die von Kunden initiiert wurden, in Magento erstattet."
\ No newline at end of file
diff --git a/i18n/de_LU.csv b/i18n/de_LU.csv
index 556de4e4..0cf37203 100644
--- a/i18n/de_LU.csv
+++ b/i18n/de_LU.csv
@@ -174,4 +174,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Aus – Keine automatische
Ein – Zahlungen mit dem Status AUTORISIEREN automatisch erfassen, wenn eine Sendung in Magento erstellt wird (Picqer wird dabei auch unterstützt).
Ein – über Wuunder – Automatische Erfassung über Wuunder.
Ein – über Sherpa – Automatische Erfassung über Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wenn die Shopwährung von der Basiswährungseinstellung in Magento abweicht, sorgt diese Einstellung dafür, dass die Zahlung in der Basiswährung und nicht in der Shopwährung beginnt."
+"Chargebacks","Rückbuchungen"
+"Set to `on` to accept chargebacks initiated from Pay.","Setzen Sie diese Option auf "Ein", um von Pay initiierte Rückbuchungen zu akzeptieren."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Wenn diese Einstellung aktiviert ist, werden Rückbuchungen, die von Kunden initiiert wurden, in Magento erstattet."
\ No newline at end of file
diff --git a/i18n/en_US.csv b/i18n/en_US.csv
index 3b952cc9..24949409 100644
--- a/i18n/en_US.csv
+++ b/i18n/en_US.csv
@@ -225,4 +225,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Off - No autocapture.
On - Automatically capture payments with the status AUTHORIZE when a shipment is created in Magento (Picqer is also supported in this).
On - via Wuunder - Capture automatically via Wuunder.
On - via Sherpa - Capture automatically via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency."
+"Chargebacks","Chargebacks"
+"Set to `on` to accept chargebacks initiated from Pay.","Set to `on` to accept chargebacks initiated from Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","When this settings is enabled, chargebacks initiated by customers will refund the order in Magento."
\ No newline at end of file
diff --git a/i18n/fr_BE.csv b/i18n/fr_BE.csv
index 22e7771c..3e3b0c04 100644
--- a/i18n/fr_BE.csv
+++ b/i18n/fr_BE.csv
@@ -173,4 +173,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Désactivé - Pas de captu
Activé - Capturer automatiquement les paiements avec le statut AUTORISER lorsqu'un envoi est créé dans Magento (Picqer est également pris en charge dans ce domaine).
Activé - via Wuunder - Capture automatique via Wuunder.
Activé - via Sherpa - Capture automatique via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
+"Chargebacks","Refacturation"
+"Set to `on` to accept chargebacks initiated from Pay.","Réglez ce paramètre sur "on" pour accepter les rétrofacturations initiées par Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Lorsque ce paramètre est activé, les rétrocessions initiées par les clients rembourseront la commande dans Magento."
\ No newline at end of file
diff --git a/i18n/fr_CA.csv b/i18n/fr_CA.csv
index 22e7771c..3e3b0c04 100644
--- a/i18n/fr_CA.csv
+++ b/i18n/fr_CA.csv
@@ -173,4 +173,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Désactivé - Pas de captu
Activé - Capturer automatiquement les paiements avec le statut AUTORISER lorsqu'un envoi est créé dans Magento (Picqer est également pris en charge dans ce domaine).
Activé - via Wuunder - Capture automatique via Wuunder.
Activé - via Sherpa - Capture automatique via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
+"Chargebacks","Refacturation"
+"Set to `on` to accept chargebacks initiated from Pay.","Réglez ce paramètre sur "on" pour accepter les rétrofacturations initiées par Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Lorsque ce paramètre est activé, les rétrocessions initiées par les clients rembourseront la commande dans Magento."
\ No newline at end of file
diff --git a/i18n/fr_CH.csv b/i18n/fr_CH.csv
index 22e7771c..3e3b0c04 100644
--- a/i18n/fr_CH.csv
+++ b/i18n/fr_CH.csv
@@ -173,4 +173,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Désactivé - Pas de captu
Activé - Capturer automatiquement les paiements avec le statut AUTORISER lorsqu'un envoi est créé dans Magento (Picqer est également pris en charge dans ce domaine).
Activé - via Wuunder - Capture automatique via Wuunder.
Activé - via Sherpa - Capture automatique via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
+"Chargebacks","Refacturation"
+"Set to `on` to accept chargebacks initiated from Pay.","Réglez ce paramètre sur "on" pour accepter les rétrofacturations initiées par Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Lorsque ce paramètre est activé, les rétrocessions initiées par les clients rembourseront la commande dans Magento."
\ No newline at end of file
diff --git a/i18n/fr_FR.csv b/i18n/fr_FR.csv
index 22e7771c..3e3b0c04 100644
--- a/i18n/fr_FR.csv
+++ b/i18n/fr_FR.csv
@@ -173,4 +173,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Désactivé - Pas de captu
Activé - Capturer automatiquement les paiements avec le statut AUTORISER lorsqu'un envoi est créé dans Magento (Picqer est également pris en charge dans ce domaine).
Activé - via Wuunder - Capture automatique via Wuunder.
Activé - via Sherpa - Capture automatique via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
+"Chargebacks","Refacturation"
+"Set to `on` to accept chargebacks initiated from Pay.","Réglez ce paramètre sur "on" pour accepter les rétrofacturations initiées par Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Lorsque ce paramètre est activé, les rétrocessions initiées par les clients rembourseront la commande dans Magento."
\ No newline at end of file
diff --git a/i18n/fr_LU.csv b/i18n/fr_LU.csv
index 22e7771c..3e3b0c04 100644
--- a/i18n/fr_LU.csv
+++ b/i18n/fr_LU.csv
@@ -173,4 +173,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Désactivé - Pas de captu
Activé - Capturer automatiquement les paiements avec le statut AUTORISER lorsqu'un envoi est créé dans Magento (Picqer est également pris en charge dans ce domaine).
Activé - via Wuunder - Capture automatique via Wuunder.
Activé - via Sherpa - Capture automatique via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Lorsque la devise du magasin diffère de la devise de base dans Magento, ce paramètre garantit que le paiement commence dans la devise de base au lieu de la devise du magasin."
+"Chargebacks","Refacturation"
+"Set to `on` to accept chargebacks initiated from Pay.","Réglez ce paramètre sur "on" pour accepter les rétrofacturations initiées par Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Lorsque ce paramètre est activé, les rétrocessions initiées par les clients rembourseront la commande dans Magento."
\ No newline at end of file
diff --git a/i18n/nl_BE.csv b/i18n/nl_BE.csv
index 99765085..b62e2785 100644
--- a/i18n/nl_BE.csv
+++ b/i18n/nl_BE.csv
@@ -229,4 +229,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Uit - Geen autocapture.
Aan - Capture automatisch betalingen met de status AUTHORIZE wanneer een shipment in Magento wordt aangemaakt (Picqer wordt hierin ook ondersteund).
Aan - via Wuunder - Capture automatisch via Wuunder.
Aan - via Sherpa - Capture automatisch via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wanneer de winkelvaluta afwijkt van de basisvaluta-instelling in Magento, zorgt deze instelling ervoor dat de betalingen worden gestart in de basisvaluta in plaats van de winkelvaluta."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wanneer de winkelvaluta afwijkt van de basisvaluta-instelling in Magento, zorgt deze instelling ervoor dat de betalingen worden gestart in de basisvaluta in plaats van de winkelvaluta."
+"Chargebacks","Terugboekingen"
+"Set to `on` to accept chargebacks initiated from Pay.","Stel in op `aan` om chargebacks te accepteren die zijn geïnitieerd vanuit Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Als deze instelling is ingeschakeld, zullen chargebacks die door klanten worden geïnitieerd de bestelling refunden in Magento."
\ No newline at end of file
diff --git a/i18n/nl_NL.csv b/i18n/nl_NL.csv
index 0a93d601..dd230bc7 100644
--- a/i18n/nl_NL.csv
+++ b/i18n/nl_NL.csv
@@ -229,4 +229,7 @@ On - via Sherpa - Capture automatically via Sherpa.","Uit - Geen autocapture.
Aan - Capture automatisch betalingen met de status AUTHORIZE wanneer een shipment in Magento wordt aangemaakt (Picqer wordt hierin ook ondersteund).
Aan - via Wuunder - Capture automatisch via Wuunder.
Aan - via Sherpa - Capture automatisch via Sherpa."
-"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wanneer de winkelvaluta afwijkt van de basisvaluta-instelling in Magento, zorgt deze instelling ervoor dat de betalingen worden gestart in de basisvaluta in plaats van de winkelvaluta."
\ No newline at end of file
+"When the store currency deviates from the base currency setting in Magento, this setting will ensure the payment starts in the base currency instead of the store currency.","Wanneer de winkelvaluta afwijkt van de basisvaluta-instelling in Magento, zorgt deze instelling ervoor dat de betalingen worden gestart in de basisvaluta in plaats van de winkelvaluta."
+"Chargebacks","Chargebacks"
+"Set to `on` to accept chargebacks initiated from Pay.","Stel in op `aan` om chargebacks te accepteren die zijn geïnitieerd vanuit Pay."
+"When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.","Als deze instelling is ingeschakeld, zullen chargebacks die door klanten worden geïnitieerd de bestelling refunden in Magento."
\ No newline at end of file
From 95d619e165e35ab803d0b01971b0257019c9c806 Mon Sep 17 00:00:00 2001
From: kevinverschoor <61683999+kevinverschoor@users.noreply.github.com>
Date: Wed, 1 May 2024 11:00:48 +0200
Subject: [PATCH 7/7] Code Polish
---
Model/PayPayment.php | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/Model/PayPayment.php b/Model/PayPayment.php
index 3ed462a7..239b7d73 100644
--- a/Model/PayPayment.php
+++ b/Model/PayPayment.php
@@ -204,7 +204,7 @@ public function chargebackOrder($orderEntityId)
if (!$this->config->chargebackFromPayEnabled() || $order->getTotalDue() != 0 || $order->getBaseTotalRefunded() == $order->getBaseGrandTotal()) {
throw new \Exception("Ignoring chargeback");
}
- try {
+ try {
$creditmemo = $this->cmFac->createByOrder($order);
$this->cmService->refund($creditmemo);
$order->addStatusHistoryComment(__('PAY. - Chargeback initiated by customer'))->save();