treezor_connect 0.14.1 → 0.15.0

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: 06ec341cb21c6dffd02522ddfcc8ab8a7f759f1641469f7fd4dfb6a4de4421fb
4
- data.tar.gz: 263a543c21fb77cbd8e32797a72393c852fe2b3d21e51a83fc8a08f60fd232a8
3
+ metadata.gz: a284f1c9a1b8a3d0bb53ae62c2876f1c971eefcc13a5966a51c1e111e5a09c92
4
+ data.tar.gz: e113ba2c37c777020254477fc531b0b84f208027b98eac50b2dbc0d09b74be9f
5
5
  SHA512:
6
- metadata.gz: c4690c7065408ee2157e7dd7ef76f91278dd00f85def634c06603915b897f6f7c115720daa7adfd82ba9662f787463a980eaed430d722e223bbc63ec22c73ed0
7
- data.tar.gz: 58e9db3fddae81d7e8cab0337a99e06045ccca0f07a5c3a6c1a5892cdcf7ce3b8695e603e2a3d3a0211942c49fa26aec4f50503a315bd28c9d13ea3a9e94a3bd
6
+ metadata.gz: a983ece93f48584fadba4d42d3acec44f24bc1109e56adaa06090746f6501a597b065e57985267de795c0e52bc4188cd0d42522d511313aa617c0cba285aa8c2
7
+ data.tar.gz: 9591728881274d4f7019aaf22c33f77441cf509f787b960bb08419dd4efbdef4902aadc8f33de366b4e4682a150cea443e5ea3be9cc952771d09afbe653043ef
@@ -2,7 +2,7 @@
2
2
 
3
3
  module TreezorConnect
4
4
  class Card < ApiResource
5
- custom_action :put, :lock_unlock, first_letter_upcased: true
5
+ custom_action :put, :lock_unlock, :limits, first_letter_upcased: true
6
6
 
7
7
  OBJECT_NAME = 'card'
8
8
  OBJECT_KEY = 'cards'
@@ -5,18 +5,28 @@ module TreezorConnect
5
5
  class Token
6
6
  class << self
7
7
  def create(params = {})
8
+ access_token = fetch_token(params[:username], params[:password], params[:sca])
9
+
10
+ {
11
+ token: access_token.token,
12
+ expires_in: access_token.expires_in,
13
+ expires_at: access_token.expires_at
14
+ }
15
+ end
16
+
17
+ private
18
+
19
+ def fetch_token(username, password, sca)
8
20
  oauth_client.client_credentials.get_token({
9
21
  grant_type: 'delegated_end_user',
10
22
  client_id: TreezorConnect.client_id,
11
23
  client_secret: TreezorConnect.client_secret,
12
- username: params[:username],
13
- password: params[:password],
14
- sca: params[:sca]
15
- }).token
24
+ username:,
25
+ password:,
26
+ sca:
27
+ })
16
28
  end
17
29
 
18
- private
19
-
20
30
  def oauth_client
21
31
  OAuth2::Client.new(
22
32
  TreezorConnect.client_id,
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: treezor_connect
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.14.1
4
+ version: 0.15.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - stefakins
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2024-12-17 00:00:00.000000000 Z
12
+ date: 2025-01-16 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: A gem for making HTTP calls to Treezor Connect.
15
15
  email: stefan.atkinson69@gmail.com