diff --git a/examples/create_charge_onestep_billet_marketplace.rb b/examples/create_charge_onestep_billet_marketplace.rb new file mode 100755 index 0000000..0c1e3f5 --- /dev/null +++ b/examples/create_charge_onestep_billet_marketplace.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, + marketplace: { + repasses: [{ + payee_code: "Insira_aqui_o_indentificador_da_conta_destino", + percentage: 2500 + }, { + payee_code: "Insira_aqui_o_indentificador_da_conta_destino", + percentage: 1500 + }] + } + }], + shippings: [{ + name: "Default Shipping Cost", + value: 100 + }], + payment: { + banking_billet: { + expire_at: '2020-09-09', + 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_marketplace.rb b/examples/create_charge_onestep_creditcard_marketplace.rb new file mode 100755 index 0000000..219d81d --- /dev/null +++ b/examples/create_charge_onestep_creditcard_marketplace.rb @@ -0,0 +1,54 @@ +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, + marketplace: { + repasses: [{ + payee_code: "Insira_aqui_o_indentificador_da_conta_destino", + percentage: 2500 + }, { + payee_code: "Insira_aqui_o_indentificador_da_conta_destino", + percentage: 1500 + }] + } + }], + shippings: [{ + name: "Default Shipping Cost", + value: 100 + }], + payment: { + credit_card: { + installments: 1, + payment_token: "InsiraAquiOPayment_token", + 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) +