/** * @param string $procedureId * @param SendSmsChallengeCommand $command * @return bool * @throws UnknownVettingProcedureException * @throws DomainException */ public function sendSmsChallenge($procedureId, SendSmsChallengeCommand $command) { $procedure = $this->getProcedure($procedureId); $phoneNumber = InternationalPhoneNumber::fromStringFormat($procedure->getSecondFactor()->secondFactorIdentifier); $command->phoneNumber = $phoneNumber; $command->body = $this->translator->trans('ra.vetting.sms.challenge_body'); $command->identity = $procedure->getSecondFactor()->identityId; $command->institution = $procedure->getSecondFactor()->institution; return $this->smsSecondFactorService->sendChallenge($command); }
/** * @param SendSmsChallengeCommand $command * @return bool Whether SMS sending did not fail. * @throws TooManyChallengesRequestedException */ public function sendChallenge(SendSmsChallengeCommand $command) { $phoneNumber = new InternationalPhoneNumber($command->country->getCountryCode(), new PhoneNumber($command->subscriber)); $stepupCommand = new StepupSendSmsChallengeCommand(); $stepupCommand->phoneNumber = $phoneNumber; $stepupCommand->body = $this->translator->trans('ss.registration.sms.challenge_body'); $stepupCommand->identity = $command->identity; $stepupCommand->institution = $command->institution; return $this->smsSecondFactorService->sendChallenge($stepupCommand); }