ravelin 0.1.43 → 0.1.44

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7934d6f3c5b99aeb5fc663fffe9396dc9f9ad1c92573a6751e6a081191d8c2d4
4
- data.tar.gz: 42cc39932a8bbe15a5b1d14fd4252f6c3cd24801f56bb6e5f68872d278c90d68
3
+ metadata.gz: d421badea5fa7f2c8701e2fa425ae44a7785e18e24e3d43247a34049db030523
4
+ data.tar.gz: 6ff503783c5a6801ecf1891eb367a35440c88749d6e6f7ed0fced31dacaad3a3
5
5
  SHA512:
6
- metadata.gz: 205bf6a447c2144c02c5427fa16e0e275a334cd774f520bba2459ffd9d0342616757d3827ab2fa9715f6a44c31782f53ba6376262684971e92a4955304a0c4c1
7
- data.tar.gz: 99d0e83f09f997b4af4907adb0f7c6851c51144528d6f56513962ab52404efdef1d6b72a4aedcaffa34b56b044288313d4447a3c93c25960ebf957c613cd9b98
6
+ metadata.gz: b1de388b1c385d75edc2685bbfe2103972ae050855c6f10f4657aaee4750ed2b4eceda70c9e3bcd89bd425321cf92e7bc2b0b200b186dfff71c2aee4d4d03a1f
7
+ data.tar.gz: caebae8e0e2273dc8a8c3f6d5cf2ec2e8cb0c0edb26c55e4c5134b3d361ba2572f792762392a1351de7a1e15e78c6889bb268e082e9e01a367b8d9d849395651
@@ -20,5 +20,9 @@ module Ravelin
20
20
  def sms_code=(mechanism)
21
21
  @sms_code = Ravelin::AuthenticationMechanisms::SmsCode.new(mechanism)
22
22
  end
23
+
24
+ def magic_link=(mechanism)
25
+ @magic_link = Ravelin::AuthenticationMechanisms::MagicLink.new(mechanism)
26
+ end
23
27
  end
24
28
  end
@@ -0,0 +1,35 @@
1
+ module Ravelin
2
+ module AuthenticationMechanisms
3
+ class MagicLink < RavelinObject
4
+ TRANSPORTATION_MECHANISM = %w(email sms)
5
+ FAILURE_REASONS = %w(INVALID_LINK TIMEOUT INTERNAL_ERROR RATE_LIMIT BANNED_USER)
6
+
7
+ attr_accessor :transport, :success, :email, :phone_number, :failure_reason
8
+ attr_required :transport, :success
9
+
10
+ def failure_reason=(reason)
11
+ @failure_reason = reason.to_s.upcase
12
+ end
13
+
14
+ def validate
15
+ super
16
+
17
+ if !success && !FAILURE_REASONS.include?(failure_reason)
18
+ raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}")
19
+ end
20
+
21
+ if !TRANSPORTATION_MECHANISM.include?(transport)
22
+ raise ArgumentError.new("Transportation mechanism value must be one of #{TRANSPORTATION_MECHANISM.join(', ')}")
23
+ end
24
+
25
+ if transport == 'email' && email.nil?
26
+ raise ArgumentError.new("email must be present for email transportation mechanism")
27
+ end
28
+
29
+ if transport == 'sms' && phone_number.nil?
30
+ raise ArgumentError.new("phone_number must be present for sms transportation mechanism")
31
+ end
32
+ end
33
+ end
34
+ end
35
+ end
data/lib/ravelin/event.rb CHANGED
@@ -39,6 +39,7 @@ module Ravelin
39
39
  password: Password,
40
40
  social: AuthenticationMechanisms::Social,
41
41
  sms_code: AuthenticationMechanisms::SmsCode,
42
+ magic_link: AuthenticationMechanisms::MagicLink,
42
43
  payment_method: PaymentMethod,
43
44
  supplier: Supplier,
44
45
  voucher_redemption: VoucherRedemption,
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.43'
2
+ VERSION = '0.1.44'
3
3
  end
data/lib/ravelin.rb CHANGED
@@ -42,6 +42,7 @@ require 'ravelin/proxy_client'
42
42
 
43
43
  require 'ravelin/authentication_mechanisms/social'
44
44
  require 'ravelin/authentication_mechanisms/sms_code'
45
+ require 'ravelin/authentication_mechanisms/magic_link'
45
46
 
46
47
 
47
48
  module Ravelin
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravelin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.43
4
+ version: 0.1.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Levy
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-12-13 00:00:00.000000000 Z
14
+ date: 2022-01-12 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -112,6 +112,7 @@ files:
112
112
  - lib/ravelin/ato_login.rb
113
113
  - lib/ravelin/ato_reclaim.rb
114
114
  - lib/ravelin/authentication_mechanism.rb
115
+ - lib/ravelin/authentication_mechanisms/magic_link.rb
115
116
  - lib/ravelin/authentication_mechanisms/sms_code.rb
116
117
  - lib/ravelin/authentication_mechanisms/social.rb
117
118
  - lib/ravelin/chargeback.rb
@@ -162,7 +163,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
163
  - !ruby/object:Gem::Version
163
164
  version: '0'
164
165
  requirements: []
165
- rubygems_version: 3.0.9
166
+ rubyforge_project:
167
+ rubygems_version: 2.7.6.2
166
168
  signing_key:
167
169
  specification_version: 4
168
170
  summary: Ruby bindings for the Ravelin API