Example #1
0
        /// <summary>
        /// Insert credit card in Navision
        /// </summary>
        /// <param name="user">User information</param>
        /// <param name="pos">market</param>
        /// <param name="comcode">customer code</param>
        /// <param name="cc1">analytical code 1</param>
        /// <param name="percode">traveler code</param>
        /// <param name="service">product</param>
        /// <param name="retval">value returned</param>
        /// <param name="cardInfos">card informations</param>
        /// <param name="forceWarning">force warning flag</param>
        /// <param name="contextSource">context source for transactional card</param>
        /// <param name="context">context information for transactional card</param>
        public static void InsertPaymentCard(UserInfo user, string pos, string comcode, string cc1, string percode, string service,
                                             InsertCardInNavisionResult retval, CardInfos cardInfos, int forceWarning, string contextSource, string context)
        {
            Navision nws = null;

            try
            {
                // Define a new navision ws connection
                nws = new Navision();

                // prepare output
                Nav_InsertPaymentCard ni = new Nav_InsertPaymentCard();

                // insert credit card
                nws.InsertPaymentCard(NavWsLogin, NavWsPassword, pos, comcode, String.IsNullOrEmpty(percode) ? string.Empty : percode
                                      , String.IsNullOrEmpty(cc1) ? string.Empty : cc1
                                      , Util.ConvertDateToString(cardInfos.GetExpirationDate(), Const.DateFormat_yyyysMMsdd), cardInfos.GetNavisionCardType(),
                                      cardInfos.GetDescription(), cardInfos.GetNavisionLodgedCard(), Util.CorrectServiceForNavision(service), user.GetLogin(),
                                      cardInfos.GetToken(), cardInfos.GetTruncatedPAN(),
                                      cardInfos.GetFirstCardReference(), cardInfos.IsNavisionTransactional(), forceWarning, contextSource, context, ref ni);
                // set value
                retval.SetValues(ni);
            }
            finally
            {
                // Let's dispose now
                if (nws != null)
                {
                    nws.Dispose();
                }
            }
        }
        public InsertPaymentCardResponse(UserInfo user, string pos, string customer, string cc1, string percode, string token
                                         , string servicegroup, CardInfos cardInfos, int contextSource, string context, int forceWarning)
        {
            //InsertCardResponse card = new InsertCardResponse();



            NavService.Nav_InsertPaymentCard o = new Nav_InsertPaymentCard();
            //RequestedService ss = new RequestedService();



            // initialisation
            this.StartDate = DateTime.Now;
            //>> EGE-66896
            this.argPos          = pos;
            this.argCostCenter   = cc1;
            this.argComcode      = customer;
            this.argPercode      = percode;
            this.argServiceslist = servicegroup;
            this.argPos          = String.IsNullOrEmpty(pos) ? pos : ((String.Compare(pos, "null", true) == 0) ? String.Empty : pos);
            //this.argCostCenter = String.IsNullOrEmpty(cc1) ? cc1 : ((String.Compare(cc1, "null", true) == 0) ? String.Empty : cc1);
            //this.argComcode = String.IsNullOrEmpty(comcode) ? comcode : ((String.Compare(comcode, "null", true) == 0) ? String.Empty : comcode);
            //this.argPercode = String.IsNullOrEmpty(percode) ? percode : ((String.Compare(percode, "null", true) == 0) ? String.Empty : percode);
            //this.argServiceslist = String.IsNullOrEmpty(argServiceslist) ? argServiceslist : ((String.Compare(argServiceslist, "null", true) == 0) ? String.Empty : argServiceslist);
            //>> EGE-66896
        }
Example #3
0
        public void SetValues(Nav_InsertPaymentCard ni)
        {
            // we need to handle exceptions

            // Let's check if we have an exception code
            NavException7 navExcep = ni.NavException[0];

            // retrieve exception code
            string exceptionCode = navExcep.NavExceptionCode[0];

            if (!String.IsNullOrEmpty(exceptionCode))
            {
                // We have an exception
                // Let's see how kind of error we have here
                this.ExceptionCode = exceptionCode;
                this.ExceptionDesc = navExcep.NavExceptionDesc[0];
            }
            else
            {
                this.CardReference             = ni.InsertCardResult[0].CardReference;
                this.Merchantflow              = ni.InsertCardResult[0].MerchandFlow;
                this.Enhancedflow              = ni.InsertCardResult[0].EnhancedFlow;
                this.CardUsedByAnotherCustomer = ni.InsertCardResult[0].CardUsedByAnotherCustomer;
                this.Operationin = ni.InsertCardResult[0].Operation;
                this.Onlinecheck = ni.InsertCardResult[0].OnlineCheck;
            }
        }
        /// <summary>
        /// Set result from Navision ws
        /// </summary>
        /// <param name="value">NavPaymentMeans</param>
        public void SetValue(Nav_InsertPaymentCard value)
        {
            this.pm = value;
            // Let's check if we have an exception code
            string exceptionCode = value.NavException == null ? null : value.NavException[0].NavExceptionCode[0];

            if (!String.IsNullOrEmpty(exceptionCode))
            {
                // We have an exception here
                this.ExceptionCount = 1;
                // set exception code and message
                this.ExceptionCode     = exceptionCode;
                this.ExceptionMessage  = value.NavException[0].NavExceptionDesc[0];
                this.ExceptionSeverity = CCEExceptionMap.EXCEPTION_SEVERITY_ERROR;
                this.ExceptionType     = CCEExceptionMap.EXCEPTION_TYPE_FONCTIONAL;
            }
        }