src/Diplix/KMGBundle/Entity/Payment.php line 11

Open in your IDE?
  1. <?php
  2. namespace Diplix\KMGBundle\Entity;
  3. use Diplix\KMGBundle\Util\PayCo;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Table(name="payments", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
  7.  * @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\PaymentRepository")
  8.  */
  9. class Payment extends BasicEntity
  10. {
  11.    public const STATUS_NEW 'new';
  12.    public const STATUS_PENDING 'pending';
  13.    public const STATUS_SUCCESS 'success';
  14.    public const STATUS_ERROR 'error';
  15.    public const SERVICE_STRIPE "stripe";
  16.     /**
  17.      * @ORM\Column(type="integer",name="id")
  18.      * @ORM\Id()
  19.      * @ORM\GeneratedValue(strategy="AUTO")
  20.      */
  21.     protected ?int $id;
  22.     /**
  23.      * @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Order", inversedBy="paymentReference" )
  24.      */
  25.     protected Order $order;
  26.     /**
  27.      * @ORM\Column(type="string")
  28.      */
  29.     protected string $service self::SERVICE_STRIPE;
  30.     /**
  31.      * @ORM\Column(type="string")
  32.      */
  33.     protected string $status self::STATUS_NEW;
  34.     /**
  35.      * @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
  36.      */
  37.     protected float|string $amount 0.0;
  38.     /**
  39.      * @ORM\Column(type="string")
  40.      */
  41.     protected string $currency "EUR";
  42.     /**
  43.      * @ORM\Column(type="string", nullable=true, unique=true, options={"default":null})
  44.      */
  45.     protected ?string $stripePaymentIntentId null;
  46.     /////////////////////////////////////////////////////////////////////////////////////////////////////
  47.     public function getId(): int
  48.     {
  49.         return $this->id;
  50.     }
  51.     public function getOrder(): Order
  52.     {
  53.         return $this->order;
  54.     }
  55.     public function setOrder(Order $order): void
  56.     {
  57.         $this->order $order;
  58.     }
  59.     /**
  60.      * @return mixed
  61.      */
  62.     public function getService()
  63.     {
  64.         return $this->service;
  65.     }
  66.     /**
  67.      * @param mixed $service
  68.      */
  69.     public function setService($service): void
  70.     {
  71.         $this->service $service;
  72.     }
  73.     public function getStatus(): string
  74.     {
  75.         return $this->status;
  76.     }
  77.     public function setStatus(string $status): void
  78.     {
  79.         $this->status $status;
  80.     }
  81.     public function getAmount(): float
  82.     {
  83.         return $this->amount;
  84.     }
  85.     public function setAmount(float $amount): void
  86.     {
  87.         $this->amount $amount;
  88.     }
  89.     public function getCurrency(): string
  90.     {
  91.         return $this->currency;
  92.     }
  93.     public function setCurrency(string $currency): void
  94.     {
  95.         $this->currency $currency;
  96.     }
  97.     public function getStripePaymentIntentId(): ?string
  98.     {
  99.         return $this->stripePaymentIntentId;
  100.     }
  101.     public function setStripePaymentIntentId(string $stripePaymentIntentId): void
  102.     {
  103.         $this->stripePaymentIntentId $stripePaymentIntentId;
  104.     }
  105. }