This package provides an unofficial go client for the Smobilpay API
smobilpay-go is compatible with modern Go releases in module mode, with Go installed:
go get github.com/NdoleStudio/smobilpay-goAlternatively the same can be achieved if you use import in a package:
import "github.com/NdoleStudio/smobilpay-go"- Client
GET /ping: API Healthcheck endpointGET /verifytx: Get the current collection statusGET /historystd: Get the transaction historyPOST /quotestd: Initializes a transactionPOST /collectstd: Confirms a transaction
- Bill
GET /bill: Get details of a bill
- Subscription
GET /subscription: Get subscription pay items.
- Topup
GET /topup: Get available topup packages.
- Cashin
GET /cashin: Get cashin pay item.
- Cashout
GET /cashout: Get Cashout pay item.
- Product
GET /product: Get product pay items.
An instance of the client can be created using New().
package main
import (
"github.com/NdoleStudio/smobilpay-go"
)
func main() {
client := smobilpay.New(
smobilpay.WithAccessToken(accessToken),
smobilpay.WithAccessSecret(accessSecret),
)
}All API calls return an error as the last return object. All successful calls will return a nil error.
status, response, err := client.Ping(context.Background())
if err != nil {
//handle error
}You can run the unit tests for this client from the root directory using the command below:
go test -vThis project is licensed under the MIT License - see the LICENSE file for details
