예제 #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();
                }
            }
        }
예제 #2
0
 public void SetValues(CardInfos card)
 {
     SetExpirationDate(Util.ConvertDateToString(card.GetExpirationDate(), Const.DateFormat_ddMMyyyyHHmmss));
     // Short Expiration
     SetShortExpirationDate(card.GetShortExpirationDate());
     // Type de carte
     SetCardType(card.GetCardType());
     // Type de carte (court)
     SetShortCardType(card.GetShortCardType());
     // PAN tronqué
     SetTruncatedPan(card.GetTruncatedPAN());
     // MII
     SetMII(card.GetMII());
     // MII Issuer Category
     SetMIIIssuerCategory(card.GetMIIIssuerCategory());
     this.ci = card;
 }
예제 #3
0
 public RBSPaymentServiceRequest(UserInfo user, CardInfos card, bool sendZeroAmount)
 {
     // Initialisation
     SetValues(user, card.GetPOS(), card.GetCardNumber(), card.GetExpirationDate(), card.GetHolderName(),
               card.GetRBSPaymentMethod(), sendZeroAmount);
 }