diff --git a/CHANGELOG.md b/CHANGELOG.md index 72a5122..4c8ae10 100755 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 0.0.15 + +- Added: new endpoint (one step) + # 0.0.14 - Added: new endpoint (settle charge) diff --git a/examples/create_charge_onestep.rb b/examples/create_charge_onestep.rb new file mode 100755 index 0000000..a809cc8 --- /dev/null +++ b/examples/create_charge_onestep.rb @@ -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: "oldbuck@gerencianet.com.br", + cpf: "04267484171", + birth: "1977-01-15", + phone_number: "5144916523" + } + } + } +} + +gerencianet = Gerencianet.new(options) +puts gerencianet.create_charge_onestep(body: body) + diff --git a/examples/create_charge_onestep_creditcard.rb b/examples/create_charge_onestep_creditcard.rb new file mode 100755 index 0000000..d156aa9 --- /dev/null +++ b/examples/create_charge_onestep_creditcard.rb @@ -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: "oldbuck@gerencianet.com.br", + cpf: "94271564656", + birth: "1977-01-15", + phone_number: "5144916523" + } + } + } +} + +gerencianet = Gerencianet.new(options) +puts gerencianet.create_charge_onestep(body: body) + diff --git a/lib/gerencianet/constants.rb b/lib/gerencianet/constants.rb index 396398b..ea1cee8 100755 --- a/lib/gerencianet/constants.rb +++ b/lib/gerencianet/constants.rb @@ -143,6 +143,10 @@ module Constants route: "/charge/:id/balance-sheet", method: "post" }, + create_charge_onestep: { + route: "/charge/one-step", + method: "post" + }, settleCharge: { route: '/charge/:id/settle', method: 'put' diff --git a/lib/gerencianet/endpoints.rb b/lib/gerencianet/endpoints.rb old mode 100644 new mode 100755 diff --git a/lib/gerencianet/status.rb b/lib/gerencianet/status.rb old mode 100644 new mode 100755 diff --git a/lib/gerencianet/version.rb b/lib/gerencianet/version.rb index 25f0653..cb14590 100755 --- a/lib/gerencianet/version.rb +++ b/lib/gerencianet/version.rb @@ -1,4 +1,4 @@ # :nodoc: module Gerencianet - VERSION = "0.0.14" + VERSION = "0.0.15" end