Remove unused transaction related classes

This commit is contained in:
2024-04-11 12:35:52 +02:00
parent 35419acc5d
commit 2a2e4eb015
2 changed files with 0 additions and 98 deletions
-68
View File
@@ -1,68 +0,0 @@
<?php
namespace App\Entity;
use ApiPlatform\Metadata as API;
use App\Validator\GatewayName;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
/**
* GatewayCheckouts represent an User's attempt to perform a payment with an specific Gateway.
*/
#[ORM\Embeddable]
class TransactionGateway
{
/**
* The Gateway processing this Transaction.
*/
#[GatewayName]
#[Assert\NotBlank()]
#[ORM\Column(length: 255)]
private ?string $name = null;
#[Assert\NotBlank()]
#[Assert\Url()]
#[ORM\Column(length: 255)]
private ?string $successUrl;
#[Assert\Url()]
#[ORM\Column(length: 255)]
private ?string $failureUrl;
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): static
{
$this->name = $name;
return $this;
}
public function getSuccessUrl(): ?string
{
return $this->successUrl;
}
public function setSuccessUrl(string $successUrl): static
{
$this->successUrl = $successUrl;
return $this;
}
public function getFailureUrl(): ?string
{
return $this->failureUrl;
}
public function setFailureUrl(string $failureUrl): static
{
$this->failureUrl = $failureUrl;
return $this;
}
}
-30
View File
@@ -1,30 +0,0 @@
<?php
namespace App\State;
use ApiPlatform\Metadata\Operation;
use ApiPlatform\State\ProcessorInterface;
use App\Entity\Transaction;
use App\Library\Economy\Payment\GatewayLocator;
use Doctrine\ORM\EntityManagerInterface;
class TransactionStateProcessor implements ProcessorInterface
{
public function __construct(
private GatewayLocator $gatewayLocator,
private EntityManagerInterface $entityManager
) {
}
/**
* @param Transaction $data
*/
public function process(mixed $data, Operation $operation, array $uriVariables = [], array $context = []): Transaction
{
$gateway = $this->gatewayLocator->getGatewayOf($data);
$gateway->process($data);
return $data;
}
}