-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from dmalberto/master
Add new endpoint
- Loading branch information
Showing
7 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# 0.0.15 | ||
|
||
- Added: new endpoint (one step) | ||
|
||
# 0.0.14 | ||
|
||
- Added: new endpoint (settle charge) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
require "gerencianet" | ||
require_relative "./credentials" | ||
|
||
options = { | ||
client_id: CREDENTIALS::CLIENT_ID, | ||
client_secret: CREDENTIALS::CLIENT_SECRET, | ||
sandbox: true | ||
} | ||
|
||
body = { | ||
items: [{ | ||
name: "Product 1", | ||
value: 1000, | ||
amount: 2 | ||
}], | ||
shippings: [{ | ||
name: "Default Shipping Cost", | ||
value: 100 | ||
}], | ||
payment: { | ||
banking_billet: { | ||
expire_at: tomorrow.strftime, | ||
customer: { | ||
name: "Gorbadoc Oldbuck", | ||
email: "[email protected]", | ||
cpf: "04267484171", | ||
birth: "1977-01-15", | ||
phone_number: "5144916523" | ||
} | ||
} | ||
} | ||
} | ||
|
||
gerencianet = Gerencianet.new(options) | ||
puts gerencianet.create_charge_onestep(body: body) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
require "gerencianet" | ||
require_relative "./credentials" | ||
|
||
options = { | ||
client_id: CREDENTIALS::CLIENT_ID, | ||
client_secret: CREDENTIALS::CLIENT_SECRET, | ||
sandbox: true | ||
} | ||
|
||
body = { | ||
items: [{ | ||
name: "Product 1", | ||
value: 1000, | ||
amount: 2 | ||
}], | ||
shippings: [{ | ||
name: "Default Shipping Cost", | ||
value: 100 | ||
}], | ||
payment: { | ||
credit_card: { | ||
installments: 1, | ||
payment_token: "6426f3abd8688639c6772963669bbb8e0eb3c319", | ||
billing_address: { | ||
street: "Av. JK", | ||
number: 909, | ||
neighborhood: "Bauxita", | ||
zipcode: "35400000", | ||
city: "Ouro Preto", | ||
state: "MG" | ||
}, | ||
customer: { | ||
name: "Gorbadoc Oldbuck", | ||
email: "[email protected]", | ||
cpf: "94271564656", | ||
birth: "1977-01-15", | ||
phone_number: "5144916523" | ||
} | ||
} | ||
} | ||
} | ||
|
||
gerencianet = Gerencianet.new(options) | ||
puts gerencianet.create_charge_onestep(body: body) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# :nodoc: | ||
module Gerencianet | ||
VERSION = "0.0.14" | ||
VERSION = "0.0.15" | ||
end |