Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ndolestudio/ynote-go
Unofficial SDK for the Y-Note API
https://github.com/ndolestudio/ynote-go
api-client orange-money orange-money-cameroon y-note
Last synced: about 1 month ago
JSON representation
Unofficial SDK for the Y-Note API
- Host: GitHub
- URL: https://github.com/ndolestudio/ynote-go
- Owner: NdoleStudio
- License: mit
- Created: 2024-11-07T18:14:01.000Z (2 months ago)
- Default Branch: main
- Last Pushed: 2024-12-01T15:52:48.000Z (about 1 month ago)
- Last Synced: 2024-12-07T00:41:27.699Z (about 1 month ago)
- Topics: api-client, orange-money, orange-money-cameroon, y-note
- Language: Go
- Homepage: https://www.y-note.cm/comment-integrer-lapi-de-remboursement-orange-money/
- Size: 30.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# ynote-go
[![Build](https://github.com/NdoleStudio/ynote-go/actions/workflows/main.yml/badge.svg)](https://github.com/NdoleStudio/ynote-go/actions/workflows/main.yml)
[![codecov](https://codecov.io/gh/NdoleStudio/ynote-go/branch/main/graph/badge.svg)](https://codecov.io/gh/NdoleStudio/ynote-go)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/NdoleStudio/ynote-go/badges/quality-score.png?b=main)](https://scrutinizer-ci.com/g/NdoleStudio/ynote-go/?branch=main)
[![Go Report Card](https://goreportcard.com/badge/github.com/NdoleStudio/ynote-go)](https://goreportcard.com/report/github.com/NdoleStudio/ynote-go)
[![GitHub contributors](https://img.shields.io/github/contributors/NdoleStudio/ynote-go)](https://github.com/NdoleStudio/ynote-go/graphs/contributors)
[![GitHub license](https://img.shields.io/github/license/NdoleStudio/ynote-go?color=brightgreen)](https://github.com/NdoleStudio/ynote-go/blob/master/LICENSE)
[![PkgGoDev](https://pkg.go.dev/badge/github.com/NdoleStudio/ynote-go)](https://pkg.go.dev/github.com/NdoleStudio/ynote-go)This package provides a generic `go` client for the Y-Note API
## Installation
`ynote-go` is compatible with modern Go releases in module mode, with Go installed:
```bash
go get github.com/NdoleStudio/ynote-go
```Alternatively the same can be achieved if you use `import` in a package:
```go
import "github.com/NdoleStudio/ynote-go"
```## Implemented
- **Token**
- `POST /oauth2/token`: Get Access Token
- **Refund**
- `POST /prod/refund`: Refund a transaction
- `GET /prod/refund/status/{transactionID}`: Get the status of a refund transaction## Usage
### Initializing the Client
An instance of the client can be created using `New()`.
```go
package mainimport (
"github.com/NdoleStudio/ynote-go"
)func main() {
client := ynote.New(
ynote.WithClientID(""),
ynote.WithClientSecret(""),
)
}
```### Error handling
All API calls return an `error` as the last return object. All successful calls will return a `nil` error.
```go
transaction, response, err := client.Refund.Status(context.Background(), "messageID")
if err != nil {
//handle error
}
```## Testing
You can run the unit tests for this client from the root directory using the command below:
```bash
go test -v
```## License
This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details