-
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.
feat: cria classe para os dados de Debito
- Loading branch information
1 parent
3c06ec9
commit 43671ff
Showing
3 changed files
with
51 additions
and
0 deletions.
There are no files selected for viewing
22 changes: 22 additions & 0 deletions
22
upload/system/library/PagSeguro/src/Domains/PaymentMethod/DebitCard.php
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,22 @@ | ||
<?php | ||
|
||
namespace ValdeirPsr\PagSeguro\Domains\PaymentMethod; | ||
|
||
class DebitCard extends AbstractPaymentMethod | ||
{ | ||
/** @var string Link de pagamento (somente leitura) */ | ||
private $paymentLink; | ||
|
||
public function __construct() | ||
{ | ||
parent::__construct('eft'); | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getPaymentLink(): string | ||
{ | ||
return $this->paymentLink; | ||
} | ||
} |
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
27 changes: 27 additions & 0 deletions
27
upload/system/library/PagSeguro/tests/unit/Domains/PaymentMethod/DebitCardTest.php
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,27 @@ | ||
<?php | ||
|
||
use PHPUnit\Framework\TestCase; | ||
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\AbstractPaymentMethod; | ||
use ValdeirPsr\PagSeguro\Domains\PaymentMethod\DebitCard; | ||
|
||
class DebitCardTest extends TestCase | ||
{ | ||
/** | ||
* @test | ||
*/ | ||
public function newInstance() | ||
{ | ||
$instance = new DebitCard(); | ||
$this->assertInstanceOf(DebitCard::class, $instance); | ||
$this->assertInstanceOf(AbstractPaymentMethod::class, $instance); | ||
} | ||
|
||
/** | ||
* @test | ||
*/ | ||
public function getMethodShouldReturnEFT() | ||
{ | ||
$instance = new DebitCard(); | ||
$this->assertEquals('eft', $instance->getMethod()); | ||
} | ||
} |