Skip to content

inuoshios/paystack-go-sdk

Repository files navigation

Paystack Golang SDK

🐈 An unofficial Golang SDK for Paystack.

Installation

To install this package, use the command below

go get github.com/rxxcc/paystack-go-sdk

Usage/Examples

Import the package

import "github.com/rxxcc/paystack-go-sdk"

Get your keys from your Paystack dashboard and add it into your environment variables

To initialize a new client

package main

import (
    paystack "github.com/rxxcc/paystack-go-sdk"
)

var (
    sKeys = "{Your secret key}"
)

func main() {
    // Handle error
    newClient, _ := paystack.NewClient(sKeys)
}

To create a new transaction

// --------------------------------- //
func main() {
    testCase := &paystack.TransactionBody{
		Amount:   "300",
		Email:    "test@test.com",
	}
    transactionData, err := newClient.InitializeTransaction(transactionData)
}

License

MIT

Author

Inu John O.