@@ -49,9 +49,9 @@ discard block |
||
49 | 49 | // Add query parameters to $path? |
50 | 50 | if (!empty($query)) { |
51 | 51 | if (strpos($path, '?') === false) { |
52 | - $path .= '?' . http_build_query($query, '', '&'); |
|
52 | + $path .= '?'.http_build_query($query, '', '&'); |
|
53 | 53 | } else { |
54 | - $path .= ini_get('arg_separator.output') . http_build_query($query, '', '&'); |
|
54 | + $path .= ini_get('arg_separator.output').http_build_query($query, '', '&'); |
|
55 | 55 | } |
56 | 56 | } |
57 | 57 | |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | */ |
141 | 141 | protected function setUrl($params) |
142 | 142 | { |
143 | - curl_setopt($this->client->ch, CURLOPT_URL, $this->client->base_url . trim($params, '/')); |
|
143 | + curl_setopt($this->client->ch, CURLOPT_URL, $this->client->base_url.trim($params, '/')); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | /** |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | curl_setopt($this->client->ch, CURLOPT_CUSTOMREQUEST, $request_type); |
160 | 160 | |
161 | 161 | // If additional data is delivered, we will send it along with the API request |
162 | - if (is_array($form) && ! empty($form)) { |
|
162 | + if (is_array($form) && !empty($form)) { |
|
163 | 163 | curl_setopt($this->client->ch, CURLOPT_POSTFIELDS, http_build_query($form, '', '&')); |
164 | 164 | } |
165 | 165 |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | */ |
19 | 19 | public $ch; |
20 | 20 | |
21 | - /** |
|
22 | - * Base url for the selected API. |
|
23 | - * |
|
24 | - * @var string |
|
25 | - */ |
|
21 | + /** |
|
22 | + * Base url for the selected API. |
|
23 | + * |
|
24 | + * @var string |
|
25 | + */ |
|
26 | 26 | public $base_url; |
27 | 27 | |
28 | 28 | /** |
@@ -38,10 +38,10 @@ discard block |
||
38 | 38 | * Instantiate object |
39 | 39 | * |
40 | 40 | * @access public |
41 | - * @param string $auth_string Format 'username:password' or ':apiKey' |
|
42 | - * @param string $base_url The API to call. Use on of the constants. |
|
43 | - * @throws Exception |
|
44 | - */ |
|
41 | + * @param string $auth_string Format 'username:password' or ':apiKey' |
|
42 | + * @param string $base_url The API to call. Use on of the constants. |
|
43 | + * @throws Exception |
|
44 | + */ |
|
45 | 45 | public function __construct($auth_string = '', $base_url = Constants::API_URL) |
46 | 46 | { |
47 | 47 | // Check if lib cURL is enabled |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->auth_string = $auth_string; |
54 | 54 | |
55 | 55 | // Set base url of selected API |
56 | - $this->base_url = $base_url; |
|
56 | + $this->base_url = $base_url; |
|
57 | 57 | |
58 | 58 | // Instantiate cURL object |
59 | 59 | $this->authenticate(); |
@@ -84,20 +84,20 @@ discard block |
||
84 | 84 | { |
85 | 85 | $this->ch = curl_init(); |
86 | 86 | |
87 | - $headers = array(); |
|
88 | - switch ($this->base_url) { |
|
89 | - case Constants::API_URL_INVOICING: |
|
90 | - $headers[] = 'Accept: application/vnd.api+json'; |
|
91 | - break; |
|
87 | + $headers = array(); |
|
88 | + switch ($this->base_url) { |
|
89 | + case Constants::API_URL_INVOICING: |
|
90 | + $headers[] = 'Accept: application/vnd.api+json'; |
|
91 | + break; |
|
92 | 92 | |
93 | - case Constants::API_URL: |
|
94 | - $headers[] = 'Accept-Version: v' . Constants::API_VERSION; |
|
95 | - $headers[] = 'Accept: application/json'; |
|
96 | - break; |
|
93 | + case Constants::API_URL: |
|
94 | + $headers[] = 'Accept-Version: v' . Constants::API_VERSION; |
|
95 | + $headers[] = 'Accept: application/json'; |
|
96 | + break; |
|
97 | 97 | |
98 | - default: |
|
99 | - break; |
|
100 | - } |
|
98 | + default: |
|
99 | + break; |
|
100 | + } |
|
101 | 101 | |
102 | 102 | if (!empty($this->auth_string)) { |
103 | 103 | $headers[] = 'Authorization: Basic ' . base64_encode($this->auth_string); |
@@ -53,7 +53,7 @@ discard block |
||
53 | 53 | $this->auth_string = $auth_string; |
54 | 54 | |
55 | 55 | // Set base url of selected API |
56 | - $this->base_url = $base_url; |
|
56 | + $this->base_url = $base_url; |
|
57 | 57 | |
58 | 58 | // Instantiate cURL object |
59 | 59 | $this->authenticate(); |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | break; |
92 | 92 | |
93 | 93 | case Constants::API_URL: |
94 | - $headers[] = 'Accept-Version: v' . Constants::API_VERSION; |
|
94 | + $headers[] = 'Accept-Version: v'.Constants::API_VERSION; |
|
95 | 95 | $headers[] = 'Accept: application/json'; |
96 | 96 | break; |
97 | 97 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | } |
101 | 101 | |
102 | 102 | if (!empty($this->auth_string)) { |
103 | - $headers[] = 'Authorization: Basic ' . base64_encode($this->auth_string); |
|
103 | + $headers[] = 'Authorization: Basic '.base64_encode($this->auth_string); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | $options = array( |
@@ -17,8 +17,8 @@ |
||
17 | 17 | const API_URL = 'https://api.quickpay.net/'; |
18 | 18 | const API_VERSION = '10'; |
19 | 19 | |
20 | - /** |
|
21 | - * Invoicing API |
|
22 | - */ |
|
23 | - const API_URL_INVOICING = 'https://invoicing.quickpay.net/'; |
|
20 | + /** |
|
21 | + * Invoicing API |
|
22 | + */ |
|
23 | + const API_URL_INVOICING = 'https://invoicing.quickpay.net/'; |
|
24 | 24 | } |