Skip to content

Latest commit

 

History

History
43 lines (37 loc) · 912 Bytes

README.md

File metadata and controls

43 lines (37 loc) · 912 Bytes

Request generátor pro Zboží.cz konverze

Install

$ composer require lukashron/zbozicz-request-conversion

Use

try {
    $order = new Order();
    $order->setOrderId('exampleTestOrderId');
    $order->setEmail('example@email.com');
    $order->setDeliveryPrice(100);
    $order->setDeliveryType('own-hands');
    $order->setPaymentType('cash');
    $order->setOtherCosts(-20);
    $order->addItem(
        (new Item())
            ->setItemId('123')
            ->setProductName('Example product')
            ->setQuantity(1)
            ->setUnitPrice(200)
    );
} catch (InvalidValueException $exception) {
    ...
}

$requestFactory = new RequestFactory(123,  'secretKeys', false);

$request = $requestFactory->make($order);

Code

$ docker compose exec app php ./vendor/bin/phpunit
$ docker compose exec app php vendor/bin/rector process

www.lukashron.cz