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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1a431630e59a11ebcf2c756c8b5d7e1e0f75cecdea8063c7e64072c555fc339f
4
- data.tar.gz: 960fe9c84b5087151528b41502bb73094e4aa93c85fc84f13933108bcd367a89
3
+ metadata.gz: 9f8bc815e8e129965bc872f5672c08c746e0f81eefbc37e8136b2972b2791279
4
+ data.tar.gz: 5444c3825d79bf20e4dddc2b2a29402880db09c6a50f8ca05f2e400d53dea0ba
5
5
  SHA512:
6
- metadata.gz: 58dabc12ec30e006db8b5728d1673466fecbed0a48c275260cece66e9a49b3efe7cdb0e66b1604128c8a2ef4b51472708ccf934dc76321a867ac11d3913d75ba
7
- data.tar.gz: 8be448780bcf9c3b1aecbfc031d492037568cc58f93d9c56ff2e4e62d0934fe46410a69a728baf58c8731ba5bfbe7dfb53eea386ff1686a04fbceb069aec0c76
6
+ metadata.gz: 03ae48c95ce23399b69dab316897faea35cfa552e1af7ef0cb9cdcdd5033c7eb38f14020ed28a09684af5f4e94e4e28ebff0af3cb134bafc062ad8a4adf94c66
7
+ data.tar.gz: b949745feb5e0aec80cc224f15e1035e73d76fc998499fd68b5d155b688b50067d1b215065d2a383f8613a66a54adb689a9453bc789fe0f163c8abc459428854
@@ -4,12 +4,15 @@ on:
4
4
  branches: [ "develop" ]
5
5
  pull_request:
6
6
  branches: [ "develop" ]
7
+
7
8
  jobs:
8
9
  Rspec:
9
10
  runs-on: ubuntu-latest
10
11
  strategy:
11
12
  matrix:
12
13
  ruby-version: ['3.0']
14
+ permissions:
15
+ checks: write
13
16
 
14
17
  steps:
15
18
  - uses: actions/checkout@v3
data/.gitignore CHANGED
@@ -10,3 +10,5 @@
10
10
 
11
11
  # rspec failure tracking
12
12
  .rspec_status
13
+
14
+ nubank_sdk-*.gem
@@ -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.6)
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.1)
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.1.10)
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.17.0)
40
- nokogiri (1.14.0)
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.5)
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
@@ -44,6 +44,7 @@ module NubankSdk
44
44
  def post(path, body)
45
45
  @connection.post(path) do |req|
46
46
  req.headers['Content-Type'] = 'application/json'
47
+ req.headers['X-Correlation-Id'] = 'WEB-APP.pewW9'
47
48
  req.body = body.to_json
48
49
  end
49
50
  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.6'
4
+ VERSION = '0.7.8'
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.6
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-01-24 00:00:00.000000000 Z
11
+ date: 2023-07-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler