1 | <?php |
||
13 | class Xero extends Server |
||
14 | { |
||
15 | /** |
||
16 | * @var string |
||
17 | */ |
||
18 | protected $responseType = 'xml'; |
||
19 | |||
20 | /** |
||
21 | * @var bool |
||
22 | */ |
||
23 | protected $usePartnerApi = false; |
||
24 | |||
25 | /** |
||
26 | * @var array |
||
27 | */ |
||
28 | protected $httpClientOptions = []; |
||
29 | |||
30 | /** |
||
31 | * {@inheritdoc} |
||
32 | */ |
||
33 | public function __construct($clientCredentials, SignatureInterface $signature = null) |
||
47 | |||
48 | /** |
||
49 | * Sets whether the Xero partner API should be used. |
||
50 | * |
||
51 | * @param bool $enable |
||
52 | * |
||
53 | * @return self |
||
54 | */ |
||
55 | public function usePartnerApi($enable = true) |
||
61 | |||
62 | /** |
||
63 | * Checks if the Xero partner API is used. |
||
64 | * |
||
65 | * @return bool |
||
66 | */ |
||
67 | public function getUsePartnerApi() |
||
71 | |||
72 | /** |
||
73 | * Creates a Guzzle HTTP client for the given URL. |
||
74 | * |
||
75 | * @return GuzzleHttpClient |
||
76 | */ |
||
77 | public function createHttpClient() |
||
81 | |||
82 | public function urlTemporaryCredentials() |
||
90 | |||
91 | public function urlAuthorization() |
||
95 | |||
96 | public function urlTokenCredentials() |
||
104 | |||
105 | public function urlUserDetails() |
||
109 | |||
110 | public function userDetails($data, TokenCredentials $tokenCredentials) |
||
114 | |||
115 | public function userUid($data, TokenCredentials $tokenCredentials) |
||
119 | |||
120 | public function userEmail($data, TokenCredentials $tokenCredentials) |
||
124 | |||
125 | public function userScreenName($data, TokenCredentials $tokenCredentials) |
||
129 | |||
130 | protected function notSupportedByXero() |
||
134 | |||
135 | /** |
||
136 | * Parse configuration array to set attributes. |
||
137 | * |
||
138 | * @param array $configuration |
||
139 | */ |
||
140 | private function parseConfiguration(array $configuration = array()) |
||
152 | |||
153 | /** |
||
154 | * Creates a client credentials instance from an array of credentials. |
||
155 | * |
||
156 | * @param array $clientCredentials |
||
157 | * |
||
158 | * @return ClientCredentials |
||
159 | */ |
||
160 | protected function createClientCredentials(array $clientCredentials) |
||
187 | } |
||
188 |