You are here

public function UsersAPIHandler::create in Google Authenticator / 2 Factor Authentication - 2FA 7

File

classes/UsersAPIHandler.php, line 41

Class

UsersAPIHandler

Code

public function create(MiniorangeUser $user) {
  $fields = array(
    'customerKey' => $this->customerId,
    'username' => $user
      ->getUsername(),
    'firstName' => $user
      ->getName(),
  );
  $json = json_encode($fields);
  $url = MoAuthConstants::getBaseUrl() . MoAuthConstants::$USERS_CREATE_API;
  return MoAuthUtilities::callService($this->customerId, $this->apiKey, $url, $json);
}