for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Sinarajabpour1998\Gateway\Core;
class TransactionManager
{
protected $driver;
protected $amount;
protected $orderId;
protected $callbackUrl;
protected $detail;
protected $config;
protected $transaction;
protected $request;
public function __construct()
$this->config = config('gateway');
}
public function pay()
$object = $this->fireDriver();
return $object->init($this->amount, $this->orderId, $this->callbackUrl, $this->detail);
public function verify()
return $object->verify($this->request);
public function getDriver()
(is_null($this->driver))
? $driver = $this->config['default']
: $driver = $this->driver;
return $driver;
public function fireDriver()
$class = $this->config['drivers'][$this->getDriver()];
return new $class($this->getDriver());
// Has parameter
public function driver($driver = null)
$this->driver = $driver;
return $this;
public function amount($amount)
$this->amount = (int) $amount;
public function orderId($orderId)
$this->orderId = $orderId;
public function callbackUrl($callbackUrl)
$this->callbackUrl = $callbackUrl;
public function request($request)
$this->request = $request;
public function detail($detail = [])
$this->detail = $detail;