diff --git a/locale.xml b/locale.xml index 2f6f95f4e6660d7d6939654e1a98c3c4a0385cee..9cb85c0f7a34e815662804454f85bf8b9e3f1ffe 100644 --- a/locale.xml +++ b/locale.xml @@ -58,7 +58,7 @@ <en><![CDATA[The payment capture of order # [orderHash] can not be initialized because it is not yet authorized by Amazon.]]></en> </locale> <locale name="payment.capture.seller_capture_note"> - <de><![CDATA[Bezahlung der Bestellung #[oderId]]]></de> + <de><![CDATA[Bezahlung der Bestellung #[orderId]]]></de> <en><![CDATA[Payment of order #[orderId]]]></en> </locale> <locale name="controls.PaymentDisplay.configuration_error"> @@ -204,8 +204,14 @@ <en><![CDATA[Order description for Amazon]]></en> </locale> <locale name="settings.payment.amazon_seller_note.description"> - <de><![CDATA[Hier legen Sie fest, welcher <b>zusätzliche Beschreibungstext</b> für eine Bestellung dem <b>Kunden bei Amazon</b> angezeigt wird. <b>Maximal 1024 Zeichen!</b>]]></de> - <en><![CDATA[Here you specify the <b>additional description text</b> for an order <b>for the customer</b> at Amazon. <b>Maximum of 1024 characters!</b>]]></en> + <de><![CDATA[Hier legen Sie fest, welcher <b>zusätzliche Beschreibungstext</b> für eine Bestellung dem <b>Kunden bei Amazon</b> angezeigt wird. <b>Maximal 255 Zeichen!</b><br><br>Verfügbare Platzhalter: +<ul> +<li><b>{orderId}</b> - Bestellnummer (mit Präfix)</li> +</ul>]]></de> + <en><![CDATA[Here you specify the <b>additional description text</b> for an order <b>for the customer</b> at Amazon. <b>Maximum of 255 characters!</b><br><br>Available placeholders: +<ul> +<li><b>{orderId}</b> - Order number (with prefix)</li> +</ul>]]></en> </locale> </groups> diff --git a/src/QUI/ERP/Payments/Amazon/Payment.php b/src/QUI/ERP/Payments/Amazon/Payment.php index 31f908e61aac0c958212a5d70238ba563bbfebe2..78bba4898782d50275b34a10b23d58e318da737a 100644 --- a/src/QUI/ERP/Payments/Amazon/Payment.php +++ b/src/QUI/ERP/Payments/Amazon/Payment.php @@ -512,13 +512,7 @@ class Payment extends QUI\ERP\Accounting\Payments\Api\AbstractPayment 'capture_amount' => $sum, 'currency_code' => $Order->getCurrency()->getCode(), 'capture_reference_id' => $captureReferenceId, - 'seller_capture_note' => $this->getLocale()->get( - 'quiqqer/payment-amazon', - 'payment.capture.seller_capture_note', - [ - 'orderId' => $Order->getId() - ] - ) + 'seller_capture_note' => $this->getSellerNote($Order) ]); $response = $this->getResponseData($Response); @@ -732,9 +726,12 @@ class Payment extends QUI\ERP\Accounting\Payments\Api\AbstractPayment $descriptionText = ''; if (!empty($description[$lang])) { - $descriptionText = $description[$lang]; + $descriptionText = str_replace(['{orderId}'], [$this->Order->getPrefixedId()], $description[$lang]); } + // max length 255 + $descriptionText = mb_substr($descriptionText, 0 , 255); + return $descriptionText; }