aitu-wallet 0.0.14 → 0.0.17

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: 4214d9b41441b89932e989e6d3c39e59d2e0e9747791e12038a3d1ec6b3ec78c
4
- data.tar.gz: 9a62a30f8a22b4d8d9efecc8f1766c9c3c5f0172c7497e3600f13339a0498eb7
3
+ metadata.gz: 11fd3274136d8355c902add45e94c78bb3308336fceb6dc5fa2df1fd32151a60
4
+ data.tar.gz: 3ee1ec362b51cc501cef68d955e58f6724ab27ad80c4f177a568626379589fa6
5
5
  SHA512:
6
- metadata.gz: 1e0a5e6481aa99a476357661ddce31096b441a3361ccc4e207a803b7adb5e79103f627fc590db7b56950a4ee1acc336e308cb6f71666d089ea339ab87d439fbb
7
- data.tar.gz: c333cf284425942f73c8f60d7c6f8d63cabcb8ea47226bead265d3f651792263448b0c2eb7977547980a90925a75c6c444b6eec392a42464618babdb3f29356b
6
+ metadata.gz: 9d34ce04cd222076e0832a4989a1834bdd8e34ec2381ecdc2773da2ee3fd96757f14ebffd05cf016c0c6c864ee3ae8085c0d158d790319fd2d8a7a29f2208f46
7
+ data.tar.gz: 67facf6a5330f108766a456ce0700ee3b1baa443ab1f9e464b642a50afa7c27e0d6e97dc4f8b3334a91dbae2873aa0a4c7f7de521892e49d8aef2cc9fc34ff7d
data/CHANGELOG.md ADDED
@@ -0,0 +1,2 @@
1
+ #0.0.1 - Unstable
2
+ * Initial Commit
@@ -45,10 +45,10 @@ module AituWallet
45
45
  # @param [String] phone
46
46
  # @param [String] back_url
47
47
  # @return [Hash, NilClass]
48
- def build_passport_link(phone, back_url)
48
+ def build_passport_link(phone, back_url, scope = 'idpc_verification')
49
49
  post_request(
50
50
  ENDPOINTS[:passport],
51
- get_link_request_data(phone, back_url)
51
+ get_link_request_data(phone, back_url, scope)
52
52
  )
53
53
  end
54
54
 
@@ -85,6 +85,8 @@ module AituWallet
85
85
  # @return [Hash, nil]
86
86
  def post_request(url, body)
87
87
  add_token_header
88
+ set_request_content_type
89
+
88
90
  response = @handler.post(url) do |request|
89
91
  request.body = body.to_json
90
92
  end
@@ -110,11 +112,11 @@ module AituWallet
110
112
  # @param [String] phone
111
113
  # @param [String] back_url
112
114
  # @return [Hash]
113
- def get_link_request_data(phone, back_url)
115
+ def get_link_request_data(phone, back_url, scope)
114
116
  {
115
117
  phone: phone,
116
- partnerUrl: back_url,
117
- scope: 0
118
+ callbackUrl: back_url,
119
+ scope: scope
118
120
  }
119
121
  end
120
122
 
@@ -123,5 +125,12 @@ module AituWallet
123
125
  def add_token_header
124
126
  @handler.headers['X-PASSPORT-TOKEN'] = @auth_token
125
127
  end
128
+
129
+ # Sets content-type header
130
+ #
131
+ # @param [String] content_type
132
+ def set_request_content_type(content_type = 'application/json')
133
+ @handler.headers['Content-Type'] = content_type
134
+ end
126
135
  end
127
136
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AituWallet
4
- VERSION = '0.0.14'
4
+ VERSION = '0.0.17'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aitu-wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.17
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yaroslav Shevchenko
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-04-25 00:00:00.000000000 Z
11
+ date: 2022-05-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -75,6 +75,7 @@ extra_rdoc_files: []
75
75
  files:
76
76
  - ".gitignore"
77
77
  - ".rubocop.yml"
78
+ - CHANGELOG.md
78
79
  - Gemfile
79
80
  - Gemfile.lock
80
81
  - README.md