aitu-wallet 0.0.13 → 0.0.16

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: '07648977763c31e45b12939123c54481fd1f56c37d0141e8f03d30369cab8c46'
4
- data.tar.gz: 1da229cb98ba1bb4c4a5d14ac7a819358d586537c8672ee827e84dfa015a99c8
3
+ metadata.gz: 183d2472305088bce17fb9412333c605d798ea0d35ded5d829dbf1a29054a484
4
+ data.tar.gz: d3dbe875508707d09b5ce2c59b9b9305f99caf7c66f71d57d78a7b25017ad6cb
5
5
  SHA512:
6
- metadata.gz: ed34e63da1ffd7e60b042c967cbc4740a2c8d4937a8e07b19c98d732a79f0834a7be7182cebaefad5b4889448ab67b0ec3488387e690e4855cf14bfe33c78a03
7
- data.tar.gz: 35e6ce9427880f9e594dacf1d7a89ffd6356d1c435909d1e3cff77575061b8eab2f5332d1b53da761a865b366fa5bcb8e5f13ebb8311bc34fa1bcfc5a01b3905
6
+ metadata.gz: 13999cc8f660e4805f25338e0f7fa9ab4c18b66acfd1b818601c06282f23a8995b6f4283afc30f5329c732839cdfa5704f7d94f984624345902da18e21a4ff81
7
+ data.tar.gz: f7aca1a62cd69213ac465246c41c317cf5641b5e49d5f9739786373c55fafc24d240b2a1d913a94fe0dc8ef51f04a6804bb9343a794c4cd303f4773b23478a00
@@ -13,7 +13,7 @@ module AituWallet
13
13
 
14
14
  ENDPOINTS = {
15
15
  user: 'integration/user',
16
- passport: 'passport',
16
+ passport: 'passport/',
17
17
  service: 'ems/service'
18
18
  }
19
19
 
@@ -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
118
  partnerUrl: back_url,
117
- scope: 0
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.13'
4
+ VERSION = '0.0.16'
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.13
4
+ version: 0.0.16
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-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake