Skip to content

Commit

Permalink
Merge pull request #26 from plentymarkets/feature/fulfillment_inbound…
Browse files Browse the repository at this point in the history
…_api_2024

changes on sp- api sdk 2024 version
  • Loading branch information
nopceal authored Dec 18, 2024
2 parents 0ac8336 + 4ddbeb9 commit 72c8390
Show file tree
Hide file tree
Showing 145 changed files with 52,995 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -596,7 +596,7 @@ public function createInboundShipment(AccessToken $accessToken, string $region,
$sanitizedResponse = $sanitizedResponse->withoutHeader($sensitiveHeader);
}

$this->getLogger('CreateInboundShipmentRequest')->report('module_amazon::log/fbaInbound/debug.requestPayload',
$this->getLogger('CreateInboundShipmentResponse')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'createInboundShipment',
Expand Down Expand Up @@ -1624,9 +1624,7 @@ public function getLabels(AccessToken $accessToken, string $region, string $ship
$sanitizedRequest = $sanitizedRequest->withoutHeader($sensitiveHeader);
}

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

$this->logger->log(
$this->configuration->logLevel('FulfillmentInbound', 'getLabels'),
'Amazon Selling Partner API post request',
$this->getLogger('GetLabelsResponse')->report('module_amazon::log/fbaInbound/debug.requestPayload',
[
'api' => 'FulfillmentInbound',
'operation' => 'getLabels',
Expand Down
10,479 changes: 10,479 additions & 0 deletions src/AmazonPHP/SellingPartner/Api/FbaInboundApi/FulfillmentInboundSDK2024.php

Large diffs are not rendered by default.

Large diffs are not rendered by default.

8 changes: 8 additions & 0 deletions src/AmazonPHP/SellingPartner/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

namespace Plenty\AmazonPHP\SellingPartner;

use Plenty\AmazonPHP\SellingPartner\IdGenerator;
use Plenty\AmazonPHP\SellingPartner\IdGenerator\UniqidGenerator;
use Plenty\AmazonPHP\SellingPartner\Configuration\LoggerConfiguration;
use Plenty\AmazonPHP\SellingPartner\Exception\InvalidArgumentException;
use Plenty\AmazonPHP\SellingPartner\STSClient\Credentials;
Expand Down Expand Up @@ -36,6 +38,7 @@ public function __construct(
$this->tmpFolderPath = \sys_get_temp_dir();
$this->loggerConfiguration = $loggerConfiguration ? $loggerConfiguration : new LoggerConfiguration();
$this->extensions = $extensions ? $extensions : new Extensions();
$this->idGenerator = new UniqidGenerator();
}

public static function forIAMUser(string $clientId, string $clientSecret, string $accessKey, string $secretKey) : self
Expand Down Expand Up @@ -229,4 +232,9 @@ public function extensions() : Extensions
{
return $this->extensions;
}

public function idGenerator() : IdGenerator
{
return $this->idGenerator;
}
}
9 changes: 9 additions & 0 deletions src/AmazonPHP/SellingPartner/Exception/AssertionException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Plenty\AmazonPHP\SellingPartner\Exception;

class AssertionException extends Exception
{
}
10 changes: 10 additions & 0 deletions src/AmazonPHP/SellingPartner/IdGenerator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

declare(strict_types=1);

namespace Plenty\AmazonPHP\SellingPartner;

interface IdGenerator
{
public function generate(): string;
}
15 changes: 15 additions & 0 deletions src/AmazonPHP/SellingPartner/IdGenerator/UniqidGenerator.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?php

declare(strict_types=1);

namespace Plenty\AmazonPHP\SellingPartner\IdGenerator;

use Plenty\AmazonPHP\SellingPartner\IdGenerator;

final class UniqidGenerator implements IdGenerator
{
public function generate(): string
{
return \uniqid('correlation_id_', true);
}
}
Loading

0 comments on commit 72c8390

Please sign in to comment.