// public ActionResult IndexBankIDMObileSign(string mobile = null, string dateofbirth = null) { public ActionResult SecureIdentifyMobile(string mobile = null, string dateofbirth = null) { if (string.IsNullOrWhiteSpace(mobile) || string.IsNullOrWhiteSpace(dateofbirth)) { return View("SecureIdentifyMobile"); } ExternalSignRequest.Language = Languages.EN; ExternalSignRequest.DocumentType=DocumentType.TEXT; ExternalSignRequest.ReturnUrlSuccess = "unie24://success"; ExternalSignRequest.ReturnUrlError = "unie24://error"; ExternalSignRequest.ReturnUrlUserAbort = "unie24://abort"; ExternalSignRequest.Title = "Test"; ExternalSignRequest.CreatePADES = false; if (string.IsNullOrWhiteSpace(mobile)) mobile = "99716935"; if (string.IsNullOrWhiteSpace(dateofbirth)) dateofbirth = "071283"; //ExternalSignRequest.SigneeRefs.FirstOrDefault().BankIdPid = "9578-5993-4-1617343"; var result = base.signClient.CreateExternalSignSimpleText(ExternalSignRequest, "Jeg bekrefter min idenfikasjon ovenfor: Kjelltech Finance and Acquisition Inc på mobilnummer: {0}".FormatWith(mobile)); string response = null; SignSuccessViewModel vm = new SignSuccessViewModel() { DocumentId = result.DocumentId, }; try { Guid SigneeRef = result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId; Guid DocumentId = result.DocumentId; vm.Name = base.signClient.CreateExternalSignBankIDMobileSignRequest(new CreateExternalSignBankIDMobileSignRequest() { DocumentId = result.DocumentId, SigneeRefId = result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId, Mobile = mobile, DateOfBirth = dateofbirth, }); return RedirectToAction("SecureIdentiyWaiting", new { SigneeRef , DocumentId }); } catch (Exception e) { BankIDMobileSignStatusResponse responseStatus = base.signClient.GetBankIDMobileSignStatus(result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId); vm.ResponseObj = Newtonsoft.Json.JsonConvert.SerializeObject(responseStatus, Formatting.Indented); } ViewBag.Error = "En feil oppstod"; return View("SecureIdentifyMobile"); }
public override ActionResult SignSuccess(Document doc, string signeeref, string userid, string docid) { Signee signee = doc.SigneeRefs.FirstOrDefault(); SignSuccessViewModel vm = new SignSuccessViewModel() { Name = signee.SignName, SignTime = signee.SignedTime.Value, DocumentId = doc.Id, SocSec=signee.SocialSecurityNumber, Push =HttpContext.Cache!=null && HttpContext.Cache[doc.Id.ToString()] != null ? HttpContext.Cache[doc.Id.ToString()] as string:"Push empty", MetaData = doc.MetaData.ToDictionary(x=>x.KeyName,y=>y.Value), }; return View("Success",vm); }
public ActionResult IndexBankIDMObileSign(string mobile = null, string dateofbirth = null) { ExternalSignRequest.Language = Languages.EN; ExternalSignRequest.DocumentType=DocumentType.TEXT; ExternalSignRequest.ReturnUrlSuccess = "unie24://success"; ExternalSignRequest.ReturnUrlError = "unie24://error"; ExternalSignRequest.ReturnUrlUserAbort = "unie24://abort"; ExternalSignRequest.Title = "Test"; ExternalSignRequest.CreatePADES = false; if (string.IsNullOrWhiteSpace(mobile)) mobile = "99716935"; if (string.IsNullOrWhiteSpace(dateofbirth)) dateofbirth = "071283"; //ExternalSignRequest.SigneeRefs.FirstOrDefault().BankIdPid = "9578-5993-4-1617343"; var result = base.signClient.CreateExternalSignSimpleText(ExternalSignRequest,"Test sign BankID mobile from Signere.no AS"); string response = null; SignSuccessViewModel vm = new SignSuccessViewModel() { DocumentId = result.DocumentId, }; try { vm.Name = base.signClient.CreateExternalSignBankIDMobileSignRequest(new CreateExternalSignBankIDMobileSignRequest() { DocumentId = result.DocumentId, SigneeRefId = result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId, Mobile = mobile, DateOfBirth = dateofbirth, }); vm.SigneeRefId = result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId; } catch (Exception e) { BankIDMobileSignStatusResponse responseStatus = base.signClient.GetBankIDMobileSignStatus(result.CreatedSigneeRefs.FirstOrDefault().SigneeRefId); vm.ResponseObj = Newtonsoft.Json.JsonConvert.SerializeObject(responseStatus, Formatting.Indented); } return View("BankIDMobileSign", vm); }