Ejemplo n.º 1
0
        /// <summary>
        /// 승인을 요청합니다.
        /// </summary>
        /// <param name="Project">업무구분 [PROJECT_D ,  PROJECT_H ...]</param>
        /// <param name="kind">현금인지  /  카드인지 구분</param>
        /// <param name="cashKind">현금영주증  중 개인/법인구분</param>
        /// <param name="cardno">카드번호  / 식별번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="amtSplit">할부개월</param>
        /// <param name="amt">승인금액</param>
        /// <param name="vanSeq">POS  에서  밴 거래시  일련번호</param>
        /// <param name="SignDataString">싸인이미지</param>
        /// <returns></returns>
        public Van.RecivedData SendData(string Project,
                                        Van.JobKind kind,
                                        CashKind cashKind,
                                        string cardno,
                                        string scope,
                                        string amtSplit,
                                        string amt,
                                        string vanSeq,
                                        string SignDataString,
                                        string OrgAgreeNo,
                                        string OrgAgreeDate
                                        , CashGbn cashgbn)
        {
            try
            {
                BizCommon.VanType type    = VanType.NONE;
                string            svrIP   = "";
                string            svrPort = "";
                string            tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                type = BizVan.GetProjectVaninfo(Project, kind, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                return(MySendData(type, svrIP, svrPort, kind, cashKind, tid, cardno, scope, amtSplit, amt, vanSeq, SignDataString, OrgAgreeNo, OrgAgreeDate, cashgbn));
            }
            catch (Exception ex)
            {
                throw  ex;
            }
        }
Ejemplo n.º 2
0
        /// <summary>
        /// 업무  구분별 밴정보를  가져온다.
        /// </summary>
        /// <param name="Project">업무구분  프로젝트.</param>
        /// <param name="kind">현금인지 /  카드인지</param>
        /// <param name="svrIp">서버아아피</param>
        /// <param name="svrPort">서버포트.</param>
        /// <param name="tid">터미널아이디</param>
        /// <returns></returns>
        public static BizCommon.VanType  GetProjectVaninfo(string Project,
                                                           Van.JobKind kind,
                                                           ref string svrIp,
                                                           ref string svrPort,
                                                           ref string tid,
                                                           ref SignPad pad,
                                                           ref string SinpadComport
                                                           )
        {
            BizCommon.VanType type = VanType.NONE;

            switch (Project.ToUpper())
            {
            case  "PROJECT_H":
                type    = Parm.CurrentUserInformation.golfTask.VanInfomation.vanType;
                svrIp   = Parm.CurrentUserInformation.golfTask.VanInfomation.SvrIP;
                svrPort = Parm.CurrentUserInformation.golfTask.VanInfomation.SvrPort;

                if (kind == JobKind.CancelCash || kind == JobKind.RegCash)
                {
                    tid = Parm.CurrentUserInformation.golfTask.CashTid;
                }
                else if (kind == JobKind.CancelCard || kind == JobKind.RegCard)
                {
                    tid = Parm.CurrentUserInformation.golfTask.CardTid;
                }

                SinpadComport = Parm.CurrentUserInformation.golfTask.SignPort;
                pad           = Parm.CurrentUserInformation.golfTask.SignPad;


                break;

            case "PROJECT_D":
                type    = Parm.CurrentUserInformation.roomTask.VanInfomation.vanType;
                svrIp   = Parm.CurrentUserInformation.roomTask.VanInfomation.SvrIP;
                svrPort = Parm.CurrentUserInformation.roomTask.VanInfomation.SvrPort;

                if (kind == JobKind.CancelCash || kind == JobKind.RegCash)
                {
                    tid = Parm.CurrentUserInformation.roomTask.gsCashTerminalID;
                }
                else if (kind == JobKind.CancelCard || kind == JobKind.RegCard)
                {
                    tid = Parm.CurrentUserInformation.roomTask.gsCardTerminalID;
                }

                SinpadComport = Parm.CurrentUserInformation.roomTask.gsEtcSignPort;
                pad           = Parm.CurrentUserInformation.roomTask.gsEtcSignPad;

                break;
            }

            return(type);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// 실제적인 승인처리 현금영수 - 카드 승인/취소 공통이다.
        /// </summary>
        /// <param name="Project">The project.</param>
        /// <param name="kind">종류 /  카드승인/카드취소/현금승인/현금취소등</param>
        /// <param name="cashKind">현금영수증일대  구분</param>
        /// <param name="cardno">카드번호 /  식별번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="amtSplit">할부개월</param>
        /// <param name="amt">금액</param>
        /// <param name="vanSeq">밴일련번호 - pos에서  밴거래시  1씩증가</param>
        /// <param name="SignDataString">싸인데이터</param>
        /// <param name="OrgAgreeNo">The org agree no.</param>
        /// <param name="OrgAgreeDate">The org agree date.</param>
        /// <returns></returns>
        public string GetVanMakeCardProtocol(string Project,
                                             Van.JobKind kind,
                                             CashKind cashKind,
                                             string cardno,
                                             string scope,
                                             string amtSplit,
                                             string amt,
                                             string vanSeq,
                                             string SignDataString,
                                             string OrgAgreeNo,
                                             string OrgAgreeDate
                                             , CashGbn cashgbn)
        {
            try
            {
                string svrIP   = "";
                string svrPort = "";
                string tid     = "";

                SignPad pad         = SignPad.NONE;
                string  signcomport = "";

                BizCommon.VanType rtype = BizVan.GetProjectVaninfo(Project, kind, ref svrIP, ref svrPort, ref tid, ref pad, ref signcomport);

                Van.VanType type = BizVan.ConvertToVanType(rtype);

                if (tid == "")
                {
                    throw new Exception("밴 터미널 아이디가 등록되지 않았습니다.");
                }
                else if (rtype != VanType.KIS && (type == Van.VanType.NONE || svrIP == "" || svrPort == ""))
                {
                    throw new Exception("밴 환경설정이 없습니다.");
                }
                string str = "";

                if (kind == JobKind.RegCard || kind == JobKind.RegCash)
                {
                    //현금영수증 부가세 관련현 수정
                    string strVat = "";// intVat = 0;
                    if (amt == null || amt == "0" || amt == "")
                    {
                        strVat = "";
                    }
                    else
                    {
                        strVat = ((int)(Convert.ToDouble(amt) - Convert.ToDouble(amt) / 1.1)).ToString();
                    }

                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Reg(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()));
                        break;

                    case Van.VanType.KSNET:
                        str = Van.KSNET.Reg(kind,
                                            cashKind,
                                            tid,
                                            cardno,
                                            scope,
                                            Basic.MaskReplace(amtSplit.Trim()),
                                            Basic.MaskReplace(amt.Trim()),
                                            1,
                                            SignDataString);


                        break;

                    case Van.VanType.KIS:
                        str = Van.KIS.Reg(kind
                                          , cashKind
                                          , tid
                                          , cardno
                                          , scope
                                          , Basic.MaskReplace(amtSplit.Trim())
                                          , Basic.MaskReplace(amt.Trim())
                                          , strVat
                                          , cashgbn);

                        break;
                    }
                }
                else if (kind == JobKind.CancelCash || kind == JobKind.CancelCard)
                {
                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Cancel(kind,
                                              cashKind,
                                              tid,
                                              cardno,
                                              scope,
                                              Basic.MaskReplace(amtSplit.Trim()),
                                              Basic.MaskReplace(amt.Trim()),
                                              OrgAgreeNo,
                                              OrgAgreeDate
                                              );
                        break;

                    case Van.VanType.KSNET:
                        str = KSNET.Cancel(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()),
                                           OrgAgreeNo,
                                           OrgAgreeDate,
                                           1,
                                           "");
                        break;
                    }
                }



                return(str);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// 실제적인 승인처리 현금영수 - 카드 승인/취소 공통이다.
        /// </summary>
        /// <param name="tid">터미널아이디</param>
        /// <param name="svrIP">서버아이피.</param>
        /// <param name="svrPort">서버포트</param>
        /// <param name="str">전송전문</param>
        /// <param name="kind">종류 /  카드승인/카드취소/현금승인/현금취소등</param>
        /// <param name="SignDataString">싸인데이터 </param>
        /// <param name="cashKind">현금영수증일대  구분</param>
        /// <param name="cardno">카드번호 /  식별번호</param>
        /// <param name="scope">유효기간</param>
        /// <param name="amtSplit">할부개월</param>
        /// <param name="amt">금액</param>
        /// <param name="vanSeq">밴일련번호 - pos에서  밴거래시  1씩증가</param>
        /// <returns></returns>
        private Van.RecivedData MySendData(
            BizCommon.VanType rtype,
            string svrIP,
            string svrPort,
            Van.JobKind kind,
            CashKind cashKind,
            string tid,
            string cardno,
            string scope,
            string amtSplit,
            string amt,
            string vanSeq,
            string SignDataString,
            string OrgAgreeNo,
            string OrgAgreeDate
            , CashGbn cashgbn)
        {
            try
            {
                Van.VanType type = BizVan.ConvertToVanType(rtype);

                /* TID 체크 하지 않음
                 * if(tid == "")
                 * {
                 *  throw new Exception(  "밴 터미널 아이디가 등록되지 않았습니다.");
                 *
                 * }
                 * else if(type != Van.VanType.KIS && ( type == Van.VanType.NONE ||  svrIP   == ""  || svrPort == "" ))
                 * {
                 *    throw new Exception(   "밴 환경설정이 없습니다.");
                 *
                 * } */

                if (svrPort == "")
                {
                    throw new Exception("통신 서버 포트가 등록되지 않았습니다.");
                }

                string str = "";

                if (kind == JobKind.RegCard || kind == JobKind.RegCash)
                {
                    //현금영수증 부가세 관련현 수정
                    string strVat = "";// intVat = 0;
                    if (amt == null || amt == "0" || amt == "")
                    {
                        strVat = "";
                    }
                    else
                    {
                        strVat = ((int)(Convert.ToDouble(amt) - Convert.ToDouble(amt) / 1.1)).ToString();
                    }

                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Reg(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()));
                        break;

                    case Van.VanType.KSNET:
                        str = Van.KSNET.Reg(kind,
                                            cashKind,
                                            tid,
                                            cardno,
                                            scope,
                                            Basic.MaskReplace(amtSplit.Trim()),
                                            Basic.MaskReplace(amt.Trim()),
                                            1,
                                            SignDataString);
                        break;

                    case Van.VanType.KIS:
                        str = Van.KIS.Reg(kind
                                          , cashKind
                                          , tid
                                          , cardno
                                          , scope
                                          , Basic.MaskReplace(amtSplit.Trim())
                                          , Basic.MaskReplace(amt.Trim())
                                          , strVat
                                          , cashgbn);

                        break;

                    case Van.VanType.STAR_CAT:
                        str = Van.STAR_CAT.Reg(kind
                                               , cashKind
                                               , Basic.MaskReplace(amtSplit.Trim())
                                               , Basic.MaskReplace(amt.Trim())
                                               , strVat
                                               , cashgbn);

                        break;
                    }
                }
                else if (kind == JobKind.CancelCash || kind == JobKind.CancelCard)
                {
                    switch (type)
                    {
                    case Van.VanType.KICC:
                        str = Van.KICC.Cancel(kind,
                                              cashKind,
                                              tid,
                                              cardno,
                                              scope,
                                              Basic.MaskReplace(amtSplit.Trim()),
                                              Basic.MaskReplace(amt.Trim()),
                                              OrgAgreeNo,
                                              OrgAgreeDate
                                              );
                        break;

                    case Van.VanType.KSNET:
                        str = KSNET.Cancel(kind,
                                           cashKind,
                                           tid,
                                           cardno,
                                           scope,
                                           Basic.MaskReplace(amtSplit.Trim()),
                                           Basic.MaskReplace(amt.Trim()),
                                           OrgAgreeNo,
                                           OrgAgreeDate,
                                           1,
                                           "");
                        break;

                    case Van.VanType.KIS:
                        str = KIS.Cancel(kind,
                                         cashKind,
                                         tid,
                                         cardno,
                                         scope,
                                         Basic.MaskReplace(amtSplit.Trim()),
                                         Basic.MaskReplace(amt.Trim()),
                                         OrgAgreeNo,
                                         OrgAgreeDate,
                                         1,
                                         "");
                        break;

                    case Van.VanType.STAR_CAT:
                        str = STAR_CAT.Cancel(kind,
                                              cashKind,
                                              Basic.MaskReplace(amtSplit.Trim()),
                                              Basic.MaskReplace(amt.Trim()),
                                              OrgAgreeNo,
                                              OrgAgreeDate
                                              );
                        break;
                    }
                }



                Van.frmVanLoading f = new Van.frmVanLoading("승인요청 중 입니다.",
                                                            type,
                                                            frmVanLoading.JobKind.Communication,
                                                            svrIP,
                                                            svrPort == "" ? -99 : int.Parse(svrPort),
                                                            str,
                                                            "BizGetRequest");

                f.CardApprovalType = SignDataString == "" ? CARD_APPROVAL_TYPE.DDC : CARD_APPROVAL_TYPE.DSC;
                f.ArgJobKinds      = kind;
                f.SignDataString   = SignDataString;
                f.Tid   = tid;
                f.Owner = this;
                IsLoop  = true;
                f.ShowDialog();

                while (IsLoop)
                {
                    Application.DoEvents();
                }


                return(_ReqData);
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }