protected override void OnStop() { ValidateCodeline.Stop(); ValidateTransaction.Stop(); CheckThirdParty.Stop(); CorrectCodeline.Stop(); CorrectTransaction.Stop(); GenerateVoucher.Stop(); GetVoucher.Stop(); }
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()); } }
/// <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; } }
/// <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; } }
public override bool IsValid() { ValidationResult = new ValidateTransaction().Validate(this); return(ValidationResult.IsValid); }