-
-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #76 from Zales0123/refactor-refund-payment-creation
🌊
- Loading branch information
Showing
7 changed files
with
134 additions
and
33 deletions.
There are no files selected for viewing
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace spec\Sylius\RefundPlugin\Event; | ||
|
||
use PhpSpec\ObjectBehavior; | ||
|
||
final class RefundPaymentGeneratedSpec extends ObjectBehavior | ||
{ | ||
function it_represents_an_immutable_fact_that_refund_payment_has_been_generated(): void | ||
{ | ||
$this->beConstructedWith(1, '000222', 10000, 'GBP', 2); | ||
|
||
$this->id()->shouldReturn(1); | ||
$this->orderNumber()->shouldReturn('000222'); | ||
$this->amount()->shouldReturn(10000); | ||
$this->currencyCode()->shouldReturn('GBP'); | ||
$this->paymentMethodId()->shouldReturn(2); | ||
} | ||
} |
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
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
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
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,57 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Sylius\RefundPlugin\Event; | ||
|
||
final class RefundPaymentGenerated | ||
{ | ||
/** @var int */ | ||
private $id; | ||
|
||
/** @var string */ | ||
private $orderNumber; | ||
|
||
/** @var int */ | ||
private $amount; | ||
|
||
/** @var string */ | ||
private $currencyCode; | ||
|
||
/** @var int */ | ||
private $paymentMethodId; | ||
|
||
public function __construct(int $id, string $orderNumber, int $amount, string $currencyCode, int $paymentMethodId) | ||
{ | ||
$this->id = $id; | ||
$this->orderNumber = $orderNumber; | ||
$this->amount = $amount; | ||
$this->currencyCode = $currencyCode; | ||
$this->paymentMethodId = $paymentMethodId; | ||
} | ||
|
||
public function id(): int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function orderNumber(): string | ||
{ | ||
return $this->orderNumber; | ||
} | ||
|
||
public function amount(): int | ||
{ | ||
return $this->amount; | ||
} | ||
|
||
public function currencyCode(): string | ||
{ | ||
return $this->currencyCode; | ||
} | ||
|
||
public function paymentMethodId(): int | ||
{ | ||
return $this->paymentMethodId; | ||
} | ||
} |
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
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