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: 3 months 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 (8 months ago)
- Default Branch: main
- Last Pushed: 2025-03-03T07:53:20.000Z (4 months ago)
- Last Synced: 2025-03-28T08:38:00.230Z (3 months 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: 38.1 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
[](https://github.com/NdoleStudio/ynote-go/actions/workflows/main.yml)
[](https://codecov.io/gh/NdoleStudio/ynote-go)
[](https://scrutinizer-ci.com/g/NdoleStudio/ynote-go/?branch=main)
[](https://goreportcard.com/report/github.com/NdoleStudio/ynote-go)
[](https://github.com/NdoleStudio/ynote-go/graphs/contributors)
[](https://github.com/NdoleStudio/ynote-go/blob/master/LICENSE)
[](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