diff --git a/controllers/keysend.ctrl.go b/controllers/keysend.ctrl.go index 0e2bd32..1bbb8f9 100644 --- a/controllers/keysend.ctrl.go +++ b/controllers/keysend.ctrl.go @@ -83,7 +83,7 @@ func (controller *KeySendController) KeySend(c echo.Context) error { for key, value := range reqBody.CustomRecords { intKey, err := strconv.Atoi(key) if err != nil { - return err + return c.JSON(http.StatusBadRequest, responses.BadArgumentsError) } invoice.DestinationCustomRecords[uint64(intKey)] = []byte(value) } diff --git a/integration_tests/util.go b/integration_tests/util.go index 9030694..06f009b 100644 --- a/integration_tests/util.go +++ b/integration_tests/util.go @@ -164,6 +164,8 @@ func (suite *TestSuite) createKeySendReq(amount int64, memo, destination, token Amount: amount, Destination: destination, Memo: memo, + //add memo as WHATSAT_MESSAGE custom record + CustomRecords: map[string]string{fmt.Sprint(service.TLV_WHATSAT_MESSAGE): memo}, })) req := httptest.NewRequest(http.MethodPost, "/keysend", &buf) req.Header.Set(echo.HeaderContentType, echo.MIMEApplicationJSON)