From 3c06ec9970b48ef024b9434d6cbb4ff9648118f2 Mon Sep 17 00:00:00 2001 From: Valdeir S Date: Tue, 18 Aug 2020 21:12:18 -0300 Subject: [PATCH] feat: cria classe para os dados de boleto --- .../PaymentMethod/AbstractPaymentMethod.php | 47 +++++++++++++++++++ .../src/Domains/PaymentMethod/Boleto.php | 22 +++++++++ .../unit/Domains/PaymentMethod/BoletoTest.php | 25 ++++++++++ 3 files changed, 94 insertions(+) create mode 100644 upload/system/library/PagSeguro/src/Domains/PaymentMethod/AbstractPaymentMethod.php create mode 100644 upload/system/library/PagSeguro/src/Domains/PaymentMethod/Boleto.php create mode 100644 upload/system/library/PagSeguro/tests/unit/Domains/PaymentMethod/BoletoTest.php diff --git a/upload/system/library/PagSeguro/src/Domains/PaymentMethod/AbstractPaymentMethod.php b/upload/system/library/PagSeguro/src/Domains/PaymentMethod/AbstractPaymentMethod.php new file mode 100644 index 0000000..765c5dd --- /dev/null +++ b/upload/system/library/PagSeguro/src/Domains/PaymentMethod/AbstractPaymentMethod.php @@ -0,0 +1,47 @@ +method = $method; + } + + /** + * @return int + */ + public function getType(): int + { + return $this->$type; + } + + /** + * @return int + */ + public function getCode(): int + { + return $this->code; + } + + /** + * @return string + */ + public function getMethod(): string + { + return $this->method; + } +} diff --git a/upload/system/library/PagSeguro/src/Domains/PaymentMethod/Boleto.php b/upload/system/library/PagSeguro/src/Domains/PaymentMethod/Boleto.php new file mode 100644 index 0000000..008e17c --- /dev/null +++ b/upload/system/library/PagSeguro/src/Domains/PaymentMethod/Boleto.php @@ -0,0 +1,22 @@ +paymentLink; + } +} diff --git a/upload/system/library/PagSeguro/tests/unit/Domains/PaymentMethod/BoletoTest.php b/upload/system/library/PagSeguro/tests/unit/Domains/PaymentMethod/BoletoTest.php new file mode 100644 index 0000000..9400969 --- /dev/null +++ b/upload/system/library/PagSeguro/tests/unit/Domains/PaymentMethod/BoletoTest.php @@ -0,0 +1,25 @@ +assertInstanceOf(Boleto::class, $instance); + } + + /** + * @test + */ + public function getMethodShouldReturnBoleto() + { + $instance = new Boleto(); + $this->assertEquals('boleto', $instance->getMethod()); + } +}