private SingleResponse <long> ApproveAttachedCardOrder(AttachCardPaymentApprovalRequest request) { SingleResponse <long> response = new SingleResponse <long>() { ResultCode = ResultCodes.normal }; XBS.ActionResult result = new XBS.ActionResult(); switch (request.Type) { case OrderType.RATransfer: { if (request.SubType == 3) { PaymentOrder order = _xBService.GetPaymentOrder(request.Id); result = _xBService.ApprovePaymentOrder(order); } //else if (request.SubType == 6) //{ // BudgetPaymentOrder order = _xBService.GetBudgetPaymentOrder(request.Id); // result = _xBService.ApprovePaymentOrder(order); //} } break; case OrderType.LoanMature: { MatureOrder order = _xBService.GetMatureOrder(request.Id); result = _xBService.ApproveMatureOrder(order); } break; case OrderType.CommunalPayment: { UtilityPaymentOrder order = _xBService.GetUtilityPaymentOrder(request.Id); result = _xBService.ApproveUtilityPaymentOrder(order); } break; default: break; } response.Result = result.Id; response.ResultCode = ResultCodeFormatter.FromPersonalAccountSecurityService(result.ResultCode); response.Description = Utils.GetActionResultErrors(result.Errors); return(response); }
public IActionResult ApproveMatureOrder(ApproveIdRequest request) { if (ModelState.IsValid) { var response = new SingleResponse <long>() { ResultCode = ResultCodes.normal }; MatureOrder order = _cacheHelper.GetApprovalOrder <MatureOrder>(request.Id); ActionResult saveResult = _xbService.ApproveMatureOrder(order); response.ResultCode = ResultCodeFormatter.FromPersonalAccountSecurityService(saveResult.ResultCode); response.Result = saveResult.Id; response.Description = utils.GetActionResultErrors(saveResult.Errors); return(ResponseExtensions.ToHttpResponse(response)); } else { return(ValidationError.GetValidationErrorResponse(ModelState)); } }