private static IVerifyAdultResult ParseError(AdultVerificationResponse response) { IVerifyAdultResult verifyAdultResult = GuestControllerErrorParser.GetVerifyAdultResult(response.error); if (verifyAdultResult == null) { return(MakeGenericFailure()); } if (verifyAdultResult is IVerifyAdultFailedQuestionsResult && response.data != null && response.data.questions != null) { VerifyAdultQuestion[] questions = response.data.questions.Select((AdultVerificationQuestion q) => new VerifyAdultQuestion(q.questionId, q.questionText, q.choices)).ToArray(); VerifyAdultQuiz quiz = new VerifyAdultQuiz(questions, response.data.applicationId); verifyAdultResult = new VerifyAdultFailedQuestionsResult(quiz); } return(verifyAdultResult); }
private static IVerifyAdultResult ParseError(GuestControllerWebCallResponse response) { IVerifyAdultResult verifyAdultResult = GuestControllerErrorParser.GetVerifyAdultResult(response.error); return(verifyAdultResult ?? MakeGenericFailure()); }