public bool AuthOtpYn()
        {
            try
            {
                using (RequestUserCertModel req = new RequestUserCertModel())
                {
                    req.userEmail = MainViewModel.LoginDataModel.userEmail;
                    req.otpCertYn = "N";

                    using (ResponseUserCertModel res = WebApiLib.SyncCall <ResponseUserCertModel, RequestUserCertModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            return(true);
                        }
                        else
                        {
                            return(false);
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                return(false);
            }
        }
Exemplo n.º 2
0
        public void CmdKYCAuth()
        {
            try
            {
                if (otpYn.Equals("Y"))
                {
                    if (string.IsNullOrWhiteSpace(MainViewModel.LoginDataModel.otpNo))
                    {
                        alert = new Alert(Localization.Resource.CertifyMyPage_Alert_8);
                        alert.ShowDialog();
                        return;
                    }
                }

                if (string.IsNullOrWhiteSpace(sFileName1) || string.IsNullOrWhiteSpace(sFileName2))
                {
                    alert = new Alert(Localization.Resource.CertifyMyPage_6_1);
                    alert.ShowDialog();
                    return;
                }
                else
                {
                    IsBusy = true;

                    using (RequestKYCAuthModel req = new RequestKYCAuthModel())
                    {
                        req.userEmail = MainViewModel.LoginDataModel.userEmail;
                        req.fileSn    = "1";

                        using (ResponseKYCAuthModel res = WebApiLib.UpLoad <ResponseKYCAuthModel, RequestKYCAuthModel>(req, sFileName1))
                        {
                            if (res.resultStrCode == "000")
                            {
                                using (RequestKYCAuthModel req2 = new RequestKYCAuthModel())
                                {
                                    if (res.resultStrCode == "000")
                                    {
                                        req2.userEmail = MainViewModel.LoginDataModel.userEmail;
                                        req2.fileSn    = "2";

                                        using (ResponseKYCAuthModel res2 = WebApiLib.UpLoad <ResponseKYCAuthModel, RequestKYCAuthModel>(req2, sFileName2))
                                        {
                                            if (res2.resultStrCode == "000")
                                            {
                                                try
                                                {
                                                    using (RequestUserCertModel req3 = new RequestUserCertModel())
                                                    {
                                                        req3.userEmail = MainViewModel.LoginDataModel.userEmail;
                                                        req3.kycCertYn = "3";

                                                        using (ResponseUserCertModel res3 = WebApiLib.SyncCall <ResponseUserCertModel, RequestUserCertModel>(req3))
                                                        {
                                                            if (res3.resultStrCode == "000")
                                                            {
                                                                alert = new Alert(Localization.Resource.CertifyMyPage_6_2);
                                                                alert.ShowDialog();

                                                                AuthEnabled         = false;
                                                                AuthVisible         = Visibility.Collapsed;
                                                                btn_kyc_cert_status = sLanguage + "btn_manager_checking.png";
                                                                MainViewModel.LoginDataModel.kycStatus = "3";

                                                                IsBusy = false;
                                                            }
                                                        }
                                                    }
                                                }
                                                catch (Exception ex)
                                                {
                                                    SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                                                }
                                            }
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
                alert = new Alert(Localization.Resource.CertifyMyPage_Alert_7, 300);
                alert.ShowDialog();
            }
            finally
            {
                IsBusy = false;
            }
        }
Exemplo n.º 3
0
        public async void CmdSetGoogleOTP()
        {
            try
            {
                if (emailCertVisible == Visibility.Visible)
                {
                    alert = new Alert(Localization.Resource.WithdrawDepositWithdraw_Common_4, 320);
                    alert.ShowDialog();
                    return;
                }
                else if (string.IsNullOrWhiteSpace(otpNumber.Trim()))
                {
                    alert = new Alert(Localization.Resource.CertifyMyPage_Alert_5);
                    alert.ShowDialog();
                    return;
                }

                IsBusy = true;

                using (RequestSetGoogleOtpModel req = new RequestSetGoogleOtpModel())
                {
                    req.userEmail  = userEmail;
                    req.authCode   = otpNumber;
                    req.encodedKey = encodeKey;
                    req.isUpt      = "Y";

                    using (ResponseSetGoogleOtpModel res = await WebApiLib.AsyncCall <ResponseSetGoogleOtpModel, RequestSetGoogleOtpModel>(req))
                    {
                        if (res.resultStrCode == "000")
                        {
                            string sResultCd = res.data.failCd;

                            if (sResultCd.Equals(""))
                            {
                                alert = new Alert(Localization.Resource.Common_Alert_2);
                                alert.ShowDialog();

                                certifyStep2Visible = Visibility.Collapsed;
                                emailCertVisible    = Visibility.Collapsed;
                                changeStep2Visible  = Visibility.Visible;
                                qrCodeUrl           = null;
                                otpNumber           = string.Empty;

                                using (RequestUserCertModel req2 = new RequestUserCertModel())
                                {
                                    req2.userEmail = userEmail;
                                    req2.otpSerial = encodeKey;
                                    req2.otpCertYn = "N";

                                    using (ResponseUserCertModel res2 = await WebApiLib.AsyncCall <ResponseUserCertModel, RequestUserCertModel>(req2))
                                    {
                                        MainViewModel.LoginDataModel.otpNo = encodeKey;
                                        Messenger.Default.Send("CoinSetting");
                                    }
                                }
                            }
                            else
                            {
                                alert = new Alert(Localization.Resource.TransferDepositWithdraw_Common_6);
                                alert.ShowDialog();
                            }
                        }
                        else
                        {
                            alert = new Alert(Localization.Resource.CertifyMyPage_Alert_9);
                            alert.ShowDialog();
                        }
                    }
                }
            }
            catch (Exception ex)
            {
                SysLog.Error("Message[{0}], StackTrace[{1}]", ex.Message, ex.StackTrace);
            }
            finally
            {
                IsBusy = false;
            }
        }