public function testCreatePlatformAccount() { $client = new NextCallerPlatformClient(null, null, true); $data = json_decode(self::DATA); $result = $client->createPlatformAccount($data); $this->assertEquals($result, self::RESPONSE_STR); }
<?php require __DIR__ . '/vendor/autoload.php'; use NextCaller\NextCallerPlatformClient; $user = ""; $password = ""; $sandbox = true; $data = array('email' => 'xxx', 'id' => 'user1'); $client = new NextCallerPlatformClient($user, $password, $sandbox); try { $client->createPlatformAccount($data); } catch (\NextCaller\Exception\RateLimitException $e) { var_dump($e->getRateLimit()); var_dump($e->getResetTime()); } catch (\NextCaller\Exception\BadResponseException $e) { // Example // 422 var_dump($e->getCode()); // Validation Error var_dump($e->getMessage()); /* array( 'message' => 'Validation Error', 'code' => '422', 'type' => 'Unprocessable Entity', 'description' => array( 'email' => array('Invalid email address') ) ); */ var_dump($e->getError());