-
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
lashnev
committed
Sep 17, 2018
1 parent
8bd2288
commit f98dd73
Showing
8 changed files
with
121 additions
and
134 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
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,14 @@ | ||
<?php | ||
|
||
namespace Platron\Starrys\handbooks; | ||
|
||
use MyCLabs\Enum\Enum; | ||
|
||
class DocumentTypes extends Enum | ||
{ | ||
const | ||
SELL = 0, | ||
REFUND = 2, | ||
BUY = 1, | ||
BUY_REFUND = 3; | ||
} |
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,16 @@ | ||
<?php | ||
|
||
namespace Platron\Starrys\handbooks; | ||
|
||
use MyCLabs\Enum\Enum; | ||
|
||
class TaxModes extends Enum | ||
{ | ||
const | ||
OSN = 1, | ||
USN_INCOME = 2, | ||
USN_INCOME_OUTCOME = 4, | ||
ENDV = 8, | ||
ESN = 16, | ||
PATENT = 32; | ||
} |
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 |
---|---|---|
|
@@ -4,6 +4,7 @@ | |
|
||
use Platron\Starrys\clients\PostClient; | ||
use Platron\Starrys\data_objects\Line; | ||
use Platron\Starrys\handbooks\DocumentTypes; | ||
use Platron\Starrys\services\ComplexRequest; | ||
use Platron\Starrys\services\ComplexResponse; | ||
|
||
|
@@ -14,13 +15,13 @@ public function testComplex(){ | |
$line->addPayAttribute(Line::PAY_ATTRIBUTE_TYPE_FULL_PAID_WITH_GET_PRODUCT); | ||
|
||
$complexServise = new ComplexRequest(time()); | ||
$complexServise->addDocumentType(ComplexRequest::DOCUMENT_TYPE_BUY) | ||
->addEmail('[email protected]') | ||
->addPhone('79050000000') | ||
->addPlace('www.test.ru') | ||
->addTaxMode($this->taxMode) | ||
->addLine($line) | ||
->addNonCash(10.00); | ||
$complexServise->addDocumentType(new DocumentTypes(DocumentTypes::BUY)); | ||
$complexServise->addEmail('[email protected]'); | ||
$complexServise->addPhone('79050000000'); | ||
$complexServise->addPlace('www.test.ru'); | ||
$complexServise->addTaxMode(new TaxModes($this->taxMode)); | ||
$complexServise->addLine($line); | ||
$complexServise->addNonCash(10.00); | ||
|
||
$response = new ComplexResponse($client->sendRequest($complexServise)); | ||
|
||
|
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
Oops, something went wrong.