ravelin 0.1.2 → 0.1.3

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
  SHA1:
3
- metadata.gz: 8149be22bff618a5fa9e1b5e84337b6106dfa519
4
- data.tar.gz: 640853f128afafa3b824d609ce2635543c2797cc
3
+ metadata.gz: 020ada105c6edf6d2265ea0f7b15d107669fa073
4
+ data.tar.gz: ddb667cfb451bcd593dbf698954d09f7ed417426
5
5
  SHA512:
6
- metadata.gz: d50f55e61004a07eb15b0663c7ba5f7c89ca45d66683a992ca408f94b3a3e27120f25fc49c7922489d1d38862c63f4c1eccb52c6f78ec3fef45b298d59b4417f
7
- data.tar.gz: 59643bd260b039007b014c2826541e77045f2d4d9836f46d4926050094149c2705b1e3ce0ad5660e1170d369dac63d496dc37dcd91493c76495fa5fe48b23595
6
+ metadata.gz: d4d6c275a47387ace45c8704d310fd1687fcf3d90b5626a253eec5a035cd208be08a79e8e94b97c4d48673dec8ab251cbca505b5222dac2e74c18fe15613cf44
7
+ data.tar.gz: f54036d815a9746bf3bf7ce0cd33c864ebe5145da56c63639fee8ca21994d0acb0c5ce3234cf876de50a7869580641021b7b819ecaed29a5f965c553effdcc1b
data/lib/ravelin.rb CHANGED
@@ -22,6 +22,7 @@ require 'ravelin/payment_method'
22
22
  require 'ravelin/pre_transaction'
23
23
  require 'ravelin/transaction'
24
24
  require 'ravelin/voucher'
25
+ require 'ravelin/voucher_redemption'
25
26
  require 'ravelin/label'
26
27
 
27
28
  require 'ravelin/event'
data/lib/ravelin/event.rb CHANGED
@@ -32,6 +32,7 @@ module Ravelin
32
32
  location: Location,
33
33
  order: Order,
34
34
  payment_method: PaymentMethod,
35
+ voucher_redemption: VoucherRedemption,
35
36
  transaction: self.name == :pretransaction ? PreTransaction : Transaction,
36
37
  label: Label,
37
38
  voucher: Voucher,
@@ -43,12 +44,13 @@ module Ravelin
43
44
  def validate_top_level_payload_params
44
45
  validate_customer_id_presence_on :order, :paymentmethod,
45
46
  :pretransaction, :transaction, :label
46
-
47
47
  case self.name
48
48
  when :customer
49
49
  validate_payload_inclusion_of :customer
50
50
  when :voucher
51
51
  validate_payload_inclusion_of :voucher
52
+ when :'paymentmethod/voucher'
53
+ validate_payload_inclusion_of :'voucher_redemption'
52
54
  when :pretransaction, :transaction
53
55
  validate_payload_inclusion_of :order_id, :payment_method_id
54
56
  when :login
@@ -1,3 +1,3 @@
1
1
  module Ravelin
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
@@ -0,0 +1,23 @@
1
+ module Ravelin
2
+ class VoucherRedemption < RavelinObject
3
+ attr_accessor :payment_method_id,
4
+ :voucher_code,
5
+ :referrer_id,
6
+ :expiry,
7
+ :value,
8
+ :currency,
9
+ :voucher_type,
10
+ :redemption_time,
11
+ :success,
12
+ :failure_source,
13
+ :failure_reason,
14
+ :custom
15
+
16
+ attr_required :payment_method_id, :voucher_code, :referrer_id, :value, :currency, :voucher_type, :redemption_time, :success
17
+
18
+ def location=(obj)
19
+ @location = Ravelin::Location.new(obj)
20
+ end
21
+ end
22
+ end
23
+
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.2
4
+ version: 0.1.3
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: 2016-08-23 00:00:00.000000000 Z
14
+ date: 2016-09-06 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: faraday
@@ -129,6 +129,7 @@ files:
129
129
  - lib/ravelin/transaction.rb
130
130
  - lib/ravelin/version.rb
131
131
  - lib/ravelin/voucher.rb
132
+ - lib/ravelin/voucher_redemption.rb
132
133
  homepage: https://developer.ravelin.com
133
134
  licenses:
134
135
  - MIT