aitu-wallet 0.0.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 ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: ecfa5b4671d6fc4c43db44251699f9a9baf3de1245545113bf81df99914581e7
4
+ data.tar.gz: 96b53f074d5acc3c88611aeb63ff3a973ce469c5fe63cddbb6b7c59e4ea21896
5
+ SHA512:
6
+ metadata.gz: f1ccf7939129b972f3e09ee5699efdd7e5797b94cc27980ebd498794b01fb50194b68030d5a2478af8b821784204557ab80cfb17a0ef6bb7b9f95a193386559e
7
+ data.tar.gz: dbd79b7c86ee923f584c09fa5f64df6aa5bca69ddc8599b4bcc9d33c001b6ba8d4bece3228c8e19e720a9bc9b91a7af94c2a0a1550449bb97b6cf49beeaeeb64
data/.gitignore ADDED
@@ -0,0 +1,18 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
12
+
13
+ # ide settings
14
+ /.idea/
15
+
16
+ # built gems
17
+
18
+ *.gem
data/.rubocop.yml ADDED
@@ -0,0 +1,20 @@
1
+ Metrics/ClassLength:
2
+ Enabled: false
3
+ Metrics/AbcSize:
4
+ Enabled: false
5
+ Metrics/BlockLength:
6
+ ExcludedMethods: ['describe', 'context', 'shared_examples']
7
+ Metrics/CyclomaticComplexity:
8
+ Enabled: false
9
+ Metrics/LineLength:
10
+ Enabled: false
11
+ Metrics/MethodLength:
12
+ Enabled: false
13
+ Metrics/PerceivedComplexity:
14
+ Enabled: false
15
+ Naming:
16
+ Enabled: false
17
+ Style/MutableConstant:
18
+ Enabled: false
19
+ Gemspec/RequiredRubyVersion:
20
+ Enabled: false
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
data/Gemfile.lock ADDED
@@ -0,0 +1,81 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ aitu-wallet (0.0.1)
5
+ faraday
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ ast (2.4.2)
11
+ diff-lcs (1.5.0)
12
+ faraday (1.9.3)
13
+ faraday-em_http (~> 1.0)
14
+ faraday-em_synchrony (~> 1.0)
15
+ faraday-excon (~> 1.1)
16
+ faraday-httpclient (~> 1.0)
17
+ faraday-multipart (~> 1.0)
18
+ faraday-net_http (~> 1.0)
19
+ faraday-net_http_persistent (~> 1.0)
20
+ faraday-patron (~> 1.0)
21
+ faraday-rack (~> 1.0)
22
+ faraday-retry (~> 1.0)
23
+ ruby2_keywords (>= 0.0.4)
24
+ faraday-em_http (1.0.0)
25
+ faraday-em_synchrony (1.0.0)
26
+ faraday-excon (1.1.0)
27
+ faraday-httpclient (1.0.1)
28
+ faraday-multipart (1.0.3)
29
+ multipart-post (>= 1.2, < 3)
30
+ faraday-net_http (1.0.1)
31
+ faraday-net_http_persistent (1.2.0)
32
+ faraday-patron (1.0.0)
33
+ faraday-rack (1.0.0)
34
+ faraday-retry (1.0.3)
35
+ multipart-post (2.1.1)
36
+ parallel (1.21.0)
37
+ parser (3.1.0.0)
38
+ ast (~> 2.4.1)
39
+ rainbow (3.1.1)
40
+ rake (12.3.3)
41
+ regexp_parser (2.2.0)
42
+ rexml (3.2.5)
43
+ rspec (3.10.0)
44
+ rspec-core (~> 3.10.0)
45
+ rspec-expectations (~> 3.10.0)
46
+ rspec-mocks (~> 3.10.0)
47
+ rspec-core (3.10.1)
48
+ rspec-support (~> 3.10.0)
49
+ rspec-expectations (3.10.2)
50
+ diff-lcs (>= 1.2.0, < 2.0)
51
+ rspec-support (~> 3.10.0)
52
+ rspec-mocks (3.10.2)
53
+ diff-lcs (>= 1.2.0, < 2.0)
54
+ rspec-support (~> 3.10.0)
55
+ rspec-support (3.10.3)
56
+ rubocop (0.93.1)
57
+ parallel (~> 1.10)
58
+ parser (>= 2.7.1.5)
59
+ rainbow (>= 2.2.2, < 4.0)
60
+ regexp_parser (>= 1.8)
61
+ rexml
62
+ rubocop-ast (>= 0.6.0)
63
+ ruby-progressbar (~> 1.7)
64
+ unicode-display_width (>= 1.4.0, < 2.0)
65
+ rubocop-ast (1.15.1)
66
+ parser (>= 3.0.1.1)
67
+ ruby-progressbar (1.11.0)
68
+ ruby2_keywords (0.0.5)
69
+ unicode-display_width (1.8.0)
70
+
71
+ PLATFORMS
72
+ x86_64-linux
73
+
74
+ DEPENDENCIES
75
+ aitu-wallet!
76
+ rake (~> 12.0)
77
+ rspec (~> 3.6)
78
+ rubocop (~> 0.49)
79
+
80
+ BUNDLED WITH
81
+ 2.2.3
data/README.md ADDED
File without changes
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'aitu_wallet/client'
4
+ require 'aitu_wallet/version'
@@ -0,0 +1,38 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'faraday'
4
+ require 'faraday/net_http'
5
+ Faraday.default_adapter = :net_http
6
+
7
+ module AituWallet
8
+ BASE_URL = 'https://dev.wallet-web-api.aitupay.kz/api/v1/facade'
9
+
10
+ ENDPOINTS = {
11
+ user: '/integration/user',
12
+ passport: '/passport',
13
+ service: '/ems/service'
14
+ }
15
+ # Client to send Aitu Wallet requests
16
+ class Client
17
+ attr_accessor :handler, :headers
18
+
19
+ def initialize(auth_token)
20
+ @handler = Faraday.new
21
+ @headers = { 'Authorization': "Basic #{auth_token}" }
22
+ end
23
+
24
+ def get_user_info(phone)
25
+ url = build_request_url(:user) + "/#{phone}"
26
+ response = @handler.get(url: url, headers: @headers)
27
+ JSON.parse(response) if response
28
+ end
29
+
30
+ private
31
+
32
+ def build_request_url(endpoint)
33
+ raise StandardError, "No such endpoint: #{endpoint}" unless ENDPOINTS[endpoint]
34
+
35
+ BASE_URL + ENDPOINTS[endpoint]
36
+ end
37
+ end
38
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module AituWallet
4
+ VERSION = '0.0.1'
5
+ end
metadata ADDED
@@ -0,0 +1,111 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: aitu-wallet
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Yaroslav Shevchenko
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2022-03-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rake
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '12.0'
20
+ type: :development
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '12.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: rspec
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '3.6'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '3.6'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.49'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.49'
55
+ - !ruby/object:Gem::Dependency
56
+ name: faraday
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2'
69
+ description: Gem to process Aitu Wallet requests
70
+ email:
71
+ - iaroslav.shevchenko@aitudala.kz
72
+ executables: []
73
+ extensions: []
74
+ extra_rdoc_files: []
75
+ files:
76
+ - ".gitignore"
77
+ - ".rubocop.yml"
78
+ - Gemfile
79
+ - Gemfile.lock
80
+ - README.md
81
+ - lib/aitu-wallet.rb
82
+ - lib/aitu_wallet/client.rb
83
+ - lib/aitu_wallet/version.rb
84
+ homepage: https://gitlab.btsd.kz/newscorr/aitu-wallet-gem
85
+ licenses:
86
+ - MIT
87
+ metadata:
88
+ allowed_push_host: https://rubygems.org
89
+ homepage_uri: https://gitlab.btsd.kz/newscorr/aitu-wallet-gem
90
+ source_code_uri: https://gitlab.btsd.kz/newscorr/aitu-wallet-gem
91
+ changelog_uri: https://gitlab.btsd.kz/newscorr/aitu-wallet-gem/CHANGELOG.md
92
+ post_install_message:
93
+ rdoc_options: []
94
+ require_paths:
95
+ - lib
96
+ required_ruby_version: !ruby/object:Gem::Requirement
97
+ requirements:
98
+ - - ">="
99
+ - !ruby/object:Gem::Version
100
+ version: 2.3.0
101
+ required_rubygems_version: !ruby/object:Gem::Requirement
102
+ requirements:
103
+ - - ">="
104
+ - !ruby/object:Gem::Version
105
+ version: '0'
106
+ requirements: []
107
+ rubygems_version: 3.2.3
108
+ signing_key:
109
+ specification_version: 4
110
+ summary: Aitu Wallet library
111
+ test_files: []