A Golang library to interact with Pagar.me API.
The documentation can be found in our Go Reference
This library covers the following features:
[Clients]
- Create new client
- Edit client
- Get client
- Get all clients
[Cards]
- Create card
- Read card
- Delete card
[Plans]
- Create plan
- Edit plan [Pending]
- Delete plan [Pending]
- Get plan [Pending]
- Get all plans [Pending]
[Subscribe]
- Create subscribe [Pending]
- Create subscribe with plan
- Edit subscribe [Pending]
- Cancel subscribe [Pending]
go get -u github.com/lucchesisp/pagarme-go
pagarme, err := pagarme.Dial("YOUR_API_SECRET")
if err != nil {
fmt.Println(err)
return
}
client := types.Client{
Code: "#00000001",
Name: "Lucas Santos",
Email: "[email protected]",
DocumentNumber: "12345678909",
DocumentType: "CPF",
Phones: types.Phone{
MobilePhone: types.PhoneFormat{
CountryCode: "55",
AreaCode: "11",
Number: "988888888",
},
HomePhone: types.PhoneFormat{
CountryCode: "55",
AreaCode: "11",
Number: "988888888",
},
},
Birthday: time.Now(),
Address: types.Address{
Country: "BR",
State: "SP",
City: "São Paulo",
Line1: "Rua Teste",
ZipCode: "01311000",
},
ClientType: "individual",
Gender: "male",
Metadata: "",
}
response, err := pagarme.CreateNewClient(context.Background(), &client)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(response)
If you support this project, consider buying me a coffee ;)