Пример #1
0
        public bool ChangeCardToMain(int userId, string card_numbers)
        {
            var response = new TransactionInfoResponse();
            try
            {
                var request = new UserInfoRequest()
                {
                    UserId = userId,
                    CardNumber = card_numbers
                };
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic = new Dictionary<string, string>();
                var url = GetUrl(BusinessObjectPublicUser.RequestFunction.ChangeToMainCard);
                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;
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
        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);
            }
        }
Пример #5
0
        public bool?ValidOtpCode(ConfirmMobileRequest request, out int status, out string message)
        {
            status  = 0;
            message = string.Empty;
            var response = new TransactionInfoResponse();

            try
            {
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic    = new Dictionary <string, string>();
                var url    = GetUrl(BusinessObjectPublicUser.RequestFunction.ValidOtpCode);
                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 <bool?>(result.ResponseData, client.Saltkey));
                }
                return(null);
            }
            catch (Exception exception)
            {
                status          = 0;
                message         = "Lỗi từ user api";
                ResponseMessage = SetResponseMessage(exception);
                return(null);
            }
        }
Пример #6
0
        public async Task <IActionResult> GetTransactionInfo(string transactionId)
        {
            TransactionInfoResponse result =
                await _link4PayServiceClient.GetTransactionInfoAsync(new TransactionRequest
            {
                TransactionId = transactionId
            });

            return(string.IsNullOrEmpty(result.AssetId)
                ? (IActionResult)NotFound()
                : Ok(result));
        }
Пример #7
0
        public bool VerifyCardInfo(string cardInfo, string idPassport, string mobile)
        {
            var response = new TransactionInfoResponse();
            try
            {
                var request = new UserInfoRequest()
                {
                    CardNumber = cardInfo,
                    Identity = idPassport,
                    EmailOrMobile = mobile
                };
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic = new Dictionary<string, string>();
                var url = GetUrl(BusinessObjectPublicUser.RequestFunction.VerifyCardInfo);
                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;
            }
        }
Пример #8
0
        public bool? ValidOtpCode(ConfirmMobileRequest request, out int status, out string message)
        {
            status = 0;
            message = string.Empty;
            var response = new TransactionInfoResponse();
            try
            {
                IHttpOrderClient client = new HttpOrderClient(Publickey, true);
                var dic = new Dictionary<string, string>();
                var url = GetUrl(BusinessObjectPublicUser.RequestFunction.ValidOtpCode);
                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<bool?>(result.ResponseData, client.Saltkey);
                }
                return null;
            }
            catch (Exception exception)
            {
                status = 0;
                message = "Lỗi từ user api";
                ResponseMessage = SetResponseMessage(exception);
                return null;
            }
        }
Пример #9
0
        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;
            }
        }
Пример #10
0
        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;
            }
        }