Ejemplo n.º 1
0
 function autorenew()
 {
     $did_number = \Yoda\Request::getString('did_number');
     $customer_id = \Yoda\Request::getInt('customer_id');
     $status = \Yoda\Request::getInt('status');
     try {
         $order = new Didww\API2\Order();
         $order->setCustomerId($customer_id);
         $did = new Didww\API2\DIDNumber();
         $did->setDidNumber($did_number);
         $did->setOrder($order);
         $did->changeAutorenew($status);
         $this->setMessage('Autorenew status for DID #' . $did->getDidNumber() . ' was changed successfully');
     } catch (SoapFault $e) {
         $this->setMessage('Error: (' . $e->faultcode . ') ' . $e->faultstring, 'danger');
     } catch (Exception $e) {
         $this->setMessage($e->getMessage(), 'danger');
     }
     $this->redirect('index.php?controller=orders&customer_id=' . $customer_id);
 }
Ejemplo n.º 2
0
 function getBilledServices()
 {
     $customer_id = $this->getCustomerId();
     if (!isset($customer_id)) {
         throw new BalanceException("Customer Id is undefined");
     }
     $response = $this->call('getservicelist', array("customer_id" => $this->getCustomerId()));
     $orders = array();
     if (count($response)) {
         foreach ($response as $serviceData) {
             $order = new \Didww\API2\Order();
             $order->setCustomerId($this->getCustomerId());
             $order->fromServiceData($serviceData);
             $orders[] = $order;
         }
     }
     return $orders;
 }