Skip to content

Commit

Permalink
V5 FbsService
Browse files Browse the repository at this point in the history
  • Loading branch information
0x543 committed Nov 11, 2024
1 parent 8b2bb27 commit b14a3ea
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
5 changes: 5 additions & 0 deletions bin/is_realized.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Gam6itko\OzonSeller\Service\V2\ProductService as V2ProductService;
use Gam6itko\OzonSeller\Service\V2\ReturnsService as V2ReturnsService;
use Gam6itko\OzonSeller\Service\V4\ProductService as V4ProductService;
use Gam6itko\OzonSeller\Service\V5\Posting\FbsService as V5FbsService;
use GuzzleHttp\Client;

const MAPPING = [
Expand Down Expand Up @@ -55,6 +56,10 @@

// V4
'/v4/product/info/prices' => [V4ProductService::class, 'infoPrices'],

//V5
'/v5/fbs/posting/product/exemplar/create-or-get' => [V5FbsService::class, 'productExemplarCreateOrGet'],
'/v5/fbs/posting/product/exemplar/set' => [V5FbsService::class, 'productExemplarSet'],
];

$client = new Client();
Expand Down
30 changes: 30 additions & 0 deletions src/Service/V5/Posting/FbsService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?php

declare(strict_types=1);

namespace Gam6itko\OzonSeller\Service\V5\Posting;

use Gam6itko\OzonSeller\Service\AbstractService;


class FbsService extends AbstractService
{
private $path = '/v5/fbs/posting';

public function productExemplarCreateOrGet(string $postingNumber): array
{
$body = [
'posting_number' => $postingNumber,
];
return $this->request('POST', "$this->path/product/exemplar/create-or-get", $body);
}
public function productExemplarSet(int $multiBoxQty, string $postingNumber, array $products): bool
{
$body = [
'multi_box_qty' => $multiBoxQty,
'posting_number' => $postingNumber,
'products' => $products,
];
return $this->request('POST', "$this->path/product/exemplar/set", $body);
}
}

0 comments on commit b14a3ea

Please sign in to comment.