示例#1
0
 protected override void OnStop()
 {
     ValidateCodeline.Stop();
     ValidateTransaction.Stop();
     CheckThirdParty.Stop();
     CorrectCodeline.Stop();
     CorrectTransaction.Stop();
     GenerateVoucher.Stop();
     GetVoucher.Stop();
 }
示例#2
0
        protected override void OnStart(string[] args)
        {
            Log.Information("Dips Service Started");

            ValidateCodeline.Start();
            ValidateTransaction.Start();
            CheckThirdParty.Start();
            CorrectCodeline.Start();
            CorrectTransaction.Start();
            GenerateVoucher.Start();
            GetVoucher.Start();
        }
 public ActionResult Edit(Transaction transaction)
 {
     if (ValidateTransaction.IsValid(transaction))
     {
         ServiceFactory.GetTransactionServices().Update(transaction);
         return(RedirectToAction("Index"));
     }
     else
     {
         ViewBag.Error = ValidateTransaction.Message;
         return(View());
     }
 }
示例#4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public async Task <TransactionResult> PayAsync(Transaction transaction)
        {
            try
            {
                //
                var validateResult = await ValidateTransaction.ValidateModelAsync(transaction, Domain.Enums.TransactionType.Pay);

                if (validateResult.Status == Domain.Enums.TransactionStatus.Error)
                {
                    return(validateResult);
                }
                //
                return(await TransactionPool.ExecuteAsync(transaction, Domain.Enums.TransactionType.Pay));
            }
            catch
            {
                throw;
            }
        }
示例#5
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="transaction"></param>
        /// <returns></returns>
        public async Task <TransactionResult> VoidAsync(string OrderId)
        {
            try
            {
                //
                var transaction = new Transaction {
                    OrderId = OrderId
                };
                var validateResult = await ValidateTransaction.ValidateModelAsync(transaction, Domain.Enums.TransactionType.Chargeback);

                if (validateResult.Status == Domain.Enums.TransactionStatus.Error)
                {
                    return(validateResult);
                }
                //
                return(await TransactionPool.ExecuteAsync(transaction, Domain.Enums.TransactionType.Chargeback));
            }
            catch
            {
                throw;
            }
        }
示例#6
0
 public override bool IsValid()
 {
     ValidationResult = new ValidateTransaction().Validate(this);
     return(ValidationResult.IsValid);
 }