Skip to content

Commit

Permalink
Merge pull request #850 from Nosto/hotfix/remove-pii-order-export
Browse files Browse the repository at this point in the history
Remove buyer data from order data
  • Loading branch information
supercid authored Mar 28, 2024
2 parents bc28d36 + d94fac9 commit ed09840
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 119 deletions.
12 changes: 2 additions & 10 deletions Model/Order/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@
use Nosto\Model\Order\OrderStatus;
use Nosto\NostoException;
use Nosto\Tagging\Logger\Logger as NostoLogger;
use Nosto\Tagging\Model\Order\Buyer\Builder as NostoBuyerBuilder;
use Nosto\Tagging\Model\Order\Item\Builder as NostoOrderItemBuilder;

class Builder
Expand All @@ -63,27 +62,23 @@ class Builder
private SalesRuleFactory $salesRuleFactory;
private NostoOrderItemBuilder $nostoOrderItemBuilder;
private ManagerInterface $eventManager;
private NostoBuyerBuilder $buyerBuilder;

/**
* @param NostoLogger $logger
* @param SalesRuleFactory $salesRuleFactory
* @param NostoOrderItemBuilder $nostoOrderItemBuilder
* @param ManagerInterface $eventManager
* @param NostoBuyerBuilder $buyerBuilder
*/
public function __construct(
NostoLogger $logger,
SalesRuleFactory $salesRuleFactory,
NostoOrderItemBuilder $nostoOrderItemBuilder,
ManagerInterface $eventManager,
NostoBuyerBuilder $buyerBuilder
ManagerInterface $eventManager
) {
$this->logger = $logger;
$this->salesRuleFactory = $salesRuleFactory;
$this->nostoOrderItemBuilder = $nostoOrderItemBuilder;
$this->eventManager = $eventManager;
$this->buyerBuilder = $buyerBuilder;
}

/**
Expand Down Expand Up @@ -120,10 +115,7 @@ public function build(Order $order)
}
$nostoOrder->setOrderStatus($nostoStatus);
}
$nostoBuyer = $this->buyerBuilder->fromOrder($order);
if ($nostoBuyer instanceof Buyer) {
$nostoOrder->setCustomer($nostoBuyer);
}
$nostoOrder->setCustomer(new Buyer());

// Add each ordered item as a line item
/** @var Item $item */
Expand Down
107 changes: 0 additions & 107 deletions Model/Order/Buyer/Builder.php

This file was deleted.

2 changes: 0 additions & 2 deletions Observer/Order/Save.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@
use Magento\Framework\Module\Manager as ModuleManager;
use Magento\Sales\Model\Order;
use Magento\Store\Model\Store;
use Nosto\Model\Order\Buyer;
use Nosto\Model\Order\Order as NostoOrder;
use Nosto\Operation\Order\OrderCreate as NostoOrderCreate;
use Nosto\Operation\Order\OrderStatus as NostoOrderUpdate;
Expand Down Expand Up @@ -256,7 +255,6 @@ private function sendNewOrder(Order $order, AccountInterface $nostoAccount, Stor
$nostoCustomerIdentifier = NostoOrderCreate::IDENTIFIER_BY_REF;
}
$nostoOrder = $this->nostoOrderBuilder->build($order);
$nostoOrder->setCustomer(new Buyer()); // Remove customer data from order API calls
if ($nostoCustomerId !== null) {
try {
$orderService = new NostoOrderCreate(
Expand Down

0 comments on commit ed09840

Please sign in to comment.