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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5aab4ff1ccb3f001c28e65c81e62dd72fa8baa7c
4
- data.tar.gz: b7bba3dd819473f70285ed51a13ba71bb2e23ed0
3
+ metadata.gz: dc8a4b6dee92d375bbc43cc83367c0573d842a48
4
+ data.tar.gz: b64f13878e6462d61e7a1dade6a0e55d156a4bc2
5
5
  SHA512:
6
- metadata.gz: aaff9d29f48ccdfd366be7f611a24dff5d693a87eee4f3088309f7633f2ccba1f24e9be6ea7832324a4d86aa7c89027ac646cca5884e9088ef8d76474463bfa3
7
- data.tar.gz: 8d63931e1fa248e26883488300c54d62838ef7647d11cfa4c1012ca32bbef14dc4b52fcd2d1fb3046e23be4cce2fbddc88c6c9131d2f571e72db94de2cc445fc
6
+ metadata.gz: b1f9fe4599f2389c34c46cbc6528cbc168524f2db5c7a7100c3d5e8db298097cf1014cec7dc4e1d7aa1c1ecea3403c25dca436c305403ff5ecfbab8c5cff5fad
7
+ data.tar.gz: 54811bf2cc8d876a2302cb380e6b704c5a1d9002258a023ad157057065c8e10a8e9419f368d26055a89895adc5ecd8dc58f6f8fd2be26c59630942cd1f3e71dd
data/Gemfile.lock CHANGED
@@ -1,8 +1,8 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- getnet_api (0.1.0)
5
- rest-client
4
+ getnet_api (0.1.1)
5
+ rest-client (>= 1.7.3)
6
6
 
7
7
  GEM
8
8
  remote: https://rubygems.org/
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/Address)
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/Customer)
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/Order)
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/Payment)
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/Credit)
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](http://www.rubydoc.info/github/qw3/superpay_api/GetnetApi/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
@@ -22,6 +22,6 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.required_ruby_version = Gem::Requirement.new(">= 1.9")
24
24
 
25
- spec.add_dependency 'rest-client', '~> 0'
25
+ spec.add_dependency 'rest-client', '>= 1.7.3'
26
26
 
27
27
  end
@@ -27,6 +27,10 @@ module GetnetApi
27
27
  # Ano de expiração do cartão com dois dígitos.
28
28
  attr_accessor :expiration_year
29
29
 
30
+ def brand
31
+ @brand ||= ""
32
+ end
33
+
30
34
  # Validações do Rails 3
31
35
  include ActiveModel::Validations
32
36
 
@@ -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 card_token
8
+ def self.verify card
9
9
 
10
10
  hash = {
11
- "number_token" => card_token.to_s,
12
- "cardholder_name": "JOAO DA SILVA",
13
- "expiration_month": "12",
14
- "expiration_year": "20",
15
- "security_code": "123"
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 a["number_token"]
32
+ # GetnetApi::CardVerification.verify card
@@ -106,10 +106,10 @@ module GetnetApi
106
106
  }
107
107
 
108
108
  if tipo == :customer
109
- customer.merge!({"address": address.to_request,})
109
+ customer.merge!({"address" => address.to_request,})
110
110
  elsif tipo == :payment
111
- customer.merge!({"name": self.name.to_s,})
112
- customer.merge!({"billing_address": address.to_request,})
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
@@ -82,9 +82,9 @@ module GetnetApi
82
82
  }
83
83
 
84
84
  if type == :boleto
85
- payment.merge!({"boleto": obj.to_request,})
85
+ payment.merge!({"boleto" => obj.to_request,})
86
86
  elsif :credit
87
- payment.merge!({"credit": obj.to_request,})
87
+ payment.merge!({"credit" => obj.to_request,})
88
88
  end
89
89
 
90
90
  return payment
@@ -3,7 +3,7 @@ module GetnetApi
3
3
  module Version
4
4
  MAJOR = 0
5
5
  MINOR = 1
6
- PATCH = 1
6
+ PATCH = 2
7
7
  STRING = "#{MAJOR}.#{MINOR}.#{PATCH}"
8
8
  end
9
9
  end
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.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: 2018-11-28 00:00:00.000000000 Z
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: '0'
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: '0'
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.