Exemple #1
0
 /**
  * @throws GPWebPayException
  * @throws \Exception
  */
 public function handleCheckout()
 {
     try {
         if (!$this->operation->getResponseUrl()) {
             $this->operation->setResponseUrl($this->link('//success!'));
         }
         $url = $this->provider->createRequest($this->operation)->getRequestUrl();
         $this->onCheckout($this, $this->provider->getRequest());
         $this->getPresenter()->redirectUrl($url);
     } catch (GPWebPayException $e) {
         throw $e;
     }
 }
Exemple #2
0
 /**
  * @param Operation $operation
  * @param $merchantNumber
  * @param $depositFlag
  * @throws InvalidArgumentException
  */
 public function __construct(Operation $operation, $merchantNumber, $depositFlag)
 {
     $this->operation = $operation;
     if (!($this->url = $operation->getResponseUrl())) {
         throw new InvalidArgumentException('Response URL in Operation must by set!');
     }
     $this->merchantNumber = $merchantNumber;
     $this->depositFlag = $depositFlag;
     $this->setParams();
 }