From f8efc7b2254cac6b0ab220bfe0b735390f783aef Mon Sep 17 00:00:00 2001 From: Caique de Castro Date: Sun, 4 Feb 2018 19:59:34 -0200 Subject: [PATCH] Dont use static methods --- src/Artistas/PagSeguroController.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/Artistas/PagSeguroController.php b/src/Artistas/PagSeguroController.php index abe0288..f61007e 100644 --- a/src/Artistas/PagSeguroController.php +++ b/src/Artistas/PagSeguroController.php @@ -4,6 +4,17 @@ class PagSeguroController { + /** @var \Artistas\PagSeguro\PagSeguroClient */ + private $pagseguro; + + /** + * Instancia as dependências + */ + public function __construct() + { + $this->pagseguro = app('pagseguro'); + } + /** * Gera um token de sessão para realizar transações. * @@ -11,7 +22,7 @@ class PagSeguroController */ public function session() { - return PagSeguroFacade::startSession(); + return $this->pagseguro->startSession(); } /** @@ -21,7 +32,7 @@ public function session() */ public function javascript() { - $scriptContent = file_get_contents(PagSeguroFacade::getUrl()['javascript']); + $scriptContent = file_get_contents($this->pagseguro->getUrl()['javascript']); return response()->make($scriptContent, '200') ->header('Content-Type', 'text/javascript');