nubank_sdk 0.7.7 → 0.7.9

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
  SHA256:
3
- metadata.gz: 754e8fdd62c26d8cd05f9e2ba7d0566d06db2a1d19d35c4da0c269acf6a7856a
4
- data.tar.gz: 7995e11b9d32330ae0ba64ebc15bc3d4e154ad317ef4ca1a9e0ed9f2fc29a547
3
+ metadata.gz: 70a7dedc1c3fc98db0109fae78d4db84d04d8793862e9cb82573fdec028ef35c
4
+ data.tar.gz: 3f3f8a316128cc826913846ba4a961c776da8af597f18c7499ce3cf7d4b42881
5
5
  SHA512:
6
- metadata.gz: 8fa99d6d646b9ed121fc1997e745844e3360cc2b97a4f37136ca7eaf53e6e0ff7b46da93edc6aafe48ea2007b58b9cbbb5e424380bc1836b2c9dd4ddf48dcbd8
7
- data.tar.gz: 4608ddb98d8386205c3679f457cea115f04ea23228f4e995053ccf4349369512c4ef2b47adb940eb2fd0213352a8deb985c520f418f2e4b9f73bdb665d54ac67
6
+ metadata.gz: 6e658b74d30927dbb483e6467cc16247ccf38ab3c174928707173f769cd375116bca42fc0ce76533c7b8c7818fd7937b79111b98aaf4c57551dc122c2d409ae0
7
+ data.tar.gz: 68a5000e30aba7ae2f24c4a65e69d46126e7e6182b5fc2b137aa05d3a439015286cb78a8bf9840b51faa68dfb159de2621b731013dbd6fa8e89af20b1d998402
@@ -16,6 +16,7 @@
16
16
  "github",
17
17
  "user",
18
18
  "credit",
19
- "utils"
19
+ "utils",
20
+ "rubocop"
20
21
  ]
21
22
  }
data/Gemfile.lock CHANGED
@@ -1,14 +1,14 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- nubank_sdk (0.7.7)
4
+ nubank_sdk (0.7.9)
5
5
  faraday (~> 2.7.1)
6
6
  json (~> 2.3)
7
7
 
8
8
  GEM
9
9
  remote: https://rubygems.org/
10
10
  specs:
11
- activesupport (7.0.4.3)
11
+ activesupport (7.0.7.2)
12
12
  concurrent-ruby (~> 1.0, >= 1.0.2)
13
13
  i18n (>= 1.6, < 2)
14
14
  minitest (>= 5.1)
@@ -22,12 +22,12 @@ GEM
22
22
  e2mmap (0.1.0)
23
23
  factory_bot (6.2.1)
24
24
  activesupport (>= 5.0.0)
25
- faraday (2.7.4)
25
+ faraday (2.7.10)
26
26
  faraday-net_http (>= 2.0, < 3.1)
27
27
  ruby2_keywords (>= 0.0.4)
28
28
  faraday-net_http (3.0.2)
29
29
  gem-release (2.2.2)
30
- i18n (1.12.0)
30
+ i18n (1.14.1)
31
31
  concurrent-ruby (~> 1.0)
32
32
  jaro_winkler (1.5.4)
33
33
  json (2.6.2)
@@ -36,7 +36,7 @@ GEM
36
36
  kramdown-parser-gfm (1.1.0)
37
37
  kramdown (~> 2.0)
38
38
  mini_portile2 (2.8.1)
39
- minitest (5.18.0)
39
+ minitest (5.19.0)
40
40
  nokogiri (1.14.3)
41
41
  mini_portile2 (~> 2.8.0)
42
42
  racc (~> 1.4)
data/Rakefile CHANGED
@@ -27,3 +27,11 @@ task :generate_git_tag do
27
27
  sh "git tag -a #{version_tag} -m \"Version #{version}\""
28
28
  sh 'git push --tags'
29
29
  end
30
+
31
+ task :build_local do
32
+ version = NubankSdk::VERSION
33
+ sh 'gem uninstall nubank_sdk'
34
+ sh 'rm nubank_sdk-*.gem' if File.exist?("nubank_sdk-#{version}.gem")
35
+ sh 'gem build nubank_sdk.gemspec'
36
+ sh "gem install --local nubank_sdk-#{version}.gem"
37
+ end
@@ -40,5 +40,36 @@ module NubankSdk
40
40
  data = Client.get_body(response)
41
41
  data[:events]
42
42
  end
43
+
44
+ #
45
+ # Returns the cards summary
46
+ #
47
+ # @return [Array<Hash>] the cards summary
48
+ def cards
49
+ # cards_url vem do 'https://prod-s7-facade.nubank.com.br/api/customers/${id}/dashboard'
50
+ # porem isso retorna muito dado... então vamos chumbar :D
51
+ customer_id = @api_routes.entrypoint(path: :ssl, entrypoint: :customer).split('/').last
52
+ cards_url = "https://prod-s7-mr-white.nubank.com.br/api/customers/#{customer_id}/card-summaries"
53
+
54
+ puts cards_url
55
+ response = @connection.get(cards_url)
56
+
57
+ data = Client.get_body(response)
58
+ data[:sections].map { |section| section[:cards] }.flatten
59
+ end
60
+
61
+ #
62
+ # Return details of a specific transaction from
63
+ # https://prod-s7-showbillz.nubank.com.br/api/items/#{transaction_id}/details
64
+ #
65
+ # @param [String] transaction_id
66
+ # @return [Hash] the transaction details
67
+ def transaction_details(transaction_id)
68
+ details_url = "https://prod-s7-showbillz.nubank.com.br/api/items/#{transaction_id}/details"
69
+
70
+ response = @connection.get(details_url)
71
+
72
+ Client.get_body(response)
73
+ end
43
74
  end
44
75
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module NubankSdk
4
- VERSION = '0.7.7'
4
+ VERSION = '0.7.9'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nubank_sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.7
4
+ version: 0.7.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Viserion77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-14 00:00:00.000000000 Z
11
+ date: 2023-09-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler