update formatting
This commit is contained in:
parent
54f1274fa6
commit
0170019fee
1 changed files with 16 additions and 16 deletions
|
|
@ -9,24 +9,24 @@ import (
|
||||||
decodepay "github.com/fiatjaf/ln-decodepay"
|
decodepay "github.com/fiatjaf/ln-decodepay"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"io"
|
"io"
|
||||||
"strings"
|
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
type LndhubAuthRequest struct {
|
type LndhubAuthRequest struct {
|
||||||
Login string `json:"login"`
|
Login string `json:"login"`
|
||||||
Password string `json:"password"`
|
Password string `json:"password"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LndhubAuthResponse struct {
|
type LndhubAuthResponse struct {
|
||||||
RefreshToken string `json:"refresh_token"`
|
RefreshToken string `json:"refresh_token"`
|
||||||
AccessToken string `json:"access_token"`
|
AccessToken string `json:"access_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type LndhubPayInvoiceRequest struct {
|
type LndhubPayInvoiceRequest struct {
|
||||||
Invoice string `json:"invoice"`
|
Invoice string `json:"invoice"`
|
||||||
FreeAmount string `json:"freeamount"`
|
FreeAmount string `json:"freeamount"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt11, param_pr string) {
|
func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt11, param_pr string) {
|
||||||
|
|
@ -124,7 +124,7 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
|
||||||
|
|
||||||
req.Header.Add("Access-Control-Allow-Origin", "*")
|
req.Header.Add("Access-Control-Allow-Origin", "*")
|
||||||
req.Header.Add("Content-Type", "application/json")
|
req.Header.Add("Content-Type", "application/json")
|
||||||
req.Header.Add("Authorization", "Bearer " + auth_keys.AccessToken)
|
req.Header.Add("Authorization", "Bearer "+auth_keys.AccessToken)
|
||||||
|
|
||||||
res2, err := client.Do(req)
|
res2, err := client.Do(req)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
@ -144,14 +144,14 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment, bolt11 decodepay.Bolt1
|
||||||
|
|
||||||
log.Info(string(b2))
|
log.Info(string(b2))
|
||||||
|
|
||||||
// var auth_keys LndhubAuthResponse
|
// var auth_keys LndhubAuthResponse
|
||||||
|
|
||||||
// err = json.Unmarshal([]byte(b), &auth_keys)
|
// err = json.Unmarshal([]byte(b), &auth_keys)
|
||||||
// if err != nil {
|
// if err != nil {
|
||||||
// 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(err)
|
||||||
// resp_err.Write(w)
|
// resp_err.Write(w)
|
||||||
// return
|
// return
|
||||||
// }
|
// }
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue