Skip to content

Commit 47ee434

Browse files
committed
Dont use static methods
1 parent 6de02d8 commit 47ee434

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/Artistas/PagSeguroController.php

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,25 @@
44

55
class PagSeguroController
66
{
7+
/** @var \Artistas\PagSeguro\PagSeguroClient */
8+
private $pagseguro;
9+
10+
/**
11+
* Instancia as dependências.
12+
*/
13+
public function __construct()
14+
{
15+
$this->pagseguro = app('pagseguro');
16+
}
17+
718
/**
819
* Gera um token de sessão para realizar transações.
920
*
1021
* @return string
1122
*/
1223
public function session()
1324
{
14-
return PagSeguroFacade::startSession();
25+
return $this->pagseguro->startSession();
1526
}
1627

1728
/**
@@ -21,7 +32,7 @@ public function session()
2132
*/
2233
public function javascript()
2334
{
24-
$scriptContent = file_get_contents(PagSeguroFacade::getUrl()['javascript']);
35+
$scriptContent = file_get_contents($this->pagseguro->getUrl()['javascript']);
2536

2637
return response()->make($scriptContent, '200')
2738
->header('Content-Type', 'text/javascript');

0 commit comments

Comments
 (0)