/// <summary> /// /// </summary> /// <param name="user"></param> /// <param name="dtpData"></param> /// <returns></returns> private static DTPData SignBySecondUser(Upsilab.Data.Model.User user, DTPData dtpData) { //User infos dtpData = GetUserInfos(user, dtpData); if (string.IsNullOrEmpty(dtpData.TransactionId)) { //throw new Exception(SignatureExceptionCode.TransactionIdMissing.ToString()); throw new Exception("La transaction de cette signature est expirée."); } //#1 : Continue transaction DTPClient dtpClient = new DTPClient(dtpData.TransactionId); //Check if all users have signed the transaction if (dtpClient.IsTransactionSignedByAll()) //if (true) { dtpData.IHM_Url = dtpData.BackUrl.Replace("%3F", "?").Replace("%3D", "=").Replace("%7B", "{").Replace("%7D", "}").Replace("%26", "&") .Replace("{STATUS}", ALREADY_SIGNED).Replace("{LOGIN}", dtpData.Login).Replace("{OFFER}", dtpData.OfferId); //Exec back url; } else { //#2 : Create access user for second user dtpData.UserAccessId = dtpClient.CreateUserAccess(string.Empty, user.UserName, user.UserFirstName, user.UserMobilePhone, dtpData.BackUrl); //#3 : create user space dtpClient.CreateUserSpace(dtpData); //#4 : create user space content dtpClient.CreateUserSpaceContent(dtpData); //#4' : Send OTP by sms to user //dtpClient.SendOtp(accessId); TODO //#5 : IHM_url dtpData.IHM_Url = dtpClient.BuildUserInterfaceUrl(dtpData); } return dtpData; }