@@ -49,7 +49,7 @@ |
||
49 | 49 | */ |
50 | 50 | public function connect($config) |
51 | 51 | { |
52 | - if(is_array($config) && $config['pdo'] instanceof PDO) { |
|
52 | + if (is_array($config) && $config['pdo'] instanceof PDO) { |
|
53 | 53 | $this->pdo = $config['pdo']; |
54 | 54 | $this->dbTable = $config['table']; |
55 | 55 | } else { |
@@ -52,7 +52,7 @@ |
||
52 | 52 | */ |
53 | 53 | public function addPClass($pclass) |
54 | 54 | { |
55 | - if (! $pclass instanceof KlarnaPClass) { |
|
55 | + if (!$pclass instanceof KlarnaPClass) { |
|
56 | 56 | throw new Klarna_InvalidTypeException('pclass', 'KlarnaPClass'); |
57 | 57 | } |
58 | 58 |
@@ -143,7 +143,7 @@ |
||
143 | 143 | } else { |
144 | 144 | file_put_contents($uri, ""); |
145 | 145 | } |
146 | - } catch(Exception $e) { |
|
146 | + } catch (Exception $e) { |
|
147 | 147 | throw new KlarnaException($e->getMessage()); |
148 | 148 | } |
149 | 149 | } |
@@ -248,11 +248,11 @@ |
||
248 | 248 | |
249 | 249 | private static $_tlcFlip = array(); |
250 | 250 | |
251 | - /** |
|
252 | - * Cache for the flipped country array |
|
253 | - * |
|
254 | - * @var array |
|
255 | - */ |
|
251 | + /** |
|
252 | + * Cache for the flipped country array |
|
253 | + * |
|
254 | + * @var array |
|
255 | + */ |
|
256 | 256 | private static $_countryFlip = array(); |
257 | 257 | |
258 | 258 | /** |
@@ -142,22 +142,22 @@ discard block |
||
142 | 142 | public static function checkLanguage($country, $language) |
143 | 143 | { |
144 | 144 | switch($country) { |
145 | - case KlarnaCountry::AT: |
|
146 | - case KlarnaCountry::DE: |
|
147 | - return ($language === KlarnaLanguage::DE); |
|
148 | - case KlarnaCountry::NL: |
|
149 | - return ($language === KlarnaLanguage::NL); |
|
150 | - case KlarnaCountry::FI: |
|
151 | - return ($language === KlarnaLanguage::FI); |
|
152 | - case KlarnaCountry::DK: |
|
153 | - return ($language === KlarnaLanguage::DA); |
|
154 | - case KlarnaCountry::NO: |
|
155 | - return ($language === KlarnaLanguage::NB); |
|
156 | - case KlarnaCountry::SE: |
|
157 | - return ($language === KlarnaLanguage::SV); |
|
158 | - default: |
|
159 | - //Country not yet supported by Klarna. |
|
160 | - return false; |
|
145 | + case KlarnaCountry::AT: |
|
146 | + case KlarnaCountry::DE: |
|
147 | + return ($language === KlarnaLanguage::DE); |
|
148 | + case KlarnaCountry::NL: |
|
149 | + return ($language === KlarnaLanguage::NL); |
|
150 | + case KlarnaCountry::FI: |
|
151 | + return ($language === KlarnaLanguage::FI); |
|
152 | + case KlarnaCountry::DK: |
|
153 | + return ($language === KlarnaLanguage::DA); |
|
154 | + case KlarnaCountry::NO: |
|
155 | + return ($language === KlarnaLanguage::NB); |
|
156 | + case KlarnaCountry::SE: |
|
157 | + return ($language === KlarnaLanguage::SV); |
|
158 | + default: |
|
159 | + //Country not yet supported by Klarna. |
|
160 | + return false; |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | /** |
@@ -173,20 +173,20 @@ discard block |
||
173 | 173 | public static function checkCurrency($country, $currency) |
174 | 174 | { |
175 | 175 | switch($country) { |
176 | - case KlarnaCountry::AT: |
|
177 | - case KlarnaCountry::DE: |
|
178 | - case KlarnaCountry::NL: |
|
179 | - case KlarnaCountry::FI: |
|
180 | - return ($currency === KlarnaCurrency::EUR); |
|
181 | - case KlarnaCountry::DK: |
|
182 | - return ($currency === KlarnaCurrency::DKK); |
|
183 | - case KlarnaCountry::NO: |
|
184 | - return ($currency === KlarnaCurrency::NOK); |
|
185 | - case KlarnaCountry::SE: |
|
186 | - return ($currency === KlarnaCurrency::SEK); |
|
187 | - default: |
|
188 | - //Country not yet supported by Klarna. |
|
189 | - return false; |
|
176 | + case KlarnaCountry::AT: |
|
177 | + case KlarnaCountry::DE: |
|
178 | + case KlarnaCountry::NL: |
|
179 | + case KlarnaCountry::FI: |
|
180 | + return ($currency === KlarnaCurrency::EUR); |
|
181 | + case KlarnaCountry::DK: |
|
182 | + return ($currency === KlarnaCurrency::DKK); |
|
183 | + case KlarnaCountry::NO: |
|
184 | + return ($currency === KlarnaCurrency::NOK); |
|
185 | + case KlarnaCountry::SE: |
|
186 | + return ($currency === KlarnaCurrency::SEK); |
|
187 | + default: |
|
188 | + //Country not yet supported by Klarna. |
|
189 | + return false; |
|
190 | 190 | } |
191 | 191 | } |
192 | 192 | /** |
@@ -201,21 +201,21 @@ discard block |
||
201 | 201 | public static function getLanguage($country) |
202 | 202 | { |
203 | 203 | switch($country) { |
204 | - case KlarnaCountry::AT: |
|
205 | - case KlarnaCountry::DE: |
|
206 | - return KlarnaLanguage::DE; |
|
207 | - case KlarnaCountry::NL: |
|
208 | - return KlarnaLanguage::NL; |
|
209 | - case KlarnaCountry::FI: |
|
210 | - return KlarnaLanguage::FI; |
|
211 | - case KlarnaCountry::DK: |
|
212 | - return KlarnaLanguage::DA; |
|
213 | - case KlarnaCountry::NO: |
|
214 | - return KlarnaLanguage::NB; |
|
215 | - case KlarnaCountry::SE: |
|
216 | - return KlarnaLanguage::SV; |
|
217 | - default: |
|
218 | - return KlarnaLanguage::EN; |
|
204 | + case KlarnaCountry::AT: |
|
205 | + case KlarnaCountry::DE: |
|
206 | + return KlarnaLanguage::DE; |
|
207 | + case KlarnaCountry::NL: |
|
208 | + return KlarnaLanguage::NL; |
|
209 | + case KlarnaCountry::FI: |
|
210 | + return KlarnaLanguage::FI; |
|
211 | + case KlarnaCountry::DK: |
|
212 | + return KlarnaLanguage::DA; |
|
213 | + case KlarnaCountry::NO: |
|
214 | + return KlarnaLanguage::NB; |
|
215 | + case KlarnaCountry::SE: |
|
216 | + return KlarnaLanguage::SV; |
|
217 | + default: |
|
218 | + return KlarnaLanguage::EN; |
|
219 | 219 | } |
220 | 220 | } |
221 | 221 | /** |
@@ -230,19 +230,19 @@ discard block |
||
230 | 230 | public static function getCurrency($country) |
231 | 231 | { |
232 | 232 | switch($country) { |
233 | - case KlarnaCountry::AT: |
|
234 | - case KlarnaCountry::DE: |
|
235 | - case KlarnaCountry::NL: |
|
236 | - case KlarnaCountry::FI: |
|
237 | - return KlarnaCurrency::EUR; |
|
238 | - case KlarnaCountry::DK: |
|
239 | - return KlarnaCurrency::DKK; |
|
240 | - case KlarnaCountry::NO: |
|
241 | - return KlarnaCurrency::NOK; |
|
242 | - case KlarnaCountry::SE: |
|
243 | - return KlarnaCurrency::SEK; |
|
244 | - default: |
|
245 | - return false; |
|
233 | + case KlarnaCountry::AT: |
|
234 | + case KlarnaCountry::DE: |
|
235 | + case KlarnaCountry::NL: |
|
236 | + case KlarnaCountry::FI: |
|
237 | + return KlarnaCurrency::EUR; |
|
238 | + case KlarnaCountry::DK: |
|
239 | + return KlarnaCurrency::DKK; |
|
240 | + case KlarnaCountry::NO: |
|
241 | + return KlarnaCurrency::NOK; |
|
242 | + case KlarnaCountry::SE: |
|
243 | + return KlarnaCurrency::SEK; |
|
244 | + default: |
|
245 | + return false; |
|
246 | 246 | } |
247 | 247 | } |
248 | 248 |
@@ -141,7 +141,7 @@ discard block |
||
141 | 141 | */ |
142 | 142 | public static function checkLanguage($country, $language) |
143 | 143 | { |
144 | - switch($country) { |
|
144 | + switch ($country) { |
|
145 | 145 | case KlarnaCountry::AT: |
146 | 146 | case KlarnaCountry::DE: |
147 | 147 | return ($language === KlarnaLanguage::DE); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | */ |
173 | 173 | public static function checkCurrency($country, $currency) |
174 | 174 | { |
175 | - switch($country) { |
|
175 | + switch ($country) { |
|
176 | 176 | case KlarnaCountry::AT: |
177 | 177 | case KlarnaCountry::DE: |
178 | 178 | case KlarnaCountry::NL: |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | */ |
201 | 201 | public static function getLanguage($country) |
202 | 202 | { |
203 | - switch($country) { |
|
203 | + switch ($country) { |
|
204 | 204 | case KlarnaCountry::AT: |
205 | 205 | case KlarnaCountry::DE: |
206 | 206 | return KlarnaLanguage::DE; |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | */ |
230 | 230 | public static function getCurrency($country) |
231 | 231 | { |
232 | - switch($country) { |
|
232 | + switch ($country) { |
|
233 | 233 | case KlarnaCountry::AT: |
234 | 234 | case KlarnaCountry::DE: |
235 | 235 | case KlarnaCountry::NL: |
@@ -261,105 +261,105 @@ discard block |
||
261 | 261 | * @var array |
262 | 262 | */ |
263 | 263 | private static $_countries = array( |
264 | - 'AF' => 1, // AFGHANISTAN |
|
265 | - 'AX' => 2, // ÅLAND ISLANDS |
|
266 | - 'AL' => 3, // ALBANIA |
|
267 | - 'DZ' => 4, // ALGERIA |
|
268 | - 'AS' => 5, // AMERICAN SAMOA |
|
269 | - 'AD' => 6, // ANDORRA |
|
270 | - 'AO' => 7, // ANGOLA |
|
271 | - 'AI' => 8, // ANGUILLA |
|
272 | - 'AQ' => 9, // ANTARCTICA |
|
273 | - 'AG' => 10, // ANTIGUA AND BARBUDA |
|
274 | - 'AR' => 11, // ARGENTINA |
|
275 | - 'AM' => 12, // ARMENIA |
|
276 | - 'AW' => 13, // ARUBA |
|
277 | - 'AU' => 14, // AUSTRALIA |
|
278 | - 'AT' => 15, // AUSTRIA |
|
279 | - 'AZ' => 16, // AZERBAIJAN |
|
280 | - 'BS' => 17, // BAHAMAS |
|
281 | - 'BH' => 18, // BAHRAIN |
|
282 | - 'BD' => 19, // BANGLADESH |
|
283 | - 'BB' => 20, // BARBADOS |
|
284 | - 'BY' => 21, // BELARUS |
|
285 | - 'BE' => 22, // BELGIUM |
|
286 | - 'BZ' => 23, // BELIZE |
|
287 | - 'BJ' => 24, // BENIN |
|
288 | - 'BM' => 25, // BERMUDA |
|
289 | - 'BT' => 26, // BHUTAN |
|
290 | - 'BO' => 27, // BOLIVIA |
|
291 | - 'BA' => 28, // BOSNIA AND HERZEGOVINA |
|
292 | - 'BW' => 29, // BOTSWANA |
|
293 | - 'BV' => 30, // BOUVET ISLAND |
|
294 | - 'BR' => 31, // BRAZIL |
|
295 | - 'IO' => 32, // BRITISH INDIAN OCEAN TERRITORY |
|
296 | - 'BN' => 33, // BRUNEI DARUSSALAM |
|
297 | - 'BG' => 34, // BULGARIA |
|
298 | - 'BF' => 35, // BURKINA FASO |
|
299 | - 'BI' => 36, // BURUNDI |
|
300 | - 'KH' => 37, // CAMBODIA |
|
301 | - 'CM' => 38, // CAMEROON |
|
302 | - 'CA' => 39, // CANADA |
|
303 | - 'CV' => 40, // CAPE VERDE |
|
304 | - 'KY' => 41, // CAYMAN ISLANDS |
|
305 | - 'CF' => 42, // CENTRAL AFRICAN REPUBLIC |
|
306 | - 'TD' => 43, // CHAD |
|
307 | - 'CL' => 44, // CHILE |
|
308 | - 'CN' => 45, // CHINA |
|
309 | - 'CX' => 46, // CHRISTMAS ISLAND |
|
310 | - 'CC' => 47, // COCOS (KEELING) ISLANDS |
|
311 | - 'CO' => 48, // COLOMBIA |
|
312 | - 'KM' => 49, // COMOROS |
|
313 | - 'CG' => 50, // CONGO |
|
314 | - 'CD' => 51, // CONGO, THE DEMOCRATIC REPUBLIC OF THE |
|
315 | - 'CK' => 52, // COOK ISLANDS |
|
316 | - 'CR' => 53, // COSTA RICA |
|
317 | - 'CI' => 54, // COTE D'IVOIRE |
|
318 | - 'HR' => 55, // CROATIA |
|
319 | - 'CU' => 56, // CUBA |
|
320 | - 'CY' => 57, // CYPRUS |
|
321 | - 'CZ' => 58, // CZECH REPUBLIC |
|
322 | - 'DK' => 59, // DENMARK |
|
323 | - 'DJ' => 60, // DJIBOUTI |
|
324 | - 'DM' => 61, // DOMINICA |
|
325 | - 'DO' => 62, // DOMINICAN REPUBLIC |
|
326 | - 'EC' => 63, // ECUADOR |
|
327 | - 'EG' => 64, // EGYPT |
|
328 | - 'SV' => 65, // EL SALVADOR |
|
329 | - 'GQ' => 66, // EQUATORIAL GUINEA |
|
330 | - 'ER' => 67, // ERITREA |
|
331 | - 'EE' => 68, // ESTONIA |
|
332 | - 'ET' => 69, // ETHIOPIA |
|
333 | - 'FK' => 70, // FALKLAND ISLANDS (MALVINAS) |
|
334 | - 'FO' => 71, // FAROE ISLANDS |
|
335 | - 'FJ' => 72, // FIJI |
|
336 | - 'FI' => 73, // FINLAND |
|
337 | - 'FR' => 74, // FRANCE |
|
338 | - 'GF' => 75, // FRENCH GUIANA |
|
339 | - 'PF' => 76, // FRENCH POLYNESIA |
|
340 | - 'TF' => 77, // FRENCH SOUTHERN TERRITORIES |
|
341 | - 'GA' => 78, // GABON |
|
342 | - 'GM' => 79, // GAMBIA |
|
343 | - 'GE' => 80, // GEORGIA |
|
344 | - 'DE' => 81, // GERMANY |
|
345 | - 'GH' => 82, // GHANA |
|
346 | - 'GI' => 83, // GIBRALTAR |
|
347 | - 'GR' => 84, // GREECE |
|
348 | - 'GL' => 85, // GREENLAND |
|
349 | - 'GD' => 86, // GRENADA |
|
350 | - 'GP' => 87, // GUADELOUPE |
|
351 | - 'GU' => 88, // GUAM |
|
352 | - 'GT' => 89, // GUATEMALA |
|
353 | - 'GG' => 90, // GUERNSEY |
|
354 | - 'GN' => 91, // GUINEA |
|
355 | - 'GW' => 92, // GUINEA-BISSAU |
|
356 | - 'GY' => 93, // GUYANA |
|
357 | - 'HT' => 94, // HAITI |
|
358 | - 'HM' => 95, // HEARD ISLAND AND MCDONALD ISLANDS |
|
359 | - 'VA' => 96, // HOLY SEE (VATICAN CITY STATE) |
|
360 | - 'HN' => 97, // HONDURAS |
|
361 | - 'HK' => 98, // HONG KONG |
|
362 | - 'HU' => 99, // HUNGARY |
|
264 | + 'AF' => 1, // AFGHANISTAN |
|
265 | + 'AX' => 2, // ÅLAND ISLANDS |
|
266 | + 'AL' => 3, // ALBANIA |
|
267 | + 'DZ' => 4, // ALGERIA |
|
268 | + 'AS' => 5, // AMERICAN SAMOA |
|
269 | + 'AD' => 6, // ANDORRA |
|
270 | + 'AO' => 7, // ANGOLA |
|
271 | + 'AI' => 8, // ANGUILLA |
|
272 | + 'AQ' => 9, // ANTARCTICA |
|
273 | + 'AG' => 10, // ANTIGUA AND BARBUDA |
|
274 | + 'AR' => 11, // ARGENTINA |
|
275 | + 'AM' => 12, // ARMENIA |
|
276 | + 'AW' => 13, // ARUBA |
|
277 | + 'AU' => 14, // AUSTRALIA |
|
278 | + 'AT' => 15, // AUSTRIA |
|
279 | + 'AZ' => 16, // AZERBAIJAN |
|
280 | + 'BS' => 17, // BAHAMAS |
|
281 | + 'BH' => 18, // BAHRAIN |
|
282 | + 'BD' => 19, // BANGLADESH |
|
283 | + 'BB' => 20, // BARBADOS |
|
284 | + 'BY' => 21, // BELARUS |
|
285 | + 'BE' => 22, // BELGIUM |
|
286 | + 'BZ' => 23, // BELIZE |
|
287 | + 'BJ' => 24, // BENIN |
|
288 | + 'BM' => 25, // BERMUDA |
|
289 | + 'BT' => 26, // BHUTAN |
|
290 | + 'BO' => 27, // BOLIVIA |
|
291 | + 'BA' => 28, // BOSNIA AND HERZEGOVINA |
|
292 | + 'BW' => 29, // BOTSWANA |
|
293 | + 'BV' => 30, // BOUVET ISLAND |
|
294 | + 'BR' => 31, // BRAZIL |
|
295 | + 'IO' => 32, // BRITISH INDIAN OCEAN TERRITORY |
|
296 | + 'BN' => 33, // BRUNEI DARUSSALAM |
|
297 | + 'BG' => 34, // BULGARIA |
|
298 | + 'BF' => 35, // BURKINA FASO |
|
299 | + 'BI' => 36, // BURUNDI |
|
300 | + 'KH' => 37, // CAMBODIA |
|
301 | + 'CM' => 38, // CAMEROON |
|
302 | + 'CA' => 39, // CANADA |
|
303 | + 'CV' => 40, // CAPE VERDE |
|
304 | + 'KY' => 41, // CAYMAN ISLANDS |
|
305 | + 'CF' => 42, // CENTRAL AFRICAN REPUBLIC |
|
306 | + 'TD' => 43, // CHAD |
|
307 | + 'CL' => 44, // CHILE |
|
308 | + 'CN' => 45, // CHINA |
|
309 | + 'CX' => 46, // CHRISTMAS ISLAND |
|
310 | + 'CC' => 47, // COCOS (KEELING) ISLANDS |
|
311 | + 'CO' => 48, // COLOMBIA |
|
312 | + 'KM' => 49, // COMOROS |
|
313 | + 'CG' => 50, // CONGO |
|
314 | + 'CD' => 51, // CONGO, THE DEMOCRATIC REPUBLIC OF THE |
|
315 | + 'CK' => 52, // COOK ISLANDS |
|
316 | + 'CR' => 53, // COSTA RICA |
|
317 | + 'CI' => 54, // COTE D'IVOIRE |
|
318 | + 'HR' => 55, // CROATIA |
|
319 | + 'CU' => 56, // CUBA |
|
320 | + 'CY' => 57, // CYPRUS |
|
321 | + 'CZ' => 58, // CZECH REPUBLIC |
|
322 | + 'DK' => 59, // DENMARK |
|
323 | + 'DJ' => 60, // DJIBOUTI |
|
324 | + 'DM' => 61, // DOMINICA |
|
325 | + 'DO' => 62, // DOMINICAN REPUBLIC |
|
326 | + 'EC' => 63, // ECUADOR |
|
327 | + 'EG' => 64, // EGYPT |
|
328 | + 'SV' => 65, // EL SALVADOR |
|
329 | + 'GQ' => 66, // EQUATORIAL GUINEA |
|
330 | + 'ER' => 67, // ERITREA |
|
331 | + 'EE' => 68, // ESTONIA |
|
332 | + 'ET' => 69, // ETHIOPIA |
|
333 | + 'FK' => 70, // FALKLAND ISLANDS (MALVINAS) |
|
334 | + 'FO' => 71, // FAROE ISLANDS |
|
335 | + 'FJ' => 72, // FIJI |
|
336 | + 'FI' => 73, // FINLAND |
|
337 | + 'FR' => 74, // FRANCE |
|
338 | + 'GF' => 75, // FRENCH GUIANA |
|
339 | + 'PF' => 76, // FRENCH POLYNESIA |
|
340 | + 'TF' => 77, // FRENCH SOUTHERN TERRITORIES |
|
341 | + 'GA' => 78, // GABON |
|
342 | + 'GM' => 79, // GAMBIA |
|
343 | + 'GE' => 80, // GEORGIA |
|
344 | + 'DE' => 81, // GERMANY |
|
345 | + 'GH' => 82, // GHANA |
|
346 | + 'GI' => 83, // GIBRALTAR |
|
347 | + 'GR' => 84, // GREECE |
|
348 | + 'GL' => 85, // GREENLAND |
|
349 | + 'GD' => 86, // GRENADA |
|
350 | + 'GP' => 87, // GUADELOUPE |
|
351 | + 'GU' => 88, // GUAM |
|
352 | + 'GT' => 89, // GUATEMALA |
|
353 | + 'GG' => 90, // GUERNSEY |
|
354 | + 'GN' => 91, // GUINEA |
|
355 | + 'GW' => 92, // GUINEA-BISSAU |
|
356 | + 'GY' => 93, // GUYANA |
|
357 | + 'HT' => 94, // HAITI |
|
358 | + 'HM' => 95, // HEARD ISLAND AND MCDONALD ISLANDS |
|
359 | + 'VA' => 96, // HOLY SEE (VATICAN CITY STATE) |
|
360 | + 'HN' => 97, // HONDURAS |
|
361 | + 'HK' => 98, // HONG KONG |
|
362 | + 'HU' => 99, // HUNGARY |
|
363 | 363 | 'IS' => 100, // ICELAND |
364 | 364 | 'IN' => 101, // INDIA |
365 | 365 | 'ID' => 102, // INDONESIA |
@@ -114,22 +114,22 @@ discard block |
||
114 | 114 | public static function get($country) |
115 | 115 | { |
116 | 116 | switch (strtoupper($country)) { |
117 | - case "DE": |
|
118 | - return KlarnaEncoding::PNO_DE; |
|
119 | - case "DK": |
|
120 | - return KlarnaEncoding::PNO_DK; |
|
121 | - case "FI": |
|
122 | - return KlarnaEncoding::PNO_FI; |
|
123 | - case "NL": |
|
124 | - return KlarnaEncoding::PNO_NL; |
|
125 | - case "NO": |
|
126 | - return KlarnaEncoding::PNO_NO; |
|
127 | - case "SE": |
|
128 | - return KlarnaEncoding::PNO_SE; |
|
129 | - case "AT": |
|
130 | - return KlarnaEncoding::PNO_AT; |
|
131 | - default: |
|
132 | - return -1; |
|
117 | + case "DE": |
|
118 | + return KlarnaEncoding::PNO_DE; |
|
119 | + case "DK": |
|
120 | + return KlarnaEncoding::PNO_DK; |
|
121 | + case "FI": |
|
122 | + return KlarnaEncoding::PNO_FI; |
|
123 | + case "NL": |
|
124 | + return KlarnaEncoding::PNO_NL; |
|
125 | + case "NO": |
|
126 | + return KlarnaEncoding::PNO_NO; |
|
127 | + case "SE": |
|
128 | + return KlarnaEncoding::PNO_SE; |
|
129 | + case "AT": |
|
130 | + return KlarnaEncoding::PNO_AT; |
|
131 | + default: |
|
132 | + return -1; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | |
@@ -144,8 +144,8 @@ discard block |
||
144 | 144 | public static function getRegexp($enc) |
145 | 145 | { |
146 | 146 | switch($enc) { |
147 | - case self::PNO_SE: |
|
148 | - /* |
|
147 | + case self::PNO_SE: |
|
148 | + /* |
|
149 | 149 | * All positions except C contain numbers 0-9. |
150 | 150 | * |
151 | 151 | * PNO: |
@@ -161,10 +161,10 @@ discard block |
||
161 | 161 | * 16XXXXXX-NNNN |
162 | 162 | * |
163 | 163 | */ |
164 | - return '/^[0-9]{6,6}(([0-9]{2,2}[-\+]{1,1}[0-9]{4,4})|([-\+]'. |
|
165 | - '{1,1}[0-9]{4,4})|([0-9]{4,6}))$/'; |
|
166 | - case self::PNO_NO: |
|
167 | - /* |
|
164 | + return '/^[0-9]{6,6}(([0-9]{2,2}[-\+]{1,1}[0-9]{4,4})|([-\+]'. |
|
165 | + '{1,1}[0-9]{4,4})|([0-9]{4,6}))$/'; |
|
166 | + case self::PNO_NO: |
|
167 | + /* |
|
168 | 168 | * All positions contain numbers 0-9. |
169 | 169 | * |
170 | 170 | * Pno |
@@ -178,10 +178,10 @@ discard block |
||
178 | 178 | * |
179 | 179 | * NNNNNNNNK (orgno) length = 9 |
180 | 180 | */ |
181 | - return '/^[0-9]{6,6}((-[0-9]{5,5})|([0-9]{2,2}((-[0-9]'. |
|
182 | - '{5,5})|([0-9]{1,1})|([0-9]{3,3})|([0-9]{5,5))))$/'; |
|
183 | - case self::PNO_FI: |
|
184 | - /* |
|
181 | + return '/^[0-9]{6,6}((-[0-9]{5,5})|([0-9]{2,2}((-[0-9]'. |
|
182 | + '{5,5})|([0-9]{1,1})|([0-9]{3,3})|([0-9]{5,5))))$/'; |
|
183 | + case self::PNO_FI: |
|
184 | + /* |
|
185 | 185 | * Pno |
186 | 186 | * DDMMYYCIIIT |
187 | 187 | * DDMMYYIIIT |
@@ -194,11 +194,11 @@ discard block |
||
194 | 194 | * NNNNNNNT |
195 | 195 | * T = 0-9, A-F, H, J, K-N, P, R-Y |
196 | 196 | */ |
197 | - return '/^[0-9]{6,6}(([A\+-]{1,1}[0-9]{3,3}[0-9A-FHJK-NPR-Y]'. |
|
198 | - '{1,1})|([0-9]{3,3}[0-9A-FHJK-NPR-Y]{1,1})|([0-9]{1,1}-{0,1}'. |
|
199 | - '[0-9A-FHJK-NPR-Y]{1,1}))$/i'; |
|
200 | - case self::PNO_DK: |
|
201 | - /* |
|
197 | + return '/^[0-9]{6,6}(([A\+-]{1,1}[0-9]{3,3}[0-9A-FHJK-NPR-Y]'. |
|
198 | + '{1,1})|([0-9]{3,3}[0-9A-FHJK-NPR-Y]{1,1})|([0-9]{1,1}-{0,1}'. |
|
199 | + '[0-9A-FHJK-NPR-Y]{1,1}))$/i'; |
|
200 | + case self::PNO_DK: |
|
201 | + /* |
|
202 | 202 | * Pno |
203 | 203 | * DDMMYYNNNG length 10 |
204 | 204 | * G = gender, odd/even for men/women. |
@@ -206,10 +206,10 @@ discard block |
||
206 | 206 | * Orgno |
207 | 207 | * XXXXXXXX length 8 |
208 | 208 | */ |
209 | - return '/^[0-9]{8,8}([0-9]{2,2})?$/'; |
|
210 | - case self::PNO_NL: |
|
211 | - case self::PNO_DE: |
|
212 | - /** |
|
209 | + return '/^[0-9]{8,8}([0-9]{2,2})?$/'; |
|
210 | + case self::PNO_NL: |
|
211 | + case self::PNO_DE: |
|
212 | + /** |
|
213 | 213 | * Pno |
214 | 214 | * DDMMYYYYG length 9 |
215 | 215 | * DDMMYYYY 8 |
@@ -217,21 +217,21 @@ discard block |
||
217 | 217 | * Orgno |
218 | 218 | * XXXXXXX 7 company org nr |
219 | 219 | */ |
220 | - return '/^[0-9]{7,9}$/'; |
|
221 | - case self::EMAIL: |
|
222 | - /** |
|
220 | + return '/^[0-9]{7,9}$/'; |
|
221 | + case self::EMAIL: |
|
222 | + /** |
|
223 | 223 | * Validates an email. |
224 | 224 | */ |
225 | - return '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]'. |
|
226 | - '+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z0-9-][a-zA-Z0-9-]+)+$/'; |
|
227 | - case self::CELLNO: |
|
228 | - /** |
|
225 | + return '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]'. |
|
226 | + '+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z0-9-][a-zA-Z0-9-]+)+$/'; |
|
227 | + case self::CELLNO: |
|
228 | + /** |
|
229 | 229 | * Validates a cellno. |
230 | 230 | * @TODO Is this encoding only for Sweden? |
231 | 231 | */ |
232 | - return '/^07[\ \-0-9]{8,13}$/'; |
|
233 | - default: |
|
234 | - throw new Klarna_UnknownEncodingException($enc); |
|
232 | + return '/^07[\ \-0-9]{8,13}$/'; |
|
233 | + default: |
|
234 | + throw new Klarna_UnknownEncodingException($enc); |
|
235 | 235 | } |
236 | 236 | } |
237 | 237 |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | */ |
144 | 144 | public static function getRegexp($enc) |
145 | 145 | { |
146 | - switch($enc) { |
|
146 | + switch ($enc) { |
|
147 | 147 | case self::PNO_SE: |
148 | 148 | /* |
149 | 149 | * All positions except C contain numbers 0-9. |
@@ -161,7 +161,7 @@ discard block |
||
161 | 161 | * 16XXXXXX-NNNN |
162 | 162 | * |
163 | 163 | */ |
164 | - return '/^[0-9]{6,6}(([0-9]{2,2}[-\+]{1,1}[0-9]{4,4})|([-\+]'. |
|
164 | + return '/^[0-9]{6,6}(([0-9]{2,2}[-\+]{1,1}[0-9]{4,4})|([-\+]' . |
|
165 | 165 | '{1,1}[0-9]{4,4})|([0-9]{4,6}))$/'; |
166 | 166 | case self::PNO_NO: |
167 | 167 | /* |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | * |
179 | 179 | * NNNNNNNNK (orgno) length = 9 |
180 | 180 | */ |
181 | - return '/^[0-9]{6,6}((-[0-9]{5,5})|([0-9]{2,2}((-[0-9]'. |
|
181 | + return '/^[0-9]{6,6}((-[0-9]{5,5})|([0-9]{2,2}((-[0-9]' . |
|
182 | 182 | '{5,5})|([0-9]{1,1})|([0-9]{3,3})|([0-9]{5,5))))$/'; |
183 | 183 | case self::PNO_FI: |
184 | 184 | /* |
@@ -194,8 +194,8 @@ discard block |
||
194 | 194 | * NNNNNNNT |
195 | 195 | * T = 0-9, A-F, H, J, K-N, P, R-Y |
196 | 196 | */ |
197 | - return '/^[0-9]{6,6}(([A\+-]{1,1}[0-9]{3,3}[0-9A-FHJK-NPR-Y]'. |
|
198 | - '{1,1})|([0-9]{3,3}[0-9A-FHJK-NPR-Y]{1,1})|([0-9]{1,1}-{0,1}'. |
|
197 | + return '/^[0-9]{6,6}(([A\+-]{1,1}[0-9]{3,3}[0-9A-FHJK-NPR-Y]' . |
|
198 | + '{1,1})|([0-9]{3,3}[0-9A-FHJK-NPR-Y]{1,1})|([0-9]{1,1}-{0,1}' . |
|
199 | 199 | '[0-9A-FHJK-NPR-Y]{1,1}))$/i'; |
200 | 200 | case self::PNO_DK: |
201 | 201 | /* |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | /** |
223 | 223 | * Validates an email. |
224 | 224 | */ |
225 | - return '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]'. |
|
225 | + return '/^[_a-zA-Z0-9-]+(\.[_a-zA-Z0-9-]+)*@[a-zA-Z0-9-]' . |
|
226 | 226 | '+(\.[a-zA-Z0-9-]+)*(\.[a-zA-Z0-9-][a-zA-Z0-9-]+)+$/'; |
227 | 227 | case self::CELLNO: |
228 | 228 | /** |
@@ -724,10 +724,10 @@ |
||
724 | 724 | class Klarna_XMLParseException extends KlarnaException |
725 | 725 | { |
726 | 726 | /** |
727 | - * Constructor |
|
728 | - * |
|
729 | - * @param string $file filename |
|
730 | - */ |
|
727 | + * Constructor |
|
728 | + * |
|
729 | + * @param string $file filename |
|
730 | + */ |
|
731 | 731 | public function __construct($file) |
732 | 732 | { |
733 | 733 | parent::__construct("Unable to parse XML file: {$file}!"); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | */ |
35 | 35 | public function __toString() |
36 | 36 | { |
37 | - return $this->getMessage() . " (#".$this->code.")"; |
|
37 | + return $this->getMessage() . " (#" . $this->code . ")"; |
|
38 | 38 | } |
39 | 39 | } |
40 | 40 | |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | { |
335 | 335 | $countryCode = KlarnaCountry::getCode($country); |
336 | 336 | parent::__construct( |
337 | - "Mismatching country/currency for '{$countryCode}'! ". |
|
337 | + "Mismatching country/currency for '{$countryCode}'! " . |
|
338 | 338 | "[country: $country currency: $currency]", |
339 | 339 | 50011 |
340 | 340 | ); |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | { |
364 | 364 | $countryCode = KlarnaCountry::getCode($country); |
365 | 365 | parent::__construct( |
366 | - "Mismatching country/language for '{$countryCode}'! ". |
|
366 | + "Mismatching country/language for '{$countryCode}'! " . |
|
367 | 367 | "[country: $country language: $language]", |
368 | 368 | 50024 |
369 | 369 | ); |
@@ -129,172 +129,172 @@ |
||
129 | 129 | * @var array |
130 | 130 | */ |
131 | 131 | private static $_languages = array( |
132 | - 'AA' => 1, // Afar |
|
133 | - 'AB' => 2, // Abkhazian |
|
134 | - 'AE' => 3, // Avestan |
|
135 | - 'AF' => 4, // Afrikaans |
|
136 | - 'AM' => 5, // Amharic |
|
137 | - 'AR' => 6, // Arabic |
|
138 | - 'AS' => 7, // Assamese |
|
139 | - 'AY' => 8, // Aymara |
|
140 | - 'AZ' => 9, // Azerbaijani |
|
141 | - 'BA' => 10, // Bashkir |
|
142 | - 'BE' => 11, // Byelorussian; Belarusian |
|
143 | - 'BG' => 12, // Bulgarian |
|
144 | - 'BH' => 13, // Bihari |
|
145 | - 'BI' => 14, // Bislama |
|
146 | - 'BN' => 15, // Bengali; Bangla |
|
147 | - 'BO' => 16, // Tibetan |
|
148 | - 'BR' => 17, // Breton |
|
149 | - 'BS' => 18, // Bosnian |
|
150 | - 'CA' => 19, // Catalan |
|
151 | - 'CE' => 20, // Chechen |
|
152 | - 'CH' => 21, // Chamorro |
|
153 | - 'CO' => 22, // Corsican |
|
154 | - 'CS' => 23, // Czech |
|
155 | - 'CU' => 24, // Church Slavic |
|
156 | - 'CV' => 25, // Chuvash |
|
157 | - 'CY' => 26, // Welsh |
|
158 | - 'DA' => 27, // Danish |
|
159 | - 'DE' => 28, // German |
|
160 | - 'DZ' => 29, // Dzongkha; Bhutani |
|
161 | - 'EL' => 30, // Greek |
|
162 | - 'EN' => 31, // English |
|
163 | - 'EO' => 32, // Esperanto |
|
164 | - 'ES' => 33, // Spanish |
|
165 | - 'ET' => 34, // Estonian |
|
166 | - 'EU' => 35, // Basque |
|
167 | - 'FA' => 36, // Persian |
|
168 | - 'FI' => 37, // Finnish |
|
169 | - 'FJ' => 38, // Fijian; Fiji |
|
170 | - 'FO' => 39, // Faroese |
|
171 | - 'FR' => 40, // French |
|
172 | - 'FY' => 41, // Frisian |
|
173 | - 'GA' => 42, // Irish |
|
174 | - 'GD' => 43, // Scots; Gaelic |
|
175 | - 'GL' => 44, // Gallegan; Galician |
|
176 | - 'GN' => 45, // Guarani |
|
177 | - 'GU' => 46, // Gujarati |
|
178 | - 'GV' => 47, // Manx |
|
179 | - 'HA' => 48, // Hausa |
|
180 | - 'HE' => 49, // Hebrew (formerly iw) |
|
181 | - 'HI' => 50, // Hindi |
|
182 | - 'HO' => 51, // Hiri Motu |
|
183 | - 'HR' => 52, // Croatian |
|
184 | - 'HU' => 53, // Hungarian |
|
185 | - 'HY' => 54, // Armenian |
|
186 | - 'HZ' => 55, // Herero |
|
187 | - 'IA' => 56, // Interlingua |
|
188 | - 'ID' => 57, // Indonesian (formerly in) |
|
189 | - 'IE' => 58, // Interlingue |
|
190 | - 'IK' => 59, // Inupiak |
|
191 | - 'IO' => 60, // Ido |
|
192 | - 'IS' => 61, // Icelandic |
|
193 | - 'IT' => 62, // Italian |
|
194 | - 'IU' => 63, // Inuktitut |
|
195 | - 'JA' => 64, // Japanese |
|
196 | - 'JV' => 65, // Javanese |
|
197 | - 'KA' => 66, // Georgian |
|
198 | - 'KI' => 67, // Kikuyu |
|
199 | - 'KJ' => 68, // Kuanyama |
|
200 | - 'KK' => 69, // Kazakh |
|
201 | - 'KL' => 70, // Kalaallisut; Greenlandic |
|
202 | - 'KM' => 71, // Khmer; Cambodian |
|
203 | - 'KN' => 72, // Kannada |
|
204 | - 'KO' => 73, // Korean |
|
205 | - 'KS' => 74, // Kashmiri |
|
206 | - 'KU' => 75, // Kurdish |
|
207 | - 'KV' => 76, // Komi |
|
208 | - 'KW' => 77, // Cornish |
|
209 | - 'KY' => 78, // Kirghiz |
|
210 | - 'LA' => 79, // Latin |
|
211 | - 'LB' => 80, // Letzeburgesch |
|
212 | - 'LN' => 81, // Lingala |
|
213 | - 'LO' => 82, // Lao; Laotian |
|
214 | - 'LT' => 83, // Lithuanian |
|
215 | - 'LV' => 84, // Latvian; Lettish |
|
216 | - 'MG' => 85, // Malagasy |
|
217 | - 'MH' => 86, // Marshall |
|
218 | - 'MI' => 87, // Maori |
|
219 | - 'MK' => 88, // Macedonian |
|
220 | - 'ML' => 89, // Malayalam |
|
221 | - 'MN' => 90, // Mongolian |
|
222 | - 'MO' => 91, // Moldavian |
|
223 | - 'MR' => 92, // Marathi |
|
224 | - 'MS' => 93, // Malay |
|
225 | - 'MT' => 94, // Maltese |
|
226 | - 'MY' => 95, // Burmese |
|
227 | - 'NA' => 96, // Nauru |
|
228 | - 'NB' => 97, // Norwegian Bokmål |
|
229 | - 'ND' => 98, // Ndebele, North |
|
230 | - 'NE' => 99, // Nepali |
|
231 | - 'NG' => 100, // Ndonga |
|
232 | - 'NL' => 101, // Dutch |
|
233 | - 'NN' => 102, // Norwegian Nynorsk |
|
234 | - 'NO' => 103, // Norwegian |
|
235 | - 'NR' => 104, // Ndebele, South |
|
236 | - 'NV' => 105, // Navajo |
|
237 | - 'NY' => 106, // Chichewa; Nyanja |
|
238 | - 'OC' => 107, // Occitan; Provençal |
|
239 | - 'OM' => 108, // (Afan) Oromo |
|
240 | - 'OR' => 109, // Oriya |
|
241 | - 'OS' => 110, // Ossetian; Ossetic |
|
242 | - 'PA' => 111, // Panjabi; Punjabi |
|
243 | - 'PI' => 112, // Pali |
|
244 | - 'PL' => 113, // Polish |
|
245 | - 'PS' => 114, // Pashto, Pushto |
|
246 | - 'PT' => 115, // Portuguese |
|
247 | - 'QU' => 116, // Quechua |
|
248 | - 'RM' => 117, // Rhaeto-Romance |
|
249 | - 'RN' => 118, // Rundi; Kirundi |
|
250 | - 'RO' => 119, // Romanian |
|
251 | - 'RU' => 120, // Russian |
|
252 | - 'RW' => 121, // Kinyarwanda |
|
253 | - 'SA' => 122, // Sanskrit |
|
254 | - 'SC' => 123, // Sardinian |
|
255 | - 'SD' => 124, // Sindhi |
|
256 | - 'SE' => 125, // Northern Sami |
|
257 | - 'SG' => 126, // Sango; Sangro |
|
258 | - 'SI' => 127, // Sinhalese |
|
259 | - 'SK' => 128, // Slovak |
|
260 | - 'SL' => 129, // Slovenian |
|
261 | - 'SM' => 130, // Samoan |
|
262 | - 'SN' => 131, // Shona |
|
263 | - 'SO' => 132, // Somali |
|
264 | - 'SQ' => 133, // Albanian |
|
265 | - 'SR' => 134, // Serbian |
|
266 | - 'SS' => 135, // Swati; Siswati |
|
267 | - 'ST' => 136, // Sesotho; Sotho, Southern |
|
268 | - 'SU' => 137, // Sundanese |
|
269 | - 'SV' => 138, // Swedish |
|
270 | - 'SW' => 139, // Swahili |
|
271 | - 'TA' => 140, // Tamil |
|
272 | - 'TE' => 141, // Telugu |
|
273 | - 'TG' => 142, // Tajik |
|
274 | - 'TH' => 143, // Thai |
|
275 | - 'TI' => 144, // Tigrinya |
|
276 | - 'TK' => 145, // Turkmen |
|
277 | - 'TL' => 146, // Tagalog |
|
278 | - 'TN' => 147, // Tswana; Setswana |
|
279 | - 'TO' => 148, // Tongan |
|
280 | - 'TR' => 149, // Turkish |
|
281 | - 'TS' => 150, // Tsonga |
|
282 | - 'TT' => 151, // Tatar |
|
283 | - 'TW' => 152, // Twi |
|
284 | - 'TY' => 153, // Tahitian |
|
285 | - 'UG' => 154, // Uighur |
|
286 | - 'UK' => 155, // Ukrainian |
|
287 | - 'UR' => 156, // Urdu |
|
288 | - 'UZ' => 157, // Uzbek |
|
289 | - 'VI' => 158, // Vietnamese |
|
290 | - 'VO' => 159, // Volapuk |
|
291 | - 'WA' => 160, // Walloon |
|
292 | - 'WO' => 161, // Wolof |
|
293 | - 'XH' => 162, // Xhosa |
|
294 | - 'YI' => 163, // Yiddish (formerly ji) |
|
295 | - 'YO' => 164, // Yoruba |
|
296 | - 'ZA' => 165, // Zhuang |
|
297 | - 'ZH' => 166, // Chinese |
|
132 | + 'AA' => 1, // Afar |
|
133 | + 'AB' => 2, // Abkhazian |
|
134 | + 'AE' => 3, // Avestan |
|
135 | + 'AF' => 4, // Afrikaans |
|
136 | + 'AM' => 5, // Amharic |
|
137 | + 'AR' => 6, // Arabic |
|
138 | + 'AS' => 7, // Assamese |
|
139 | + 'AY' => 8, // Aymara |
|
140 | + 'AZ' => 9, // Azerbaijani |
|
141 | + 'BA' => 10, // Bashkir |
|
142 | + 'BE' => 11, // Byelorussian; Belarusian |
|
143 | + 'BG' => 12, // Bulgarian |
|
144 | + 'BH' => 13, // Bihari |
|
145 | + 'BI' => 14, // Bislama |
|
146 | + 'BN' => 15, // Bengali; Bangla |
|
147 | + 'BO' => 16, // Tibetan |
|
148 | + 'BR' => 17, // Breton |
|
149 | + 'BS' => 18, // Bosnian |
|
150 | + 'CA' => 19, // Catalan |
|
151 | + 'CE' => 20, // Chechen |
|
152 | + 'CH' => 21, // Chamorro |
|
153 | + 'CO' => 22, // Corsican |
|
154 | + 'CS' => 23, // Czech |
|
155 | + 'CU' => 24, // Church Slavic |
|
156 | + 'CV' => 25, // Chuvash |
|
157 | + 'CY' => 26, // Welsh |
|
158 | + 'DA' => 27, // Danish |
|
159 | + 'DE' => 28, // German |
|
160 | + 'DZ' => 29, // Dzongkha; Bhutani |
|
161 | + 'EL' => 30, // Greek |
|
162 | + 'EN' => 31, // English |
|
163 | + 'EO' => 32, // Esperanto |
|
164 | + 'ES' => 33, // Spanish |
|
165 | + 'ET' => 34, // Estonian |
|
166 | + 'EU' => 35, // Basque |
|
167 | + 'FA' => 36, // Persian |
|
168 | + 'FI' => 37, // Finnish |
|
169 | + 'FJ' => 38, // Fijian; Fiji |
|
170 | + 'FO' => 39, // Faroese |
|
171 | + 'FR' => 40, // French |
|
172 | + 'FY' => 41, // Frisian |
|
173 | + 'GA' => 42, // Irish |
|
174 | + 'GD' => 43, // Scots; Gaelic |
|
175 | + 'GL' => 44, // Gallegan; Galician |
|
176 | + 'GN' => 45, // Guarani |
|
177 | + 'GU' => 46, // Gujarati |
|
178 | + 'GV' => 47, // Manx |
|
179 | + 'HA' => 48, // Hausa |
|
180 | + 'HE' => 49, // Hebrew (formerly iw) |
|
181 | + 'HI' => 50, // Hindi |
|
182 | + 'HO' => 51, // Hiri Motu |
|
183 | + 'HR' => 52, // Croatian |
|
184 | + 'HU' => 53, // Hungarian |
|
185 | + 'HY' => 54, // Armenian |
|
186 | + 'HZ' => 55, // Herero |
|
187 | + 'IA' => 56, // Interlingua |
|
188 | + 'ID' => 57, // Indonesian (formerly in) |
|
189 | + 'IE' => 58, // Interlingue |
|
190 | + 'IK' => 59, // Inupiak |
|
191 | + 'IO' => 60, // Ido |
|
192 | + 'IS' => 61, // Icelandic |
|
193 | + 'IT' => 62, // Italian |
|
194 | + 'IU' => 63, // Inuktitut |
|
195 | + 'JA' => 64, // Japanese |
|
196 | + 'JV' => 65, // Javanese |
|
197 | + 'KA' => 66, // Georgian |
|
198 | + 'KI' => 67, // Kikuyu |
|
199 | + 'KJ' => 68, // Kuanyama |
|
200 | + 'KK' => 69, // Kazakh |
|
201 | + 'KL' => 70, // Kalaallisut; Greenlandic |
|
202 | + 'KM' => 71, // Khmer; Cambodian |
|
203 | + 'KN' => 72, // Kannada |
|
204 | + 'KO' => 73, // Korean |
|
205 | + 'KS' => 74, // Kashmiri |
|
206 | + 'KU' => 75, // Kurdish |
|
207 | + 'KV' => 76, // Komi |
|
208 | + 'KW' => 77, // Cornish |
|
209 | + 'KY' => 78, // Kirghiz |
|
210 | + 'LA' => 79, // Latin |
|
211 | + 'LB' => 80, // Letzeburgesch |
|
212 | + 'LN' => 81, // Lingala |
|
213 | + 'LO' => 82, // Lao; Laotian |
|
214 | + 'LT' => 83, // Lithuanian |
|
215 | + 'LV' => 84, // Latvian; Lettish |
|
216 | + 'MG' => 85, // Malagasy |
|
217 | + 'MH' => 86, // Marshall |
|
218 | + 'MI' => 87, // Maori |
|
219 | + 'MK' => 88, // Macedonian |
|
220 | + 'ML' => 89, // Malayalam |
|
221 | + 'MN' => 90, // Mongolian |
|
222 | + 'MO' => 91, // Moldavian |
|
223 | + 'MR' => 92, // Marathi |
|
224 | + 'MS' => 93, // Malay |
|
225 | + 'MT' => 94, // Maltese |
|
226 | + 'MY' => 95, // Burmese |
|
227 | + 'NA' => 96, // Nauru |
|
228 | + 'NB' => 97, // Norwegian Bokmål |
|
229 | + 'ND' => 98, // Ndebele, North |
|
230 | + 'NE' => 99, // Nepali |
|
231 | + 'NG' => 100, // Ndonga |
|
232 | + 'NL' => 101, // Dutch |
|
233 | + 'NN' => 102, // Norwegian Nynorsk |
|
234 | + 'NO' => 103, // Norwegian |
|
235 | + 'NR' => 104, // Ndebele, South |
|
236 | + 'NV' => 105, // Navajo |
|
237 | + 'NY' => 106, // Chichewa; Nyanja |
|
238 | + 'OC' => 107, // Occitan; Provençal |
|
239 | + 'OM' => 108, // (Afan) Oromo |
|
240 | + 'OR' => 109, // Oriya |
|
241 | + 'OS' => 110, // Ossetian; Ossetic |
|
242 | + 'PA' => 111, // Panjabi; Punjabi |
|
243 | + 'PI' => 112, // Pali |
|
244 | + 'PL' => 113, // Polish |
|
245 | + 'PS' => 114, // Pashto, Pushto |
|
246 | + 'PT' => 115, // Portuguese |
|
247 | + 'QU' => 116, // Quechua |
|
248 | + 'RM' => 117, // Rhaeto-Romance |
|
249 | + 'RN' => 118, // Rundi; Kirundi |
|
250 | + 'RO' => 119, // Romanian |
|
251 | + 'RU' => 120, // Russian |
|
252 | + 'RW' => 121, // Kinyarwanda |
|
253 | + 'SA' => 122, // Sanskrit |
|
254 | + 'SC' => 123, // Sardinian |
|
255 | + 'SD' => 124, // Sindhi |
|
256 | + 'SE' => 125, // Northern Sami |
|
257 | + 'SG' => 126, // Sango; Sangro |
|
258 | + 'SI' => 127, // Sinhalese |
|
259 | + 'SK' => 128, // Slovak |
|
260 | + 'SL' => 129, // Slovenian |
|
261 | + 'SM' => 130, // Samoan |
|
262 | + 'SN' => 131, // Shona |
|
263 | + 'SO' => 132, // Somali |
|
264 | + 'SQ' => 133, // Albanian |
|
265 | + 'SR' => 134, // Serbian |
|
266 | + 'SS' => 135, // Swati; Siswati |
|
267 | + 'ST' => 136, // Sesotho; Sotho, Southern |
|
268 | + 'SU' => 137, // Sundanese |
|
269 | + 'SV' => 138, // Swedish |
|
270 | + 'SW' => 139, // Swahili |
|
271 | + 'TA' => 140, // Tamil |
|
272 | + 'TE' => 141, // Telugu |
|
273 | + 'TG' => 142, // Tajik |
|
274 | + 'TH' => 143, // Thai |
|
275 | + 'TI' => 144, // Tigrinya |
|
276 | + 'TK' => 145, // Turkmen |
|
277 | + 'TL' => 146, // Tagalog |
|
278 | + 'TN' => 147, // Tswana; Setswana |
|
279 | + 'TO' => 148, // Tongan |
|
280 | + 'TR' => 149, // Turkish |
|
281 | + 'TS' => 150, // Tsonga |
|
282 | + 'TT' => 151, // Tatar |
|
283 | + 'TW' => 152, // Twi |
|
284 | + 'TY' => 153, // Tahitian |
|
285 | + 'UG' => 154, // Uighur |
|
286 | + 'UK' => 155, // Ukrainian |
|
287 | + 'UR' => 156, // Urdu |
|
288 | + 'UZ' => 157, // Uzbek |
|
289 | + 'VI' => 158, // Vietnamese |
|
290 | + 'VO' => 159, // Volapuk |
|
291 | + 'WA' => 160, // Walloon |
|
292 | + 'WO' => 161, // Wolof |
|
293 | + 'XH' => 162, // Xhosa |
|
294 | + 'YI' => 163, // Yiddish (formerly ji) |
|
295 | + 'YO' => 164, // Yoruba |
|
296 | + 'ZA' => 165, // Zhuang |
|
297 | + 'ZH' => 166, // Chinese |
|
298 | 298 | 'ZU' => 167 // Zulu |
299 | 299 | ); |
300 | 300 | } |
@@ -103,7 +103,7 @@ |
||
103 | 103 | * |
104 | 104 | * @param int $val KlarnaLanguage constant |
105 | 105 | * |
106 | - * @return lowercase string|null |
|
106 | + * @return string|null string|null |
|
107 | 107 | */ |
108 | 108 | public static function getCode($val) |
109 | 109 | { |
@@ -26,17 +26,17 @@ |
||
26 | 26 | * @link http://integration.klarna.com/ |
27 | 27 | */ |
28 | 28 | |
29 | - /** |
|
30 | - * Connection exception |
|
31 | - * |
|
32 | - * @category Payment |
|
33 | - * @package Klarna_Checkout |
|
34 | - * @author Rickard D. <[email protected]> |
|
35 | - * @author Christer G. <[email protected]> |
|
36 | - * @copyright 2012 Klarna AB |
|
37 | - * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0 |
|
38 | - * @link http://integration.klarna.com/ |
|
39 | - */ |
|
29 | + /** |
|
30 | + * Connection exception |
|
31 | + * |
|
32 | + * @category Payment |
|
33 | + * @package Klarna_Checkout |
|
34 | + * @author Rickard D. <[email protected]> |
|
35 | + * @author Christer G. <[email protected]> |
|
36 | + * @copyright 2012 Klarna AB |
|
37 | + * @license http://www.apache.org/licenses/LICENSE-2.0 Apache license v2.0 |
|
38 | + * @link http://integration.klarna.com/ |
|
39 | + */ |
|
40 | 40 | class Klarna_Checkout_ConnectionErrorException extends Klarna_Checkout_Exception |
41 | 41 | { |
42 | 42 |
@@ -76,7 +76,7 @@ |
||
76 | 76 | } |
77 | 77 | |
78 | 78 | $key = substr($header, 0, $pos); |
79 | - $value = trim(substr($header, $pos+1)); |
|
79 | + $value = trim(substr($header, $pos + 1)); |
|
80 | 80 | |
81 | 81 | $this->headers[$key] = trim($value); |
82 | 82 |