ravelin 0.1.32 → 0.1.37

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: 57a184f34aa13ef561c8cd0c18d830f8a735dd3da60f70be709063f75fbfe32a
4
- data.tar.gz: f503c5530a4fbe00aa8664c6bd96278c4c7478eea1af0ebfc55d6bee60bed7d6
3
+ metadata.gz: f1777e2b3d47dc15c850bf7c3877347c52110a0982ebe5b1c672b24b606e767e
4
+ data.tar.gz: d7d071a3d9c85e96d050bed1e1f48630ead9f308ea00cd0236df02c06c2304c6
5
5
  SHA512:
6
- metadata.gz: d4f7d17b50ac3a972c322471da46fee99d79019809883ee02fab0543ae04bad6045a8e985fce80652781d146876be5ee25409f12fffd620713defb1baf49eb87
7
- data.tar.gz: c4d6dca27fca949a8033a4c9daac33df7d333722a2e2e7015cc37910b61662737a2be65c87eac7428209f550d7a117e30fc67bf79ab8758df1eb46701a5e8524
6
+ metadata.gz: ac0fe4a54cb415a3a0ae7b83f955e38a5f1e29334c459c7a44eb4f038aa06feea8c04b72a1f9cdaa5848d31a59df5d72ea69dbe0c3c46240ef9ba40284bf5a80
7
+ data.tar.gz: c2308e470c160d4d189b07a8c56305fc22d8295899666ec4e61a0459961f555e06fe9f3c03e4e8ea97a4507ebf2838358ec107397542489dbfc0f2f5690c97ce
data/lib/ravelin.rb CHANGED
@@ -23,6 +23,7 @@ require 'ravelin/item'
23
23
  require 'ravelin/location'
24
24
  require 'ravelin/login'
25
25
  require 'ravelin/order'
26
+ require 'ravelin/app'
26
27
  require 'ravelin/payment_method'
27
28
  require 'ravelin/password'
28
29
  require 'ravelin/pre_transaction'
@@ -0,0 +1,27 @@
1
+ module Ravelin
2
+ class App < RavelinObject
3
+ attr_accessor :name, :platform, :domain
4
+
5
+ PLATFORM_IOS = 'ios'
6
+ PLATFORM_ANDROID = 'android'
7
+ PLATFORM_WEB = 'web'
8
+ PLATFORM_MOBILE_WEB = 'mobile-web'
9
+ PLATFORM_VALUES = [PLATFORM_IOS, PLATFORM_ANDROID, PLATFORM_WEB, PLATFORM_MOBILE_WEB]
10
+
11
+ def validate
12
+ super
13
+
14
+ raise ArgumentError, "Platform value be one of #{PLATFORM_VALUES.join(', ')}" unless App.valid_platform?(platform)
15
+ raise ArgumentError, 'Domain is not valid' unless App.valid_domain?(domain)
16
+ end
17
+
18
+ def self.valid_platform?(platform)
19
+ platform.nil? || PLATFORM_VALUES.include?(platform)
20
+ end
21
+
22
+ def self.valid_domain?(domain)
23
+ domain.nil? || /^[a-z0-9\-\\.]+$/.match(domain)
24
+ end
25
+
26
+ end
27
+ end
@@ -20,5 +20,15 @@ module Ravelin
20
20
  :three_d_secure
21
21
 
22
22
  attr_required :transaction_id, :currency, :debit, :credit
23
+
24
+ def initialize(params)
25
+ unless params['3ds'].nil?
26
+ self.three_d_secure = ThreeDSecure.new(params['3ds'])
27
+ params.delete('3ds')
28
+ end
29
+
30
+ super(params)
31
+ end
32
+
23
33
  end
24
34
  end
data/lib/ravelin/order.rb CHANGED
@@ -13,7 +13,9 @@ module Ravelin
13
13
  :custom,
14
14
  :creation_time,
15
15
  :execution_time,
16
- :status
16
+ :status,
17
+ :app,
18
+ :category
17
19
 
18
20
  attr_required :order_id
19
21
 
@@ -30,5 +32,9 @@ module Ravelin
30
32
  def to=(obj)
31
33
  @to = Ravelin::Location.new(obj)
32
34
  end
35
+
36
+ def app=(obj)
37
+ @app = Ravelin::App.new(obj)
38
+ end
33
39
  end
34
40
  end
@@ -21,7 +21,8 @@ module Ravelin
21
21
  # Only when type = paypal
22
22
  :email,
23
23
  :custom,
24
- :e_wallet
24
+ :e_wallet,
25
+ :scheme
25
26
 
26
27
  attr_required :payment_method_id, :method_type
27
28
  end
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = '0.1.32'
2
+ VERSION = '0.1.37'
3
3
  end
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.32
4
+ version: 0.1.37
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: 2020-11-17 00:00:00.000000000 Z
14
+ date: 2021-06-14 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -108,6 +108,7 @@ extensions: []
108
108
  extra_rdoc_files: []
109
109
  files:
110
110
  - lib/ravelin.rb
111
+ - lib/ravelin/app.rb
111
112
  - lib/ravelin/ato_login.rb
112
113
  - lib/ravelin/ato_reclaim.rb
113
114
  - lib/ravelin/authentication_mechanism.rb