Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tzsd 729 sdk com settle #1

Open
wants to merge 35 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
6c00db6
v1.0.0: Fix import packages on examples
FilipeMata Nov 8, 2017
27f2e93
v1.0.0: CI
FilipeMata Nov 8, 2017
a931ffb
v1.0.0: Update README
FilipeMata Nov 8, 2017
0faaeee
v1.0.0: Update README
FilipeMata Nov 8, 2017
3cff19e
v1.0.0: Update README
FilipeMata Nov 8, 2017
1744183
v1.0.0: Fix CI
FilipeMata Nov 8, 2017
add5b66
v1.0.0: Fix CI
FilipeMata Nov 8, 2017
8697e6e
v1.0.0: Hide example folder at build
FilipeMata Nov 8, 2017
a7885d7
v1.0.0: Fix CI
FilipeMata Nov 8, 2017
a6fdbc7
v1.0.0: Fix example folder imports
FilipeMata Nov 8, 2017
4765a10
Update README.md
FilipeMata Nov 8, 2017
233ca37
Merge branch 'master' of https://github.com/gerencianet/gn-api-sdk-go
FilipeMata Nov 8, 2017
202294a
v1.0.0: Add codeclimate
FilipeMata Nov 8, 2017
1ed9fe7
v1.0.0: Fix codeclimate
FilipeMata Nov 8, 2017
e8d7c70
v1.0.0: Fix codeclimate
FilipeMata Nov 8, 2017
991f432
v1.0.0: Fix codeclimate
FilipeMata Nov 8, 2017
c1c3e4a
v1.0.0: change codeclimate
FilipeMata Nov 8, 2017
d09c5e4
v1.0.0: update codeclimate
FilipeMata Nov 8, 2017
34d1786
v1.0.0: update codeclimate
FilipeMata Nov 8, 2017
162902b
v1.0.0: cacel codeclimate due there's no support for golang
FilipeMata Nov 8, 2017
93a48a1
v1.0.1: Add new endpoints
FilipeMata Jan 8, 2018
1daaeb6
v1.0.2: Add new endpoint
Jul 9, 2018
e7c77de
TZSD_729-SDK-com-Settle:Foi adicionado dois endpoints (SettleCharge e…
Dec 26, 2018
a358e0a
TZSD_729-SDK-com-Settle:Foi adicionado dois endpoints (SettleCharge e…
Dec 26, 2018
b262db0
Merge branch 'master' into TZSD_729-SDK-com-Settle
Thiagogresende Dec 27, 2018
d7cd6a2
Merge pull request #1 from gerencianet/TZSD_729-SDK-com-Settle
Thiagogresende Dec 27, 2018
9c18594
Add new endpoint (one step)
Aug 28, 2019
baac121
Merge pull request #2 from dmalberto/master
WhinterGoncalves Aug 29, 2019
4d387cb
Minor release: endpoints
Sep 9, 2019
b601be0
add: New examples onestep marketplace
SadyCoimbraEfi Sep 20, 2019
cc0e9ed
Update create_charge_onestep_billet_marketplace.go
WhinterGoncalves Sep 24, 2019
c90da26
Update create_charge_onestep_credit_card_marketplace.go
WhinterGoncalves Sep 24, 2019
a631ad4
add: New examples onestep marketplace
WhinterGoncalves Sep 24, 2019
8f53168
Inclusão dos endpoints Pix
matheus-rodriguesGN Jul 26, 2021
e099d19
Merge pull request #4 from matheus-rodriguesGN/master
matheus-rodriguesGN Jul 26, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
language: go
sudo: false
go:
- 1.8
before_install:
- go get -t ./...
- go get github.com/mattn/goveralls
script:
- $GOPATH/bin/goveralls -service=travis-ci
21 changes: 20 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
# 1.1.0

- Added: new endpoint (one step)

# 1.0.3

- Added: new endpoint (settle charge)
- Added: new endpoint (settle parcel carnet)

# 1.0.2

- Added: new endpoint (create charge balance sheet)

# 1.0.1

- Added: new endpoint (update plan)
- Added: new endpoint (create subscription history)
- Updated: examples

# 1.0.0

- Initial release
- Initial release
158 changes: 83 additions & 75 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,75 +1,83 @@
# gn-api-sdk-go

> A go library for integration of your backend with the Gerencianet payment services.

## Installation

Install with:

```bash
$ go get github.com/FilipeMata/gn-api-sdk-go/gerencianet
```
## Tested with
```
go 1.8
```
## Basic usage

```go

import (
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
)

credentials := map[string]interface{} {
"client_id": "client_id",
"client_secret": "client_secret",
"sandbox": true,
"timeout": 10,
}

gn := gerencianet.NewGerencianet(credentials)

body = {
"items": [{
"name": "Product 1",
"value": 1000,
"amount": 2,
}],
"shippings": [{
"name": "Default Shipping Cost",
"value": 100,
}]
}

res, err := gn.CreateCharge(body)

```

## Examples

You can run the examples inside `examples` with
`$ go run example.go`:

```bash
$ go run charge/create_charge.go
```

Just remember to set the correct credentials inside `examples/configs.go` before running.

## Tests

To run the tests, just run:

```bash
$ go test
```

## Changelog

[CHANGELOG](CHANGELOG.md)


## License

The library is available as open source under the terms of the [MIT License](LICENSE).
# gn-api-sdk-go

> A go library for integration of your backend with the payment services
provided by [Gerencianet](http://gerencianet.com.br).

[![Build Status](https://travis-ci.org/gerencianet/gn-api-sdk-go.svg)](https://travis-ci.org/gerencianet/gn-api-sdk-go)
[![Coverage Status](https://coveralls.io/repos/github/gerencianet/gn-api-sdk-go/badge.svg?branch=master)](https://coveralls.io/github/gerencianet/gn-api-sdk-go?branch=master)

## Installation

Install with:

```bash

$ go get github.com/gerencianet/gn-api-sdk-go/gerencianet
$ go mod init github.com/gerencianet/gn-api-sdk-go
```
## Tested with
```
go 1.8, 1.11.4 and 1.16.5

```
## Basic usage

```go

import (
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

credentials := map[string]interface{} {
"client_id": "client_id",
"client_secret": "client_secret",
"sandbox": true,
"timeout": 10,
}

gn := gerencianet.NewGerencianet(credentials)

body = {
"items": [{
"name": "Product 1",
"value": 1000,
"amount": 2,
}],
"shippings": [{
"name": "Default Shipping Cost",
"value": 100,
}]
}

res, err := gn.CreateCharge(body)

```

## Examples

You can run the examples inside `_examples` with
`$ go run example.go`:

```bash
$ go run charge/create_charge.go
```

Just remember to set the correct credentials inside `examples/configs.go` before running.

## Tests

To run the tests, just run:

```bash
$ go test
```

## Changelog

[CHANGELOG](CHANGELOG.md)


## License

The library is available as open source under the terms of the [MIT License](LICENSE).
8 changes: 5 additions & 3 deletions examples/configs/configs.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
package configs

var Credentials = map[string]interface{} {
"client_id": "Your Client_Id",
"client_secret": "Your Client_Secret",
"sandbox": true,
"client_id": "Client_Id_cc838f2acc53d20df92a4211a768c10c392f96ac",
"client_secret": "Client_Secret_74ec12aed00def635deca9a19cf6e24b1010c721",
"sandbox": false,
"timeout": 20,
"CA" : "",
"Key" : "",
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
20 changes: 20 additions & 0 deletions examples/default/carnet/settle_parcel.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package main

import (
"fmt"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"

func main(){

credentials := configs.Credentials
gn := gerencianet.NewGerencianet(credentials)

res, err := gn.SettleCarnetParcel(1, 1) // no lugar dos 1s coloque o carnet_id e o numero da parcela respectivamente

if err != nil {
fmt.Println(err)
} else {
fmt.Println(res)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
4 changes: 2 additions & 2 deletions examples/charge/card.go → examples/default/charge/card.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package main

import (
"fmt"
"github.com/FilipeMata/gn-api-sdk-go/gerencianet"
"github.com/FilipeMata/gn-api-sdk-go/examples/configs"
"github.com/gerencianet/gn-api-sdk-go/gerencianet"
"github.com/gerencianet/gn-api-sdk-go/examples/configs"
)

func main(){
Expand Down
Loading