https://github.com/akbarfa49/tripay
GO Library for Tripay Payment Gateway
https://github.com/akbarfa49/tripay
golang golang-library payment-gateway tripay
Last synced: 3 months ago
JSON representation
GO Library for Tripay Payment Gateway
- Host: GitHub
- URL: https://github.com/akbarfa49/tripay
- Owner: akbarfa49
- License: mit
- Created: 2021-08-17T12:01:07.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-08-20T15:00:04.000Z (almost 4 years ago)
- Last Synced: 2024-06-20T11:09:28.527Z (11 months ago)
- Topics: golang, golang-library, payment-gateway, tripay
- Language: Go
- Homepage:
- Size: 16.6 KB
- Stars: 2
- Watchers: 1
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
Tripay Unofficial Library
===============IMPORTANT: Make sure you read the documentation and understand what these methods are used for!
need atleast Go Version 1.16 and above to use this package
## Instalation
```
go get github.com/akbarfa49/tripay
```## Example
```GO
tr := tripay.New("your-apikey","your-private-key","your-merchant-code",tripay.Development);req := tripay.RequestTransaction{
PaymentMethod: tripay.BNIVA,
MerchantRef: "INV69",
Amount: 20000,
CustomerName: "akbarfa",
CustomerEmail: "[email protected]",
CustomerPhone: "081234567891",
OrderItems: []tripay.Item{0: {Sku: "duar",Name: "duar",Price: 20000,Quantity: 1}},
}
b, err := tr.RequestClosedTransaction(req)
if err != nil {
log.Panic(err)
return
}
v:=tripay.ClosedTransactionResponse{}
if err := json.Unmarshal(b, &v); err != nil{
log.Panicln(err)
}
os.WriteFile("dump/requestclosed.json", b, 0644)
```## Testing
This package is tested using _test package.
Have Request? DM me on instagram.com/akbarfa49