Merge pull request #48 from boltcard/lndhub-status-ok

Send OK response on successful BoltHub payment
This commit is contained in:
Peter Rounce 2023-03-24 10:27:25 +00:00 committed by GitHub
commit 0d3216ad99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -3,15 +3,16 @@ package lnurlw
import ( import (
"bytes" "bytes"
"encoding/json" "encoding/json"
"io"
"net/http"
"strconv"
"strings"
"github.com/boltcard/boltcard/db" "github.com/boltcard/boltcard/db"
"github.com/boltcard/boltcard/lnd" "github.com/boltcard/boltcard/lnd"
"github.com/boltcard/boltcard/resp_err" "github.com/boltcard/boltcard/resp_err"
decodepay "github.com/fiatjaf/ln-decodepay" decodepay "github.com/fiatjaf/ln-decodepay"
log "github.com/sirupsen/logrus" log "github.com/sirupsen/logrus"
"io"
"net/http"
"strconv"
"strings"
) )
type LndhubAuthRequest struct { type LndhubAuthRequest struct {
@ -146,14 +147,12 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
log.Info(string(b2)) log.Info(string(b2))
// var auth_keys LndhubAuthResponse log.Debug("sending 'status OK' response")
// err = json.Unmarshal([]byte(b), &auth_keys) w.Header().Set("Content-Type", "application/json")
// if err != nil { w.WriteHeader(http.StatusOK)
// log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn(err) jsonData := []byte(`{"status":"OK"}`)
// resp_err.Write(w) w.Write(jsonData)
// return
// }
} }