Skip to content

Commit

Permalink
Merge pull request #28 from plentymarkets/oms/fulfi/log_inbound_requests
Browse files Browse the repository at this point in the history
Oms/fulfi/log inbound requests
  • Loading branch information
nopceal authored Oct 28, 2024
2 parents f96b8e8 + 714b1af commit 0ac8336
Showing 1 changed file with 9 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Plenty\AmazonPHP\SellingPartner\HttpFactory;
use Plenty\AmazonPHP\SellingPartner\HttpSignatureHeaders;
use Plenty\AmazonPHP\SellingPartner\ObjectSerializer;
use Plenty\Log\Traits\Loggable;
use Psr\Http\Client\ClientExceptionInterface;
use Psr\Http\Client\ClientInterface;
use Psr\Http\Message\RequestInterface;
Expand All @@ -21,6 +22,8 @@
*/
final class FulfillmentInboundSDK
{
use Loggable;

public const API_NAME = 'FulfillmentInbound';

public const OPERATION_CONFIRMPREORDER = 'confirmPreorder';
Expand Down Expand Up @@ -570,9 +573,7 @@ public function createInboundShipment(AccessToken $accessToken, string $region,
$sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'createInboundShipment'),
'Amazon Selling Partner API pre request',
$this->getLogger('CreateInboundShipmentRequest')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'createInboundShipment',
Expand All @@ -595,9 +596,7 @@ public function createInboundShipment(AccessToken $accessToken, string $region,
$sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'createInboundShipment'),
'Amazon Selling Partner API post request',
$this->getLogger('CreateInboundShipmentRequest')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'createInboundShipment',
Expand Down Expand Up @@ -787,9 +786,7 @@ public function createInboundShipmentPlan(AccessToken $accessToken, string $regi
$sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'createInboundShipmentPlan'),
'Amazon Selling Partner API pre request',
$this->getLogger('CreateInboundShipmentPlanRequest')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'createInboundShipmentPlan',
Expand All @@ -812,9 +809,7 @@ public function createInboundShipmentPlan(AccessToken $accessToken, string $regi
$sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'createInboundShipmentPlan'),
'Amazon Selling Partner API post request',
$this->getLogger('CreateInboundShipmentPlanResponse')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'createInboundShipmentPlan',
Expand Down Expand Up @@ -3298,9 +3293,7 @@ public function putTransportDetails(AccessToken $accessToken, string $region, st
$sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'putTransportDetails'),
'Amazon Selling Partner API pre request',
$this->getLogger('PutTransportDetailsRequest')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'putTransportDetails',
Expand All @@ -3323,9 +3316,7 @@ public function putTransportDetails(AccessToken $accessToken, string $region, st
$sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
}

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'putTransportDetails'),
'Amazon Selling Partner API post request',
$this->getLogger('PutTransportDetailsResponse')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'putTransportDetails',
Expand Down

0 comments on commit 0ac8336

Please sign in to comment.