fix formatting
This commit is contained in:
parent
f3949b1b59
commit
b4494c7ed3
11 changed files with 34 additions and 34 deletions
|
|
@ -3,12 +3,12 @@ package main
|
||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func random_hex() string {
|
func random_hex() string {
|
||||||
|
|
|
||||||
14
db/db.go
14
db/db.go
|
|
@ -47,13 +47,13 @@ type Transaction struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type Card_wipe_info struct {
|
type Card_wipe_info struct {
|
||||||
Id int
|
Id int
|
||||||
K0 string
|
K0 string
|
||||||
K1 string
|
K1 string
|
||||||
K2 string
|
K2 string
|
||||||
K3 string
|
K3 string
|
||||||
K4 string
|
K4 string
|
||||||
Uid string
|
Uid string
|
||||||
}
|
}
|
||||||
|
|
||||||
func open() (*sql.DB, error) {
|
func open() (*sql.DB, error) {
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,10 @@ import (
|
||||||
"github.com/aws/aws-sdk-go/aws/credentials"
|
"github.com/aws/aws-sdk-go/aws/credentials"
|
||||||
"github.com/aws/aws-sdk-go/aws/session"
|
"github.com/aws/aws-sdk-go/aws/session"
|
||||||
"github.com/aws/aws-sdk-go/service/ses"
|
"github.com/aws/aws-sdk-go/service/ses"
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Send_balance_email(recipient_email string, card_id int) {
|
func Send_balance_email(recipient_email string, card_id int) {
|
||||||
|
|
|
||||||
|
|
@ -1,10 +1,10 @@
|
||||||
package lndhub
|
package lndhub
|
||||||
|
|
||||||
import (
|
import (
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
|
||||||
"github.com/boltcard/boltcard/db"
|
"github.com/boltcard/boltcard/db"
|
||||||
"github.com/boltcard/boltcard/email"
|
"github.com/boltcard/boltcard/email"
|
||||||
)
|
)
|
||||||
|
|
||||||
func Pay_invoice(card_payment_id int, invoice string) {
|
func Pay_invoice(card_payment_id int, invoice string) {
|
||||||
|
|
|
||||||
|
|
@ -2,13 +2,13 @@ package lnurlp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/lnd"
|
||||||
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"github.com/boltcard/boltcard/lnd"
|
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Callback(w http.ResponseWriter, r *http.Request) {
|
func Callback(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package lnurlp
|
package lnurlp
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Response(w http.ResponseWriter, r *http.Request) {
|
func Response(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
package lnurlw
|
package lnurlw
|
||||||
|
|
||||||
import (
|
import (
|
||||||
decodepay "github.com/fiatjaf/ln-decodepay"
|
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"net/http"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
"io"
|
|
||||||
"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"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"io"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
func lndhub_payment(w http.ResponseWriter, p *db.Payment) {
|
func lndhub_payment(w http.ResponseWriter, p *db.Payment) {
|
||||||
|
|
@ -28,7 +28,7 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment) {
|
||||||
//the login JSON is held in the Card_name field
|
//the login JSON is held in the Card_name field
|
||||||
body := []byte(c.Card_name)
|
body := []byte(c.Card_name)
|
||||||
|
|
||||||
r, err := http.NewRequest("POST", lndhub_url + "/auth", bytes.NewBuffer(body))
|
r, err := http.NewRequest("POST", lndhub_url+"/auth", bytes.NewBuffer(body))
|
||||||
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)
|
||||||
|
|
@ -57,7 +57,7 @@ func lndhub_payment(w http.ResponseWriter, p *db.Payment) {
|
||||||
|
|
||||||
log.Info(string(b))
|
log.Info(string(b))
|
||||||
|
|
||||||
// fmt.Println(string(b))
|
// fmt.Println(string(b))
|
||||||
|
|
||||||
//lndhub.payinvoice API call
|
//lndhub.payinvoice API call
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -4,14 +4,14 @@ import (
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"errors"
|
"errors"
|
||||||
|
"github.com/boltcard/boltcard/crypto"
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"os"
|
"os"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/crypto"
|
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type ResponseData struct {
|
type ResponseData struct {
|
||||||
|
|
|
||||||
6
main.go
6
main.go
|
|
@ -1,13 +1,13 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/lnurlp"
|
||||||
|
"github.com/boltcard/boltcard/lnurlw"
|
||||||
"github.com/gorilla/mux"
|
"github.com/gorilla/mux"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"time"
|
"time"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/lnurlw"
|
|
||||||
"github.com/boltcard/boltcard/lnurlp"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var router = mux.NewRouter()
|
var router = mux.NewRouter()
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ package main
|
||||||
import (
|
import (
|
||||||
"database/sql"
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
log "github.com/sirupsen/logrus"
|
|
||||||
"net/http"
|
|
||||||
"github.com/boltcard/boltcard/db"
|
"github.com/boltcard/boltcard/db"
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
|
log "github.com/sirupsen/logrus"
|
||||||
|
"net/http"
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,11 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"github.com/boltcard/boltcard/db"
|
||||||
|
"github.com/boltcard/boltcard/resp_err"
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strconv"
|
"strconv"
|
||||||
"github.com/boltcard/boltcard/db"
|
|
||||||
"github.com/boltcard/boltcard/resp_err"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func wipeboltcard(w http.ResponseWriter, r *http.Request) {
|
func wipeboltcard(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue