midas_client 0.1.3 → 0.1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 48c2b25290113dfad892d58a05687d1de8b89475
4
- data.tar.gz: 663fed3bda6bbba8da20dd7cd8132b3b1f01ece3
3
+ metadata.gz: a3ec35f5131e1304acf26ba2dd20420837d3bbec
4
+ data.tar.gz: 3d1f73a438cf3b5dda84e28787da901659b6c730
5
5
  SHA512:
6
- metadata.gz: 115e6253d94e6ff221d2a434b73b897fae9e9df0d123778d88a814ffba9742629f8a6538608e34c93559425c09c294577dd89ede10840af911504a2d95f5213a
7
- data.tar.gz: 83217c8b4e346ae2533877ac95eefc896139ff9f9815b1ebab731dc589065d1ec8317b5b1c7ab2063789c2c99df2258d3f9dea1c2667000be9dec8c5809aa9ce
6
+ metadata.gz: f29c794f3ee70d79875afbf75dc98f9e6dcc8011fffc9172b27bd5e0d3001cac3fdf2fb85bee800e4697622a4a5aa29e30f0e95fc2916d0b581b726ab68f0cd4
7
+ data.tar.gz: cb324eac3066f58d782e36170e30b132d687e5c3c6d8267b768b97a6f2dce546c3285771659dd2275ab1d25281d3f2d86f5a236140fc72ab8dc999f2570fb88c
data/README.md CHANGED
@@ -38,10 +38,13 @@ Request
38
38
 
39
39
  Response
40
40
 
41
- $ [MIDAS_CLIENT][CALLER:request][17/05/2017 20:48:05.087]METHOD: post URL: https://sandbox.ansertecnologia.net/midas-core/v2/creditcard login: pdv01 password: /eFRsg8RLne+I0GlECQofYvnsDfb0w== payload: {:externalId=>"teste_midas_client_00002", :pan=>"552952@@@@@@4124", :expirationMonth=>"01", :expirationYear=>"2021", :holderName=>"TESTE MIDAS CLIENT", :customer=>{:documentType=>"CPF", :documentNumber=>"36549450152"}}
42
- $ [MIDAS_CLIENT][CALLER:request][17/05/2017 20:48:06.103][RESPONSE] {:result=>{:success=>true, :code=>"010", :message=>"O cartao jah foi armazenado anteriormente"}, :brand=>"MASTER", :cardToken=>"f887d732863eb3ef2e45c0bd8b57ed33"}
41
+ $ [17/05/2017 20:48:05.087]METHOD: post URL: https://sandbox.ansertecnologia.net/midas-core/v2/creditcard login: pdv01 password: /eFRsg8RLne+I0GlECQofYvnsDfb0w== payload: {:externalId=>"teste_midas_client_00002", :pan=>"552952@@@@@@4124", :expirationMonth=>"01", :expirationYear=>"2021", :holderName=>"TESTE MIDAS CLIENT", :customer=>{:documentType=>"CPF", :documentNumber=>"36549450152"}}
42
+ $ [17/05/2017 20:48:06.103][RESPONSE] {:result=>{:success=>true, :code=>"010", :message=>"O cartao jah foi armazenado anteriormente"}, :brand=>"MASTER", :cardToken=>"f887d732863eb3ef2e45c0bd8b57ed33"}
43
43
 
44
44
  ## Change Releases
45
+ VERSION - 0.1.3.1 - 2017/05/28
46
+ - publishing stable gem
47
+ - read.me
45
48
 
46
49
  VERSION - 0.1.3 - 2017/05/22
47
50
  - Removing Rails log dependency
@@ -84,7 +87,8 @@ Subscriptions
84
87
 
85
88
  ## Contributing
86
89
 
87
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/midas_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
90
+ - Tests must be implemented, please pull request tests
91
+ - Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/midas_client. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.
88
92
 
89
93
  ## License
90
94
 
data/lib/midas_client.rb CHANGED
@@ -17,9 +17,12 @@ require_relative "midas_client/subscription"
17
17
  #end
18
18
 
19
19
  module MidasClient
20
- @@spec = Gem::Specification.find_by_name("midas_client")
21
- @@gem_root = @@spec.gem_dir
22
20
 
23
21
  class << self
22
+ attr_reader :gem_root
23
+
24
+ spec = Gem::Specification.find_by_name("midas_client")
25
+ @gem_root = spec.gem_dir
26
+
24
27
  end
25
- end
28
+ end
@@ -5,7 +5,7 @@ module MidasClient
5
5
 
6
6
  attr_accessor :login, :password
7
7
 
8
- def initialize(login, password)
8
+ def initialize(login, password, option={})
9
9
  @login = login
10
10
  @password = password
11
11
  log("POS #{login} INITIALIZED!")
@@ -132,10 +132,10 @@ module MidasClient
132
132
  response = request(method, endpoint, self.login, self.password, params)
133
133
 
134
134
  # recupera a lista de invoices da assinatura para chamar o método de atualização de cada invoice.
135
- invoices = subscription_invoices(subscription_token)
135
+ result, invoices = subscription_invoices(subscription_token)
136
136
 
137
137
  # filtra apenas as invoices em aberto
138
- opened_invoices = invoices[:invoices].select{|s| s[:status] == 'OPEN'}
138
+ opened_invoices = invoices.select{|s| s[:status] == 'OPEN'}
139
139
 
140
140
  # percorre cada uma das invoices abertas e chama o método de atualização
141
141
  opened_invoices.each do |inv|
@@ -1,3 +1,3 @@
1
1
  module MidasClient
2
- VERSION = "0.1.3"
2
+ VERSION = "0.1.3.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: midas_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Carlos Andre Oliveira
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-05-22 00:00:00.000000000 Z
11
+ date: 2017-05-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler