You are here

public function AuthenticationAPIHandler::challenge in Google Authenticator / 2 Factor Authentication - 2FA 7

File

classes/AuthenticationAPIHandler.php, line 11

Class

AuthenticationAPIHandler

Code

public function challenge(MiniorangeUser $user) {
  $fields = array(
    'customerKey' => $user
      ->getCustomerId(),
    'username' => $user
      ->getUsername(),
    'email' => $user
      ->getEmail(),
    'phone' => $user
      ->getPhone(),
    'authType' => $user
      ->getAuthType(),
    'transactionName' => MoAuthConstants::$TRANSACTION_NAME,
  );
  $json = json_encode($fields);
  $url = MoAuthConstants::getBaseUrl() . MoAuthConstants::$AUTH_CHALLENGE_API;
  return MoAuthUtilities::callService($this->customerId, $this->apiKey, $url, $json);
}