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();