@@ -22,13 +22,13 @@ |
||
22 | 22 | if ($this->app->runningInConsole()) { |
23 | 23 | //publish the config files |
24 | 24 | $this->publishes([ |
25 | - __DIR__.'/../config/chpter.php' => config_path('chpter.php'), |
|
26 | - ], 'chpter-config'); |
|
25 | + __DIR__.'/../config/chpter.php' => config_path('chpter.php'), |
|
26 | + ], 'chpter-config'); |
|
27 | 27 | |
28 | 28 | // Register commands |
29 | 29 | $this->commands([ |
30 | 30 | InstallChpter::class, |
31 | - ]); |
|
31 | + ]); |
|
32 | 32 | } |
33 | 33 | } |
34 | 34 |
@@ -40,7 +40,7 @@ |
||
40 | 40 | public function register() |
41 | 41 | { |
42 | 42 | |
43 | - $this->app->singleton(Chpter::class, function () { |
|
43 | + $this->app->singleton(Chpter::class, function() { |
|
44 | 44 | return new Chpter(); |
45 | 45 | }); |
46 | 46 | } |
@@ -1,6 +1,6 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | |
4 | -Route::get('demo', function () { |
|
4 | +Route::get('demo', function() { |
|
5 | 5 | return "This is amazing right (:"; |
6 | 6 | }); |
@@ -16,8 +16,8 @@ |
||
16 | 16 | $this->info('Publishing Configuration...'); |
17 | 17 | |
18 | 18 | $this->call('vendor:publish', [ |
19 | - '--provider' => "KiplingKelvin\ChpterLaravelSdk\ChpterServiceProvider", |
|
20 | - '--tag' => "chpter-config" |
|
19 | + '--provider' => "KiplingKelvin\ChpterLaravelSdk\ChpterServiceProvider", |
|
20 | + '--tag' => "chpter-config" |
|
21 | 21 | ]); |
22 | 22 | |
23 | 23 | $this->info('Installed Chpter for Laravel'); |
@@ -9,9 +9,9 @@ |
||
9 | 9 | return KiplingKelvin\ChpterLaravelSdk\Chpter::mpesaPayment($customer, $products, $amount, $callback_details); |
10 | 10 | } |
11 | 11 | |
12 | -function chpter_card_payment($customer, $products, $amount,$card_details, $callback_details) |
|
12 | +function chpter_card_payment($customer, $products, $amount, $card_details, $callback_details) |
|
13 | 13 | { |
14 | - return KiplingKelvin\ChpterLaravelSdk\Chpter::cardPayment($customer, $products, $amount,$card_details, $callback_details); |
|
14 | + return KiplingKelvin\ChpterLaravelSdk\Chpter::cardPayment($customer, $products, $amount, $card_details, $callback_details); |
|
15 | 15 | } |
16 | 16 | function chpter_hosted_redirect_payment($customer, $amount, $redirect_urls) |
17 | 17 | { |
@@ -30,15 +30,15 @@ |
||
30 | 30 | public function __construct() |
31 | 31 | { |
32 | 32 | //Base URL for the API endpoints. This is basically the 'common' part of the API endpoints |
33 | - $this->chpter_payment_url = config('chpter.payment_url'); |
|
34 | - $this->chpter_hosted_redirect_payment_url = config('chpter.hosted_redirect_payment_url'); |
|
35 | - $this->chpter_express_redirect_payment_url = config('chpter.express_redirect_payment_url'); |
|
33 | + $this->chpter_payment_url = config('chpter.payment_url'); |
|
34 | + $this->chpter_hosted_redirect_payment_url = config('chpter.hosted_redirect_payment_url'); |
|
35 | + $this->chpter_express_redirect_payment_url = config('chpter.express_redirect_payment_url'); |
|
36 | 36 | |
37 | - $this->chpter_accounts_token_renewal_url = config('chpter.accounts_token_renewal_url'); |
|
37 | + $this->chpter_accounts_token_renewal_url = config('chpter.accounts_token_renewal_url'); |
|
38 | 38 | |
39 | 39 | |
40 | - $this->token = config('chpter.chpter_token'); |
|
41 | - $this->domain =config('chpter.domain'); |
|
40 | + $this->token = config('chpter.chpter_token'); |
|
41 | + $this->domain =config('chpter.domain'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 |
@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | |
39 | 39 | |
40 | 40 | $this->token = config('chpter.chpter_token'); |
41 | - $this->domain =config('chpter.domain'); |
|
41 | + $this->domain = config('chpter.domain'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
45 | 45 | public function mpesaPayment($customer, $products, $amount, $callback_details) |
46 | 46 | { |
47 | 47 | |
48 | - $client = new Client(); |
|
48 | + $client = new Client(); |
|
49 | 49 | |
50 | 50 | $requestBody = array( |
51 | 51 | "customer_details"=> $customer, |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | public function hostedRedirectPayment($customer, $amount, $redirect_urls) |
74 | 74 | { |
75 | 75 | |
76 | - $client = new Client(); |
|
76 | + $client = new Client(); |
|
77 | 77 | |
78 | 78 | $requestBody = array( |
79 | 79 | "customer_details"=> $customer, |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | public function expressRedirectPayment($transaction_data, $redirect_urls) |
100 | 100 | { |
101 | 101 | |
102 | - $client = new Client(); |
|
102 | + $client = new Client(); |
|
103 | 103 | |
104 | 104 | $requestBody = array( |
105 | 105 | "transaction_data"=> $transaction_data, |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | public function accountsTokenRenewal() |
125 | 125 | { |
126 | 126 | |
127 | - $client = new Client(); |
|
127 | + $client = new Client(); |
|
128 | 128 | |
129 | 129 | try { |
130 | 130 | $response = $client->post($this->chpter_accounts_token_renewal_url, [ |
@@ -6,5 +6,5 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', |
|
9 | + 'Composer\\InstalledVersions' => $vendorDir.'/composer/InstalledVersions.php', |
|
10 | 10 | ); |
@@ -6,6 +6,6 @@ |
||
6 | 6 | $baseDir = dirname($vendorDir); |
7 | 7 | |
8 | 8 | return array( |
9 | - 'KiplingKelvin\\ChpterLaravelSdk\\' => array($baseDir . '/src'), |
|
10 | - 'App\\' => array($baseDir . '/app'), |
|
9 | + 'KiplingKelvin\\ChpterLaravelSdk\\' => array($baseDir.'/src'), |
|
10 | + 'App\\' => array($baseDir.'/app'), |
|
11 | 11 | ); |
@@ -6,39 +6,39 @@ |
||
6 | 6 | |
7 | 7 | class ComposerStaticInit912ef365a6588e1102f28f1b2c039019 |
8 | 8 | { |
9 | - public static $files = array ( |
|
10 | - 'eb4ca143a560593927b6c460308f3a8f' => __DIR__ . '/../..' . '/src/functions.php', |
|
9 | + public static $files = array( |
|
10 | + 'eb4ca143a560593927b6c460308f3a8f' => __DIR__.'/../..'.'/src/functions.php', |
|
11 | 11 | ); |
12 | 12 | |
13 | - public static $prefixLengthsPsr4 = array ( |
|
13 | + public static $prefixLengthsPsr4 = array( |
|
14 | 14 | 'K' => |
15 | - array ( |
|
15 | + array( |
|
16 | 16 | 'KiplingKelvin\\ChpterLaravelSdk\\' => 31, |
17 | 17 | ), |
18 | 18 | 'A' => |
19 | - array ( |
|
19 | + array( |
|
20 | 20 | 'App\\' => 4, |
21 | 21 | ), |
22 | 22 | ); |
23 | 23 | |
24 | - public static $prefixDirsPsr4 = array ( |
|
24 | + public static $prefixDirsPsr4 = array( |
|
25 | 25 | 'KiplingKelvin\\ChpterLaravelSdk\\' => |
26 | - array ( |
|
27 | - 0 => __DIR__ . '/../..' . '/src', |
|
26 | + array( |
|
27 | + 0 => __DIR__.'/../..'.'/src', |
|
28 | 28 | ), |
29 | 29 | 'App\\' => |
30 | - array ( |
|
31 | - 0 => __DIR__ . '/../..' . '/app', |
|
30 | + array( |
|
31 | + 0 => __DIR__.'/../..'.'/app', |
|
32 | 32 | ), |
33 | 33 | ); |
34 | 34 | |
35 | - public static $classMap = array ( |
|
36 | - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', |
|
35 | + public static $classMap = array( |
|
36 | + 'Composer\\InstalledVersions' => __DIR__.'/..'.'/composer/InstalledVersions.php', |
|
37 | 37 | ); |
38 | 38 | |
39 | 39 | public static function getInitializer(ClassLoader $loader) |
40 | 40 | { |
41 | - return \Closure::bind(function () use ($loader) { |
|
41 | + return \Closure::bind(function() use ($loader) { |
|
42 | 42 | $loader->prefixLengthsPsr4 = ComposerStaticInit912ef365a6588e1102f28f1b2c039019::$prefixLengthsPsr4; |
43 | 43 | $loader->prefixDirsPsr4 = ComposerStaticInit912ef365a6588e1102f28f1b2c039019::$prefixDirsPsr4; |
44 | 44 | $loader->classMap = ComposerStaticInit912ef365a6588e1102f28f1b2c039019::$classMap; |
@@ -203,20 +203,20 @@ discard block |
||
203 | 203 | return; |
204 | 204 | } |
205 | 205 | |
206 | - $first = $prefix[0]; |
|
207 | - if (!isset($this->prefixesPsr0[$first][$prefix])) { |
|
208 | - $this->prefixesPsr0[$first][$prefix] = (array) $paths; |
|
206 | + $first = $prefix[ 0 ]; |
|
207 | + if (!isset($this->prefixesPsr0[ $first ][ $prefix ])) { |
|
208 | + $this->prefixesPsr0[ $first ][ $prefix ] = (array) $paths; |
|
209 | 209 | |
210 | 210 | return; |
211 | 211 | } |
212 | 212 | if ($prepend) { |
213 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
213 | + $this->prefixesPsr0[ $first ][ $prefix ] = array_merge( |
|
214 | 214 | (array) $paths, |
215 | - $this->prefixesPsr0[$first][$prefix] |
|
215 | + $this->prefixesPsr0[ $first ][ $prefix ] |
|
216 | 216 | ); |
217 | 217 | } else { |
218 | - $this->prefixesPsr0[$first][$prefix] = array_merge( |
|
219 | - $this->prefixesPsr0[$first][$prefix], |
|
218 | + $this->prefixesPsr0[ $first ][ $prefix ] = array_merge( |
|
219 | + $this->prefixesPsr0[ $first ][ $prefix ], |
|
220 | 220 | (array) $paths |
221 | 221 | ); |
222 | 222 | } |
@@ -249,24 +249,24 @@ discard block |
||
249 | 249 | (array) $paths |
250 | 250 | ); |
251 | 251 | } |
252 | - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { |
|
252 | + } elseif (!isset($this->prefixDirsPsr4[ $prefix ])) { |
|
253 | 253 | // Register directories for a new namespace. |
254 | 254 | $length = strlen($prefix); |
255 | - if ('\\' !== $prefix[$length - 1]) { |
|
255 | + if ('\\' !== $prefix[ $length - 1 ]) { |
|
256 | 256 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
257 | 257 | } |
258 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
259 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
258 | + $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length; |
|
259 | + $this->prefixDirsPsr4[ $prefix ] = (array) $paths; |
|
260 | 260 | } elseif ($prepend) { |
261 | 261 | // Prepend directories for an already registered namespace. |
262 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
262 | + $this->prefixDirsPsr4[ $prefix ] = array_merge( |
|
263 | 263 | (array) $paths, |
264 | - $this->prefixDirsPsr4[$prefix] |
|
264 | + $this->prefixDirsPsr4[ $prefix ] |
|
265 | 265 | ); |
266 | 266 | } else { |
267 | 267 | // Append directories for an already registered namespace. |
268 | - $this->prefixDirsPsr4[$prefix] = array_merge( |
|
269 | - $this->prefixDirsPsr4[$prefix], |
|
268 | + $this->prefixDirsPsr4[ $prefix ] = array_merge( |
|
269 | + $this->prefixDirsPsr4[ $prefix ], |
|
270 | 270 | (array) $paths |
271 | 271 | ); |
272 | 272 | } |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | if (!$prefix) { |
287 | 287 | $this->fallbackDirsPsr0 = (array) $paths; |
288 | 288 | } else { |
289 | - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; |
|
289 | + $this->prefixesPsr0[ $prefix[ 0 ] ][ $prefix ] = (array) $paths; |
|
290 | 290 | } |
291 | 291 | } |
292 | 292 | |
@@ -307,11 +307,11 @@ discard block |
||
307 | 307 | $this->fallbackDirsPsr4 = (array) $paths; |
308 | 308 | } else { |
309 | 309 | $length = strlen($prefix); |
310 | - if ('\\' !== $prefix[$length - 1]) { |
|
310 | + if ('\\' !== $prefix[ $length - 1 ]) { |
|
311 | 311 | throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); |
312 | 312 | } |
313 | - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; |
|
314 | - $this->prefixDirsPsr4[$prefix] = (array) $paths; |
|
313 | + $this->prefixLengthsPsr4[ $prefix[ 0 ] ][ $prefix ] = $length; |
|
314 | + $this->prefixDirsPsr4[ $prefix ] = (array) $paths; |
|
315 | 315 | } |
316 | 316 | } |
317 | 317 | |
@@ -401,8 +401,8 @@ discard block |
||
401 | 401 | if ($prepend) { |
402 | 402 | self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; |
403 | 403 | } else { |
404 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
405 | - self::$registeredLoaders[$this->vendorDir] = $this; |
|
404 | + unset(self::$registeredLoaders[ $this->vendorDir ]); |
|
405 | + self::$registeredLoaders[ $this->vendorDir ] = $this; |
|
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | spl_autoload_unregister(array($this, 'loadClass')); |
417 | 417 | |
418 | 418 | if (null !== $this->vendorDir) { |
419 | - unset(self::$registeredLoaders[$this->vendorDir]); |
|
419 | + unset(self::$registeredLoaders[ $this->vendorDir ]); |
|
420 | 420 | } |
421 | 421 | } |
422 | 422 | |
@@ -447,10 +447,10 @@ discard block |
||
447 | 447 | public function findFile($class) |
448 | 448 | { |
449 | 449 | // class map lookup |
450 | - if (isset($this->classMap[$class])) { |
|
451 | - return $this->classMap[$class]; |
|
450 | + if (isset($this->classMap[ $class ])) { |
|
451 | + return $this->classMap[ $class ]; |
|
452 | 452 | } |
453 | - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { |
|
453 | + if ($this->classMapAuthoritative || isset($this->missingClasses[ $class ])) { |
|
454 | 454 | return false; |
455 | 455 | } |
456 | 456 | if (null !== $this->apcuPrefix) { |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | |
474 | 474 | if (false === $file) { |
475 | 475 | // Remember that this class does not exist. |
476 | - $this->missingClasses[$class] = true; |
|
476 | + $this->missingClasses[ $class ] = true; |
|
477 | 477 | } |
478 | 478 | |
479 | 479 | return $file; |
@@ -497,18 +497,18 @@ discard block |
||
497 | 497 | private function findFileWithExtension($class, $ext) |
498 | 498 | { |
499 | 499 | // PSR-4 lookup |
500 | - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; |
|
500 | + $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR).$ext; |
|
501 | 501 | |
502 | - $first = $class[0]; |
|
503 | - if (isset($this->prefixLengthsPsr4[$first])) { |
|
502 | + $first = $class[ 0 ]; |
|
503 | + if (isset($this->prefixLengthsPsr4[ $first ])) { |
|
504 | 504 | $subPath = $class; |
505 | 505 | while (false !== $lastPos = strrpos($subPath, '\\')) { |
506 | 506 | $subPath = substr($subPath, 0, $lastPos); |
507 | - $search = $subPath . '\\'; |
|
508 | - if (isset($this->prefixDirsPsr4[$search])) { |
|
509 | - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); |
|
510 | - foreach ($this->prefixDirsPsr4[$search] as $dir) { |
|
511 | - if (file_exists($file = $dir . $pathEnd)) { |
|
507 | + $search = $subPath.'\\'; |
|
508 | + if (isset($this->prefixDirsPsr4[ $search ])) { |
|
509 | + $pathEnd = DIRECTORY_SEPARATOR.substr($logicalPathPsr4, $lastPos + 1); |
|
510 | + foreach ($this->prefixDirsPsr4[ $search ] as $dir) { |
|
511 | + if (file_exists($file = $dir.$pathEnd)) { |
|
512 | 512 | return $file; |
513 | 513 | } |
514 | 514 | } |
@@ -518,7 +518,7 @@ discard block |
||
518 | 518 | |
519 | 519 | // PSR-4 fallback dirs |
520 | 520 | foreach ($this->fallbackDirsPsr4 as $dir) { |
521 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { |
|
521 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr4)) { |
|
522 | 522 | return $file; |
523 | 523 | } |
524 | 524 | } |
@@ -530,14 +530,14 @@ discard block |
||
530 | 530 | . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); |
531 | 531 | } else { |
532 | 532 | // PEAR-like class name |
533 | - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; |
|
533 | + $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR).$ext; |
|
534 | 534 | } |
535 | 535 | |
536 | - if (isset($this->prefixesPsr0[$first])) { |
|
537 | - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { |
|
536 | + if (isset($this->prefixesPsr0[ $first ])) { |
|
537 | + foreach ($this->prefixesPsr0[ $first ] as $prefix => $dirs) { |
|
538 | 538 | if (0 === strpos($class, $prefix)) { |
539 | 539 | foreach ($dirs as $dir) { |
540 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
540 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
541 | 541 | return $file; |
542 | 542 | } |
543 | 543 | } |
@@ -547,7 +547,7 @@ discard block |
||
547 | 547 | |
548 | 548 | // PSR-0 fallback dirs |
549 | 549 | foreach ($this->fallbackDirsPsr0 as $dir) { |
550 | - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { |
|
550 | + if (file_exists($file = $dir.DIRECTORY_SEPARATOR.$logicalPathPsr0)) { |
|
551 | 551 | return $file; |
552 | 552 | } |
553 | 553 | } |