getnet_api 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +2 -2
- data/README.md +6 -6
- data/getnet_api.gemspec +1 -1
- data/lib/getnet_api/card.rb +4 -0
- data/lib/getnet_api/card_verification.rb +7 -7
- data/lib/getnet_api/customer.rb +3 -3
- data/lib/getnet_api/payment.rb +2 -2
- data/lib/getnet_api/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dc8a4b6dee92d375bbc43cc83367c0573d842a48
|
4
|
+
data.tar.gz: b64f13878e6462d61e7a1dade6a0e55d156a4bc2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1f9fe4599f2389c34c46cbc6528cbc168524f2db5c7a7100c3d5e8db298097cf1014cec7dc4e1d7aa1c1ecea3403c25dca436c305403ff5ecfbab8c5cff5fad
|
7
|
+
data.tar.gz: 54811bf2cc8d876a2302cb380e6b704c5a1d9002258a023ad157057065c8e10a8e9419f368d26055a89895adc5ecd8dc58f6f8fd2be26c59630942cd1f3e71dd
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -59,7 +59,7 @@ end
|
|
59
59
|
Nesse endpoint serão recebidos dados para os pagamentos.
|
60
60
|
|
61
61
|
|
62
|
-
### Montar [Endereço](
|
62
|
+
### Montar [Endereço](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Address)
|
63
63
|
|
64
64
|
```ruby
|
65
65
|
obj_endereco = GetnetApi::Address.new ({
|
@@ -73,7 +73,7 @@ obj_endereco = GetnetApi::Address.new ({
|
|
73
73
|
})
|
74
74
|
```
|
75
75
|
|
76
|
-
### Montar [Cliente](
|
76
|
+
### Montar [Cliente](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Customer)
|
77
77
|
|
78
78
|
```ruby
|
79
79
|
obj_cliente = GetnetApi::Customer.new ({
|
@@ -90,7 +90,7 @@ obj_cliente = GetnetApi::Customer.new ({
|
|
90
90
|
})
|
91
91
|
```
|
92
92
|
|
93
|
-
### Montar [Pedido](
|
93
|
+
### Montar [Pedido](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Order)
|
94
94
|
|
95
95
|
```ruby
|
96
96
|
obj_pedido = GetnetApi::Order.new ({
|
@@ -102,7 +102,7 @@ obj_pedido = GetnetApi::Order.new ({
|
|
102
102
|
|
103
103
|
---
|
104
104
|
|
105
|
-
### Montar [Pagamento](
|
105
|
+
### Montar [Pagamento](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Payment)
|
106
106
|
|
107
107
|
```ruby
|
108
108
|
obj_pagamento = GetnetApi::Payment.new ({
|
@@ -114,7 +114,7 @@ obj_pagamento = GetnetApi::Payment.new ({
|
|
114
114
|
```
|
115
115
|
## Criando um pagamento na GetNet do tipo Credit
|
116
116
|
|
117
|
-
### Montar [Cartão](
|
117
|
+
### Montar [Cartão](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Credit)
|
118
118
|
|
119
119
|
```ruby
|
120
120
|
obj_credit = GetnetApi::Credit.new ({
|
@@ -139,7 +139,7 @@ novo_pagamento = GetnetApi::Payment.create obj_pagamento, obj_credito, :credit
|
|
139
139
|
|
140
140
|
## Criando um pagamento na GetNet do tipo Boleto
|
141
141
|
|
142
|
-
### Montar [Boleto](
|
142
|
+
### Montar [Boleto](https://www.rubydoc.info/gems/getnet_api/GetnetApi/Boleto)
|
143
143
|
|
144
144
|
```ruby
|
145
145
|
obj_boleto = GetnetApi::Boleto.new ({
|
data/getnet_api.gemspec
CHANGED
data/lib/getnet_api/card.rb
CHANGED
@@ -5,14 +5,14 @@ module GetnetApi
|
|
5
5
|
require 'net/http'
|
6
6
|
|
7
7
|
# Metodo para verificar se o token gerado é valido.
|
8
|
-
def self.verify
|
8
|
+
def self.verify card
|
9
9
|
|
10
10
|
hash = {
|
11
|
-
"number_token" =>
|
12
|
-
"cardholder_name"
|
13
|
-
"expiration_month"
|
14
|
-
"expiration_year"
|
15
|
-
"security_code"
|
11
|
+
"number_token" => card.number_token.to_s,
|
12
|
+
"cardholder_name" => card.cardholder_name.to_s,
|
13
|
+
"expiration_month" => card.expiration_month.to_s,
|
14
|
+
"expiration_year" => card.expiration_year.to_s,
|
15
|
+
"security_code" => card.security_code.to_s
|
16
16
|
}
|
17
17
|
|
18
18
|
response = self.build_request self.endpoint, "post", hash
|
@@ -29,4 +29,4 @@ module GetnetApi
|
|
29
29
|
end
|
30
30
|
end
|
31
31
|
|
32
|
-
# GetnetApi::CardVerification.verify
|
32
|
+
# GetnetApi::CardVerification.verify card
|
data/lib/getnet_api/customer.rb
CHANGED
@@ -106,10 +106,10 @@ module GetnetApi
|
|
106
106
|
}
|
107
107
|
|
108
108
|
if tipo == :customer
|
109
|
-
customer.merge!({"address"
|
109
|
+
customer.merge!({"address" => address.to_request,})
|
110
110
|
elsif tipo == :payment
|
111
|
-
customer.merge!({"name"
|
112
|
-
customer.merge!({"billing_address"
|
111
|
+
customer.merge!({"name" => self.name.to_s,})
|
112
|
+
customer.merge!({"billing_address" => address.to_request,})
|
113
113
|
end
|
114
114
|
|
115
115
|
return customer
|
data/lib/getnet_api/payment.rb
CHANGED
@@ -82,9 +82,9 @@ module GetnetApi
|
|
82
82
|
}
|
83
83
|
|
84
84
|
if type == :boleto
|
85
|
-
payment.merge!({"boleto"
|
85
|
+
payment.merge!({"boleto" => obj.to_request,})
|
86
86
|
elsif :credit
|
87
|
-
payment.merge!({"credit"
|
87
|
+
payment.merge!({"credit" => obj.to_request,})
|
88
88
|
end
|
89
89
|
|
90
90
|
return payment
|
data/lib/getnet_api/version.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: getnet_api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- QW3 Software & Marketing
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rest-client
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 1.7.3
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version:
|
26
|
+
version: 1.7.3
|
27
27
|
description: Gem para utilização dos meios de pagamento Getnet - Uma empresa Santander
|
28
28
|
para integrar sua plataforma de forma segura e eficaz com as principais formas de
|
29
29
|
pagamento disponíveis no mercado.
|