|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace Daaner\NovaPoshta\Models; |
|
4
|
|
|
|
|
5
|
|
|
use Daaner\NovaPoshta\NovaPoshta; |
|
6
|
|
|
use Daaner\NovaPoshta\Traits\DateTimes; |
|
7
|
|
|
use Daaner\NovaPoshta\Traits\DocumentList; |
|
8
|
|
|
use Daaner\NovaPoshta\Traits\Limit; |
|
9
|
|
|
|
|
10
|
|
|
use Daaner\NovaPoshta\Traits\InternetDocumentProperty; |
|
11
|
|
|
use Daaner\NovaPoshta\Traits\SenderProperty; |
|
12
|
|
|
use Daaner\NovaPoshta\Traits\OptionsSeatProperty; |
|
13
|
|
|
use Daaner\NovaPoshta\Traits\RecipientProperty; |
|
14
|
|
|
|
|
15
|
|
|
class InternetDocument extends NovaPoshta |
|
16
|
|
|
{ |
|
17
|
|
|
use Limit, DateTimes, DocumentList; //getDocumentList |
|
18
|
|
|
|
|
19
|
|
|
use InternetDocumentProperty, SenderProperty, OptionsSeatProperty, RecipientProperty; //save |
|
20
|
|
|
|
|
21
|
|
|
protected $model = 'InternetDocument'; |
|
22
|
|
|
protected $calledMethod; |
|
23
|
|
|
protected $methodProperties = []; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @see https://devcenter.novaposhta.ua/docs/services/556eef34a0fe4f02049c664e/operations/557eb417a0fe4f02fc455b2c |
|
27
|
|
|
* |
|
28
|
|
|
* @return array |
|
29
|
|
|
*/ |
|
30
|
|
|
public function getDocumentList() |
|
31
|
|
|
{ |
|
32
|
|
|
$this->calledMethod = 'getDocumentList'; |
|
33
|
|
|
|
|
34
|
|
|
$this->getPage(); |
|
35
|
|
|
$this->addLimit(); |
|
36
|
|
|
|
|
37
|
|
|
//DateTime |
|
38
|
|
|
$this->getDateTime(); |
|
39
|
|
|
$this->getDateTimeFromTo(); |
|
40
|
|
|
// $this->getFullList(); |
|
41
|
|
|
|
|
42
|
|
|
// $methodProperties = [ |
|
43
|
|
|
// 'GetFullList' => 0, |
|
44
|
|
|
// ]; |
|
45
|
|
|
|
|
46
|
|
|
return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true); |
|
47
|
|
|
} |
|
48
|
|
|
|
|
49
|
|
|
|
|
50
|
|
|
/** |
|
51
|
|
|
* @see https://devcenter.novaposhta.ua/docs/services/556eef34a0fe4f02049c664e/operations/556ef753a0fe4f02049c664f |
|
52
|
|
|
* |
|
53
|
|
|
* @return array |
|
54
|
|
|
*/ |
|
55
|
|
|
public function save($description = null) |
|
56
|
|
|
{ |
|
57
|
|
|
$this->calledMethod = 'save'; |
|
58
|
|
|
|
|
59
|
|
|
$this->getPayerType(); |
|
60
|
|
|
$this->getServiceType(); |
|
61
|
|
|
$this->getPaymentMethod(); |
|
62
|
|
|
$this->getCargoType(); |
|
63
|
|
|
|
|
64
|
|
|
$this->getDateTime(); |
|
65
|
|
|
$this->setDescription($description); |
|
66
|
|
|
$this->getSeatsAmount(); |
|
67
|
|
|
$this->getCost(); |
|
68
|
|
|
$this->getOptionsSeat(); |
|
69
|
|
|
|
|
70
|
|
|
//Отправитель и другое |
|
71
|
|
|
$this->getSender(); |
|
72
|
|
|
$this->getRecipientType(); |
|
73
|
|
|
$this->getBackwardDeliveryData(); |
|
74
|
|
|
$this->getNote(); |
|
75
|
|
|
$this->getAdditionalInformation(); |
|
76
|
|
|
|
|
77
|
|
|
return $this->getResponse($this->model, $this->calledMethod, $this->methodProperties, true); |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|