public void Init()
        {
            Mock<IPaymentService> mPaymentSrv = new Mock<IPaymentService>();
            mPaymentSrv.Setup(o => o.MakePayment(It.IsAny<PaymentRequest>())).Callback<PaymentRequest>(o => { this.paymentModelClb = o; });

            mPaymentSrv.Setup(o => o.ProcessResult(It.IsAny<string>()))
                .Returns(paymentResClb = ClassPropertyInitializator.SetProperties<PaymentResult>(new PaymentResult()));

            this.localMgr = new Mock<ILocalizationManager>();

            this.dbContext = new Mock<IGeneralDataHelper>();
            this.dbContext.Setup(o => o.Get(It.IsAny<Expression<Func<ApplicationForm, bool>>>())).Returns(() => new ApplicationForm());

            this.paymentLogic = new VetumaPaymentLogic(mPaymentSrv.Object, localMgr.Object, this.dbContext.Object);
        }
        /// <summary>
        /// Method saves Vetuma payment response results to db
        /// </summary>
        /// <param name="paymentResult">Vetuma response Model</param>
        /// <param name="applicationid">Application form Id</param>
        private void SavePaymentResponseModel(PaymentResult paymentResult, int applicationid)
        {
            var result = this.DbContext.Get<VetumaPayment>(o => o.ApplicationFormId == applicationid);

            if (result == null)
            {
                throw new ArgumentException(string.Format("Payment for application:  {0}  not found", applicationid));
            }

            if (paymentResult.TransactionId != result.TransactionId)
            {
                throw new ArgumentException("TransactionID does not match");
            }

            result.IsPaid = paymentResult.Success;
            result.PaymentId = paymentResult.PaymentId;
            result.ArchivingCode = paymentResult.ArchivingCode;
            result.PaymentDate = DateTime.Now;

            this.DbContext.Update<VetumaPayment>(result);
            this.DbContext.FlushChanges();
        }
        /// <summary>
        /// Method maps PaymentReslts object from Web to DB object.
        /// If passed object is null method returns null
        /// </summary>
        /// <param name="model">PaymentResult object</param>
        /// <returns>PaymentResultModel object</returns>
        public static model.PaymentResultModel ToWebPaymentResultModel(PaymentResult model)
        {
            if (model == null)
            {
                return null;
            }

            return new model.PaymentResultModel
            {
                ArchivingCode = model.ArchivingCode,
                OrderNumber = model.OrderNumber,
                PaymentId = model.PaymentId,
                ReferenceNumber = model.ReferenceNumber,
                Success = model.Success
            };
        }