From e94b5709065e91f89fecab29bbffff4c015860fe Mon Sep 17 00:00:00 2001 From: elraphty Date: Tue, 10 Sep 2024 10:54:15 +0100 Subject: [PATCH] added logging to v2 generate invoice --- handlers/tribes.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/handlers/tribes.go b/handlers/tribes.go index 03e1d9e76..92a2d2b53 100644 --- a/handlers/tribes.go +++ b/handlers/tribes.go @@ -681,10 +681,14 @@ func (th *tribeHandler) GenerateV2BudgetInvoice(w http.ResponseWriter, r *http.R url := fmt.Sprintf("%s/invoice", config.V2BotUrl) + fmt.Println("BOT URL ====", url) + amountMsat := invoice.Amount * 1000 bodyData := fmt.Sprintf(`{"amt_msat": %d}`, amountMsat) + fmt.Println("Invoice BODY DATA ===", bodyData) + jsonBody := []byte(bodyData) client := &http.Client{} @@ -692,10 +696,10 @@ func (th *tribeHandler) GenerateV2BudgetInvoice(w http.ResponseWriter, r *http.R req.Header.Set("x-admin-token", config.V2BotToken) req.Header.Set("Content-Type", "application/json") - res, _ := client.Do(req) + res, err := client.Do(req) if err != nil { - log.Printf("Request Failed: %s", err) + log.Printf("Client Request Failed: %s", err) return }