diff --git a/src/Dto/GatewayCheckoutUpdateDto.php b/src/Dto/GatewayCheckoutUpdateDto.php deleted file mode 100644 index 1ce5e7f..0000000 --- a/src/Dto/GatewayCheckoutUpdateDto.php +++ /dev/null @@ -1,29 +0,0 @@ -status = $status; - $this->gatewayReference = $gatewayReference; - } -} diff --git a/src/Entity/GatewayCheckout.php b/src/Entity/GatewayCheckout.php index 1ebae28..34c8e6d 100644 --- a/src/Entity/GatewayCheckout.php +++ b/src/Entity/GatewayCheckout.php @@ -4,10 +4,8 @@ namespace App\Entity; use ApiPlatform\Doctrine\Orm\Filter\SearchFilter; use ApiPlatform\Metadata as API; -use App\Dto\GatewayCheckoutUpdateDto; use App\Repository\GatewayCheckoutRepository; use App\State\GatewayCheckoutProcessor; -use App\State\GatewayCheckoutUpdateProcessor; use App\Validator\GatewayName; use Doctrine\Common\Collections\ArrayCollection; use Doctrine\Common\Collections\Collection; @@ -20,13 +18,13 @@ use Symfony\Component\Validator\Constraints as Assert; /** * A GatewayCheckout bundles the data to perform a payment operation with a Gateway.\ * \ - * Once the Gateway validates the checkout as successful it will generated the appropiate AccountingTransactions for each GatewayCharge. + * Once the Gateway validates the payment as successful the GatewayCheckout will be updated + * and respective AccountingTransactions will be generated for each GatewayCharge. */ #[Gedmo\Loggable()] #[API\GetCollection()] #[API\Post(processor: GatewayCheckoutProcessor::class)] #[API\Get()] -#[API\Patch(input: GatewayCheckoutUpdateDto::class, processor: GatewayCheckoutUpdateProcessor::class)] #[API\ApiFilter(filterClass: SearchFilter::class, properties: ['origin' => 'exact', 'charges.target' => 'exact'])] #[ORM\Entity(repositoryClass: GatewayCheckoutRepository::class)] class GatewayCheckout diff --git a/src/State/GatewayCheckoutUpdateProcessor.php b/src/State/GatewayCheckoutUpdateProcessor.php deleted file mode 100644 index 3ed4605..0000000 --- a/src/State/GatewayCheckoutUpdateProcessor.php +++ /dev/null @@ -1,40 +0,0 @@ -checkoutRepository->find($uriVariables['id']); - - if (!$checkout) { - throw new HttpException(Response::HTTP_NOT_FOUND, sprintf("The checkout '%s' does not exist.", $uriVariables['id'])); - } - - $checkout->setGatewayReference($data->gatewayReference); - - $this->entityManager->persist($checkout); - $this->entityManager->flush(); - - return $checkout; - } -}