for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Shetabit\Multipay;
use Ramsey\Uuid\Uuid;
use Shetabit\Multipay\Traits\HasDetail;
class Invoice
{
use HasDetail;
/**
* invoice's unique universal id (uuid)
*
* @var string
*/
protected $uuid;
* Amount
* @var int|float
protected $amount = 0;
* invoice's transaction id
protected $transactionId;
protected $driver;
* Invoice constructor.
* @throws \Exception
public function __construct()
$this->uuid();
}
* Set invoice uuid
* @param $uuid|null
public function uuid($uuid = null)
if (empty($uuid)) {
$uuid = Uuid::uuid4()->toString();
$this->uuid = $uuid;
return $this;
* Get invoice uuid
* @return string
public function getUuid()
return $this->uuid;
* Set the amount of invoice
* @param $amount
* @return $this
public function amount($amount)
if (!is_numeric($amount)) {
throw new \Exception('Amount value should be a number (integer or float).');
$this->amount = $amount;
* Get the value of invoice
* @return int|float
public function getAmount()
return $this->amount;
* set transaction id
* @param $id
public function transactionId($id)
$this->transactionId = $id;
* Get the value of transaction's id
public function getTransactionId()
return $this->transactionId;
* Set the value of driver
* @param $driver
public function via($driver)
$this->driver = $driver;
* Get the value of driver
public function getDriver()
return $this->driver;