/**
  * Constructor.
  *
  * @param RublonConsumer $rublon
  */
 public function __construct(RublonConsumer $rublon, $userEmail)
 {
     parent::__construct($rublon);
     $this->userEmailHash = hash(self::HASH_ALG, $userEmail);
     if ($rublon->isConfigured()) {
         $this->systemTokenHash = hash_hmac(self::HASH_ALG, $this->getRublon()->getSystemToken(), $this->getRublon()->getSecretKey());
     }
 }
 /**
  * (non-PHPdoc)
  * @see RublonAPIClient::validateResponse()
  */
 protected function validateResponse()
 {
     if (parent::validateResponse()) {
         if (!empty($this->response[self::FIELD_RESULT][self::FIELD_WEB_URI])) {
             return true;
         } else {
             throw new MissingField_RublonClientException($this, self::FIELD_WEB_URI);
         }
     }
 }
 /**
  * Constructor.
  * 
  * @param RublonConsumer $rublon
  * @param string $accessToken
  */
 public function __construct(RublonConsumer $rublon, $accessToken)
 {
     parent::__construct($rublon);
     if (!$rublon->isConfigured()) {
         trigger_error(RublonConsumer::TEMPLATE_CONFIG_ERROR, E_USER_ERROR);
     }
     // Set request URL and parameters
     $url = $rublon->getAPIDomain() . $this->urlPath;
     $params = array(self::FIELD_SYSTEM_TOKEN => $rublon->getSystemToken(), self::FIELD_ACCESS_TOKEN => $accessToken);
     $this->setRequestURL($url)->setRequestParams($params);
 }
 /**
  * Constructor.
  * 
  * @param Rublon $rublon
  * @param string $url
  * @param array $params
  */
 public function __construct(RublonConsumer $rublon, $params)
 {
     parent::__construct($rublon);
     if (!$rublon->isConfigured()) {
         trigger_error(RublonConsumer::TEMPLATE_CONFIG_ERROR, E_USER_ERROR);
     }
     $consumerRegistrationData = RublonHelper::getConsumerRegistrationData();
     $url = $consumerRegistrationData['url'] . $consumerRegistrationData['action'] . $this->urlPath;
     // Set request URL and parameters
     $this->setRequestURL($url)->setRequestParams($params);
 }
 /**
  * Constructor.
  *
  * @param Rublon $rublon
  */
 public function __construct(RublonConsumer $rublon, $userEmail)
 {
     parent::__construct($rublon);
     if (!$rublon->isConfigured()) {
         trigger_error(RublonConsumer::TEMPLATE_CONFIG_ERROR, E_USER_ERROR);
     }
     // Set request URL and parameters
     $url = $rublon->getAPIDomain() . $this->urlPath;
     $params = array(RublonAuthParams::FIELD_SYSTEM_TOKEN => $rublon->getSystemToken(), self::FIELD_ACTION => self::ACTION_SUBSCRIBE, self::FIELD_USER_EMAIL => $userEmail);
     $this->setRequestURL($url)->setRequestParams($params);
 }
 /**
  * Constructor.
  * 
  * @param RublonConsumer $rublon
  * @param string $accessToken
  */
 public function __construct(RublonConsumer $rublon, $accessToken)
 {
     parent::__construct($rublon);
     if (!$rublon->isConfigured()) {
         trigger_error(RublonConsumer::TEMPLATE_CONFIG_ERROR, E_USER_ERROR);
     }
     if (!preg_match('/[a-z0-9]{100}/i', $accessToken)) {
         throw new RublonException(self::ERROR_ACCESS_TOKEN, RublonException::CODE_INVALID_ACCESS_TOKEN);
     }
     // Set request URL and parameters
     $url = $rublon->getAPIDomain() . $this->urlPath;
     $params = array(self::FIELD_SYSTEM_TOKEN => $rublon->getSystemToken(), self::FIELD_ACCESS_TOKEN => $accessToken);
     $this->setRequestURL($url)->setRequestParams($params);
 }
 /**
  * Constructor.
  *
  * @param Rublon $rublon
  */
 public function __construct(RublonConsumer $rublon, $userId, $userEmail)
 {
     parent::__construct($rublon);
     if (!$rublon->isConfigured()) {
         trigger_error(RublonConsumer::TEMPLATE_CONFIG_ERROR, E_USER_ERROR);
     }
     if (empty($userEmail)) {
         $userEmail = self::EMAIL_PING;
     }
     // Set request URL and parameters
     $url = $rublon->getAPIDomain() . $this->urlPath;
     $params = array(RublonAuthParams::FIELD_SYSTEM_TOKEN => $rublon->getSystemToken(), self::FIELD_USERS => array(array(RublonAuthParams::FIELD_USER_ID => $userId, RublonAuthParams::FIELD_USER_EMAIL_HASH => hash(self::HASH_ALG, strtolower($userEmail)))), self::FIELD_INCLUDING_EMAIL => true);
     $this->setRequestURL($url)->setRequestParams($params);
 }
 public function perform()
 {
     $this->addRequestParams(array(self::FIELD_SYSTEM_TOKEN => $this->getRublon()->getSystemToken()));
     return parent::perform();
 }
 public function perform()
 {
     $this->addRequestParams(array(self::FIELD_SYSTEM_TOKEN => $this->getRublon()->getSystemToken(), self::FIELD_NOTIFICATION_CHANNEL => $this->notificationChannel, self::FIELD_NOTIFICATION_TITLE => $this->notificationTitle, self::FIELD_NOTIFICATION_URL => $this->notificationUrl, self::FIELD_NOTIFICATION_TYPE => $this->notificationType));
     return parent::perform();
 }