ravelin 0.1.42 → 0.1.43

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: fa12cde476bee9cbbd88613942bdca7746191a57f9601a0c106635b462c98703
4
- data.tar.gz: 6e0773ee2c05982c058f3f3f38c731a7d01e1552b6891285ea196748ee759039
3
+ metadata.gz: 7934d6f3c5b99aeb5fc663fffe9396dc9f9ad1c92573a6751e6a081191d8c2d4
4
+ data.tar.gz: 42cc39932a8bbe15a5b1d14fd4252f6c3cd24801f56bb6e5f68872d278c90d68
5
5
  SHA512:
6
- metadata.gz: b5296e27a8c83234c765a6fe7a66a347ec8319a37db8f3d0e7cb93bfff052228810eac8d3d05d13214a35cf8aab12e80d2a76694cc63fd579f6f19e2ba9ac103
7
- data.tar.gz: fb0ef69631b4f712f0600f3147c186352359c3371464e8c7d16cd48c79a5e41e403ed3a38082bbc4bdd2ba1de7eaedae532872129282c64630de4232cbea6626
6
+ metadata.gz: 205bf6a447c2144c02c5427fa16e0e275a334cd774f520bba2459ffd9d0342616757d3827ab2fa9715f6a44c31782f53ba6376262684971e92a4955304a0c4c1
7
+ data.tar.gz: 99d0e83f09f997b4af4907adb0f7c6851c51144528d6f56513962ab52404efdef1d6b72a4aedcaffa34b56b044288313d4447a3c93c25960ebf957c613cd9b98
@@ -16,5 +16,9 @@ module Ravelin
16
16
  def social=(mechanism)
17
17
  @social = Ravelin::AuthenticationMechanisms::Social.new(mechanism)
18
18
  end
19
+
20
+ def sms_code=(mechanism)
21
+ @sms_code = Ravelin::AuthenticationMechanisms::SmsCode.new(mechanism)
22
+ end
19
23
  end
20
24
  end
@@ -0,0 +1,22 @@
1
+ module Ravelin
2
+ module AuthenticationMechanisms
3
+ class SmsCode < RavelinObject
4
+ FAILURE_REASONS = %w(INVALID_CODE CODE_TIMEOUT INTERNAL_ERROR RATE_LIMIT BANNED_USER AUTHENTICATION_FAILURE)
5
+
6
+ attr_accessor :success, :phone_number, :failure_reason
7
+ attr_required :success, :phone_number
8
+
9
+ def failure_reason=(reason)
10
+ @failure_reason = reason.to_s.upcase
11
+ end
12
+
13
+ def validate
14
+ super
15
+
16
+ if !success && !FAILURE_REASONS.include?(failure_reason)
17
+ raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}")
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
data/lib/ravelin/event.rb CHANGED
@@ -38,6 +38,7 @@ module Ravelin
38
38
  order: Order,
39
39
  password: Password,
40
40
  social: AuthenticationMechanisms::Social,
41
+ sms_code: AuthenticationMechanisms::SmsCode,
41
42
  payment_method: PaymentMethod,
42
43
  supplier: Supplier,
43
44
  voucher_redemption: VoucherRedemption,
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.42'
2
+ VERSION = '0.1.43'
3
3
  end
data/lib/ravelin.rb CHANGED
@@ -41,6 +41,7 @@ require 'ravelin/client'
41
41
  require 'ravelin/proxy_client'
42
42
 
43
43
  require 'ravelin/authentication_mechanisms/social'
44
+ require 'ravelin/authentication_mechanisms/sms_code'
44
45
 
45
46
 
46
47
  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.42
4
+ version: 0.1.43
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-10 00:00:00.000000000 Z
14
+ date: 2021-12-13 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/sms_code.rb
115
116
  - lib/ravelin/authentication_mechanisms/social.rb
116
117
  - lib/ravelin/chargeback.rb
117
118
  - lib/ravelin/checkout_transaction.rb