Skip to content

Commit

Permalink
RATEPLUG-216: dfp: disable for admin orders
Browse files Browse the repository at this point in the history
  • Loading branch information
rommelfreddy committed Jan 10, 2022
1 parent 8f4b963 commit 7b2052e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Component/Mapper/PaymentRequestData.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ class PaymentRequestData

private $shippingTax;

/**
* @var string|null
*/
private $dfpToken;

private $lang;
Expand Down Expand Up @@ -73,7 +76,7 @@ public function __construct(
$items,
$shippingCost,
$shippingTax,
$dfpToken,
$dfpToken = null,
Shop $shop,
$amount,
$currencyId,
Expand Down Expand Up @@ -170,7 +173,7 @@ public function getShippingTax()
}

/**
* @return mixed
* @return string|null
*/
public function getDfpToken()
{
Expand Down
7 changes: 6 additions & 1 deletion Services/DfpService.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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);
Expand Down
19 changes: 18 additions & 1 deletion plugin.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<label lang="de">Ratepay Payment Plugin für Shopware 5</label>
<label>Ratepay Payment Plugin for Shopware 5</label>

<version>6.1.3</version>
<version>6.1.4</version>
<copyright>Copyright (c), Ratepay GmbH</copyright>
<license>MIT</license>
<link>https://www.ratepay.com</link>
Expand All @@ -22,6 +22,23 @@
<description>Ratepay enables you to accept online payments without any risk of fraud and without the hassle of debtors management.</description>
<description lang="de">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.</description>

<changelog version="6.1.4">
<changes>
<![CDATA[
<ul>
<li>disable DFP for admin-orders</li>
</ul>
]]>
</changes>
<changes lang="de">
<![CDATA[
<ul>
<li>DFP für Admin-Bestellungen deaktiviert</li>
</ul>
]]>
</changes>
</changelog>

<changelog version="6.1.3">
<changes>
<![CDATA[
Expand Down

0 comments on commit 7b2052e

Please sign in to comment.