//basic example
$PayTR = (new PayTR())->configure($config['paytr']);
//configure method
namespace Mirarus\VirtualPos\Providers;
class PayTR
{
public function configure(array $config): self
{
$this->setApiId($config['api_id']);
$this->setApiKey($config['api_key']);
$this->setApiSecret($config['api_secret']);
$this->setApiSandbox($config['sandbox']);
$this->setApiDebug($config['debug']);
$this->setApiSuccessfulUrl($config['success_url']);
$this->setApiFailedUrl($config['failed_url']);
return $this;
}
}