Ejemplo n.º 1
0
 /**
  * @param DeliveryEvent $event
  *
  * @Di\Observe("cubalider.sms.delivered")
  */
 public function increase(DeliveryEvent $event)
 {
     try {
         $link = $this->pickLinkInternalWorker->pick($event->getMessage());
         $this->increaseDeliveredStatInternalWorker->increase($link['info']);
         $this->deleteLinkInternalWorker->delete($event->getMessage());
     } catch (NonExistentMessageInternalException $e) {
     }
 }
 /**
  * @param DeliveryEvent $event
  *
  * @Di\Observe("cubalider.sms.not_delivered")
  */
 public function increase(DeliveryEvent $event)
 {
     try {
         $link = $this->pickLinkInternalWorker->pick($event->getMessage());
         try {
             $this->increaseSubscriptionBalanceWorker->increase($link['subscription']);
         } catch (NonExistentMobileInternalException $e) {
             // Maybe subscription was deleted, then ignore it
         }
         // TODO: Delete link in a post event
         $this->deleteLinkInternalWorker->delete($event->getMessage());
     } catch (NonExistentMessageInternalException $e) {
     }
 }