From 829a7c1ed4732115a298e36499098127079c9c91 Mon Sep 17 00:00:00 2001 From: Benson Samaasi Date: Sat, 20 Jun 2026 03:49:01 +0100 Subject: [PATCH 1/2] feat(docs): update README for v2, add examples and installation instructions --- README.md | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index ebb6577..5cee992 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,9 @@ # Paystack SDK for Go -[![Go Reference](https://pkg.go.dev/badge/github.com/samaasi/paystack-sdk-go.svg)](https://pkg.go.dev/github.com/samaasi/paystack-sdk-go) -[![Go Report Card](https://goreportcard.com/badge/github.com/samaasi/paystack-sdk-go)](https://goreportcard.com/report/github.com/samaasi/paystack-sdk-go) +[![Go Reference](https://pkg.go.dev/badge/github.com/samaasi/paystack-sdk-go/v2.svg)](https://pkg.go.dev/github.com/samaasi/paystack-sdk-go/v2) +[![Go Report Card](https://goreportcard.com/badge/github.com/samaasi/paystack-sdk-go/v2)](https://goreportcard.com/report/github.com/samaasi/paystack-sdk-go/v2) +[![GitHub release](https://img.shields.io/github/v/release/samaasi/paystack-sdk-go)](https://github.com/samaasi/paystack-sdk-go/releases/latest) +[![codecov](https://codecov.io/gh/samaasi/paystack-sdk-go/branch/master/graph/badge.svg)](https://codecov.io/gh/samaasi/paystack-sdk-go) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) A comprehensive and robust Go SDK for the [Paystack API](https://paystack.com/docs/api/). This library provides a clean, idiomatic Go interface for integrating Paystack payments into your applications. @@ -20,7 +22,7 @@ A comprehensive and robust Go SDK for the [Paystack API](https://paystack.com/do ## Installation ```bash -go get github.com/samaasi/paystack-sdk-go +go get github.com/samaasi/paystack-sdk-go/v2@v2.0.0 ``` ## Usage @@ -74,8 +76,8 @@ import ( "log" "os" - paystack "github.com/samaasi/paystack-sdk-go" - "github.com/samaasi/paystack-sdk-go/paystackapi" + paystack "github.com/samaasi/paystack-sdk-go/v2" + "github.com/samaasi/paystack-sdk-go/v2/paystackapi" "github.com/samaasi/paystack-sdk-go/service/transactions" ) @@ -119,8 +121,8 @@ import ( "fmt" "log" - paystack "github.com/samaasi/paystack-sdk-go" - "github.com/samaasi/paystack-sdk-go/paystackapi" + paystack "github.com/samaasi/paystack-sdk-go/v2" + "github.com/samaasi/paystack-sdk-go/v2/paystackapi" "github.com/samaasi/paystack-sdk-go/service/transactions" ) @@ -241,6 +243,17 @@ ctx := paystackapi.WithCustomHeader(context.Background(), "X-Custom-Header", "Va - Verification - Virtual Accounts +## Examples + +Runnable examples are available under [`examples/`](examples/): + +| Example | Description | +|---|---| +| [`initialize_transaction/`](examples/initialize_transaction/main.go) | Initialize a transaction and redirect to the Paystack checkout URL | +| [`verify_webhook/`](examples/verify_webhook/main.go) | IP allowlist + HMAC signature verification + event dispatch | +| [`pagination/`](examples/pagination/main.go) | Paginate a transaction list using the generic iterator | +| [`charge_returning_customer/`](examples/charge_returning_customer/main.go) | Charge an existing authorization with typed error handling | + ## Contributing Contributions are welcome! Please see [CONTRIBUTING.md](CONTRIBUTING.md) for details. From 37f30a60be5b197285053761b7a7fef670e448bc Mon Sep 17 00:00:00 2001 From: Benson Samaasi Date: Sat, 20 Jun 2026 03:49:13 +0100 Subject: [PATCH 2/2] feat(ci): add Codecov integration for test coverage reporting --- .github/workflows/test.yml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 367cd0b..14550d6 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,4 +28,11 @@ jobs: run: go vet ./... - name: Test - run: go test -v ./... + run: go test -v -coverprofile=coverage.out ./... + + - name: Upload coverage to Codecov + if: matrix.go-version == '1.23' + uses: codecov/codecov-action@v4 + with: + files: coverage.out + fail_ci_if_error: false