Skip to content

Commit

Permalink
added logging to v2 generate invoice
Browse files Browse the repository at this point in the history
  • Loading branch information
elraphty committed Sep 10, 2024
1 parent 31edf7a commit b20b63c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions handlers/tribes.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,21 +681,25 @@ 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{}
req, _ := http.NewRequest(http.MethodPost, url, bytes.NewBuffer(jsonBody))

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
}

Expand Down

0 comments on commit b20b63c

Please sign in to comment.