Skip to content

Commit

Permalink
Пример использования
Browse files Browse the repository at this point in the history
  • Loading branch information
alexey lashnev committed Aug 14, 2017
1 parent d40ccd6 commit 651ca37
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,20 @@ vendor/bin/phpunit tests/integration

### 1. Создание чека

Смотрите в интеграционных тестах - /tests/integration/
```php
$client = new PostClient($this->starrysApiUrl, $this->secretKeyPath, $this->certPath);
$line = new Line('Test product', 1, 10.00, Line::TAX_VAT18);
$line->addPayAttribute(Line::PAY_ATTRIBUTE_TYPE_FULL_PAID_WITH_GET_PRODUCT);

$complexServise = new ComplexRequest(time());
$complexServise->addDocumentType(ComplexRequest::DOCUMENT_TYPE_BUY)
->addEmail('[email protected]')
->addGroup($this->group)
->addPhone('79050000000')
->addPlace('www.test.ru')
->addTaxMode($this->taxMode)
->addLine($line)
->addNonCash(10.00);

$response = new ComplexResponse($client->sendRequest($complexServise));
```

0 comments on commit 651ca37

Please sign in to comment.