This package provides a generic go
client for the Y-Note API
ynote-go
is compatible with modern Go releases in module mode, with Go installed:
go get github.com/NdoleStudio/ynote-go
Alternatively the same can be achieved if you use import
in a package:
import "github.com/NdoleStudio/ynote-go"
- Token
POST /oauth2/token
: Get Access Token
- Refund
POST /prod/refund
: Refund a transactionGET /prod/refund/status/{transactionID}
: Get the status of a refund transaction
An instance of the client can be created using New()
.
package main
import (
"github.com/NdoleStudio/ynote-go"
)
func main() {
client := ynote.New(
ynote.WithClientID(""),
ynote.WithClientSecret(""),
)
}
All API calls return an error
as the last return object. All successful calls will return a nil
error.
transaction, response, err := client.Refund.Status(context.Background(), "messageID")
if err != nil {
//handle error
}
You can run the unit tests for this client from the root directory using the command below:
go test -v
This project is licensed under the MIT License - see the LICENSE file for details