/**
  * @param $data
  * @return bool
  */
 public function parseJsonException($data)
 {
     $this->error = true;
     if ($this->getSettingValue('monetasdk_debug_mode')) {
         MonetaSdkUtils::addToLog("parseJsonException:\n" . $data);
     }
     if (isset($data['detail']['faultDetail'])) {
         $this->errorCode = $data['detail']['faultDetail'];
     }
     if (isset($data['faultstring'])) {
         $this->errorMessage = $data['faultstring'];
     }
     if ($this->errorCode && isset($this->settings[$this->errorCode])) {
         $this->errorMessageHumanConverted = $this->settings[$this->errorCode];
     } else {
         $this->errorMessageHumanConverted = $this->errorMessage;
         $handleServiceUnavailableEvent = MonetaSdkUtils::handleEvent('ServiceUnavailable', array('errorCode' => $this->errorCode, 'errorMessage' => $this->errorMessage, 'errorMessageHumanConverted' => $this->errorMessageHumanConverted), $this->getSettingValue('monetasdk_event_files_path'));
     }
 }
 /**
  * processForwardCreateUserForm
  *
  * @throws MonetaSdkException
  */
 private function processForwardCreateUserForm($processResultData)
 {
     $firstName = $this->getRequestedValue('moneta_sdk_first_name');
     $lastName = $this->getRequestedValue('moneta_sdk_last_name');
     $email = $this->getRequestedValue('moneta_sdk_email');
     $gender = $this->getRequestedValue('moneta_sdk_gender');
     $unitId = $this->sdkMonetaCreateUser($firstName, $lastName, $email, $gender);
     $unitData = array('unitId' => $unitId, 'firstName' => $firstName, 'lastName' => $lastName, 'email' => $email, 'gender' => $gender);
     $handleCreateUser = MonetaSdkUtils::handleEvent('CreateUserResult', $unitData);
     // добавить пользователю новый счёт
     if ($unitId) {
         $processResultData = array_merge($processResultData, $unitData);
         $accountPaymentPassword = rand(10000, 99999);
         $secret = $this->sdkGetSecretFromAccountProfile();
         $accountEncryptedPaymentPassword = encrypt($accountPaymentPassword, $secret);
         $accountId = $this->sdkMonetaCreateAccount($unitId, $accountPaymentPassword, $email);
         if ($accountId) {
             $accountData = array('unitId' => $unitId, 'accountId' => $accountId, 'accountPaymentPassword' => $accountPaymentPassword, 'accountEncryptedPaymentPassword' => $accountEncryptedPaymentPassword, 'accountNotificationEmail' => $email);
             $processResultData = array_merge($processResultData, $accountData);
         }
     }
     return $processResultData;
 }