From d52b5bfa04e10fc92ea2d75e68068028c1c9c981 Mon Sep 17 00:00:00 2001 From: Ken Date: Sun, 23 May 2021 13:11:14 -0400 Subject: [PATCH] update paring link --- coverage.out | 46 +++++++++++++++++++++++---------------------- go.mod | 3 ++- go.sum | 6 ++++++ mockBTCPayClient.go | 7 +++++++ plugin.go | 9 +++++++++ plugin_test.go | 8 ++++++++ updateMods.sh | 2 ++ 7 files changed, 58 insertions(+), 23 deletions(-) create mode 100755 updateMods.sh diff --git a/coverage.out b/coverage.out index f0b000a..a453f32 100644 --- a/coverage.out +++ b/coverage.out @@ -1,24 +1,26 @@ mode: set -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:17.44,19.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:22.49,24.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:27.74,29.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:32.70,34.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:37.70,39.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:42.94,44.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:47.82,49.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:52.77,54.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:57.86,59.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:38.34,43.2 4 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:46.44,48.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:51.51,71.2 13 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:74.57,97.24 17 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:100.2,109.13 9 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:97.24,99.3 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:113.66,114.21 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:114.21,119.3 4 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:122.83,123.21 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:40.34,45.2 4 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:48.44,51.2 2 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:54.44,56.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:59.51,79.2 13 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:82.57,105.24 17 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:108.2,118.13 10 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:105.24,107.3 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:122.66,123.21 1 1 github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:123.21,128.3 4 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:132.75,134.2 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:137.53,141.16 4 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:144.2,144.12 1 1 -github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:141.16,143.3 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:131.83,132.21 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:132.21,137.3 4 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:141.75,143.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:146.53,150.16 4 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:153.2,153.12 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/plugin.go:150.16,152.3 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:19.44,21.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:24.51,26.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:29.49,31.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:34.74,36.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:39.70,41.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:44.70,46.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:49.94,51.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:54.82,56.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:59.77,61.2 1 1 +github.com/Ulbora/Six910BTCPayServerPlugin/mockBTCPayClient.go:64.86,66.2 1 1 diff --git a/go.mod b/go.mod index b654791..7e83581 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,8 @@ module github.com/Ulbora/Six910BTCPayServerPlugin go 1.15 require ( - github.com/Ulbora/BTCPayClient v1.0.0 + github.com/Ulbora/BTCPayClient v1.0.1 github.com/Ulbora/Level_Logger v1.0.2 github.com/btcsuite/btcd v0.21.0-beta + golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a // indirect ) diff --git a/go.sum b/go.sum index 48c8502..9784c36 100644 --- a/go.sum +++ b/go.sum @@ -39,6 +39,8 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE github.com/StackExchange/wmi v0.0.0-20180116203802-5d049714c4a6/go.mod h1:3eOhrUMpNV+6aFIbp5/iudMxNCF27Vw2OZgy4xEx0Fg= github.com/Ulbora/BTCPayClient v1.0.0 h1:hQByHlGBPmST3mQRJUXKhd8vUjxvJuLz5IMxWnAmbXQ= github.com/Ulbora/BTCPayClient v1.0.0/go.mod h1:9+M6EUN5UQJs0nUvk8E2b7yJ5a/XJzLkiOLdC5xTHDU= +github.com/Ulbora/BTCPayClient v1.0.1 h1:f2BQ3ShK132a4/2ji0Tq1NU9PiQkensp519ghBE9Jz4= +github.com/Ulbora/BTCPayClient v1.0.1/go.mod h1:9+M6EUN5UQJs0nUvk8E2b7yJ5a/XJzLkiOLdC5xTHDU= github.com/Ulbora/GoProxy v1.0.1 h1:7gFPaJdXDV3tFDSWYxpQx7SQmNKcZPrv4SMwxa+vFhA= github.com/Ulbora/GoProxy v1.0.1/go.mod h1:8qICy+U1tSywRYoy9RdP+Zm6G2nN2K1YcvMupVlkIYI= github.com/Ulbora/Level_Logger v1.0.2 h1:uhuNi1oSQ1zSDhuYQS7NEHqtR4lAYPGyW2XGwJZtxmk= @@ -110,6 +112,7 @@ github.com/cpuguy83/go-md2man/v2 v2.0.0/go.mod h1:maD7wRr/U5Z6m/iR4s+kqSMx2CaBsr github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhrIygKg= github.com/davecgh/go-spew v0.0.0-20171005155431-ecdeabc65495/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/deckarep/golang-set v0.0.0-20180603214616-504e848d77ea/go.mod h1:93vsz/8Wt4joVM7c2AVqh+YRMiUSc14yDtF28KmMOgQ= github.com/decred/dcrd/lru v1.0.0/go.mod h1:mxKOwFd7lFjN2GZYsiz/ecgqR6kkYAl+0pz0tEMk218= @@ -420,6 +423,8 @@ golang.org/x/crypto v0.0.0-20200115085410-6d4e4cb37c7d/go.mod h1:LzIPMQfyMNhhGPh golang.org/x/crypto v0.0.0-20200510223506-06a226fb4e37/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9 h1:psW17arqaxU48Z5kZ0CQnkZWQJsqcURM6tKiBApRjXI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a h1:kr2P4QFmQr29mSLA43kwrOcgcReGTfbE9N577tCTuBc= +golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5tA2iutPOUgjI07+tq3H3K9MVA1s8= golang.org/x/exp v0.0.0-20180321215751-8460e604b9de/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20180807140117-3d87b88a115f/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= @@ -473,6 +478,7 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20200813134508-3edf25e44fcc/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA= golang.org/x/net v0.0.0-20210220033124-5f55cee0dc0d/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw= diff --git a/mockBTCPayClient.go b/mockBTCPayClient.go index 1b2ded3..48801bc 100644 --- a/mockBTCPayClient.go +++ b/mockBTCPayClient.go @@ -1,6 +1,8 @@ package six910btcplugin import ( + "log" + cl "github.com/Ulbora/BTCPayClient" ) @@ -18,6 +20,11 @@ func (a *MockBTCPayClient) New() cl.Client { return a } +//SetLogLevel SetLogLevel +func (a *MockBTCPayClient) SetLogLevel(level int) { + log.Println("Setting log level on mock to ", level) +} + //GetClientID GetClientID func (a *MockBTCPayClient) GetClientID() string { return a.MockClientID diff --git a/plugin.go b/plugin.go index 4761e61..6740369 100644 --- a/plugin.go +++ b/plugin.go @@ -17,6 +17,7 @@ type Plugin interface { SetClient(c cl.Client) NewPairConnect(host string) *BTCPay CreateInvoice(inv *cl.InvoiceReq) *cl.InvoiceResponse + SetLogLevel(level int) } //PayPlugin PayPlugin @@ -32,6 +33,7 @@ type BTCPay struct { PrivateKey string Token string Host string + PairingURL string } //New New @@ -42,6 +44,12 @@ func (p *PayPlugin) New() Plugin { return p } +//SetLogLevel SetLogLevel +func (p *PayPlugin) SetLogLevel(level int) { + p.log.LogLevel = level + p.Client.SetLogLevel(level) +} + //SetClient SetClient func (p *PayPlugin) SetClient(c cl.Client) { p.Client = c @@ -105,6 +113,7 @@ func (p *PayPlugin) NewPairConnect(host string) *BTCPay { rtn.PrivateKey = pkh rtn.PublicKey = pub rtn.Token = resp.Data[0].Token + rtn.PairingURL = pairingURL return &rtn diff --git a/plugin_test.go b/plugin_test.go index 3377ff7..ccf5edb 100644 --- a/plugin_test.go +++ b/plugin_test.go @@ -150,3 +150,11 @@ func TestPayPlugin_CreateInvoice(t *testing.T) { // t.Fail() } + +func TestPayPlugin_SetLogLevel(t *testing.T) { + var ppi PayPlugin + var mc MockBTCPayClient + ppi.SetClient(mc.New()) + p := ppi.New() + p.SetLogLevel(3) +} diff --git a/updateMods.sh b/updateMods.sh new file mode 100755 index 0000000..e44e45d --- /dev/null +++ b/updateMods.sh @@ -0,0 +1,2 @@ +# GO111MODULE=on go get -u +go get -u all ./...