Merge pull request #63 from boltcard/card-pin-number

update logging
This commit is contained in:
Peter Rounce 2023-07-26 08:33:47 +01:00 committed by GitHub
commit 85bde475a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -56,13 +56,13 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
card_name_parts := strings.Split(c.Card_name, ":")
if len(card_name_parts) != 2 {
log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn(err)
log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn("login:password not found")
resp_err.Write(w)
return
}
if len(card_name_parts[0]) != 20 || len(card_name_parts[1]) != 20 {
log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn(err)
log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id}).Warn("login:password badly formed")
resp_err.Write(w)
return
}
@ -72,7 +72,6 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
lhAuthRequest.Password = card_name_parts[1]
authReq, err := json.Marshal(lhAuthRequest)
log.Info(string(authReq))
req_auth, err := http.NewRequest("POST", lndhub_url+"/auth", bytes.NewBuffer(authReq))
if err != nil {
@ -101,6 +100,9 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
return
}
log.WithFields(log.Fields{"card_payment_id": p.Card_payment_id,
"resp_auth_bytes": resp_auth_bytes}).Info("issue 62")
var auth_keys LndhubAuthResponse
err = json.Unmarshal([]byte(resp_auth_bytes), &auth_keys)