1 | <?php |
||
6 | class RestCompleteAuthorizeRequest extends AbstractRequest |
||
7 | { |
||
8 | 6 | public function getEndpoint() |
|
12 | |||
13 | 6 | public function getHttpMethod() |
|
17 | |||
18 | 6 | public function getReference() |
|
22 | |||
23 | public function setReference($value) |
||
27 | |||
28 | 6 | public function hasReference() |
|
32 | |||
33 | 6 | public function getAuthorityType() |
|
37 | |||
38 | 6 | public function setAuthorityType($value) |
|
42 | |||
43 | 6 | public function getAuthorityValue() |
|
47 | |||
48 | 6 | public function setAuthorityValue($value) |
|
52 | |||
53 | 6 | public function getCaptureFunds() |
|
57 | |||
58 | 6 | public function setCaptureFunds($value) |
|
62 | |||
63 | 6 | public function getData() |
|
64 | { |
||
65 | 6 | $this->validate('amount', 'authorityType', 'authorityValue', 'captureFunds', 'currency'); |
|
66 | |||
67 | 6 | $data = $this->getBaseData(); |
|
68 | |||
69 | 6 | $data['authority'] = $this->getAuthority(); |
|
70 | 6 | $data['amount'] = $this->getAmount(); |
|
71 | 6 | $data['currency'] = $this->getCurrency(); |
|
72 | 6 | $data['capture'] = $this->getCaptureFunds(); |
|
73 | |||
74 | 6 | if ($this->hasReference()) { |
|
75 | $data['reference'] = $this->getReference(); |
||
76 | } |
||
77 | |||
78 | 6 | return $data; |
|
79 | } |
||
80 | |||
81 | 6 | public function getAuthority() |
|
82 | { |
||
83 | return [ |
||
84 | 6 | 'type' => $this->getAuthorityType(), |
|
85 | 6 | 'value' => $this->getAuthorityValue(), |
|
86 | 2 | ]; |
|
87 | } |
||
88 | |||
89 | 6 | protected function createResponse($data, $headers = [], $status = 404) |
|
93 | } |
||
94 |