Skip to content

Commit

Permalink
Update module path, transfer from nndi-oss to golang-malawi
Browse files Browse the repository at this point in the history
  • Loading branch information
zikani03 committed Mar 9, 2023
1 parent f6e788d commit d82cfe7
Show file tree
Hide file tree
Showing 9 changed files with 16 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Unofficial library for working with DPOs APIs for payment processing in Go appl
> The APIs are likely to change very frequently until we get to a v1. ymmv...
```sh
$ go get github.com/nndi-oss/go-dpo
$ go get github.com/golang-malawi/go-dpo
```

Please check out [the examples](./examples/)
Expand Down
12 changes: 4 additions & 8 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import (
)

const (
defaultUA = "go-dpo: https://github.com/nndi-oss/go-dpo"
defaultUA = "go-dpo: https://github.com/golang-malawi/go-dpo"
)

// Client struct represents a client and it's configuration for working with the DPO API.
Expand Down Expand Up @@ -221,7 +221,7 @@ func (c *Client) VerifyToken(token *CreateTokenResponse) (*VerifyTokenResponse,
}

r := bytes.NewReader(xmlData)
var created = false
created := false

maxAttempts := c.maxAttempts

Expand All @@ -235,7 +235,6 @@ func (c *Client) VerifyToken(token *CreateTokenResponse) (*VerifyTokenResponse,
req.Header.Add("Cache-control", "no-cache")

resp, err := c.http.Do(req)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -326,7 +325,6 @@ func (c *Client) ChargeCreditCard(cardHolder, cardNumber, cvv, cardExpiry string
req.Header.Add("Cache-control", "no-cache")

resp, err := c.http.Do(req)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -386,7 +384,7 @@ func (c *Client) CancelToken(tokenStr string) (*CancelTokenResponse, error) {
}

r := bytes.NewReader(xmlData)
var created = false
created := false

maxAttempts := c.maxAttempts

Expand All @@ -400,7 +398,6 @@ func (c *Client) CancelToken(tokenStr string) (*CancelTokenResponse, error) {
req.Header.Add("Cache-control", "no-cache")

resp, err := c.http.Do(req)

if err != nil {
return nil, err
}
Expand Down Expand Up @@ -471,7 +468,7 @@ func (c *Client) RefundToken(tokenStr string, refundAmount *big.Float, refundRef
}

r := bytes.NewReader(xmlData)
var created = false
created := false

maxAttempts := c.maxAttempts

Expand All @@ -485,7 +482,6 @@ func (c *Client) RefundToken(tokenStr string, refundAmount *big.Float, refundRef
req.Header.Add("Cache-control", "no-cache")

resp, err := c.http.Do(req)

if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package dpo_test
import (
"testing"

"github.com/nndi-oss/go-dpo"
"github.com/golang-malawi/go-dpo"
"github.com/stretchr/testify/assert"
)

Expand Down
7 changes: 3 additions & 4 deletions doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,11 @@
//
// You are recommended to set the user agent for the client to some string that identifies your application.
//
// clientToken := os.Getenv("DPO_TOKEN")
// client := dpo.NewClient(clientToken, true)
// client.SetUserAgent("Example User Agent")
// clientToken := os.Getenv("DPO_TOKEN")
// client := dpo.NewClient(clientToken, true)
// client.SetUserAgent("Example User Agent")
//
// # Usage: Error Handling
//
// The dpo package exposes errors that are thrown from DPO API.
//
package dpo
3 changes: 1 addition & 2 deletions examples/chargecard/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,10 @@ import (
"os"
"time"

"github.com/nndi-oss/go-dpo"
"github.com/golang-malawi/go-dpo"
)

func main() {

clientToken := os.Getenv("DPO_TOKEN")

client := dpo.NewClient(clientToken, true)
Expand Down
6 changes: 3 additions & 3 deletions examples/fiber/go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/nndi-oss/go-dpo/examples/fiber
module github.com/golang-malawi/go-dpo/examples/fiber

replace github.com/nndi-oss/go-dpo => ../../
replace github.com/golang-malawi/go-dpo => ../../

go 1.18

require (
github.com/gofiber/fiber/v2 v2.38.1
github.com/gofiber/template v1.7.1
github.com/joho/godotenv v1.4.0
github.com/nndi-oss/go-dpo v0.0.0-00010101000000-000000000000
github.com/golang-malawi/go-dpo v0.0.0-00010101000000-000000000000
)

require (
Expand Down
2 changes: 1 addition & 1 deletion examples/fiber/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gofiber/template/html"
"github.com/joho/godotenv"

"github.com/nndi-oss/go-dpo"
"github.com/golang-malawi/go-dpo"
)

type DPOConfig struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
module github.com/nndi-oss/go-dpo
module github.com/golang-malawi/go-dpo

go 1.18

Expand Down
2 changes: 1 addition & 1 deletion token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"testing"
"time"

"github.com/nndi-oss/go-dpo"
"github.com/golang-malawi/go-dpo"
"github.com/stretchr/testify/assert"
)

Expand Down

0 comments on commit d82cfe7

Please sign in to comment.