Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/danteay/mercadopago
https://github.com/danteay/mercadopago
cash mercadopago oxxo payment
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/danteay/mercadopago
- Owner: danteay
- License: gpl-3.0
- Created: 2017-05-11T16:08:02.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-11T17:09:58.000Z (over 7 years ago)
- Last Synced: 2024-06-20T15:57:31.774Z (7 months ago)
- Topics: cash, mercadopago, oxxo, payment
- Language: Go
- Size: 17.6 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MercadoPago GO
Basic library for mercadopago
## Install
```bash
go get https://github.com/danteay/mercadopago
```## Usage
### Importing
```go
import mp "github.com/danteay/mercadopago"
```### Configuring
#### ClientId and ClientSecret
```go
clientId := "12345678987"
clientSecret := "iugbkjSfFewASndfvñjn1234"client := new(mp.MpClient)
client.Init(clientId, clientSecret)
```#### AccessToken
```go
accessToken := "APP_PP_iugbkjSfFewASndfvñjn1234nlkefa__T_TT__adfhbrjnkfkl"client := new(mp.MpClient)
client.Init(accessToken)
```### Create order
```go
paymentData := mp.RequestData{
"payer": mp.RequestData{
"type": "customer",
"email": "[email protected]",
"first_name": "Dante Aligeri",
"last_name": "",
},
"transaction_amount": 20,
"description": "Service expres - Service regular",
"payment_method_id": "oxxo",
}response, err := client.CreatePayment(paymentData)
fmt.Println(err)
fmt.Println(string(response))
```