public ActionResult TransferUnallocatedModal(int id) { var transaction = paymentService.GetBankTransaction(id); var model = new TransferUnallocatedModel() { Transaction = transaction }; return(PartialView("_TransferModal", model)); }
public ActionResult TransferUnallocated(TransferUnallocatedModel model) { var success = true; var failureMessage = "There has been an error whilst refunding the payment."; try { var payment = paymentService.GetBankTransaction(model.Transaction.ID); if (payment != null) { if (model.PayerID <= 0) { failureMessage += " You must select a payer to transfer to."; success = false; } if (model.Amount <= 0) { failureMessage += " The amount to transfer must be more than £0.00."; success = false; } else { paymentService.TransferCustomerPayment(payment, model.PayerID, model.Notes, model.Amount); } } } catch (Exception ex) { success = false; loggingService.LogException(ex); } SetFeedbackMessage(success, "Payment has been transferred.", failureMessage); return(RedirectToSamePage()); }