-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
alexey lashnev
committed
Aug 14, 2017
1 parent
d40ccd6
commit 651ca37
Showing
1 changed file
with
17 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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)); | ||
``` |