-
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.
# Conflicts: # src/services/BaseServiceResponse.php # src/services/ComplexRequest.php
- Loading branch information
Showing
24 changed files
with
701 additions
and
460 deletions.
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
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 |
---|---|---|
|
@@ -19,22 +19,4 @@ vendor/bin/phpunit tests/integration | |
|
||
## Примеры использования | ||
|
||
### 1. Создание чека | ||
|
||
```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)); | ||
``` | ||
Примеры использования можно найти в интеграционных тестах tests/integration |
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
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
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
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 |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Platron\Starrys\data_objects; | ||
|
||
class AgentData extends BaseDataObject | ||
{ | ||
/** @var string */ | ||
protected $Operation; | ||
/** @var string */ | ||
protected $Phone; | ||
|
||
/** | ||
* AgentData constructor. | ||
* @param string $operation | ||
* @param int $phone | ||
*/ | ||
public function __construct($operation, $phone) | ||
{ | ||
$this->Operation = (string)$operation; | ||
$this->Phone = (string)$phone; | ||
} | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Platron\Starrys\data_objects; | ||
|
||
class GetPaymentOperatorData extends BaseDataObject | ||
{ | ||
/** @var string */ | ||
protected $Phone; | ||
|
||
/** | ||
* GetPaymentOperatorData constructor. | ||
* @param $phone | ||
*/ | ||
public function __construct($phone) | ||
{ | ||
$this->Phone = (string)$phone; | ||
} | ||
} |
Oops, something went wrong.