-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update 0.15 for Laravel 5.1 #22
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,32 +21,11 @@ class PayumServiceProvider extends ServiceProvider | |
*/ | ||
public function boot() | ||
{ | ||
$this->package('payum/payum-laravel-package'); | ||
\View::addNamespace('payum/payum', __DIR__.'/../../views'); | ||
|
||
$this->app->error(function(ReplyInterface $reply) | ||
{ | ||
$response = null; | ||
|
||
if ($reply instanceof SymfonyHttpResponse) { | ||
$response = $reply->getResponse(); | ||
} elseif ($reply instanceof HttpResponse) { | ||
$response = new Response($reply->getContent()); | ||
} elseif ($reply instanceof HttpRedirect) { | ||
$response = new RedirectResponse($reply->getUrl()); | ||
} | ||
|
||
if ($response) { | ||
return $response; | ||
} | ||
|
||
$ro = new \ReflectionObject($reply); | ||
throw new LogicException( | ||
sprintf('Cannot convert reply %s to Laravel response.', $ro->getShortName()), | ||
null, | ||
$reply | ||
); | ||
}); | ||
$this->publishes([ | ||
__DIR__.'/../../config/config.php' => config_path('payum-laravel-package.php'), | ||
]); | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't it work in Laravel5? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'd prefer this way, cuz you can easily customize response just by registering another listener There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. never mind, I read you comments |
||
$this->loadViewsFrom(__DIR__.'/../../views', 'payum/payum'); | ||
|
||
\Route::any('/payment/authorize/{payum_token}', array( | ||
'as' => 'payum_authorize_do', | ||
|
@@ -77,8 +56,8 @@ public function boot() | |
//TODO add exceptions if invalid gateways and storages options set. | ||
|
||
$payum = new ContainerAwareRegistry( | ||
\Config::get('payum-laravel-package::gateways'), | ||
\Config::get('payum-laravel-package::storages') | ||
\Config::get('payum-laravel-package.gateways'), | ||
\Config::get('payum-laravel-package.storages') | ||
); | ||
|
||
$payum->setContainer($app); | ||
|
@@ -89,7 +68,7 @@ public function boot() | |
$this->app['payum.security.token_storage'] = $this->app->share(function($app) { | ||
//TODO add exceptions if invalid gateways and storages options set. | ||
|
||
$tokenStorage = \Config::get('payum-laravel-package::token_storage'); | ||
$tokenStorage = \Config::get('payum-laravel-package.token_storage'); | ||
|
||
return is_object($tokenStorage) ? $tokenStorage : $app[$tokenStorage]; | ||
}); | ||
|
@@ -116,6 +95,9 @@ public function boot() | |
*/ | ||
public function register() | ||
{ | ||
$this->mergeConfigFrom( | ||
__DIR__.'/../../config/config.php', 'payum-laravel-package' | ||
); | ||
} | ||
|
||
/** | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I can see It is not working with Laravel4 any more. I dont know, How many people uses Laravel5 in compare with Laravel4.