Skip to content

Commit

Permalink
Add label type param
Browse files Browse the repository at this point in the history
  • Loading branch information
jarekmajcher committed Feb 14, 2024
1 parent 3eb5602 commit b7dd178
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Api/WebClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,12 @@ final class WebClient implements WebClientInterface

private ShippingGatewayInterface $shippingGateway;

public function __construct(Client $client)
private string $labelType = 'normal';

public function __construct(Client $client, string $labelType)
{
$this->apiClient = $client;
$this->labelType = $labelType;
}

public function setShippingGateway(ShippingGatewayInterface $shippingGateway): WebClientInterface
Expand Down Expand Up @@ -120,6 +123,7 @@ public function getLabels(array $shipmentIds): ?string

$data = [
'format' => 'pdf',
'type' => $this->labelType,
'shipment_ids' => $shipmentIds,
];

Expand Down
2 changes: 2 additions & 0 deletions src/Resources/config/config.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
parameters:
bitbag.inpost.label_type: 'normal'
imports:
- { resource: "@BitBagSyliusInPostPlugin/Resources/config/services.xml" }
- { resource: "@BitBagSyliusInPostPlugin/Resources/config/resource/bitbag_inpost.yml" }
Expand Down
1 change: 1 addition & 0 deletions src/Resources/config/services.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
id="bitbag.sylius_inpost_plugin.api.web_client"
>
<argument type="service" id="sylius.http_client"/>
<argument>%bitbag.inpost.label_type%</argument>
</service>

<service
Expand Down

0 comments on commit b7dd178

Please sign in to comment.