1 | <?php |
||
21 | class Moip |
||
22 | { |
||
23 | /** |
||
24 | * endpoint of production. |
||
25 | * |
||
26 | * @const string |
||
27 | */ |
||
28 | const ENDPOINT_PRODUCTION = 'https://api.moip.com.br'; |
||
29 | |||
30 | /** |
||
31 | * endpoint of sandbox. |
||
32 | * |
||
33 | * @const string |
||
34 | */ |
||
35 | const ENDPOINT_SANDBOX = 'https://sandbox.moip.com.br'; |
||
36 | |||
37 | /** |
||
38 | * Client name. |
||
39 | * |
||
40 | * @const string |
||
41 | * */ |
||
42 | const CLIENT = 'MoipPhpSDK'; |
||
43 | |||
44 | /** |
||
45 | * Client Version. |
||
46 | * |
||
47 | * @const string |
||
48 | */ |
||
49 | const CLIENT_VERSION = '1.3.2'; |
||
50 | |||
51 | /** |
||
52 | * Authentication that will be added to the header of request. |
||
53 | * |
||
54 | * @var \Moip\MoipAuthentication |
||
55 | */ |
||
56 | private $moipAuthentication; |
||
57 | |||
58 | /** |
||
59 | * Endpoint of request. |
||
60 | * |
||
61 | * @var \Moip\Moip::ENDPOINT_PRODUCTION|\Moip\Moip::ENDPOINT_SANDBOX |
||
62 | */ |
||
63 | private $endpoint; |
||
64 | |||
65 | /** |
||
66 | * @var Requests_Session HTTP session configured to use the moip API. |
||
67 | */ |
||
68 | private $session; |
||
69 | |||
70 | /** |
||
71 | * Create a new aurhentication with the endpoint. |
||
72 | * |
||
73 | * @param \Moip\Auth\MoipAuthentication $moipAuthentication |
||
74 | * @param string $endpoint |
||
75 | */ |
||
76 | public function __construct(Authentication $moipAuthentication, $endpoint = self::ENDPOINT_PRODUCTION) |
||
82 | |||
83 | /** |
||
84 | * Creates a new Request_Session with all the default values. |
||
85 | * A Session is created at construction. |
||
86 | * |
||
87 | * @param float $timeout How long should we wait for a response?(seconds with a millisecond precision, default: 30, example: 0.01). |
||
88 | * @param float $connect_timeout How long should we wait while trying to connect? (seconds with a millisecond precision, default: 10, example: 0.01) |
||
89 | */ |
||
90 | public function createNewSession($timeout = 30.0, $connect_timeout = 30.0) |
||
100 | |||
101 | /** |
||
102 | * Returns the http session created. |
||
103 | * |
||
104 | * @return Requests_Session |
||
105 | */ |
||
106 | public function getSession() |
||
110 | |||
111 | /** |
||
112 | * Replace the http session by a custom one. |
||
113 | * |
||
114 | * @param Requests_Session $session |
||
115 | */ |
||
116 | public function setSession($session) |
||
120 | |||
121 | /** |
||
122 | * Create a new Customer instance. |
||
123 | * |
||
124 | * @return \Moip\Resource\Customer |
||
125 | */ |
||
126 | public function customers() |
||
130 | |||
131 | /** |
||
132 | * Create a new Account instance. |
||
133 | * |
||
134 | * @return \Moip\Resource\Account |
||
135 | */ |
||
136 | public function accounts() |
||
140 | |||
141 | /** |
||
142 | * Create a new Entry instance. |
||
143 | * |
||
144 | * @return \Moip\Resource\Entry |
||
145 | */ |
||
146 | public function entries() |
||
150 | |||
151 | /** |
||
152 | * Create a new Orders instance. |
||
153 | * |
||
154 | * @return \Moip\Resource\Orders |
||
155 | */ |
||
156 | public function orders() |
||
160 | |||
161 | /** |
||
162 | * Create a new Payment instance. |
||
163 | * |
||
164 | * @return \Moip\Resource\Payment |
||
165 | */ |
||
166 | public function payments() |
||
170 | |||
171 | /** |
||
172 | * Create a new Multiorders instance. |
||
173 | * |
||
174 | * @return \Moip\Resource\Multiorders |
||
175 | */ |
||
176 | public function multiorders() |
||
180 | |||
181 | /** |
||
182 | * Create a new Transfers. |
||
183 | * |
||
184 | * @return \Moip\Resource\Transfers |
||
185 | */ |
||
186 | |||
187 | /** |
||
188 | * Create a new Transfers instance. |
||
189 | * |
||
190 | * @return Transfers |
||
191 | */ |
||
192 | public function transfers() |
||
196 | |||
197 | /** |
||
198 | * Create a new Notification Prefences instance. |
||
199 | * |
||
200 | * @return NotificationPreferences |
||
201 | */ |
||
202 | public function notifications() |
||
206 | |||
207 | /** |
||
208 | * Create a new WebhookList instance. |
||
209 | * |
||
210 | * @return WebhookList |
||
211 | */ |
||
212 | public function webhooks() |
||
216 | |||
217 | /** |
||
218 | * Create a new Keys instance. |
||
219 | * |
||
220 | * @return Keys |
||
221 | */ |
||
222 | public function keys() |
||
226 | |||
227 | /** |
||
228 | * Get the endpoint. |
||
229 | * |
||
230 | * @return \Moip\Moip::ENDPOINT_PRODUCTION|\Moip\Moip::ENDPOINT_SANDBOX |
||
231 | */ |
||
232 | public function getEndpoint() |
||
236 | } |
||
237 |
Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.
Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..