コード例 #1
0
 public function testUserResponse()
 {
     $Response = UserResponse::initializeByString('{"id": 12345}');
     $this->assertEquals('12345', $Response->getId());
     $this->assertEquals('user\'s data
 id: 12345', (string) $Response);
 }
コード例 #2
0
ファイル: Client.php プロジェクト: chapsuk/PaymentNinjaClient
 /**
  * REST API method user/resolve implementation
  * @param string $id user's unique, unchangeable identifier
  * @param string $email user's email address
  * @param string $ip user's IP address
  * @param null|string $displayName user's display name, if present
  * @param null|string $locale user's locale as ISO 639-1
  * @param null|string $phone user's phne number if present
  * @return Request user/resolved request instance
  * @throws ErrorException if there is an API error
  */
 public function userResolve($id, $email, $ip, $displayName = null, $locale = null, $phone = null)
 {
     $parameters = ['identifier' => (string) $id, 'email' => (string) $email, 'ip' => (string) $ip];
     if (!is_null($displayName)) {
         $parameters['display_name'] = (string) $displayName;
     }
     if (!is_null($locale)) {
         $parameters['locale'] = (string) $locale;
     }
     if (!is_null($phone)) {
         $parameters['phone'] = (string) $phone;
     }
     return $this->getRequest('user/resolve', $parameters, function ($string) {
         return UserResponse::initializeByString($string);
     });
 }