-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add: New examples onestep marketplace
- Loading branch information
1 parent
3415be6
commit 8860415
Showing
2 changed files
with
99 additions
and
0 deletions.
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 |
---|---|---|
@@ -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) | ||
|
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,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) | ||
|