From b56a5d0f28afb02869fede3c686ef80f7a75fbcd Mon Sep 17 00:00:00 2001 From: Daniel Subiabre Date: Thu, 4 Apr 2024 13:22:50 +0200 Subject: [PATCH] Save Gateway references in Transaction --- src/Entity/Transaction.php | 40 +++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/src/Entity/Transaction.php b/src/Entity/Transaction.php index 75e2b3f..810b97a 100644 --- a/src/Entity/Transaction.php +++ b/src/Entity/Transaction.php @@ -24,7 +24,7 @@ class Transaction private ?int $id = null; /** - * The monetary value to be received at target and issued at origin. + * The monetary value received at target and issued at origin. */ #[Assert\Valid()] #[Assert\NotBlank()] @@ -47,6 +47,20 @@ class Transaction #[ORM\JoinColumn(nullable: false)] private ?Accounting $target = null; + /** + * The name of the Gateway implementation that secured the money in this Transaction. + */ + #[Assert\NotBlank()] + #[ORM\Column(length: 255)] + private ?string $gateway = null; + + /** + * An external identifier provided by the Gateway for this Transaction. + */ + #[Assert\NotBlank()] + #[ORM\Column(length: 255)] + private ?string $gatewayReference = null; + public function getId(): ?int { return $this->id; @@ -87,4 +101,28 @@ class Transaction return $this; } + + public function getGateway(): ?string + { + return $this->gateway; + } + + public function setGateway(string $gateway): static + { + $this->gateway = $gateway; + + return $this; + } + + public function getGatewayReference(): ?string + { + return $this->gatewayReference; + } + + public function setGatewayReference(string $gatewayReference): static + { + $this->gatewayReference = $gatewayReference; + + return $this; + } }