nubank_sdk 0.7.6 → 0.7.8
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 +4 -4
- data/.github/workflows/quality-inspector.yml +3 -0
- data/.gitignore +2 -0
- data/.vscode/settings.json +2 -1
- data/Gemfile.lock +6 -6
- data/Rakefile +8 -0
- data/lib/nubank_sdk/client.rb +1 -0
- data/lib/nubank_sdk/credit.rb +31 -0
- data/lib/nubank_sdk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9f8bc815e8e129965bc872f5672c08c746e0f81eefbc37e8136b2972b2791279
|
4
|
+
data.tar.gz: 5444c3825d79bf20e4dddc2b2a29402880db09c6a50f8ca05f2e400d53dea0ba
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 03ae48c95ce23399b69dab316897faea35cfa552e1af7ef0cb9cdcdd5033c7eb38f14020ed28a09684af5f4e94e4e28ebff0af3cb134bafc062ad8a4adf94c66
|
7
|
+
data.tar.gz: b949745feb5e0aec80cc224f15e1035e73d76fc998499fd68b5d155b688b50067d1b215065d2a383f8613a66a54adb689a9453bc789fe0f163c8abc459428854
|
data/.gitignore
CHANGED
data/.vscode/settings.json
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
nubank_sdk (0.7.
|
4
|
+
nubank_sdk (0.7.8)
|
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.
|
11
|
+
activesupport (7.0.4.3)
|
12
12
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
13
13
|
i18n (>= 1.6, < 2)
|
14
14
|
minitest (>= 5.1)
|
@@ -16,7 +16,7 @@ GEM
|
|
16
16
|
ast (2.4.2)
|
17
17
|
backport (1.2.0)
|
18
18
|
benchmark (0.2.1)
|
19
|
-
concurrent-ruby (1.
|
19
|
+
concurrent-ruby (1.2.2)
|
20
20
|
diff-lcs (1.5.0)
|
21
21
|
docile (1.4.0)
|
22
22
|
e2mmap (0.1.0)
|
@@ -36,8 +36,8 @@ GEM
|
|
36
36
|
kramdown-parser-gfm (1.1.0)
|
37
37
|
kramdown (~> 2.0)
|
38
38
|
mini_portile2 (2.8.1)
|
39
|
-
minitest (5.
|
40
|
-
nokogiri (1.14.
|
39
|
+
minitest (5.18.0)
|
40
|
+
nokogiri (1.14.3)
|
41
41
|
mini_portile2 (~> 2.8.0)
|
42
42
|
racc (~> 1.4)
|
43
43
|
parallel (1.22.1)
|
@@ -105,7 +105,7 @@ GEM
|
|
105
105
|
yard (~> 0.9, >= 0.9.24)
|
106
106
|
thor (1.2.1)
|
107
107
|
tilt (2.0.11)
|
108
|
-
tzinfo (2.0.
|
108
|
+
tzinfo (2.0.6)
|
109
109
|
concurrent-ruby (~> 1.0)
|
110
110
|
unicode-display_width (2.3.0)
|
111
111
|
webrick (1.7.0)
|
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
|
data/lib/nubank_sdk/client.rb
CHANGED
data/lib/nubank_sdk/credit.rb
CHANGED
@@ -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
|
data/lib/nubank_sdk/version.rb
CHANGED
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.
|
4
|
+
version: 0.7.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Viserion77
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-07-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|