Exemple #1
0
 /**
  * Attempts to connect to BitPay API
  * @return void
  */
 public function connect()
 {
     $network = $this->bitpay->setNetwork($this->request->get['network']);
     $this->log('debug', 'Attempting to connect to ' . $network);
     $redirect = str_replace('&', '&', $this->url->link('payment/bitpay', 'token=' . $this->session->data['token'], 'SSL'));
     try {
         $url = $this->bitpay->getPairingUrl() . '&redirect=' . urlencode($redirect);
         $this->response->redirect($url);
         return;
     } catch (Exception $e) {
         $this->log('error', $this->language->get('log_unable_to_connect'));
         $this->session->data['warning'] = $this->language->get('warning_unable_to_connect');
         $this->response->redirect($this->url->link('payment/bitpay', 'token=' . $this->session->data['token'], 'SSL'));
     }
 }