@@ -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 | } |
@@ -26,25 +26,25 @@ |
||
26 | 26 | * @link http://integration.klarna.com/ |
27 | 27 | */ |
28 | 28 | |
29 | -define('KLARNA_CHECKOUT_DIR', dirname(__file__) . '/Checkout'); |
|
29 | +define('KLARNA_CHECKOUT_DIR', dirname(__file__).'/Checkout'); |
|
30 | 30 | |
31 | -require_once KLARNA_CHECKOUT_DIR . '/ConnectorInterface.php'; |
|
32 | -require_once KLARNA_CHECKOUT_DIR . '/ResourceInterface.php'; |
|
33 | -require_once KLARNA_CHECKOUT_DIR . '/Connector.php'; |
|
34 | -require_once KLARNA_CHECKOUT_DIR . '/BasicConnector.php'; |
|
35 | -require_once KLARNA_CHECKOUT_DIR . '/Order.php'; |
|
36 | -require_once KLARNA_CHECKOUT_DIR . '/Digest.php'; |
|
37 | -require_once KLARNA_CHECKOUT_DIR . '/Exception.php'; |
|
38 | -require_once KLARNA_CHECKOUT_DIR . '/ConnectionErrorException.php'; |
|
39 | -require_once KLARNA_CHECKOUT_DIR . '/ConnectorException.php'; |
|
40 | -require_once KLARNA_CHECKOUT_DIR . '/UserAgent.php'; |
|
31 | +require_once KLARNA_CHECKOUT_DIR.'/ConnectorInterface.php'; |
|
32 | +require_once KLARNA_CHECKOUT_DIR.'/ResourceInterface.php'; |
|
33 | +require_once KLARNA_CHECKOUT_DIR.'/Connector.php'; |
|
34 | +require_once KLARNA_CHECKOUT_DIR.'/BasicConnector.php'; |
|
35 | +require_once KLARNA_CHECKOUT_DIR.'/Order.php'; |
|
36 | +require_once KLARNA_CHECKOUT_DIR.'/Digest.php'; |
|
37 | +require_once KLARNA_CHECKOUT_DIR.'/Exception.php'; |
|
38 | +require_once KLARNA_CHECKOUT_DIR.'/ConnectionErrorException.php'; |
|
39 | +require_once KLARNA_CHECKOUT_DIR.'/ConnectorException.php'; |
|
40 | +require_once KLARNA_CHECKOUT_DIR.'/UserAgent.php'; |
|
41 | 41 | |
42 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/TransportInterface.php'; |
|
43 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/CURLHandleInterface.php'; |
|
44 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/Request.php'; |
|
45 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/Response.php'; |
|
46 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/Transport.php'; |
|
47 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/CURLTransport.php'; |
|
48 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/CURLHeaders.php'; |
|
49 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/CURLHandle.php'; |
|
50 | -require_once KLARNA_CHECKOUT_DIR . '/HTTP/CURLFactory.php'; |
|
42 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/TransportInterface.php'; |
|
43 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/CURLHandleInterface.php'; |
|
44 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/Request.php'; |
|
45 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/Response.php'; |
|
46 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/Transport.php'; |
|
47 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/CURLTransport.php'; |
|
48 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/CURLHeaders.php'; |
|
49 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/CURLHandle.php'; |
|
50 | +require_once KLARNA_CHECKOUT_DIR.'/HTTP/CURLFactory.php'; |
@@ -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 |
@@ -96,7 +96,7 @@ |
||
96 | 96 | foreach ($this->_fields as $key => $value) { |
97 | 97 | $parts[] = "$key/{$value['name']}_{$value['version']}"; |
98 | 98 | if (array_key_exists('options', $value)) { |
99 | - $parts[] = '(' . implode(' ; ', $value['options']) . ')'; |
|
99 | + $parts[] = '('.implode(' ; ', $value['options']).')'; |
|
100 | 100 | } |
101 | 101 | } |
102 | 102 | return implode(' ', $parts); |
@@ -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 |
@@ -121,7 +121,7 @@ |
||
121 | 121 | // Convert headers to cURL format. |
122 | 122 | $requestHeaders = array(); |
123 | 123 | foreach ($request->getHeaders() as $key => $value) { |
124 | - $requestHeaders[] = $key . ': ' . $value; |
|
124 | + $requestHeaders[] = $key.': '.$value; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | $curl->setOption(CURLOPT_HTTPHEADER, $requestHeaders); |
@@ -38,7 +38,7 @@ |
||
38 | 38 | $matches['streetNumber'] = trim($matches['streetNumber']); |
39 | 39 | |
40 | 40 | // remove unnecessary numeric indexes |
41 | - unset($matches[0], $matches[1],$matches[2]); |
|
41 | + unset($matches[0], $matches[1], $matches[2]); |
|
42 | 42 | |
43 | 43 | return $matches; |
44 | 44 | } |
@@ -37,7 +37,7 @@ |
||
37 | 37 | */ |
38 | 38 | protected $transactionId = null; |
39 | 39 | |
40 | - protected $apiUrl = array('live'=>'https://api.klarna.com/','test'=>'https://api.playground.klarna.com/'); |
|
40 | + protected $apiUrl = array('live'=>'https://api.klarna.com/', 'test'=>'https://api.playground.klarna.com/'); |
|
41 | 41 | |
42 | 42 | /** |
43 | 43 | * Creates an instance of light connector |
@@ -1678,7 +1678,7 @@ discard block |
||
1678 | 1678 | |
1679 | 1679 | /** |
1680 | 1680 | * |
1681 | - * @return array |
|
1681 | + * @return string |
|
1682 | 1682 | */ |
1683 | 1683 | public function getLabel() |
1684 | 1684 | { |
@@ -1715,7 +1715,7 @@ discard block |
||
1715 | 1715 | /** |
1716 | 1716 | * Creates and returns the klarna client for an event. |
1717 | 1717 | * |
1718 | - * @return \Klarna_Checkout_Connector |
|
1718 | + * @return Klarna_Checkout_ConnectorInterface |
|
1719 | 1719 | */ |
1720 | 1720 | public function onInitResourceKlarnaCheckoutConnector() |
1721 | 1721 | { |
@@ -1768,7 +1768,7 @@ discard block |
||
1768 | 1768 | |
1769 | 1769 | /** |
1770 | 1770 | * @param string $requiredVersion |
1771 | - * @return bool|mixed |
|
1771 | + * @return boolean |
|
1772 | 1772 | */ |
1773 | 1773 | protected function assertMinimumVersion($requiredVersion) |
1774 | 1774 | { |
@@ -1932,6 +1932,7 @@ discard block |
||
1932 | 1932 | * |
1933 | 1933 | * @param $config Enlight_Config |
1934 | 1934 | * @param $lastName string |
1935 | + * @param boolean $userLoggedIn |
|
1935 | 1936 | * @return bool |
1936 | 1937 | */ |
1937 | 1938 | private function getShowLoginConfig($config, $userLoggedIn) |
@@ -2035,7 +2036,7 @@ discard block |
||
2035 | 2036 | * Helper method to get the correct order for the elements |
2036 | 2037 | * |
2037 | 2038 | * @param $config Enlight_Config |
2038 | - * @return array Array with the order of the elements |
|
2039 | + * @return string[] Array with the order of the elements |
|
2039 | 2040 | */ |
2040 | 2041 | private function getPositionOrder($config) |
2041 | 2042 | { |
@@ -2334,7 +2335,7 @@ discard block |
||
2334 | 2335 | /** |
2335 | 2336 | * @param Shopware\Models\Payment\Payment $payment |
2336 | 2337 | * @param $basket |
2337 | - * @return bool |
|
2338 | + * @return double |
|
2338 | 2339 | */ |
2339 | 2340 | private function getFee($payment, $basket) |
2340 | 2341 | { |
@@ -22,7 +22,6 @@ |
||
22 | 22 | * our trademarks remain entirely with us. |
23 | 23 | */ |
24 | 24 | |
25 | -use Doctrine\DBAL\Connection; |
|
26 | 25 | use Shopware\Components\StreetSplitService; |
27 | 26 | |
28 | 27 | # Load dummy interface CSRFWhitelistAware for SW < 5.2 |
@@ -491,7 +491,7 @@ discard block |
||
491 | 491 | $args->setReturn($builder); |
492 | 492 | } |
493 | 493 | |
494 | - public function onGetStreetSplitService() |
|
494 | + public function onGetStreetSplitService() |
|
495 | 495 | { |
496 | 496 | $this->Application()->Loader()->registerNamespace( |
497 | 497 | 'Shopware\Components', |
@@ -1364,12 +1364,12 @@ discard block |
||
1364 | 1364 | /** @var Enlight_Components_Session_Namespace $session */ |
1365 | 1365 | $session = $this->Application()->Session(); |
1366 | 1366 | |
1367 | - // Switch User to external PaymentId after registration |
|
1368 | - if (isset($session['KlarnaExternalPaymentId'])) { |
|
1367 | + // Switch User to external PaymentId after registration |
|
1368 | + if (isset($session['KlarnaExternalPaymentId'])) { |
|
1369 | 1369 | $this->savePayment($session['KlarnaExternalPaymentId']); |
1370 | 1370 | } |
1371 | 1371 | |
1372 | - $view->assign('klarnaRedirect', $request->has('klarnaRedirect') && $request->getParam('klarnaRedirect') == 1); |
|
1372 | + $view->assign('klarnaRedirect', $request->has('klarnaRedirect') && $request->getParam('klarnaRedirect') == 1); |
|
1373 | 1373 | } |
1374 | 1374 | |
1375 | 1375 | |
@@ -1460,7 +1460,7 @@ discard block |
||
1460 | 1460 | $userData['billingaddress']['country'] =$country; |
1461 | 1461 | $userData['shippingaddress']['countryID'] = $session['sChangedCountry']; |
1462 | 1462 | $userData['billingaddress']['countryID'] = $session['sChangedCountry']; |
1463 | - } |
|
1463 | + } |
|
1464 | 1464 | |
1465 | 1465 | $orderVariables['sUserData'] = $userData; |
1466 | 1466 | $testbreakpoint = 0; |
@@ -2385,14 +2385,14 @@ discard block |
||
2385 | 2385 | } else { |
2386 | 2386 | $url = $front->Router()->assemble(array('controller' => 'index', 'module' => 'frontend')); |
2387 | 2387 | } |
2388 | - if (version_compare(Shopware::VERSION, '5.2.0', '>=')) { |
|
2388 | + if (version_compare(Shopware::VERSION, '5.2.0', '>=')) { |
|
2389 | 2389 | # make sure me get only the image name, path is set in case of upgarde from SW.5.1 to 5.2 |
2390 | 2390 | $parts = explode('/', $media); |
2391 | 2391 | $end = end($parts); |
2392 | - $media = $url . 'media/image/' . $end; |
|
2393 | - } else { |
|
2394 | - $media = $url . $media; |
|
2395 | - } |
|
2392 | + $media = $url . 'media/image/' . $end; |
|
2393 | + } else { |
|
2394 | + $media = $url . $media; |
|
2395 | + } |
|
2396 | 2396 | } |
2397 | 2397 | |
2398 | 2398 | return $media; |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | use Shopware\Components\StreetSplitService; |
27 | 27 | |
28 | 28 | # Load dummy interface CSRFWhitelistAware for SW < 5.2 |
29 | -require_once __DIR__ . '/Components/CSRFWhitelistAware.php'; |
|
29 | +require_once __DIR__.'/Components/CSRFWhitelistAware.php'; |
|
30 | 30 | |
31 | 31 | /** |
32 | 32 | * Shopware Klarna Plugin |
@@ -252,8 +252,8 @@ discard block |
||
252 | 252 | */ |
253 | 253 | public function getKLarnaService() { |
254 | 254 | if ($this->klarnaService === null) { |
255 | - require_once __DIR__ . '/Components/Klarna/Klarna.php'; |
|
256 | - require_once __DIR__ . '/Components/Klarna/transport/xmlrpc-3.0.0.beta/lib/xmlrpc.inc'; |
|
255 | + require_once __DIR__.'/Components/Klarna/Klarna.php'; |
|
256 | + require_once __DIR__.'/Components/Klarna/transport/xmlrpc-3.0.0.beta/lib/xmlrpc.inc'; |
|
257 | 257 | $this->klarnaService = new Klarna(); |
258 | 258 | } |
259 | 259 | |
@@ -400,8 +400,8 @@ discard block |
||
400 | 400 | |
401 | 401 | $klarnaService = $this->getService(); |
402 | 402 | |
403 | - $klarnaAddrBilling = $this->getKlarnaAddrByRawOrderData($orderDataRaw,'billing'); |
|
404 | - $klarnaAddrShipping = $this->getKlarnaAddrByRawOrderData($orderDataRaw,'shipping'); |
|
403 | + $klarnaAddrBilling = $this->getKlarnaAddrByRawOrderData($orderDataRaw, 'billing'); |
|
404 | + $klarnaAddrShipping = $this->getKlarnaAddrByRawOrderData($orderDataRaw, 'shipping'); |
|
405 | 405 | |
406 | 406 | $transactionId = $orderDataRaw['transactionId']; |
407 | 407 | |
@@ -495,7 +495,7 @@ discard block |
||
495 | 495 | { |
496 | 496 | $this->Application()->Loader()->registerNamespace( |
497 | 497 | 'Shopware\Components', |
498 | - __DIR__ . '/Components/' |
|
498 | + __DIR__.'/Components/' |
|
499 | 499 | ); |
500 | 500 | |
501 | 501 | return new StreetSplitService(); |
@@ -509,27 +509,27 @@ discard block |
||
509 | 509 | * @param mixed $mPrintableElement |
510 | 510 | * @return void |
511 | 511 | */ |
512 | - public function klarnaLog($message, $logLevelMessage=1, $mPrintableElement=null) { |
|
512 | + public function klarnaLog($message, $logLevelMessage = 1, $mPrintableElement = null) { |
|
513 | 513 | $configname = 'klarnaLogLevel'; |
514 | 514 | $elementId = Shopware()->Db()->fetchOne('SELECT id FROM s_core_config_elements WHERE name = ?', [$configname]); |
515 | 515 | $logLevelConfigSetting = Shopware()->Db()->fetchOne('SELECT value FROM s_core_config_values WHERE element_id = ?', [$elementId]); |
516 | 516 | $logLevelConfigSetting = unserialize($logLevelConfigSetting); |
517 | - $logLevelSetting = (is_numeric($logLevelConfigSetting) && $logLevelConfigSetting >=0 && $logLevelConfigSetting <=4) ? (int)$logLevelConfigSetting : 1; |
|
517 | + $logLevelSetting = (is_numeric($logLevelConfigSetting) && $logLevelConfigSetting >= 0 && $logLevelConfigSetting <= 4) ? (int) $logLevelConfigSetting : 1; |
|
518 | 518 | |
519 | 519 | if ($logLevelMessage <= $logLevelSetting) { |
520 | 520 | $prefix = "[".date('Y-m-d H:i:s')."] "; |
521 | 521 | $debugBacktrace = ''; |
522 | 522 | if ($logLevelSetting >= 4) { |
523 | - $debugBacktrace = print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS),true); |
|
523 | + $debugBacktrace = print_r(debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS), true); |
|
524 | 524 | } |
525 | 525 | $sPrintableElementMessage = ''; |
526 | 526 | if ($mPrintableElement !== null) { |
527 | - $sPrintableElementMessage = print_r($mPrintableElement,true); |
|
527 | + $sPrintableElementMessage = print_r($mPrintableElement, true); |
|
528 | 528 | } |
529 | 529 | $fullMessage = $prefix.$message."\n".$sPrintableElementMessage.$debugBacktrace; |
530 | 530 | $shopPath = Shopware()->DocPath(); |
531 | 531 | $logfilePath = $shopPath.'/var/log/klarnaTrace.log'; |
532 | - $fileHandler = fopen($logfilePath,'a'); |
|
532 | + $fileHandler = fopen($logfilePath, 'a'); |
|
533 | 533 | fwrite($fileHandler, $fullMessage); |
534 | 534 | fclose($fileHandler); |
535 | 535 | } |
@@ -555,7 +555,7 @@ discard block |
||
555 | 555 | $country = $repository->findOneBy(array('id' => $baseData['countryId'])); |
556 | 556 | $countryiso = $country->getIso(); |
557 | 557 | |
558 | - $klarnaAddr = new KlarnaAddr(); |
|
558 | + $klarnaAddr = new KlarnaAddr(); |
|
559 | 559 | $klarnaAddr->setEmail($orderDataRaw['customerEmail']); |
560 | 560 | $klarnaAddr->setFirstName($baseData['firstName']); |
561 | 561 | $klarnaAddr->setLastName($baseData['lastName']); |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | $klarnaAddr->setCountry($countryiso); |
571 | 571 | } |
572 | 572 | |
573 | - $this->klarnaLog('Update order address from backend with following address data:',3,$klarnaAddr); |
|
573 | + $this->klarnaLog('Update order address from backend with following address data:', 3, $klarnaAddr); |
|
574 | 574 | return $klarnaAddr; |
575 | 575 | } |
576 | 576 | |
@@ -598,10 +598,10 @@ discard block |
||
598 | 598 | if ($index == count($addressParts) || $houseNumberFound) { |
599 | 599 | // at least last element should be streetnr |
600 | 600 | if (!empty($streetnr)) $streetnr .= ' '; |
601 | - $streetnr .= (string)$addressPart; |
|
601 | + $streetnr .= (string) $addressPart; |
|
602 | 602 | } |
603 | - else { |
|
604 | - $street .= (string)' '.$addressPart; |
|
603 | + else { |
|
604 | + $street .= (string) ' '.$addressPart; |
|
605 | 605 | } |
606 | 606 | } |
607 | 607 | |
@@ -1218,11 +1218,11 @@ discard block |
||
1218 | 1218 | public function registerMyTemplateDir($isBackend = false) |
1219 | 1219 | { |
1220 | 1220 | if ($isBackend) { |
1221 | - $this->get('template')->addTemplateDir(__DIR__ . '/Views/', 'klarna'); |
|
1221 | + $this->get('template')->addTemplateDir(__DIR__.'/Views/', 'klarna'); |
|
1222 | 1222 | } elseif ($this->isTemplateResponsive()) { |
1223 | - $this->get('template')->addTemplateDir(__DIR__ . '/Views/responsive', 'klarna'); |
|
1223 | + $this->get('template')->addTemplateDir(__DIR__.'/Views/responsive', 'klarna'); |
|
1224 | 1224 | } else { |
1225 | - $this->get('template')->addTemplateDir(__DIR__ . '/Views/_emotion', 'klarna'); |
|
1225 | + $this->get('template')->addTemplateDir(__DIR__.'/Views/_emotion', 'klarna'); |
|
1226 | 1226 | } |
1227 | 1227 | } |
1228 | 1228 | |
@@ -1250,7 +1250,7 @@ discard block |
||
1250 | 1250 | { |
1251 | 1251 | $this->registerMyTemplateDir(); |
1252 | 1252 | |
1253 | - return __DIR__ . '/Controllers/Frontend/PaymentKlarna.php'; |
|
1253 | + return __DIR__.'/Controllers/Frontend/PaymentKlarna.php'; |
|
1254 | 1254 | } |
1255 | 1255 | |
1256 | 1256 | /** |
@@ -1262,10 +1262,10 @@ discard block |
||
1262 | 1262 | { |
1263 | 1263 | $this->registerMyTemplateDir(true); |
1264 | 1264 | $this->Application()->Snippets()->addConfigDir( |
1265 | - __DIR__ . '/Snippets/' |
|
1265 | + __DIR__.'/Snippets/' |
|
1266 | 1266 | ); |
1267 | 1267 | |
1268 | - return __DIR__ . '/Controllers/Backend/PaymentKlarna.php'; |
|
1268 | + return __DIR__.'/Controllers/Backend/PaymentKlarna.php'; |
|
1269 | 1269 | } |
1270 | 1270 | |
1271 | 1271 | /** |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | |
1290 | 1290 | // just return in case kco payment is deactivated in backend |
1291 | 1291 | |
1292 | - if (!$this->isKcoPaymentActive()){ |
|
1292 | + if (!$this->isKcoPaymentActive()) { |
|
1293 | 1293 | return; |
1294 | 1294 | } |
1295 | 1295 | $user = $view->getAssign('sUserData'); |
@@ -1300,7 +1300,7 @@ discard block |
||
1300 | 1300 | && ($request->getActionName() == 'cart' || $request->getActionName() == 'ajaxCart') |
1301 | 1301 | ) { |
1302 | 1302 | $this->registerMyTemplateDir(); |
1303 | - $view->assign('KlarnaEnableButton', (bool)$config->get('showKlarnaButton')); |
|
1303 | + $view->assign('KlarnaEnableButton', (bool) $config->get('showKlarnaButton')); |
|
1304 | 1304 | $view->assign('KlarnaShowCheckoutButton', $this->getShowCheckoutButton($user)); |
1305 | 1305 | $view->assign('klarnaKcoPaymentActive', $this->isKlarnaKcoPaymentActive($user)); |
1306 | 1306 | $view->assign('KlarnaPaymentDescription', $this->getPayment()->getDescription()); |
@@ -1329,7 +1329,7 @@ discard block |
||
1329 | 1329 | $view->assign('KlarnaMerchantId', $config->get('merchantId')); |
1330 | 1330 | $view->assign('KlarnaHideCheckoutSteps', true); |
1331 | 1331 | |
1332 | - if (version_compare(Shopware::VERSION, '5.2.0', '<')){ |
|
1332 | + if (version_compare(Shopware::VERSION, '5.2.0', '<')) { |
|
1333 | 1333 | $view->assign('KlarnaSkipLoginFix', true); |
1334 | 1334 | } |
1335 | 1335 | if (!$this->isTemplateResponsive()) { |
@@ -1390,7 +1390,7 @@ discard block |
||
1390 | 1390 | public function addJsFiles() |
1391 | 1391 | { |
1392 | 1392 | $jsPath = array( |
1393 | - __DIR__ . '/Views/responsive/frontend/_public/src/js/jquery.klarna_checkout.js' |
|
1393 | + __DIR__.'/Views/responsive/frontend/_public/src/js/jquery.klarna_checkout.js' |
|
1394 | 1394 | ); |
1395 | 1395 | |
1396 | 1396 | return new Doctrine\Common\Collections\ArrayCollection($jsPath); |
@@ -1449,15 +1449,15 @@ discard block |
||
1449 | 1449 | $userData['additional'] |
1450 | 1450 | ); |
1451 | 1451 | |
1452 | - if (isset($session['sChangedCountry'])){ |
|
1452 | + if (isset($session['sChangedCountry'])) { |
|
1453 | 1453 | |
1454 | 1454 | /** @var \Shopware\Components\Model\ModelManager $em */ |
1455 | 1455 | $em = $this->get('models'); |
1456 | 1456 | |
1457 | 1457 | /** @var \Shopware\Models\Customer\Customer $customer */ |
1458 | 1458 | $country = $em->getRepository('Shopware\Models\Country\Country')->findOneBy(array('id' => $session['sChangedCountry'])); |
1459 | - $userData['shippingaddress']['country'] =$country; |
|
1460 | - $userData['billingaddress']['country'] =$country; |
|
1459 | + $userData['shippingaddress']['country'] = $country; |
|
1460 | + $userData['billingaddress']['country'] = $country; |
|
1461 | 1461 | $userData['shippingaddress']['countryID'] = $session['sChangedCountry']; |
1462 | 1462 | $userData['billingaddress']['countryID'] = $session['sChangedCountry']; |
1463 | 1463 | } |
@@ -1477,10 +1477,10 @@ discard block |
||
1477 | 1477 | $this->klarnaLog("Entering Bootstrap::getCountryByShop", 3); |
1478 | 1478 | $locale = explode('_', $locale); |
1479 | 1479 | $locale = isset($locale[1]) ? $locale[1] : $locale[0]; |
1480 | - $this->klarnaLog("Bootstrap::getCountryByShop locale to request for:".$locale,3); |
|
1480 | + $this->klarnaLog("Bootstrap::getCountryByShop locale to request for:".$locale, 3); |
|
1481 | 1481 | $sql = 'SELECT id FROM s_core_countries WHERE countryiso=?'; |
1482 | 1482 | $countryId = Shopware()->Db()->fetchOne($sql, array($locale)); |
1483 | - $countryId = ($countryId) ? (int)$countryId : null; |
|
1483 | + $countryId = ($countryId) ? (int) $countryId : null; |
|
1484 | 1484 | |
1485 | 1485 | return $countryId; |
1486 | 1486 | } |
@@ -1511,7 +1511,7 @@ discard block |
||
1511 | 1511 | $locale = $locale == 'nn-no' ? 'nb-no' : $locale; |
1512 | 1512 | |
1513 | 1513 | if ($locale == 'de-de') { |
1514 | - if($countryIso == 'CH') { |
|
1514 | + if ($countryIso == 'CH') { |
|
1515 | 1515 | $locale = 'de-ch'; |
1516 | 1516 | } elseif ($countryIso == 'AT') { |
1517 | 1517 | $locale = 'de-at'; |
@@ -1526,10 +1526,10 @@ discard block |
||
1526 | 1526 | $config = $this->Config(); |
1527 | 1527 | $options = $this->getColorConfigOptions($config); |
1528 | 1528 | |
1529 | - $options['allow_separate_shipping_address'] = (bool)$config->get('allowSeparateShippingAddress'); |
|
1530 | - $options['packstation_enabled'] = (bool)$config->get('supportPackstation') && $allowPackstation; |
|
1531 | - $options['phone_mandatory'] = (bool)$config->get('mandatoryPhone'); |
|
1532 | - $options['date_of_birth_mandatory'] = (bool)$config->get('mandatoryBirthday'); |
|
1529 | + $options['allow_separate_shipping_address'] = (bool) $config->get('allowSeparateShippingAddress'); |
|
1530 | + $options['packstation_enabled'] = (bool) $config->get('supportPackstation') && $allowPackstation; |
|
1531 | + $options['phone_mandatory'] = (bool) $config->get('mandatoryPhone'); |
|
1532 | + $options['date_of_birth_mandatory'] = (bool) $config->get('mandatoryBirthday'); |
|
1533 | 1533 | |
1534 | 1534 | if (!empty($dispatch)) { |
1535 | 1535 | $options['shipping_details'] = $dispatch['description']; |
@@ -1544,19 +1544,19 @@ discard block |
||
1544 | 1544 | foreach ($basket['content'] as $index=>$basketItem) { |
1545 | 1545 | // compatibility to shopware plugin custom products |
1546 | 1546 | if (isset($basketItem['custom_product_prices'])) { |
1547 | - $basketItemPrice = (double)$basketItem['custom_product_prices']['total']; |
|
1547 | + $basketItemPrice = (double) $basketItem['custom_product_prices']['total']; |
|
1548 | 1548 | } |
1549 | 1549 | else { |
1550 | - $basketItemPrice = (double)str_replace(',', '.', $basketItem['price']); |
|
1550 | + $basketItemPrice = (double) str_replace(',', '.', $basketItem['price']); |
|
1551 | 1551 | } |
1552 | 1552 | $unitPrice = round($basketItemPrice * 100); |
1553 | 1553 | $cart[] = array( |
1554 | 1554 | 'type' => $unitPrice >= 0 ? 'physical' : 'discount', |
1555 | 1555 | 'reference' => $basketItem['ordernumber'], |
1556 | 1556 | 'name' => $basketItem['articlename'], |
1557 | - 'quantity' => (int)$basketItem['quantity'], |
|
1558 | - 'unit_price' => (int)$unitPrice, |
|
1559 | - 'tax_rate' => (int)round($basketItem['tax_rate'] * 100) |
|
1557 | + 'quantity' => (int) $basketItem['quantity'], |
|
1558 | + 'unit_price' => (int) $unitPrice, |
|
1559 | + 'tax_rate' => (int) round($basketItem['tax_rate'] * 100) |
|
1560 | 1560 | ); |
1561 | 1561 | } |
1562 | 1562 | if (!empty($basket['sShippingcosts'])) { |
@@ -1567,8 +1567,8 @@ discard block |
||
1567 | 1567 | 'reference' => 'SHIPPING', |
1568 | 1568 | 'name' => 'Shipping Fee', |
1569 | 1569 | 'quantity' => 1, |
1570 | - 'unit_price' => (int)round($shippingAmount * 100), |
|
1571 | - 'tax_rate' => (int)round($basket['sShippingcostsTax'] * 100), |
|
1570 | + 'unit_price' => (int) round($shippingAmount * 100), |
|
1571 | + 'tax_rate' => (int) round($basket['sShippingcostsTax'] * 100), |
|
1572 | 1572 | ); |
1573 | 1573 | } |
1574 | 1574 | |
@@ -1599,7 +1599,7 @@ discard block |
||
1599 | 1599 | 'action' => 'return', |
1600 | 1600 | 'forceSecure' => true |
1601 | 1601 | ) |
1602 | - ) . "?transactionId={checkout.order.uri}"; |
|
1602 | + )."?transactionId={checkout.order.uri}"; |
|
1603 | 1603 | $merchant['push_uri'] = $router->assemble( |
1604 | 1604 | array( |
1605 | 1605 | 'controller' => 'payment_klarna', |
@@ -1607,7 +1607,7 @@ discard block |
||
1607 | 1607 | 'forceSecure' => true, |
1608 | 1608 | 'appendSession' => true |
1609 | 1609 | ) |
1610 | - ) . "&transactionId={checkout.order.uri}"; |
|
1610 | + )."&transactionId={checkout.order.uri}"; |
|
1611 | 1611 | $merchant['back_to_store_uri'] = $router->assemble( |
1612 | 1612 | array( |
1613 | 1613 | 'controller' => 'index', |
@@ -1620,41 +1620,41 @@ discard block |
||
1620 | 1620 | |
1621 | 1621 | public function getCheckoutAddress($user, $type = 'billing') |
1622 | 1622 | { |
1623 | - if (empty($user[$type . 'address']['zipcode']) || $user[$type . 'address']['zipcode'] == '00000') { |
|
1623 | + if (empty($user[$type.'address']['zipcode']) || $user[$type.'address']['zipcode'] == '00000') { |
|
1624 | 1624 | return array(); |
1625 | 1625 | } |
1626 | 1626 | |
1627 | 1627 | $address = array( |
1628 | - 'given_name' => $user[$type . 'address']['firstname'], |
|
1629 | - 'family_name' => $user[$type . 'address']['lastname'], |
|
1630 | - 'postal_code' => $user[$type . 'address']['zipcode'], |
|
1631 | - 'city' => $user[$type . 'address']['city'], |
|
1628 | + 'given_name' => $user[$type.'address']['firstname'], |
|
1629 | + 'family_name' => $user[$type.'address']['lastname'], |
|
1630 | + 'postal_code' => $user[$type.'address']['zipcode'], |
|
1631 | + 'city' => $user[$type.'address']['city'], |
|
1632 | 1632 | 'country' => $user['additional'][$type == 'billing' ? 'country' : 'countryShipping']['countryiso'], |
1633 | 1633 | 'email' => $user['additional']['user']['email'], |
1634 | 1634 | 'phone' => $user['billingaddress']['phone'], |
1635 | 1635 | ); |
1636 | 1636 | $address['country'] = strtolower($address['country']); |
1637 | 1637 | if ($address['country'] == 'de' || $address['country'] == 'nl') { |
1638 | - $address['title'] = $user[$type . 'address']['salutation'] == 'ms' ? 'Frau' : 'Herr'; |
|
1638 | + $address['title'] = $user[$type.'address']['salutation'] == 'ms' ? 'Frau' : 'Herr'; |
|
1639 | 1639 | if ($this->assertMinimumVersion('5.0.0')) { |
1640 | 1640 | /** @var StreetSplitService $streetSplitService */ |
1641 | 1641 | $streetSplitService = Shopware()->StreetSplitService(); |
1642 | - $streetAndNumber = $streetSplitService->split($user[$type . 'address']['street']); |
|
1642 | + $streetAndNumber = $streetSplitService->split($user[$type.'address']['street']); |
|
1643 | 1643 | |
1644 | 1644 | $address['street_name'] = $streetAndNumber['streetName']; |
1645 | 1645 | $address['street_number'] = $streetAndNumber['streetNumber']; |
1646 | 1646 | } else { |
1647 | - $address['street_name'] = $user[$type . 'address']['street']; |
|
1648 | - $address['street_number'] = $user[$type . 'address']['streetnumber']; |
|
1647 | + $address['street_name'] = $user[$type.'address']['street']; |
|
1648 | + $address['street_number'] = $user[$type.'address']['streetnumber']; |
|
1649 | 1649 | } |
1650 | 1650 | } else { |
1651 | 1651 | $address['street_address'] = trim( |
1652 | - $user[$type . 'address']['street'] . ' ' . $user[$type . 'address']['streetnumber'] |
|
1652 | + $user[$type.'address']['street'].' '.$user[$type.'address']['streetnumber'] |
|
1653 | 1653 | ); |
1654 | 1654 | } |
1655 | 1655 | |
1656 | 1656 | // Make sure phone number is unset if empty |
1657 | - if ($address['phone'] === null){ |
|
1657 | + if ($address['phone'] === null) { |
|
1658 | 1658 | unset($address['phone']); |
1659 | 1659 | } |
1660 | 1660 | return $address; |
@@ -1691,7 +1691,7 @@ discard block |
||
1691 | 1691 | */ |
1692 | 1692 | public function getVersion() |
1693 | 1693 | { |
1694 | - $info = json_decode(file_get_contents(__DIR__ . DIRECTORY_SEPARATOR . 'plugin.json'), true); |
|
1694 | + $info = json_decode(file_get_contents(__DIR__.DIRECTORY_SEPARATOR.'plugin.json'), true); |
|
1695 | 1695 | |
1696 | 1696 | if ($info) { |
1697 | 1697 | return $info['currentVersion']; |
@@ -1708,7 +1708,7 @@ discard block |
||
1708 | 1708 | return array( |
1709 | 1709 | 'version' => $this->getVersion(), |
1710 | 1710 | 'label' => $this->getLabel(), |
1711 | - 'description' => file_get_contents(__DIR__ . '/info.txt') |
|
1711 | + 'description' => file_get_contents(__DIR__.'/info.txt') |
|
1712 | 1712 | ); |
1713 | 1713 | } |
1714 | 1714 | |
@@ -1719,7 +1719,7 @@ discard block |
||
1719 | 1719 | */ |
1720 | 1720 | public function onInitResourceKlarnaCheckoutConnector() |
1721 | 1721 | { |
1722 | - require_once __DIR__ . '/Components/KlarnaCheckout/Checkout.php'; |
|
1722 | + require_once __DIR__.'/Components/KlarnaCheckout/Checkout.php'; |
|
1723 | 1723 | if ($this->Config()->get('testDrive')) { |
1724 | 1724 | Klarna_Checkout_Order::$baseUri = 'https://checkout.testdrive.klarna.com/checkout/orders'; |
1725 | 1725 | } else { |
@@ -1738,8 +1738,8 @@ discard block |
||
1738 | 1738 | */ |
1739 | 1739 | public function onInitResourceKlarnaService() |
1740 | 1740 | { |
1741 | - require_once __DIR__ . '/Components/Klarna/Klarna.php'; |
|
1742 | - require_once __DIR__ . '/Components/Klarna/transport/xmlrpc-3.0.0.beta/lib/xmlrpc.inc'; |
|
1741 | + require_once __DIR__.'/Components/Klarna/Klarna.php'; |
|
1742 | + require_once __DIR__.'/Components/Klarna/transport/xmlrpc-3.0.0.beta/lib/xmlrpc.inc'; |
|
1743 | 1743 | |
1744 | 1744 | $k = new Klarna(); |
1745 | 1745 | return $k; |
@@ -1757,7 +1757,7 @@ discard block |
||
1757 | 1757 | array(), |
1758 | 1758 | //less files to compile |
1759 | 1759 | array( |
1760 | - __DIR__ . '/Views/responsive/frontend/_public/src/less/all.less' |
|
1760 | + __DIR__.'/Views/responsive/frontend/_public/src/less/all.less' |
|
1761 | 1761 | ), |
1762 | 1762 | //import directory |
1763 | 1763 | __DIR__ |
@@ -1824,7 +1824,7 @@ discard block |
||
1824 | 1824 | |
1825 | 1825 | $salutation = $form['register']['personal']['salutation']; |
1826 | 1826 | if (!empty($salutation) && ($countryIso == 'DE' || $countryIso == 'NL')) { |
1827 | - $create['shipping_address']['title'] = ($salutation == 'ms' ? 'Frau' : 'Herr');//German names |
|
1827 | + $create['shipping_address']['title'] = ($salutation == 'ms' ? 'Frau' : 'Herr'); //German names |
|
1828 | 1828 | } |
1829 | 1829 | |
1830 | 1830 | $billingStreet = $form['register']['billing']['street']; |
@@ -1841,7 +1841,7 @@ discard block |
||
1841 | 1841 | $create['shipping_address']['street_number'] = $billingStreetNumber; |
1842 | 1842 | } |
1843 | 1843 | } else { |
1844 | - $create['shipping_address']['street_address'] = $billingStreet . ' ' . $billingStreetNumber; |
|
1844 | + $create['shipping_address']['street_address'] = $billingStreet.' '.$billingStreetNumber; |
|
1845 | 1845 | } |
1846 | 1846 | } |
1847 | 1847 | |
@@ -1900,9 +1900,9 @@ discard block |
||
1900 | 1900 | $view->assign('sPayments', $this->filterPayments($adminModule->sGetPaymentMeans())); |
1901 | 1901 | $view->assign('sCountryList', $adminModule->sGetCountryList()); |
1902 | 1902 | $view->assign('KlarnaHideCheckoutSteps', true); |
1903 | - $view->assign('KlarnaShowB2bSelect', (bool)$config->get('showB2bSelect')); |
|
1904 | - $view->assign('KlarnaShowBasket', (bool)$config->get('showMiniBasket')); |
|
1905 | - $view->assign('KlarnaShowDispatch', (bool)$config->get('showDispatch')); |
|
1903 | + $view->assign('KlarnaShowB2bSelect', (bool) $config->get('showB2bSelect')); |
|
1904 | + $view->assign('KlarnaShowBasket', (bool) $config->get('showMiniBasket')); |
|
1905 | + $view->assign('KlarnaShowDispatch', (bool) $config->get('showDispatch')); |
|
1906 | 1906 | $view->assign( |
1907 | 1907 | 'KlarnaCDNLink', |
1908 | 1908 | $this->buildCDNLink() |
@@ -1912,7 +1912,7 @@ discard block |
||
1912 | 1912 | $view->sUserData['billingaddress']['lastname'] == 'Klarna Checkout' |
1913 | 1913 | ); |
1914 | 1914 | $debugShowLogin = !empty($session->sUserId); |
1915 | - $debugShowLogin2 = $this->getShowLoginConfig($config,!empty($session->sUserId)); |
|
1915 | + $debugShowLogin2 = $this->getShowLoginConfig($config, !empty($session->sUserId)); |
|
1916 | 1916 | $view->assign( |
1917 | 1917 | 'KlarnaShowLogin', |
1918 | 1918 | $this->getShowLoginConfig($config, !empty($session->sUserId)) |
@@ -1936,7 +1936,7 @@ discard block |
||
1936 | 1936 | */ |
1937 | 1937 | private function getShowLoginConfig($config, $userLoggedIn) |
1938 | 1938 | { |
1939 | - return (bool)$config->get('showLoginPanel') && !($userLoggedIn); |
|
1939 | + return (bool) $config->get('showLoginPanel') && !($userLoggedIn); |
|
1940 | 1940 | } |
1941 | 1941 | |
1942 | 1942 | /**demo |
@@ -1978,7 +1978,7 @@ discard block |
||
1978 | 1978 | $result = Shopware()->Db()->fetchAssoc($sql, array()); |
1979 | 1979 | |
1980 | 1980 | // Load translations if available |
1981 | - $this->countries = array_map(function ($country) { |
|
1981 | + $this->countries = array_map(function($country) { |
|
1982 | 1982 | $country['id'] = $country['countryId']; |
1983 | 1983 | return Shopware()->Modules()->Admin()->sGetCountryTranslation($country); |
1984 | 1984 | }, $result); |
@@ -2099,7 +2099,7 @@ discard block |
||
2099 | 2099 | 'phone' => $billingAddress['phone'] |
2100 | 2100 | ), |
2101 | 2101 | 'billing' => array( |
2102 | - 'street' => $billingAddress['street_name'] . ' ' . $billingAddress['street_number'], |
|
2102 | + 'street' => $billingAddress['street_name'].' '.$billingAddress['street_number'], |
|
2103 | 2103 | 'zipcode' => $billingAddress['postal_code'], |
2104 | 2104 | 'city' => $billingAddress['city'] |
2105 | 2105 | ) |
@@ -2290,13 +2290,13 @@ discard block |
||
2290 | 2290 | /** @var Shopware\Models\Attribute\Payment $payment */ |
2291 | 2291 | foreach ($payments as $payment) { |
2292 | 2292 | $paymentObj = $payment->getPayment(); |
2293 | - if (is_null($paymentObj)){ |
|
2293 | + if (is_null($paymentObj)) { |
|
2294 | 2294 | $paymentName = false; |
2295 | 2295 | } else { |
2296 | 2296 | $paymentName = $paymentObj->getName(); |
2297 | 2297 | } |
2298 | 2298 | |
2299 | - if(!$paymentName){ |
|
2299 | + if (!$paymentName) { |
|
2300 | 2300 | continue; |
2301 | 2301 | } |
2302 | 2302 | |
@@ -2305,7 +2305,7 @@ discard block |
||
2305 | 2305 | } |
2306 | 2306 | $paymentArray = array( |
2307 | 2307 | 'name' => $payment->getPayment()->getDescription(), |
2308 | - 'redirect_uri' => $this->getRedirectUri() . '/paymentId/' . $payment->getPaymentId() |
|
2308 | + 'redirect_uri' => $this->getRedirectUri().'/paymentId/'.$payment->getPaymentId() |
|
2309 | 2309 | ); |
2310 | 2310 | |
2311 | 2311 | if ($fee = $this->getFee($payment->getPayment(), $basket)) { |
@@ -2316,7 +2316,7 @@ discard block |
||
2316 | 2316 | //Shorten the description to max. 500 characters |
2317 | 2317 | $description = strip_tags($description); |
2318 | 2318 | $description = preg_replace('#<!--.*-->#ms', '', $description); |
2319 | - $paymentArray['description'] = substr($description, 0, 497) . '...'; |
|
2319 | + $paymentArray['description'] = substr($description, 0, 497).'...'; |
|
2320 | 2320 | } |
2321 | 2321 | |
2322 | 2322 | //Only add to external checkouts if an image is set and if the shop supports SSL |
@@ -2374,14 +2374,14 @@ discard block |
||
2374 | 2374 | { |
2375 | 2375 | $media = $payment->getSwagKlarnaKlarnaMedia(); |
2376 | 2376 | if (!$payment->getSwagKlarnaShowInKlarnaIframe() || !empty($media)) { |
2377 | - if ($this->assertMinimumVersion('5.1') && version_compare(Shopware::VERSION, '5.2.0', '<=') ) { |
|
2377 | + if ($this->assertMinimumVersion('5.1') && version_compare(Shopware::VERSION, '5.2.0', '<=')) { |
|
2378 | 2378 | $media = $this->get('shopware_media.media_service')->getUrl($media); |
2379 | 2379 | } else { |
2380 | 2380 | /** @var Enlight_Controller_Front $front */ |
2381 | 2381 | $front = $this->get('front'); |
2382 | 2382 | $request = $front->Request(); |
2383 | 2383 | if ($request && $request->getHttpHost()) { |
2384 | - $url = ($request->isSecure() ? 'https' : 'http') . '://' . $request->getHttpHost() . $request->getBasePath() . "/"; |
|
2384 | + $url = ($request->isSecure() ? 'https' : 'http').'://'.$request->getHttpHost().$request->getBasePath()."/"; |
|
2385 | 2385 | } else { |
2386 | 2386 | $url = $front->Router()->assemble(array('controller' => 'index', 'module' => 'frontend')); |
2387 | 2387 | } |
@@ -2389,9 +2389,9 @@ discard block |
||
2389 | 2389 | # make sure me get only the image name, path is set in case of upgarde from SW.5.1 to 5.2 |
2390 | 2390 | $parts = explode('/', $media); |
2391 | 2391 | $end = end($parts); |
2392 | - $media = $url . 'media/image/' . $end; |
|
2392 | + $media = $url.'media/image/'.$end; |
|
2393 | 2393 | } else { |
2394 | - $media = $url . $media; |
|
2394 | + $media = $url.$media; |
|
2395 | 2395 | } |
2396 | 2396 | } |
2397 | 2397 |
@@ -597,10 +597,11 @@ discard block |
||
597 | 597 | $index++; |
598 | 598 | if ($index == count($addressParts) || $houseNumberFound) { |
599 | 599 | // at least last element should be streetnr |
600 | - if (!empty($streetnr)) $streetnr .= ' '; |
|
600 | + if (!empty($streetnr)) { |
|
601 | + $streetnr .= ' '; |
|
602 | + } |
|
601 | 603 | $streetnr .= (string)$addressPart; |
602 | - } |
|
603 | - else { |
|
604 | + } else { |
|
604 | 605 | $street .= (string)' '.$addressPart; |
605 | 606 | } |
606 | 607 | } |
@@ -1545,8 +1546,7 @@ discard block |
||
1545 | 1546 | // compatibility to shopware plugin custom products |
1546 | 1547 | if (isset($basketItem['custom_product_prices'])) { |
1547 | 1548 | $basketItemPrice = (double)$basketItem['custom_product_prices']['total']; |
1548 | - } |
|
1549 | - else { |
|
1549 | + } else { |
|
1550 | 1550 | $basketItemPrice = (double)str_replace(',', '.', $basketItem['price']); |
1551 | 1551 | } |
1552 | 1552 | $unitPrice = round($basketItemPrice * 100); |