From 7b2052e59f61962f34c2d5282f54d6b54730f2d4 Mon Sep 17 00:00:00 2001 From: Frederik Rommel Date: Mon, 10 Jan 2022 11:34:28 +0100 Subject: [PATCH] RATEPLUG-216: dfp: disable for admin orders --- Component/Mapper/PaymentRequestData.php | 7 +++++-- Services/DfpService.php | 7 ++++++- plugin.xml | 19 ++++++++++++++++++- 3 files changed, 29 insertions(+), 4 deletions(-) diff --git a/Component/Mapper/PaymentRequestData.php b/Component/Mapper/PaymentRequestData.php index 1bc39b35..41612fe5 100644 --- a/Component/Mapper/PaymentRequestData.php +++ b/Component/Mapper/PaymentRequestData.php @@ -44,6 +44,9 @@ class PaymentRequestData private $shippingTax; + /** + * @var string|null + */ private $dfpToken; private $lang; @@ -73,7 +76,7 @@ public function __construct( $items, $shippingCost, $shippingTax, - $dfpToken, + $dfpToken = null, Shop $shop, $amount, $currencyId, @@ -170,7 +173,7 @@ public function getShippingTax() } /** - * @return mixed + * @return string|null */ public function getDfpToken() { diff --git a/Services/DfpService.php b/Services/DfpService.php index 56b79dbb..496d6abc 100644 --- a/Services/DfpService.php +++ b/Services/DfpService.php @@ -32,6 +32,10 @@ public function __construct(SessionHelper $sessionHelper) $this->sessionHelper = $sessionHelper; } + /** + * @param bool $backend + * @return string|null + */ public function getDfpId($backend = false) { if ($backend === false) { @@ -43,7 +47,8 @@ public function getDfpId($backend = false) $sessionId = $this->sessionHelper->getSession()->get('sessionId'); } else { // admin or console request - $sessionId = rand(); + // $sessionId = rand(); + return null; // RATEPLUG-216: disable DFP Token for admin orders } $token = DeviceFingerprint::createDeviceIdentToken($sessionId); diff --git a/plugin.xml b/plugin.xml index 0cc152fd..83540e4a 100644 --- a/plugin.xml +++ b/plugin.xml @@ -12,7 +12,7 @@ - 6.1.3 + 6.1.4 Copyright (c), Ratepay GmbH MIT https://www.ratepay.com @@ -22,6 +22,23 @@ Ratepay enables you to accept online payments without any risk of fraud and without the hassle of debtors management. Ratepay stellt verschiedene Zahlungsarten für Ihren Onlineshop zur Verfügung, ohne dass Sie sich mit der Risikoprüfung oder dem Debitorenmanagement beschäftigen müssen. + + + +
  • disable DFP for admin-orders
  • + + ]]> +
    + + +
  • DFP für Admin-Bestellungen deaktiviert
  • + + ]]> +
    +
    +