tickethub 0.3.21 → 0.3.22

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: e9e8a89948125c8d6d784e70ca72baf416140339
4
- data.tar.gz: 3a2a848b68a9a4c2e9d52e1502db8a9544cac0b2
3
+ metadata.gz: de1554be2b9bd8a9122dfb3404cdfbf49c508abc
4
+ data.tar.gz: e86f4f7238bf5194ca1740d76edae1f7e932917e
5
5
  SHA512:
6
- metadata.gz: c454b463a8b651f9e5f4daf0388960eb9c03a57ae50a5a648c79a239fc3b93e68c270667c88cba5393e7650c8379d495a3b9e0bbb83e3ff23eb9440fbf324837
7
- data.tar.gz: df1bad7968a18dd322fd23ca71061bb4e5a135a33388372e5b56d3ebb4ad0fc79d4c4a8d19f457dea8863ffa05bb9d3ea9f3095382e67cb790458a797e9d606d
6
+ metadata.gz: ea16a6c1ce3fce503b75e48b2ce298192ad9e23970497f3fe259bb81737c7011e8b916f8b51c5b3412d665fce38386cf78580dcbc61391b59e717964fa448453
7
+ data.tar.gz: 850315e9c74ef3917ac99536983e112ffdefdaab01f2d20ae9d61cccb1d123e9ea9a82e50732eb9036306e685c94514fcd7d0a3c4c0edc9fcef4b87dc014b040
@@ -0,0 +1,21 @@
1
+ require_relative '../resource'
2
+
3
+ module Tickethub
4
+ class Supplier::Adjustment < Resource
5
+ path '/supplier/adjustments'
6
+
7
+ attribute :amount, type: :money
8
+
9
+ require_relative 'dispute'
10
+ require_relative 'transfer'
11
+ require_relative 'charge'
12
+
13
+ association :dispute, Supplier::Refund
14
+ association :transfer, Supplier::Transfer
15
+
16
+ collection :charges, Supplier::Charge
17
+
18
+ attribute :updated_at, type: :datetime
19
+ attribute :created_at, type: :datetime
20
+ end
21
+ end
@@ -4,12 +4,18 @@ module Tickethub
4
4
  class Supplier::Charge < Resource
5
5
  path '/supplier/charges'
6
6
 
7
- require_relative 'charge/gateway'
8
- require_relative 'charge/service'
9
-
10
7
  attribute :amount, type: :money
11
- attribute :vat, type: :money
8
+ attribute :tax, type: :money
9
+
10
+ association :context, -> (endpoint, attributes) {
11
+ case attributes['object']
12
+ when 'refund' then Supplier::Refund.call(endpoint, attributes)
13
+ when 'payment' then Supplier::Payment.call(endpoint, attributes)
14
+ when 'adjustment' then Supplier::Adjustment.call(endpoint, attributes)
15
+ end
16
+ }
12
17
 
18
+ attribute :updated_at, type: :datetime
13
19
  attribute :created_at, type: :datetime
14
20
  end
15
21
  end
@@ -2,8 +2,11 @@ module Tickethub
2
2
  class Supplier::Dispute < Resource
3
3
  path '/supplier/disputes'
4
4
 
5
- attribute :amount, type: :money
5
+ require_relative 'adjustment'
6
+
7
+ collection :adjustments, Supplier::Adjustment
6
8
 
9
+ attribute :amount, type: :money
7
10
  attribute :created_at, type: :datetime
8
11
  attribute :updated_at, type: :datetime
9
12
  end
@@ -4,18 +4,16 @@ module Tickethub
4
4
  class Supplier::Payment::Stripe < Supplier::Payment
5
5
  polymorphic 'stripe'
6
6
 
7
+ require_relative '../charge'
7
8
  require_relative '../source'
8
9
  require_relative '../dispute'
9
10
  require_relative '../../address'
10
- require_relative '../charge/gateway'
11
- require_relative '../charge/service'
11
+
12
+ collection :charges, Supplier::Charge
12
13
 
13
14
  association :dispute, Supplier::Dispute
14
15
  association :source, Supplier::Source
15
- association :address, Tickethub::Address
16
-
17
- association :gateway_charge, Supplier::Charge::Gateway
18
- association :service_charge, Supplier::Charge::Service
16
+ association :transfer, Supplier::Transfer
19
17
 
20
18
  attribute :charges, type: :money
21
19
  end
@@ -5,9 +5,15 @@ module Tickethub
5
5
  path '/supplier/refunds'
6
6
 
7
7
  require_relative 'payment'
8
+ require_relative 'user'
9
+ require_relative 'transfer'
10
+ require_relative 'charge'
8
11
 
9
12
  association :payment, Supplier::Payment
10
13
  association :user, Supplier::User
14
+ association :transfer, Supplier::Transfer
15
+
16
+ collection :charges, Supplier::Charge
11
17
 
12
18
  attribute :amount, type: :money
13
19
  attribute :currency, type: :currency
@@ -5,8 +5,12 @@ module Tickethub
5
5
  path '/supplier/transfers'
6
6
 
7
7
  require_relative 'payment'
8
+ require_relative 'refund'
9
+ require_relative 'adjustment'
8
10
 
9
11
  collection :payments, Supplier::Payment
12
+ collection :refunds, Supplier::Refund
13
+ collection :adjustments, Supplier::Adjustment
10
14
 
11
15
  attribute :amount, type: :money
12
16
  attribute :currency, type: :currency
@@ -2,7 +2,6 @@ module Tickethub
2
2
  class Supplier < Resource
3
3
  path '/supplier', singleton: true
4
4
 
5
- require_relative 'supplier/bill'
6
5
  require_relative 'supplier/customer'
7
6
  require_relative 'supplier/order'
8
7
  require_relative 'supplier/booking'
@@ -35,7 +34,6 @@ module Tickethub
35
34
  require_relative 'address'
36
35
  require_relative 'token'
37
36
 
38
- collection :bills, Bill
39
37
  collection :customers, Customer
40
38
  collection :orders, Order
41
39
  collection :bookings, Booking
@@ -1,3 +1,3 @@
1
1
  module Tickethub
2
- VERSION = '0.3.21'
2
+ VERSION = '0.3.22'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tickethub
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.21
4
+ version: 0.3.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Oliver Morgan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-04-23 00:00:00.000000000 Z
11
+ date: 2015-04-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -109,9 +109,9 @@ files:
109
109
  - lib/tickethub/response.rb
110
110
  - lib/tickethub/response/headers.rb
111
111
  - lib/tickethub/supplier.rb
112
+ - lib/tickethub/supplier/adjustment.rb
112
113
  - lib/tickethub/supplier/answer.rb
113
114
  - lib/tickethub/supplier/app.rb
114
- - lib/tickethub/supplier/bill.rb
115
115
  - lib/tickethub/supplier/booking.rb
116
116
  - lib/tickethub/supplier/booking/ticket.rb
117
117
  - lib/tickethub/supplier/booking/voucher.rb
@@ -141,7 +141,6 @@ files:
141
141
  - lib/tickethub/supplier/purchase.rb
142
142
  - lib/tickethub/supplier/question.rb
143
143
  - lib/tickethub/supplier/rate.rb
144
- - lib/tickethub/supplier/receipt.rb
145
144
  - lib/tickethub/supplier/refund.rb
146
145
  - lib/tickethub/supplier/reseller.rb
147
146
  - lib/tickethub/supplier/scan.rb
@@ -1,11 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Supplier::Bill < Resource
5
- path '/supplier/bills'
6
-
7
- require_relative 'receipt'
8
-
9
- collection :receipts, Supplier::Receipt
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Supplier::Receipt < Resource
5
- path '/supplier/receipts'
6
-
7
- require_relative 'bill'
8
-
9
- association :bill, Supplier::Bill
10
- end
11
- end