diff --git a/pkg/controllers/payinvoice.ctrl.go b/pkg/controllers/payinvoice.ctrl.go index 169c881..bc3508c 100644 --- a/pkg/controllers/payinvoice.ctrl.go +++ b/pkg/controllers/payinvoice.ctrl.go @@ -10,19 +10,18 @@ type PayInvoiceController struct{} // PayInvoice : Pay invoice Controller func (PayInvoiceController) PayInvoice(c echo.Context) error { - var body struct { - ID uint `json:"id"` + var reqBody struct { Invoice string `json:"invoice" validate:"required"` Amount int `json:"amount" validate:"gt=0"` } - if err := c.Bind(&body); err != nil { + if err := c.Bind(&reqBody); err != nil { return c.JSON(http.StatusBadRequest, echo.Map{ "message": "failed to bind json", }) } - if err := c.Validate(&body); err != nil { + if err := c.Validate(&reqBody); err != nil { return c.JSON(http.StatusBadRequest, echo.Map{ "message": "invalid request", })