gerencianet 0.0.13 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.travis.yml +2 -2
- data/CHANGELOG.md +18 -0
- data/README.md +4 -4
- data/examples/certs/developmentCertificate.pem +0 -0
- data/examples/certs/productionCertificate.pem +0 -0
- data/examples/credentials.rb +4 -2
- data/examples/{cancel_carnet.rb → default/carnet/cancel_carnet.rb} +2 -2
- data/examples/{cancel_parcel.rb → default/carnet/cancel_parcel.rb} +2 -2
- data/examples/{create_carnet.rb → default/carnet/create_carnet.rb} +3 -3
- data/examples/{create_carnet_history.rb → default/carnet/create_carnet_history.rb} +2 -2
- data/examples/{detail_carnet.rb → default/carnet/detail_carnet.rb} +2 -2
- data/examples/{resend_carnet.rb → default/carnet/resend_carnet.rb} +3 -3
- data/examples/{resend_parcel.rb → default/carnet/resend_parcel.rb} +3 -3
- data/examples/default/carnet/settle_carnet_parcel.rb +16 -0
- data/examples/{update_carnet_metadata.rb → default/carnet/update_carnet_metadata.rb} +2 -2
- data/examples/{update_parcel.rb → default/carnet/update_parcel.rb} +2 -2
- data/examples/{all_in_one.rb → default/charge/all_in_one.rb} +3 -3
- data/examples/{cancel_charge.rb → default/charge/cancel_charge.rb} +2 -2
- data/examples/{charge_link.rb → default/charge/charge_link.rb} +2 -2
- data/examples/{create_billet_payment.rb → default/charge/create_billet_payment.rb} +4 -4
- data/examples/{create_card_payment.rb → default/charge/create_card_payment.rb} +3 -3
- data/examples/{create_charge.rb → default/charge/create_charge.rb} +2 -2
- data/examples/{create_charge_balance_sheet.rb → default/charge/create_charge_balance_sheet.rb} +2 -2
- data/examples/{create_charge_history.rb → default/charge/create_charge_history.rb} +2 -2
- data/examples/default/charge/create_charge_onestep.rb +36 -0
- data/examples/default/charge/create_charge_onestep_creditcard.rb +45 -0
- data/examples/{detail_charge.rb → default/charge/detail_charge.rb} +2 -2
- data/examples/{resend_billet.rb → default/charge/resend_billet.rb} +3 -3
- data/examples/default/charge/settle_charge.rb +15 -0
- data/examples/{update_billet.rb → default/charge/update_billet.rb} +2 -2
- data/examples/{update_charge_link.rb → default/charge/update_charge_link.rb} +2 -2
- data/examples/{update_charge_metadata.rb → default/charge/update_charge_metadata.rb} +2 -2
- data/examples/default/marketplace/create_charge_onestep_billet_marketplace.rb +45 -0
- data/examples/default/marketplace/create_charge_onestep_creditcard_marketplace.rb +54 -0
- data/examples/{get_notification.rb → default/notification/get_notification.rb} +2 -2
- data/examples/{get_installments.rb → default/others/get_installments.rb} +2 -2
- data/examples/{cancel_subscription.rb → default/subscriptions/cancel_subscription.rb} +2 -2
- data/examples/{create_plan.rb → default/subscriptions/create_plan.rb} +2 -2
- data/examples/{create_subscription.rb → default/subscriptions/create_subscription.rb} +2 -2
- data/examples/{create_subscription_history.rb → default/subscriptions/create_subscription_history.rb} +2 -2
- data/examples/{create_subscription_payment.rb → default/subscriptions/create_subscription_payment.rb} +3 -3
- data/examples/{delete_plan.rb → default/subscriptions/delete_plan.rb} +2 -2
- data/examples/{detail_subscription.rb → default/subscriptions/detail_subscription.rb} +2 -2
- data/examples/{get_plans.rb → default/subscriptions/get_plans.rb} +2 -2
- data/examples/{update_plan.rb → default/subscriptions/update_plan.rb} +2 -2
- data/examples/{update_subscription_metadata.rb → default/subscriptions/update_subscription_metadata.rb} +2 -2
- data/examples/gn/account/pix_detail_balance.rb +16 -0
- data/examples/gn/account/pix_detail_settings.rb +17 -0
- data/examples/gn/account/pix_update_settings.rb +33 -0
- data/examples/gn/key/pix_create_evp.rb +17 -0
- data/examples/gn/key/pix_delete_evp.rb +20 -0
- data/examples/gn/key/pix_list_evp.rb +16 -0
- data/examples/pix/charge/pix_create_charge.rb +35 -0
- data/examples/pix/charge/pix_create_immediate_charge.rb +31 -0
- data/examples/pix/charge/pix_detail_charge.rb +21 -0
- data/examples/pix/charge/pix_list_charges.rb +21 -0
- data/examples/pix/charge/pix_update_charge.rb +26 -0
- data/examples/pix/location/pix_create_location.rb +20 -0
- data/examples/pix/location/pix_detail_location.rb +20 -0
- data/examples/pix/location/pix_generate_qrcode.rb +26 -0
- data/examples/pix/location/pix_list_location.rb +21 -0
- data/examples/pix/location/pix_unset_txid.rb +21 -0
- data/examples/pix/pix/pix_detail.rb +20 -0
- data/examples/pix/pix/pix_detail_devolution.rb +22 -0
- data/examples/pix/pix/pix_devolution.rb +27 -0
- data/examples/pix/pix/pix_list_received.rb +21 -0
- data/examples/pix/pix/pix_send.rb +27 -0
- data/examples/pix/webhooks/pix_config_webhook.rb +28 -0
- data/examples/pix/webhooks/pix_delete_webhook.rb +22 -0
- data/examples/pix/webhooks/pix_detail_webhook.rb +21 -0
- data/examples/pix/webhooks/pix_list_webhook.rb +22 -0
- data/gerencianet.gemspec +4 -4
- data/lib/gerencianet/constants.rb +263 -137
- data/lib/gerencianet/endpoints.rb +73 -20
- data/lib/gerencianet/status.rb +0 -0
- data/lib/gerencianet/version.rb +1 -1
- metadata +114 -82
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -16,4 +16,4 @@ body = {
|
|
16
16
|
}
|
17
17
|
|
18
18
|
gerencianet = Gerencianet.new(options)
|
19
|
-
puts gerencianet.resend_billet(params: params, body: body)
|
19
|
+
puts gerencianet.resend_billet(params: params, body: body)
|
@@ -0,0 +1,15 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
options = {
|
5
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
6
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
|
+
}
|
9
|
+
|
10
|
+
params = {
|
11
|
+
id: 553880
|
12
|
+
}
|
13
|
+
|
14
|
+
gerencianet = Gerencianet.new(options)
|
15
|
+
puts gerencianet.settle_charge(params: params)
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,11 +1,11 @@
|
|
1
1
|
require "gerencianet"
|
2
2
|
require "date"
|
3
|
-
require_relative "
|
3
|
+
require_relative "../../credentials"
|
4
4
|
|
5
5
|
options = {
|
6
6
|
client_id: CREDENTIALS::CLIENT_ID,
|
7
7
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
8
|
-
sandbox:
|
8
|
+
sandbox: CREDENTIALS::SANDBOX
|
9
9
|
}
|
10
10
|
|
11
11
|
expireAt = Date.today + 3
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -0,0 +1,45 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
options = {
|
5
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
6
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
|
+
}
|
9
|
+
|
10
|
+
body = {
|
11
|
+
items: [{
|
12
|
+
name: "Product 1",
|
13
|
+
value: 1000,
|
14
|
+
amount: 2,
|
15
|
+
marketplace: {
|
16
|
+
repasses: [{
|
17
|
+
payee_code: "Insira_aqui_o_indentificador_da_conta_destino",
|
18
|
+
percentage: 2500
|
19
|
+
}, {
|
20
|
+
payee_code: "Insira_aqui_o_indentificador_da_conta_destino",
|
21
|
+
percentage: 1500
|
22
|
+
}]
|
23
|
+
}
|
24
|
+
}],
|
25
|
+
shippings: [{
|
26
|
+
name: "Default Shipping Cost",
|
27
|
+
value: 100
|
28
|
+
}],
|
29
|
+
payment: {
|
30
|
+
banking_billet: {
|
31
|
+
expire_at: '2020-09-09',
|
32
|
+
customer: {
|
33
|
+
name: "Gorbadoc Oldbuck",
|
34
|
+
email: "oldbuck@gerencianet.com.br",
|
35
|
+
cpf: "94271564656",
|
36
|
+
birth: "1977-01-15",
|
37
|
+
phone_number: "5144916523"
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
gerencianet = Gerencianet.new(options)
|
44
|
+
puts gerencianet.create_charge_onestep(body: body)
|
45
|
+
|
@@ -0,0 +1,54 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
options = {
|
5
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
6
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
|
+
}
|
9
|
+
|
10
|
+
body = {
|
11
|
+
items: [{
|
12
|
+
name: "Product 1",
|
13
|
+
value: 1000,
|
14
|
+
amount: 2,
|
15
|
+
marketplace: {
|
16
|
+
repasses: [{
|
17
|
+
payee_code: "Insira_aqui_o_indentificador_da_conta_destino",
|
18
|
+
percentage: 2500
|
19
|
+
}, {
|
20
|
+
payee_code: "Insira_aqui_o_indentificador_da_conta_destino",
|
21
|
+
percentage: 1500
|
22
|
+
}]
|
23
|
+
}
|
24
|
+
}],
|
25
|
+
shippings: [{
|
26
|
+
name: "Default Shipping Cost",
|
27
|
+
value: 100
|
28
|
+
}],
|
29
|
+
payment: {
|
30
|
+
credit_card: {
|
31
|
+
installments: 1,
|
32
|
+
payment_token: "InsiraAquiOPayment_token",
|
33
|
+
billing_address: {
|
34
|
+
street: "Av. JK",
|
35
|
+
number: 909,
|
36
|
+
neighborhood: "Bauxita",
|
37
|
+
zipcode: "35400000",
|
38
|
+
city: "Ouro Preto",
|
39
|
+
state: "MG"
|
40
|
+
},
|
41
|
+
customer: {
|
42
|
+
name: "Gorbadoc Oldbuck",
|
43
|
+
email: "oldbuck@gerencianet.com.br",
|
44
|
+
cpf: "94271564656",
|
45
|
+
birth: "1977-01-15",
|
46
|
+
phone_number: "5144916523"
|
47
|
+
}
|
48
|
+
}
|
49
|
+
}
|
50
|
+
}
|
51
|
+
|
52
|
+
gerencianet = Gerencianet.new(options)
|
53
|
+
puts gerencianet.create_charge_onestep(body: body)
|
54
|
+
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
body = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
plan = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -26,7 +26,7 @@ body = {
|
|
26
26
|
customer: {
|
27
27
|
name: "Gorbadoc Oldbuck",
|
28
28
|
email: "oldbuck@gerencianet.com.br",
|
29
|
-
cpf: "
|
29
|
+
cpf: "94271564656",
|
30
30
|
birth: "1977-01-15",
|
31
31
|
phone_number: "5144916523"
|
32
32
|
}
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -1,10 +1,10 @@
|
|
1
1
|
require "gerencianet"
|
2
|
-
require_relative "
|
2
|
+
require_relative "../../credentials"
|
3
3
|
|
4
4
|
options = {
|
5
5
|
client_id: CREDENTIALS::CLIENT_ID,
|
6
6
|
client_secret: CREDENTIALS::CLIENT_SECRET,
|
7
|
-
sandbox:
|
7
|
+
sandbox: CREDENTIALS::SANDBOX
|
8
8
|
}
|
9
9
|
|
10
10
|
params = {
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
require "uri"
|
5
|
+
require "net/http"
|
6
|
+
require "openssl"
|
7
|
+
|
8
|
+
options = {
|
9
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
10
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
11
|
+
pix_cert: CREDENTIALS::PIX_CERT,
|
12
|
+
sandbox: CREDENTIALS::SANDBOX
|
13
|
+
}
|
14
|
+
|
15
|
+
gerencianet = Gerencianet.new(options)
|
16
|
+
puts gerencianet.pix_detail_balance()
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
require "uri"
|
5
|
+
require "net/http"
|
6
|
+
require "openssl"
|
7
|
+
|
8
|
+
options = {
|
9
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
10
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
11
|
+
pix_cert: CREDENTIALS::PIX_CERT,
|
12
|
+
sandbox: CREDENTIALS::SANDBOX
|
13
|
+
}
|
14
|
+
|
15
|
+
gerencianet = Gerencianet.new(options)
|
16
|
+
puts gerencianet.pix_detail_settings()
|
17
|
+
|
@@ -0,0 +1,33 @@
|
|
1
|
+
require "gerencianet"
|
2
|
+
require_relative "../../credentials"
|
3
|
+
|
4
|
+
require "uri"
|
5
|
+
require "net/http"
|
6
|
+
require "openssl"
|
7
|
+
|
8
|
+
options = {
|
9
|
+
client_id: CREDENTIALS::CLIENT_ID,
|
10
|
+
client_secret: CREDENTIALS::CLIENT_SECRET,
|
11
|
+
pix_cert: CREDENTIALS::PIX_CERT,
|
12
|
+
sandbox: CREDENTIALS::SANDBOX
|
13
|
+
}
|
14
|
+
|
15
|
+
body = {
|
16
|
+
pix: {
|
17
|
+
receberSemChave: true,
|
18
|
+
chaves: {
|
19
|
+
"sua_chave": {
|
20
|
+
recebimento: {
|
21
|
+
txidObrigatorio: true,
|
22
|
+
qrCodeEstatico: {
|
23
|
+
recusarTodos: false
|
24
|
+
}
|
25
|
+
}
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
}
|
30
|
+
|
31
|
+
gerencianet = Gerencianet.new(options)
|
32
|
+
puts gerencianet.pix_update_settings(body: body)
|
33
|
+
|