public UserInfoResponse Register(UserLoginRequest request, out int status, out string message) { status = 0; message = string.Empty; var response = new UserInfoResponse(); try { IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.Register); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { status = result.Status; message = result.Message; ResponseMessage = result.Message; Status = result.Status; return(SerializerObject.ProtoBufDeserialize <UserInfoResponse>(result.ResponseData, client.Saltkey)); } return(null); } catch (Exception exception) { status = 0; message = "Lỗi từ user api"; ResponseMessage = SetResponseMessage(exception); return(null); } }
public bool ForgotChangePassword(ChangePasswordRequest request) { var response = new TransactionInfoResponse(); try { IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.ForgotChangePassword); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { ResponseMessage = result.Message; Status = result.Status; return(SerializerObject.ProtoBufDeserialize <bool>(result.ResponseData, client.Saltkey)); } return(false); } catch (Exception exception) { ResponseMessage = "User API - " + SetResponseMessage(exception); return(false); } }
public bool VerifyOTPViaMobile(int userId, string cardNumber, string id, string mobileNumber) { var response = new TransactionInfoResponse(); try { var request = new UserInfoRequest() { UserId = userId, CardNumber = cardNumber, Identity = id, EmailOrMobile = mobileNumber }; IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.VerifyOTPViaMobile); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { Status = result.Status; ResponseMessage = result.Message; return(SerializerObject.ProtoBufDeserialize <bool>(result.ResponseData, client.Saltkey)); } return(false); } catch (Exception exception) { Status = 0; ResponseMessage = SetResponseMessage(exception); return(false); } }
public UserCardInfoResponse GetCardInfo(int userId, string cardNumber, bool isVerify = false) { var response = new UserCardInfoResponse(); try { var request = new UserInfoRequest() { UserId = userId, CardNumber = cardNumber, IsVerify = isVerify }; IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.GetCardInfo); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { Status = result.Status; ResponseMessage = result.Message; return(SerializerObject.ProtoBufDeserialize <UserCardInfoResponse>(result.ResponseData, client.Saltkey)); } return(response); } catch (Exception exception) { Status = 0; ResponseMessage = SetResponseMessage(exception); return(default(UserCardInfoResponse)); } }
public UserCardInfoResponse InsertUserCard(int userId, string card_numbers, bool setMainCard, string otp, string accountId, string fullName) { var response = new TransactionInfoResponse(); try { var request = new UserInfoRequest() { UserId = userId, CardNumber = card_numbers, SetMainCard = setMainCard, OTP = otp, Csn = accountId, FullName = fullName }; IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.InsertUserCard); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { Status = result.Status; ResponseMessage = result.Message; return(SerializerObject.ProtoBufDeserialize <UserCardInfoResponse>(result.ResponseData, client.Saltkey)); } return(null); } catch (Exception exception) { Status = 0; ResponseMessage = SetResponseMessage(exception); return(null); } }
public VingroupCardResponse GetListVingroupcardByUserId(int userId) { var response = new VingroupCardResponse(); try { var request = new UserInfoRequest() { UserId = userId }; IHttpOrderClient client = new HttpOrderClient(Publickey, true); var dic = new Dictionary <string, string>(); var url = GetUrl(BusinessObjectPublicUser.RequestFunction.GetListVingroupCardByUserId); var result = client.Post(request, url, dic, Appid, Uid); if (result != null && result.ResponseData != null) { Status = result.Status; ResponseMessage = result.Message; return(SerializerObject.ProtoBufDeserialize <VingroupCardResponse>(result.ResponseData, client.Saltkey)); } return(null); } catch (Exception exception) { Status = 0; ResponseMessage = SetResponseMessage(exception); return(null); } }