/**
  * @param Request $http
  * @throws CheckoutException
  */
 public function processRequest(Request $http)
 {
     try {
         $response = \WebToPay::checkResponse($http->all(), array('projectid' => $this->projectId, 'sign_password' => $this->signPassword));
         if ($response['test'] !== '0') {
             //throw new CheckoutException('Testing, real payment was not made');
         }
         if ($response['type'] !== 'macro') {
             throw new CheckoutException('Only macro payment callbacks are accepted');
         }
         if ($response['orderid'] != $this->request->transaction) {
             throw new CheckoutException('Incorrect transaction');
         }
         if ($response['amount'] != $this->request->amount * 100) {
             throw new CheckoutException('Incorrect amount');
         }
         if ($response['currency'] != $this->request->currency) {
             throw new CheckoutException('Incorrect currency');
         }
         if ($this->request->status == TransactionData::PAID) {
             throw new CheckoutException('Transaction already done.');
         }
         TransactionData::update($this->request->transaction, ['date_paid' => time(), 'status' => TransactionData::PAID, 'gateway_response' => $response]);
         Callback::call($this->request);
         echo 'OK';
     } catch (CheckoutException $e) {
         throw new CheckoutException('Gateway got error', 500, $e);
     }
 }