ravelin 0.1.39 → 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: 0a793f5a60f55e14c0720c5fc5c0a243b0a7abbf8e972d7ea66b784153a41df8
4
- data.tar.gz: 58976fc86aa26e58a2cf9fd11d94ddb95df761013d144e365c5560ef2e53f2fd
3
+ metadata.gz: 7934d6f3c5b99aeb5fc663fffe9396dc9f9ad1c92573a6751e6a081191d8c2d4
4
+ data.tar.gz: 42cc39932a8bbe15a5b1d14fd4252f6c3cd24801f56bb6e5f68872d278c90d68
5
5
  SHA512:
6
- metadata.gz: 24c544d57436933762d96615c9e6a608088aea9a83dc17cc6e1e9b6ed662c4f04eb968e5b1faca1a873403a31214aa111018b23c10596a5c59221dbfc5af5969
7
- data.tar.gz: ae45e6285b2c6f2356ee8f5dd2ff600346ff66fc543198091c71d9053218f6da8ed01223a51b67c3ce795a5e0d0065ed070d29c17fe8a8aa8d3697e74731969b
6
+ metadata.gz: 205bf6a447c2144c02c5427fa16e0e275a334cd774f520bba2459ffd9d0342616757d3827ab2fa9715f6a44c31782f53ba6376262684971e92a4955304a0c4c1
7
+ data.tar.gz: 99d0e83f09f997b4af4907adb0f7c6851c51144528d6f56513962ab52404efdef1d6b72a4aedcaffa34b56b044288313d4447a3c93c25960ebf957c613cd9b98
@@ -12,5 +12,13 @@ module Ravelin
12
12
  def password=(passwd)
13
13
  @password = Ravelin::Password.new(passwd)
14
14
  end
15
+
16
+ def social=(mechanism)
17
+ @social = Ravelin::AuthenticationMechanisms::Social.new(mechanism)
18
+ end
19
+
20
+ def sms_code=(mechanism)
21
+ @sms_code = Ravelin::AuthenticationMechanisms::SmsCode.new(mechanism)
22
+ end
15
23
  end
16
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
@@ -0,0 +1,31 @@
1
+ module Ravelin
2
+ module AuthenticationMechanisms
3
+ class Social < RavelinObject
4
+ PROVIDERS = %w(apple azure facebook google linkedin microsoft okta onelogin ping twitter)
5
+ FAILURE_REASONS = %w(TIMEOUT UNKNOWN_USERNAME INTERNAL_ERROR RATE_LIMIT SOCIAL_FAILURE BANNED_USER)
6
+
7
+ attr_accessor :success, :social_provider, :failure_reason
8
+ attr_required :success, :social_provider
9
+
10
+ def social_provider=(provider)
11
+ @social_provider = provider.to_s.downcase
12
+ end
13
+
14
+ def failure_reason=(reason)
15
+ @failure_reason = reason.to_s.upcase
16
+ end
17
+
18
+ def validate
19
+ super
20
+
21
+ if !success && !FAILURE_REASONS.include?(failure_reason)
22
+ raise ArgumentError.new("Failure reason value must be one of #{FAILURE_REASONS.join(', ')}")
23
+ end
24
+
25
+ if !PROVIDERS.include?(social_provider)
26
+ raise ArgumentError.new("Social provider value must be one of #{PROVIDERS.join(', ')}")
27
+ end
28
+ end
29
+ end
30
+ end
31
+ end
data/lib/ravelin/event.rb CHANGED
@@ -27,21 +27,24 @@ module Ravelin
27
27
 
28
28
  def object_classes
29
29
  {
30
- ato_login: AtoLogin,
30
+ ato_login: AtoLogin,
31
31
  authentication_mechanism: AuthenticationMechanism,
32
- chargeback: Chargeback,
33
- customer: Customer,
34
- ato_reclaim: AtoReclaim,
35
- device: Device,
36
- location: Location,
37
- login: Login,
38
- order: Order,
39
- password: Password,
40
- payment_method: PaymentMethod,
41
- voucher_redemption: VoucherRedemption,
42
- transaction: transaction,
43
- label: Label,
44
- voucher: Voucher,
32
+ chargeback: Chargeback,
33
+ customer: Customer,
34
+ ato_reclaim: AtoReclaim,
35
+ device: Device,
36
+ location: Location,
37
+ login: Login,
38
+ order: Order,
39
+ password: Password,
40
+ social: AuthenticationMechanisms::Social,
41
+ sms_code: AuthenticationMechanisms::SmsCode,
42
+ payment_method: PaymentMethod,
43
+ supplier: Supplier,
44
+ voucher_redemption: VoucherRedemption,
45
+ transaction: transaction,
46
+ label: Label,
47
+ voucher: Voucher,
45
48
  }
46
49
  end
47
50
 
@@ -0,0 +1,30 @@
1
+ module Ravelin
2
+ class Supplier < RavelinObject
3
+ attr_accessor :supplier_id,
4
+ :type,
5
+ :group_id,
6
+ :group_name,
7
+ :registration_time,
8
+ :email,
9
+ :email_verified_time,
10
+ :name,
11
+ :telephone,
12
+ :telephone_verified_time,
13
+ :telephone_country,
14
+ :home_location,
15
+ :market,
16
+ :market_country,
17
+ :level,
18
+ :employment_type,
19
+ :transport_type,
20
+ :category,
21
+ :tags,
22
+ :custom
23
+
24
+ attr_required :supplier_id, :type
25
+
26
+ def home_location=(obj)
27
+ @home_location = Ravelin::Location.new(obj)
28
+ end
29
+ end
30
+ end
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.39'
2
+ VERSION = '0.1.43'
3
3
  end
data/lib/ravelin.rb CHANGED
@@ -27,6 +27,7 @@ require 'ravelin/app'
27
27
  require 'ravelin/payment_method'
28
28
  require 'ravelin/password'
29
29
  require 'ravelin/pre_transaction'
30
+ require 'ravelin/supplier'
30
31
  require 'ravelin/three_d_secure'
31
32
  require 'ravelin/transaction'
32
33
  require 'ravelin/voucher'
@@ -39,6 +40,10 @@ require 'ravelin/response'
39
40
  require 'ravelin/client'
40
41
  require 'ravelin/proxy_client'
41
42
 
43
+ require 'ravelin/authentication_mechanisms/social'
44
+ require 'ravelin/authentication_mechanisms/sms_code'
45
+
46
+
42
47
  module Ravelin
43
48
  @faraday_adapter = Faraday.default_adapter
44
49
  @faraday_timeout = 1
metadata CHANGED
@@ -1,17 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ravelin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.39
4
+ version: 0.1.43
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sam Levy
8
8
  - Tommy Palmer
9
9
  - Gurkan Oluc
10
10
  - Mathilda Thompson
11
- autorequire:
11
+ autorequire:
12
12
  bindir: exe
13
13
  cert_chain: []
14
- date: 2021-11-24 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,8 @@ 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
116
+ - lib/ravelin/authentication_mechanisms/social.rb
115
117
  - lib/ravelin/chargeback.rb
116
118
  - lib/ravelin/checkout_transaction.rb
117
119
  - lib/ravelin/client.rb
@@ -134,6 +136,7 @@ files:
134
136
  - lib/ravelin/proxy_client.rb
135
137
  - lib/ravelin/ravelin_object.rb
136
138
  - lib/ravelin/response.rb
139
+ - lib/ravelin/supplier.rb
137
140
  - lib/ravelin/tag.rb
138
141
  - lib/ravelin/three_d_secure.rb
139
142
  - lib/ravelin/transaction.rb
@@ -144,7 +147,7 @@ homepage: https://developer.ravelin.com
144
147
  licenses:
145
148
  - MIT
146
149
  metadata: {}
147
- post_install_message:
150
+ post_install_message:
148
151
  rdoc_options: []
149
152
  require_paths:
150
153
  - lib
@@ -159,9 +162,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
159
162
  - !ruby/object:Gem::Version
160
163
  version: '0'
161
164
  requirements: []
162
- rubyforge_project:
163
- rubygems_version: 2.7.6.2
164
- signing_key:
165
+ rubygems_version: 3.0.9
166
+ signing_key:
165
167
  specification_version: 4
166
168
  summary: Ruby bindings for the Ravelin API
167
169
  test_files: []