From 7f252bc030884f844ddcd1149ede1c1183839448 Mon Sep 17 00:00:00 2001 From: MarcEricMartel <74071476+MarcEricMartel@users.noreply.github.com> Date: Thu, 8 Dec 2022 17:59:45 -0800 Subject: [PATCH] Update InvoiceController.cs --- .../GrossesMitainesAPI/Controllers/InvoiceController.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs b/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs index b954c59..e51bf90 100644 --- a/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs +++ b/GrossesMitaines/GrossesMitainesAPI/Controllers/InvoiceController.cs @@ -81,6 +81,9 @@ public class InvoiceController : Controller { var service = new ChargeService(); Charge charge = service.Create(options); + if (charge.FailureMessage is not null && charge.FailureMessage != "") + return Json(charge.ToJson()); + try { _context.Invoices.Update(inv); _context.SaveChanges();