Files
afup/sources/AppBundle/Payment/PayboxResponse.php
2017-06-12 11:10:53 +02:00

99 lines
1.5 KiB
PHP

<?php
namespace AppBundle\Payment;
class PayboxResponse
{
const STATUS_SUCCESS = '00000';
const STATUS_CANCELED = '';
const STATUS_ERROR = '';
const STATUS_DUPLICATE = '00015';
/**
* @var string
*/
private $cmd;
/**
* @var string
*/
private $status;
/**
* @var int
*/
private $total;
/**
* @var string
*/
private $authorizationId;
/**
* @var string
*/
private $transactionId;
public function __construct($cmd, $status, $total, $authorizationId, $transactionId)
{
$this->cmd = $cmd;
$this->status = $status;
$this->total = $total;
$this->authorizationId = $authorizationId;
$this->transactionId = $transactionId;
}
/**
* @return string
*/
public function getCmd()
{
return $this->cmd;
}
/**
* @return string
*/
public function getStatus()
{
return $this->status;
}
/**
* @return int
*/
public function getTotal()
{
return $this->total;
}
/**
* @return string
*/
public function getAuthorizationId()
{
return $this->authorizationId;
}
/**
* @return string
*/
public function getTransactionId()
{
return $this->transactionId;
}
public function isSuccessful()
{
return $this->status === self::STATUS_SUCCESS;
}
public function isErrorCode()
{
return substr($this->status, 0, 3) === '001';
}
}