Skip to content

Commit 4c939ab

Browse files
committed
Ignited to Omnipay
1 parent 1cc7270 commit 4c939ab

File tree

7 files changed

+48
-52
lines changed

7 files changed

+48
-52
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
},
1717
"autoload": {
1818
"psr-0": {
19-
"laravel-omnipay\\LaravelOmnipay": "src/"
19+
"Omnipay\\LaravelOmnipay": "src/"
2020
}
2121
},
2222
"extra": {

src/Ignited/LaravelOmnipay/BaseServiceProvider.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
<?php namespace Ignited\LaravelOmnipay;
1+
<?php namespace Omnipay\LaravelOmnipay;
22

33
use Illuminate\Support\ServiceProvider;
44
use Omnipay\Common\GatewayFactory;
55

6-
abstract class BaseServiceProvider extends ServiceProvider {
6+
abstract class BaseServiceProvider extends ServiceProvider
7+
{
78

89
/**
910
* Indicates if loading of the provider is deferred.
@@ -44,5 +45,4 @@ public function provides()
4445
{
4546
return ['omnipay'];
4647
}
47-
48-
}
48+
}
Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1-
<?php namespace Ignited\LaravelOmnipay\Facades;
1+
<?php namespace Omnipay\LaravelOmnipay\Facades;
22

33
use Illuminate\Support\Facades\Facade;
44

5-
class OmnipayFacade extends Facade {
6-
7-
protected static function getFacadeAccessor() { return 'omnipay'; }
8-
9-
}
5+
class OmnipayFacade extends Facade
6+
{
7+
protected static function getFacadeAccessor()
8+
{
9+
return 'omnipay';
10+
}
11+
}

src/Ignited/LaravelOmnipay/LaravelOmnipayManager.php

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
1-
<?php namespace Ignited\LaravelOmnipay;
1+
<?php namespace Omnipay\LaravelOmnipay;
22

33
use Closure;
44
use Omnipay\Common\GatewayFactory;
55
use Omnipay\Common\Helper;
66
use Omnipay\Common\CreditCard;
77

8-
class LaravelOmnipayManager {
8+
class LaravelOmnipayManager
9+
{
910
/**
1011
* The application instance.
1112
*
@@ -50,7 +51,7 @@ public function __construct($app, $factory)
5051
$this->factory = $factory;
5152
}
5253

53-
/**
54+
/**
5455
* Get an instance of the specified gateway
5556
* @param index of config array to use
5657
* @return Omnipay\Common\AbstractGateway
@@ -59,8 +60,7 @@ public function gateway($name = null)
5960
{
6061
$name = $name ?: $this->getGateway();
6162

62-
if ( ! isset($this->gateways[$name]))
63-
{
63+
if (! isset($this->gateways[$name])) {
6464
$this->gateways[$name] = $this->resolve($name);
6565
}
6666

@@ -71,8 +71,7 @@ protected function resolve($name)
7171
{
7272
$config = $this->getConfig($name);
7373

74-
if(is_null($config))
75-
{
74+
if (is_null($config)) {
7675
throw new \UnexpectedValueException("Gateway [$name] is not defined.");
7776
}
7877

@@ -82,8 +81,7 @@ protected function resolve($name)
8281

8382
$reflection = new \ReflectionClass($class);
8483

85-
foreach($config['options'] as $optionName=>$value)
86-
{
84+
foreach ($config['options'] as $optionName=>$value) {
8785
$method = 'set' . ucfirst($optionName);
8886

8987
if ($reflection->hasMethod($method)) {
@@ -111,8 +109,7 @@ protected function getConfig($name)
111109

112110
public function getGateway()
113111
{
114-
if(!isset($this->gateway))
115-
{
112+
if (!isset($this->gateway)) {
116113
$this->gateway = $this->getDefault();
117114
}
118115
return $this->gateway;
@@ -137,8 +134,7 @@ public function __call($method, $parameters)
137134
{
138135
$callable = [$this->gateway(), $method];
139136

140-
if(method_exists($this->gateway(), $method))
141-
{
137+
if (method_exists($this->gateway(), $method)) {
142138
return call_user_func_array($callable, $parameters);
143139
}
144140

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,11 @@
1-
<?php namespace Ignited\LaravelOmnipay;
2-
3-
class LaravelOmnipayServiceProvider extends BaseServiceProvider {
1+
<?php namespace Omnipay\LaravelOmnipay;
42

3+
class LaravelOmnipayServiceProvider extends BaseServiceProvider
4+
{
55
public function boot()
66
{
77
// Publish config
88
$configPath = __DIR__ . '/../../config/config.php';
99
$this->publishes([$configPath => config_path('laravel-omnipay.php')], 'config');
1010
}
11-
12-
}
11+
}
Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
<?php namespace Ignited\LaravelOmnipay;
1+
<?php namespace Omnipay\LaravelOmnipay;
22

3-
class LumenOmnipayServiceProvider extends BaseServiceProvider {
4-
5-
public function boot()
6-
{
7-
$this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'laravel-omnipay');
8-
}
9-
10-
}
3+
class LumenOmnipayServiceProvider extends BaseServiceProvider
4+
{
5+
public function boot()
6+
{
7+
$this->mergeConfigFrom(realpath(__DIR__.'/../../config/config.php'), 'laravel-omnipay');
8+
}
9+
}

src/config/config.php

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,19 +2,19 @@
22

33
return [
44

5-
// The default gateway to use
6-
'default' => 'paypal',
5+
// The default gateway to use
6+
'default' => 'paypal',
77

8-
// Add in each gateway here
9-
'gateways' => [
10-
'paypal' => [
11-
'driver' => 'PayPal_Express',
12-
'options' => [
13-
'solutionType' => '',
14-
'landingPage' => '',
15-
'headerImageUrl' => ''
16-
]
17-
]
18-
]
8+
// Add in each gateway here
9+
'gateways' => [
10+
'paypal' => [
11+
'driver' => 'PayPal_Express',
12+
'options' => [
13+
'solutionType' => '',
14+
'landingPage' => '',
15+
'headerImageUrl' => ''
16+
]
17+
]
18+
]
1919

20-
];
20+
];

0 commit comments

Comments
 (0)