You are here

public function MiniorangeCustomerSetup::getCustomerKeys in Google Authenticator / 2 Factor Authentication - 2FA 8

Same name and namespace in other branches
  1. 8.2 src/MiniorangeCustomerSetup.php \Drupal\miniorange_2fa\MiniorangeCustomerSetup::getCustomerKeys()

Get Customer Keys.

File

src/MiniorangeCustomerSetup.php, line 75
Contains miniOrange Customer class.

Class

MiniorangeCustomerSetup
@file This class represents configuration for customer.

Namespace

Drupal\miniorange_2fa

Code

public function getCustomerKeys() {
  $url = MoAuthConstants::$CUSTOMER_GET_API;
  $fields = array(
    'email' => $this->email,
    'password' => $this->password,
  );
  $json = json_encode($fields);
  $response = MoAuthUtilities::callService($this->defaultCustomerId, $this->defaultCustomerApiKey, $url, $json);
  if (json_last_error() == JSON_ERROR_NONE && empty($response->apiKey)) {
    \Drupal::logger('miniorange_2fa')
      ->error($response->message);
  }
  return $response;
}