/**
  * @param $request
  * @throws CheckoutException
  */
 public function __construct($request)
 {
     $this->request = $request = Gateway::parseRequest($request);
     if ($this->request->provider != Provider::PAYSERA) {
         throw new CheckoutException('Bad gateway');
     }
     $config = Gateway::getCredentials($this->request->provider, $this->request->mode);
     $this->projectId = $config['projectId'];
     $this->signPassword = $config['signPassword'];
     $this->accept = $config['accept'];
     $this->mode = $this->request->mode;
 }
 /**
  * @param $request
  * @throws CheckoutException
  */
 public function __construct($request)
 {
     $this->request = $request = Gateway::parseRequest($request);
     if ($this->request->provider != Provider::PAYPAL) {
         throw new CheckoutException('Bad gateway');
     }
     $config = Gateway::getCredentials($this->request->provider, $this->request->mode);
     $this->username = $config['username'];
     $this->password = $config['password'];
     $this->signature = $config['signature'];
     $this->mode = $this->request->mode == Mode::LIVE ? 'live' : 'sandbox';
 }