Example #1
0
 public function __construct(Request $request)
 {
     $this->request = $request;
     $params = $this->request->getMethodParams();
     ksort($params);
     array_walk($params, function (&$value, $key) {
         $value = $key . $value;
     });
     $this->sign = self::getSignString($request->getMethodPath() . '/' . Api::getInstance()->getAppKey() . implode($params), Api::getInstance()->getAppKeySecret());
 }
Example #2
0
 public function getAuthSetsForMethod(Request $request)
 {
     $params = $request->getMethodParams();
     MethodUtils::checkSignature(array(Types::STRING), $params);
     $parts = explode('.', $params[0]);
     if (count($parts) != 2 || count_chars($parts[0]) < 1 || count_chars($parts[1]) < 1) {
         throw new InvalidParameterException('methodId must consist of an ' . 'owner object and a method name separated by a single dot.');
     }
     return new ReturnValue(call_user_func_array(array($this->authenticator, 'getAuthSetsForMethod'), $parts));
 }
 public function solveCaptcha(Request $request)
 {
     $params = $request->getMethodParams();
     MethodUtils::checkSignature(array(Types::INT, Types::STRING), $params);
     call_user_func_array(array($this->captchaAuth, 'solveCaptcha'), $params);
 }