https://github.com/danteay/oxxopay
short wrapper for oxxopay
https://github.com/danteay/oxxopay
cash conekta oxxo payment
Last synced: about 1 month ago
JSON representation
short wrapper for oxxopay
- Host: GitHub
- URL: https://github.com/danteay/oxxopay
- Owner: danteay
- License: gpl-3.0
- Created: 2017-05-11T18:53:00.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T19:10:41.000Z (almost 8 years ago)
- Last Synced: 2025-01-28T22:31:26.914Z (3 months ago)
- Topics: cash, conekta, oxxo, payment
- Language: Go
- Size: 13.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# OxxoPay Go
## Installing
```bash
go get https://github.com/danteay/oxxopay
```## Importing
```go
import op "github.com/danteay/oxxopay"
```## Usage
### Configuring
```go
privateApiKey := "key_asdRfdasASfadf"client := new(op.OpClient)
client.Init(privateApiKey)
```### CreateOrder
```go
data := op.RequestData{
"line_items": []op.RequestData{
op.RequestData{
"name": "La divina comedia",
"unit_price": 12345,
"quantity": 1,
},
},
"currency": "MXN",
"customer_info": op.RequestData{
"name": "Dante Aligeri",
"email": "[email protected]",
"phone": "+525561463627",
"charges": []op.RequestData{
op.RequestData{
"payment_method": op.RequestData{
"type": "oxxo_cash",
},
},
},
},
}response, errReq := client.CreateOrder(data)
fmt.Println(err)
fmt.Println(string(response))
```### Get Order Info
```go
orderId := "ord_bjhbkjntgfouvasd"response, errReq := client.GetOrder(orderId)
fmt.Println(err)
fmt.Println(string(response))
```### Get List Orders
```go
response, errReq := client.GetListOrders(orderId)fmt.Println(err)
fmt.Println(string(response))
```