public function MiniorangeCustomerSetup::createCustomer in Google Authenticator / 2 Factor Authentication - 2FA 8
Same name and namespace in other branches
- 8.2 src/MiniorangeCustomerSetup.php \Drupal\miniorange_2fa\MiniorangeCustomerSetup::createCustomer()
Create Customer.
File
- src/
MiniorangeCustomerSetup.php, line 53 - Contains miniOrange Customer class.
Class
- MiniorangeCustomerSetup
- @file This class represents configuration for customer.
Namespace
Drupal\miniorange_2faCode
public function createCustomer() {
$url = MoAuthConstants::$CUSTOMER_CREATE_API;
$fields = array(
'companyName' => $_SERVER['SERVER_NAME'],
'areaOfInterest' => MoAuthConstants::$PLUGIN_NAME,
'email' => $this->email,
'phone' => $this->phone,
'password' => $this->password,
);
$json = json_encode($fields);
$response = MoAuthUtilities::callService($this->defaultCustomerId, $this->defaultCustomerApiKey, $url, $json);
if (json_last_error() == JSON_ERROR_NONE && strcasecmp($response->status, 'CURL_ERROR')) {
\Drupal::logger('miniorange_2fa')
->error($response->message);
}
return $response;
}