forked from larabook/gateway
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
22 changed files
with
518 additions
and
56 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
/vendor | ||
/.idea |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
namespace Larabookir\Gateway; | ||
|
||
use Illuminate\Support\Facades\File; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class GatewayServiceProviderLaravel4 extends ServiceProvider | ||
{ | ||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$config = __DIR__ . '/../config/gateway.php'; | ||
$migrations = __DIR__ . '/../migrations/'; | ||
$views = __DIR__ . '/../views/'; | ||
|
||
|
||
|
||
|
||
// for laravel 4.2 | ||
$this->package('larabook/gateway',null,__DIR__.'/../'); | ||
|
||
|
||
if ( | ||
File::glob(base_path('/database/migrations/*create_gateway_status_log_table\.php')) | ||
&& !File::exists(base_path('/database/migrations/2017_04_05_103357_alter_id_in_transactions_table.php')) | ||
) { | ||
@File::copy($migrations.'/2017_04_05_103357_alter_id_in_transactions_table.php',base_path('database/migrations/2017_04_05_103357_alter_id_in_transactions_table.php')); | ||
} | ||
} | ||
|
||
/** | ||
* Register the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('gateway', function () { | ||
return new GatewayResolver(); | ||
}); | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
<?php | ||
|
||
namespace Larabookir\Gateway; | ||
|
||
use Illuminate\Support\Facades\File; | ||
use Illuminate\Support\ServiceProvider; | ||
|
||
class GatewayServiceProviderLaravel5 extends ServiceProvider | ||
{ | ||
/** | ||
* Indicates if loading of the provider is deferred. | ||
* | ||
* @var bool | ||
*/ | ||
protected $defer = false; | ||
|
||
/** | ||
* Bootstrap the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function boot() | ||
{ | ||
$config = __DIR__ . '/../config/gateway.php'; | ||
$migrations = __DIR__ . '/../migrations/'; | ||
$views = __DIR__ . '/../views/'; | ||
|
||
//php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider --tag=config | ||
$this->publishes([ | ||
$config => config_path('gateway.php'), | ||
], 'config'); | ||
|
||
// php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider --tag=migrations | ||
$this->publishes([ | ||
$migrations => base_path('database/migrations') | ||
], 'migrations'); | ||
|
||
|
||
|
||
if ( | ||
File::glob(base_path('/database/migrations/*create_gateway_status_log_table\.php')) | ||
&& !File::exists(base_path('/database/migrations/2017_04_05_103357_alter_id_in_transactions_table.php')) | ||
) { | ||
@File::copy($migrations.'/2017_04_05_103357_alter_id_in_transactions_table.php',base_path('database/migrations/2017_04_05_103357_alter_id_in_transactions_table.php')); | ||
} | ||
|
||
|
||
$this->loadViewsFrom($views, 'gateway'); | ||
|
||
// php artisan vendor:publish --provider=Larabookir\Gateway\GatewayServiceProvider --tag=views | ||
$this->publishes([ | ||
$views => base_path('resources/views/vendor/gateway'), | ||
], 'views'); | ||
|
||
//$this->mergeConfigFrom( $config,'gateway') | ||
} | ||
|
||
/** | ||
* Register the application services. | ||
* | ||
* @return void | ||
*/ | ||
public function register() | ||
{ | ||
$this->app->singleton('gateway', function () { | ||
return new GatewayResolver(); | ||
}); | ||
|
||
} | ||
} |
Oops, something went wrong.