<?php
namespace Diplix\KMGBundle\Entity;
use Diplix\KMGBundle\Util\PayCo;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Table(name="payments", indexes={@ORM\Index(name="be_deleted",columns={"be_deleted"})})
* @ORM\Entity(repositoryClass="Diplix\KMGBundle\Repository\PaymentRepository")
*/
class Payment extends BasicEntity
{
public const STATUS_NEW = 'new';
public const STATUS_PENDING = 'pending';
public const STATUS_SUCCESS = 'success';
public const STATUS_ERROR = 'error';
public const SERVICE_STRIPE = "stripe";
/**
* @ORM\Column(type="integer",name="id")
* @ORM\Id()
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected ?int $id;
/**
* @ORM\ManyToOne(targetEntity="Diplix\KMGBundle\Entity\Order", inversedBy="paymentReference" )
*/
protected Order $order;
/**
* @ORM\Column(type="string")
*/
protected string $service = self::SERVICE_STRIPE;
/**
* @ORM\Column(type="string")
*/
protected string $status = self::STATUS_NEW;
/**
* @ORM\Column(type="decimal", nullable=false, precision=12, scale=2,options={"unsigned":false})
*/
protected float|string $amount = 0.0;
/**
* @ORM\Column(type="string")
*/
protected string $currency = "EUR";
/**
* @ORM\Column(type="string", nullable=true, unique=true, options={"default":null})
*/
protected ?string $stripePaymentIntentId = null;
/////////////////////////////////////////////////////////////////////////////////////////////////////
public function getId(): int
{
return $this->id;
}
public function getOrder(): Order
{
return $this->order;
}
public function setOrder(Order $order): void
{
$this->order = $order;
}
/**
* @return mixed
*/
public function getService()
{
return $this->service;
}
/**
* @param mixed $service
*/
public function setService($service): void
{
$this->service = $service;
}
public function getStatus(): string
{
return $this->status;
}
public function setStatus(string $status): void
{
$this->status = $status;
}
public function getAmount(): float
{
return $this->amount;
}
public function setAmount(float $amount): void
{
$this->amount = $amount;
}
public function getCurrency(): string
{
return $this->currency;
}
public function setCurrency(string $currency): void
{
$this->currency = $currency;
}
public function getStripePaymentIntentId(): ?string
{
return $this->stripePaymentIntentId;
}
public function setStripePaymentIntentId(string $stripePaymentIntentId): void
{
$this->stripePaymentIntentId = $stripePaymentIntentId;
}
}