Skip to content

Commit

Permalink
Dont use static methods
Browse files Browse the repository at this point in the history
  • Loading branch information
caiquecastro committed Feb 4, 2018
1 parent 6de02d8 commit f8efc7b
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/Artistas/PagSeguroController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,25 @@

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.
*
* @return string
*/
public function session()
{
return PagSeguroFacade::startSession();
return $this->pagseguro->startSession();
}

/**
Expand All @@ -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');
Expand Down

0 comments on commit f8efc7b

Please sign in to comment.