tickethub 0.3.55 → 0.3.56

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: 2104dae8c56d244f9d0d90bede003ad3f7f0538d
4
- data.tar.gz: d326ad069be4b004c67211254861d0aa93cea2c4
3
+ metadata.gz: 2faf725e33ff7442bfe95986bd0c2237660556a7
4
+ data.tar.gz: 284bc2745dfaaf7d02f1c4b2c559d6d471355702
5
5
  SHA512:
6
- metadata.gz: f9e2f0c3716fbfe47175a363352b76766bd72145047a56882aa836783e10bdb5574e7334364f63f7ac011619c573a07237a04f5359ea083c793d16b45f7f2cea
7
- data.tar.gz: 259b8a4ecbfdf9c44c43cfd018ce847ae3d4bb81979ff3aebaf4c0ba897960928575cae6107da67c9a9314de50c1188569681a3d6c2c20fa749ecc92f2cd719c
6
+ metadata.gz: d3ea5294bfea89414c0873bde6b54a7faf9422b447ff470c32e874e850b113ad7903c86017682f29cd21145ab5eb7c6643c8407da26f69fc9817218434d21323
7
+ data.tar.gz: 35518440f8471ea1966f7aee12f29f0f315b898b583d46fc73c541f6aea54aaa98445fde97a4af75f08195f5108aa586db991e9bd5d6b072e672b35194f94a7a
@@ -12,8 +12,8 @@ module Tickethub
12
12
  def initialize(url, options = {})
13
13
  @url = url.to_s
14
14
  @id = SecureRandom.uuid
15
- @retries = 3
16
- @timeout = 30
15
+ @retries = 6
16
+ @timeout = 10
17
17
 
18
18
  @options = {
19
19
  :method => :get,
@@ -8,7 +8,7 @@ module Tickethub
8
8
  require_relative 'product'
9
9
  require_relative '../token'
10
10
 
11
- association :product, Supplier::Product
11
+ collection :products, Supplier::Product
12
12
  association :partner, Supplier::Partner
13
13
 
14
14
  attribute :updated_at, type: :datetime
@@ -11,6 +11,7 @@ module Tickethub
11
11
 
12
12
  require_relative 'booking'
13
13
  require_relative 'voucher'
14
+ require_relative 'channel'
14
15
  require_relative 'ticket'
15
16
  require_relative 'extra'
16
17
  require_relative 'fee'
@@ -30,6 +31,7 @@ module Tickethub
30
31
 
31
32
  collection :bookings, Supplier::Booking
32
33
  collection :vouchers, Supplier::Voucher
34
+ collection :channels, Supplier::Channel
33
35
  collection :tickets, Supplier::Ticket
34
36
  collection :extras, Supplier::Extra
35
37
  collection :fees, Supplier::Fee
@@ -1,3 +1,3 @@
1
1
  module Tickethub
2
- VERSION = '0.3.55'
2
+ VERSION = '0.3.56'
3
3
  end
data/lib/tickethub.rb CHANGED
@@ -24,7 +24,6 @@ module Tickethub
24
24
 
25
25
  require_relative 'tickethub/token'
26
26
  require_relative 'tickethub/supplier'
27
- require_relative 'tickethub/channel'
28
27
  require_relative 'tickethub/reseller'
29
28
  require_relative 'tickethub/app'
30
29
  require_relative 'tickethub/user'
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.55
4
+ version: 0.3.56
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-09-24 00:00:00.000000000 Z
11
+ date: 2015-10-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,32 +94,6 @@ files:
94
94
  - lib/tickethub/app.rb
95
95
  - lib/tickethub/app/category.rb
96
96
  - lib/tickethub/app/subscription.rb
97
- - lib/tickethub/channel.rb
98
- - lib/tickethub/channel/answer.rb
99
- - lib/tickethub/channel/booking.rb
100
- - lib/tickethub/channel/booking/ticket.rb
101
- - lib/tickethub/channel/booking/voucher.rb
102
- - lib/tickethub/channel/coupon.rb
103
- - lib/tickethub/channel/customer.rb
104
- - lib/tickethub/channel/discount.rb
105
- - lib/tickethub/channel/extra.rb
106
- - lib/tickethub/channel/fee.rb
107
- - lib/tickethub/channel/option.rb
108
- - lib/tickethub/channel/order.rb
109
- - lib/tickethub/channel/payment.rb
110
- - lib/tickethub/channel/payment/paypal.rb
111
- - lib/tickethub/channel/payment/stripe.rb
112
- - lib/tickethub/channel/product.rb
113
- - lib/tickethub/channel/purchase.rb
114
- - lib/tickethub/channel/question.rb
115
- - lib/tickethub/channel/refund.rb
116
- - lib/tickethub/channel/session.rb
117
- - lib/tickethub/channel/supplier.rb
118
- - lib/tickethub/channel/tax.rb
119
- - lib/tickethub/channel/ticket.rb
120
- - lib/tickethub/channel/tier.rb
121
- - lib/tickethub/channel/variant.rb
122
- - lib/tickethub/channel/voucher.rb
123
97
  - lib/tickethub/collection.rb
124
98
  - lib/tickethub/connection.rb
125
99
  - lib/tickethub/contact.rb
@@ -1,11 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Answer < Resource
5
- path '/channel/answers'
6
-
7
- require_relative 'question'
8
-
9
- association :question, Channel::Question
10
- end
11
- end
@@ -1,13 +0,0 @@
1
- require_relative '../booking'
2
-
3
- module Tickethub
4
- class Channel::Booking::Ticket < Channel::Booking
5
- polymorphic 'ticket'
6
-
7
- require_relative '../ticket'
8
-
9
- collection :tickets, Channel::Ticket
10
-
11
- attribute :valid_from, type: :datetime
12
- end
13
- end
@@ -1,13 +0,0 @@
1
- require_relative '../booking'
2
-
3
- module Tickethub
4
- class Channel::Booking::Voucher < Channel::Booking
5
- polymorphic 'voucher'
6
-
7
- require_relative '../voucher'
8
-
9
- collection :vouchers, Channel::Voucher
10
-
11
- attribute :expires_on, type: :date
12
- end
13
- end
@@ -1,38 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Booking < Resource
5
- path '/channel/bookings'
6
-
7
- require_relative 'booking/ticket'
8
- require_relative 'booking/voucher'
9
-
10
- require_relative 'order'
11
- require_relative 'answer'
12
- require_relative 'product'
13
- require_relative 'variant'
14
- require_relative 'purchase'
15
- require_relative 'discount'
16
- require_relative 'fee'
17
- require_relative 'tier'
18
-
19
- collection :answers, Channel::Answer
20
- collection :purchases, Channel::Purchase
21
- collection :fees, Channel::Fee
22
- collection :tiers, Channel::Tier
23
- collection :discounts, Channel::Discount
24
-
25
- association :order, Channel::Order
26
- association :product, Channel::Product
27
- association :variant, Channel::Variant
28
-
29
- attribute :amount, type: :money
30
- attribute :discount, type: :money
31
- attribute :tax, type: :money
32
- attribute :total, type: :money
33
-
34
- attribute :created_at, type: :datetime
35
- attribute :updated_at, type: :datetime
36
- attribute :cancelled_at, type: :datetime
37
- end
38
- end
@@ -1,14 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Coupon < Resource
5
- path '/channel/coupons'
6
-
7
- require_relative 'booking'
8
-
9
- collection :bookings, Channel::Booking
10
-
11
- attribute :valid_from, type: :date
12
- attribute :expires_on, type: :date
13
- end
14
- end
@@ -1,11 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Customer < Resource
5
- path '/channel/customers'
6
-
7
- require_relative '../address'
8
-
9
- association :address, Tickethub::Address
10
- end
11
- end
@@ -1,12 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Discount < Resource
5
- path '/channel/discounts'
6
-
7
- attribute :amount, type: :money
8
-
9
- attribute :created_at, type: :datetime
10
- attribute :updated_at, type: :datetime
11
- end
12
- end
@@ -1,12 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Extra < Resource
5
- path '/channel/extras'
6
-
7
- attribute :price, type: :money
8
-
9
- attribute :created_at, type: :datetime
10
- attribute :updated_at, type: :datetime
11
- end
12
- end
@@ -1,15 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Fee < Resource
5
- path '/channel/fees'
6
-
7
- require_relative 'tax'
8
- require_relative 'booking'
9
-
10
- association :tax, Channel::Tax
11
- association :booking, Channel::Booking
12
-
13
- attribute :amount, type: :money
14
- end
15
- end
@@ -1,14 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Option < Resource
5
- path '/channel/options'
6
-
7
- scope :dates, -> (params) { @endpoint[:dates].get(params).decoded }
8
-
9
- attribute :date_time, type: :datetime
10
-
11
- attribute :time, type: :time
12
- attribute :total, type: :money
13
- end
14
- end
@@ -1,38 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Order < Resource
5
- path '/channel/orders'
6
-
7
- require_relative 'customer'
8
- require_relative 'booking'
9
- require_relative 'payment'
10
-
11
- require_relative 'customer'
12
- require_relative 'session'
13
-
14
- require_relative 'answer'
15
- require_relative '../address'
16
-
17
- collection :bookings, Channel::Booking
18
- collection :payments, Channel::Payment
19
- collection :answers, Channel::Answer
20
-
21
- association :customer, Channel::Customer
22
- association :session, Channel::Session
23
- association :address, Tickethub::Address
24
-
25
- attribute :total, type: :money
26
- attribute :balance, type: :money
27
- attribute :currency, type: :currency
28
-
29
- attribute :expires_at, type: :datetime
30
- attribute :confirmed_at, type: :datetime
31
- attribute :created_at, type: :datetime
32
- attribute :updated_at, type: :datetime
33
-
34
- def confirm(params = {})
35
- self.load @endpoint[:confirm].post(params)
36
- end
37
- end
38
- end
@@ -1,8 +0,0 @@
1
- require_relative '../payment'
2
-
3
- module Tickethub
4
- class Channel::Payment::Paypal < Channel::Payment
5
- path '/channel/payments/paypal'
6
- polymorphic 'paypal'
7
- end
8
- end
@@ -1,8 +0,0 @@
1
- require_relative '../payment'
2
-
3
- module Tickethub
4
- class Channel::Payment::Stripe < Channel::Payment
5
- path '/channel/payments/stripe'
6
- polymorphic 'stripe'
7
- end
8
- end
@@ -1,27 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Payment < Resource
5
- path '/channel/payments'
6
-
7
- require_relative 'refund'
8
-
9
- require_relative 'payment/paypal'
10
- require_relative 'payment/stripe'
11
-
12
- require_relative 'order'
13
-
14
- association :order, Channel::Order
15
-
16
- collection :refunds, Channel::Refund
17
-
18
- attribute :amount, type: :money
19
- attribute :refunded, type: :money
20
- attribute :balance, type: :money
21
- attribute :refunded_at, type: :datetime
22
- attribute :confirmed_at, type: :datetime
23
-
24
- attribute :created_at, type: :datetime
25
- attribute :updated_at, type: :datetime
26
- end
27
- end
@@ -1,35 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Product < Resource
5
- path '/channel/products'
6
-
7
- require_relative 'booking'
8
- require_relative 'extra'
9
- require_relative 'option'
10
- require_relative 'tier'
11
- require_relative 'variant'
12
- require_relative 'question'
13
- require_relative 'tax'
14
-
15
- require_relative '../contact'
16
- require_relative '../address'
17
-
18
- association :contact, Tickethub::Contact
19
- association :address, Tickethub::Address
20
-
21
- collection :bookings, Channel::Booking
22
- collection :extras, Channel::Extra
23
- collection :options, Channel::Option
24
- collection :tiers, Channel::Tier
25
- collection :variants, Channel::Variant
26
- collection :questions, Channel::Question
27
- collection :taxes, Channel::Tax
28
-
29
- attribute :time_zone, type: :timezone
30
- attribute :currency, type: :currency
31
-
32
- attribute :created_at, type: :datetime
33
- attribute :updated_at, type: :datetime
34
- end
35
- end
@@ -1,19 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Purchase < Resource
5
- path '/channel/purchases'
6
-
7
- require_relative 'booking'
8
- require_relative 'extra'
9
-
10
- association :booking, Channel::Booking
11
- association :extra, Channel::Extra
12
-
13
- attribute :price, type: :money
14
- attribute :total, type: :money
15
-
16
- attribute :updated_at, type: :datetime
17
- attribute :created_at, type: :datetime
18
- end
19
- end
@@ -1,11 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Question < Resource
5
- path '/channel/questions'
6
-
7
- require_relative 'answer'
8
-
9
- collection :answers, Channel::Answer
10
- end
11
- end
@@ -1,16 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Refund < Resource
5
- path '/channel/refunds'
6
-
7
- require_relative 'payment'
8
-
9
- association :payment, Channel::Payment
10
-
11
- attribute :amount, type: :money
12
-
13
- attribute :created_at, type: :datetime
14
- attribute :updated_at, type: :datetime
15
- end
16
- end
@@ -1,10 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Session < Resource
5
- path '/channel/sessions'
6
-
7
- attribute :updated_at, type: :datetime
8
- attribute :created_at, type: :datetime
9
- end
10
- end
@@ -1,19 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Supplier < Resource
5
- path '/channel/suppliers'
6
-
7
- require_relative '../contact'
8
- require_relative '../address'
9
-
10
- association :contact, Tickethub::Contact
11
- association :address, Tickethub::Address
12
-
13
- attribute :time_zone, type: :timezone
14
- attribute :currency, type: :currency
15
-
16
- attribute :created_at, type: :datetime
17
- attribute :updated_at, type: :datetime
18
- end
19
- end
@@ -1,14 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Tax < Resource
5
- path '/channel/taxes'
6
-
7
- require_relative 'fee'
8
-
9
- collection :fees, Channel::Fee
10
-
11
- attribute :updated_at, type: :datetime
12
- attribute :created_at, type: :datetime
13
- end
14
- end
@@ -1,23 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Ticket < Resource
5
- path '/channel/tickets'
6
-
7
- require_relative 'booking'
8
- require_relative 'tier'
9
- require_relative 'voucher'
10
-
11
- association :booking, Channel::Booking
12
- association :tier, Channel::Tier
13
- association :voucher, Channel::Voucher
14
-
15
- attribute :price, type: :money
16
- attribute :interval, type: :duration
17
-
18
- attribute :last_scan_at, type: :datetime
19
- attribute :expires_at, type: :datetime
20
- attribute :updated_at, type: :datetime
21
- attribute :created_at, type: :datetime
22
- end
23
- end
@@ -1,15 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Tier < Resource
5
- path '/channel/tiers'
6
-
7
- attribute :price, type: :money
8
-
9
- attribute :notice, type: :duration
10
- attribute :period, type: :duration
11
-
12
- attribute :interval, type: :duration
13
- attribute :duration, type: :duration
14
- end
15
- end
@@ -1,7 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Variant < Resource
5
- path '/channel/variants'
6
- end
7
- end
@@ -1,19 +0,0 @@
1
- require_relative '../resource'
2
-
3
- module Tickethub
4
- class Channel::Voucher < Resource
5
- path '/channel/vouchers'
6
-
7
- require_relative 'tier'
8
- require_relative 'booking'
9
-
10
- association :tier, Channel::Tier
11
- association :booking, Channel::Booking
12
-
13
- attribute :price, type: :money
14
- attribute :total, type: :money
15
-
16
- attribute :created_at, type: :datetime
17
- attribute :updated_at, type: :datetime
18
- end
19
- end
@@ -1,50 +0,0 @@
1
- module Tickethub
2
- class Channel < Resource
3
- path '/channel', singleton: true
4
-
5
- require_relative 'channel/voucher'
6
- require_relative 'channel/coupon'
7
- require_relative 'channel/tier'
8
- require_relative 'channel/variant'
9
- require_relative 'channel/extra'
10
- require_relative 'channel/question'
11
- require_relative 'channel/booking'
12
- require_relative 'channel/order'
13
- require_relative 'channel/payment'
14
- require_relative 'channel/option'
15
-
16
- require_relative 'channel/product'
17
- require_relative 'channel/supplier'
18
-
19
- collection :vouchers, Voucher
20
- collection :coupons, Coupon
21
- collection :tiers, Tier
22
- collection :variants, Variant
23
- collection :extras, Extra
24
- collection :questions, Question
25
- collection :bookings, Booking
26
- collection :orders, Order
27
- collection :payments, Payment
28
- collection :options, Option
29
-
30
- association :product, Product
31
- association :supplier, Supplier
32
-
33
- def self.[](attributes)
34
- token = attributes[:token].is_a?(String) ? attributes[:token]
35
- : attributes[:token][:access_token]
36
- self.call Tickethub.endpoint(auth_type: :bearer, password: token)[path]
37
- end
38
-
39
- def initialize(endpoint, attributes = nil)
40
- attributes ||= endpoint.get
41
-
42
- if attributes['token']
43
- endpoint = Tickethub.endpoint(auth_type: :bearer,
44
- password: attributes['token']['access_token'])[self.class.path]
45
- end
46
-
47
- super(endpoint, attributes)
48
- end
49
- end
50
- end