Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
27 changes: 20 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.
Expand All @@ -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
Expand Down Expand Up @@ -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"
)

Expand Down Expand Up @@ -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"
)

Expand Down Expand Up @@ -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.
Expand Down
Loading