Skip to content

Commit

Permalink
Translations and Improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinverschoor committed Apr 30, 2024
1 parent 27c4d64 commit aaed35c
Show file tree
Hide file tree
Showing 15 changed files with 61 additions and 22 deletions.
8 changes: 6 additions & 2 deletions Controller/Checkout/Exchange.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
14 changes: 7 additions & 7 deletions Model/PayPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion etc/adminhtml/system.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,11 @@ On - via Sherpa - Capture automatically via Sherpa.</tooltip>
<config_path>payment/paynl/allow_refund_from_pay</config_path>
</field>
<field id="allow_chargeback_from_pay" translate="label" type="select" sortOrder="107" showInDefault="1" showInWebsite="1" showInStore="1">
<label>Chargeback from Pay.</label>
<label>Chargebacks</label>
<comment>
<![CDATA[Set to `on` to accept chargebacks initiated from Pay.]]>
</comment>
<tooltip>When this settings is enabled, chargebacks initiated by customers will refund the order in Magento.</tooltip>
<source_model>Paynl\Payment\Model\Config\Source\OffOn</source_model>
<config_path>payment/paynl/allow_chargeback_from_pay</config_path>
</field>
Expand Down
3 changes: 2 additions & 1 deletion i18n/de_AT.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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.",""
5 changes: 4 additions & 1 deletion i18n/de_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/de_LU.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/en_US.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/fr_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/fr_CA.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/fr_CH.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/fr_FR.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/fr_LU.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
5 changes: 4 additions & 1 deletion i18n/nl_BE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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."
"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."
Loading

0 comments on commit aaed35c

Please sign in to comment.