tickethub 0.3.67 → 0.3.68
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tickethub/channel/payment/paypal.rb +1 -1
- data/lib/tickethub/channel/payment/stripe.rb +1 -1
- data/lib/tickethub/resource.rb +13 -7
- data/lib/tickethub/supplier/charge.rb +3 -4
- data/lib/tickethub/supplier/message/email.rb +1 -1
- data/lib/tickethub/supplier/message/sms.rb +1 -1
- data/lib/tickethub/supplier/message.rb +4 -4
- data/lib/tickethub/supplier/order.rb +0 -2
- data/lib/tickethub/supplier/payment/cash.rb +1 -1
- data/lib/tickethub/supplier/payment/credit.rb +1 -1
- data/lib/tickethub/supplier/payment/direct.rb +1 -1
- data/lib/tickethub/supplier/payment/handpoint.rb +1 -1
- data/lib/tickethub/supplier/payment/paypal.rb +1 -1
- data/lib/tickethub/supplier/payment/spreedly.rb +1 -1
- data/lib/tickethub/supplier/payment/stripe.rb +1 -1
- data/lib/tickethub/supplier/payment.rb +0 -1
- data/lib/tickethub/supplier/reseller.rb +0 -2
- data/lib/tickethub/supplier/source/alipay.rb +1 -1
- data/lib/tickethub/supplier/source/bitcoin.rb +1 -1
- data/lib/tickethub/supplier/source/card.rb +1 -1
- data/lib/tickethub/supplier.rb +0 -2
- data/lib/tickethub/user.rb +0 -4
- data/lib/tickethub/version.rb +1 -1
- data/lib/tickethub.rb +0 -2
- metadata +2 -41
- data/lib/tickethub/app/category.rb +0 -7
- data/lib/tickethub/app/subscription.rb +0 -11
- data/lib/tickethub/app.rb +0 -34
- data/lib/tickethub/reseller/answer.rb +0 -11
- data/lib/tickethub/reseller/booking.rb +0 -40
- data/lib/tickethub/reseller/channel.rb +0 -15
- data/lib/tickethub/reseller/customer.rb +0 -11
- data/lib/tickethub/reseller/discount.rb +0 -12
- data/lib/tickethub/reseller/extra.rb +0 -12
- data/lib/tickethub/reseller/fee.rb +0 -15
- data/lib/tickethub/reseller/invoice.rb +0 -7
- data/lib/tickethub/reseller/option.rb +0 -14
- data/lib/tickethub/reseller/order.rb +0 -38
- data/lib/tickethub/reseller/payment/credit.rb +0 -7
- data/lib/tickethub/reseller/payment/stripe.rb +0 -11
- data/lib/tickethub/reseller/payment.rb +0 -29
- data/lib/tickethub/reseller/product.rb +0 -35
- data/lib/tickethub/reseller/purchase.rb +0 -19
- data/lib/tickethub/reseller/question.rb +0 -11
- data/lib/tickethub/reseller/refund.rb +0 -16
- data/lib/tickethub/reseller/scan.rb +0 -15
- data/lib/tickethub/reseller/source/alipay.rb +0 -7
- data/lib/tickethub/reseller/source/bitcoin.rb +0 -7
- data/lib/tickethub/reseller/source/card.rb +0 -9
- data/lib/tickethub/reseller/source.rb +0 -11
- data/lib/tickethub/reseller/supplier.rb +0 -19
- data/lib/tickethub/reseller/tax.rb +0 -16
- data/lib/tickethub/reseller/ticket.rb +0 -24
- data/lib/tickethub/reseller/tier.rb +0 -19
- data/lib/tickethub/reseller/user.rb +0 -9
- data/lib/tickethub/reseller/variant.rb +0 -10
- data/lib/tickethub/reseller.rb +0 -82
- data/lib/tickethub/supplier/app.rb +0 -5
- data/lib/tickethub/supplier/charge/gateway.rb +0 -7
- data/lib/tickethub/supplier/charge/service.rb +0 -7
- data/lib/tickethub/supplier/payment/complimentary.rb +0 -7
- data/lib/tickethub/supplier/subscription.rb +0 -13
- data/lib/tickethub/user/app.rb +0 -7
- data/lib/tickethub/user/reseller.rb +0 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 433a02361c6c852967e3faa7796fc0e920df5bd8
|
4
|
+
data.tar.gz: a998a97a94c7b25b938a8ab0394c476ec836df76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d52ac5a9afb737fa1cda4c34d08f16466caf14636672e328be99e88fae7d29623e31b891f6acf0c23363180f1650fee0cc122882bacd7d3ac0c43b462a1526cd
|
7
|
+
data.tar.gz: cb530e1d9235c209222e9f27532c620ab4ebd453ee0f57498759b401f00eac489df20a26f6de16d8d3542c124b34551ac9e6b721eb64e5cd2580ee3120680e99
|
data/lib/tickethub/resource.rb
CHANGED
@@ -55,12 +55,12 @@ module Tickethub
|
|
55
55
|
Tickethub::Collection.new Tickethub.endpoint[self.path], self, params
|
56
56
|
end
|
57
57
|
|
58
|
-
def self.polymorphic(type, attribute = :type)
|
59
|
-
self.superclass.register_type type, self, attribute
|
58
|
+
def self.polymorphic(type, method, attribute = :type)
|
59
|
+
self.superclass.register_type type, method, self, attribute
|
60
60
|
end
|
61
61
|
|
62
|
-
def self.register_type(type, klass, attribute = :type) # klass, attribute
|
63
|
-
self.registered_types[
|
62
|
+
def self.register_type(type, method, klass, attribute = :type) # klass, attribute
|
63
|
+
self.registered_types[method] = { type: type, klass: klass, attribute: attribute }
|
64
64
|
end
|
65
65
|
|
66
66
|
def self.attribute(key, options)
|
@@ -158,7 +158,7 @@ module Tickethub
|
|
158
158
|
attributes ||= endpoint.get params
|
159
159
|
|
160
160
|
klass = registered_types.find do |type, options|
|
161
|
-
attributes[options[:attribute].to_s] == type
|
161
|
+
attributes[options[:attribute].to_s] == options[:type]
|
162
162
|
end
|
163
163
|
|
164
164
|
klass = klass ? klass[1][:klass] : self
|
@@ -186,8 +186,14 @@ module Tickethub
|
|
186
186
|
|
187
187
|
def self.collection(key, klass, options = {}, &block)
|
188
188
|
define_method key do |params = {}|
|
189
|
-
|
190
|
-
|
189
|
+
if @attributes[key.to_sym].is_a? Array
|
190
|
+
@attributes[key.to_sym].collect do |attrs|
|
191
|
+
klass.call(@endpoint[key], attrs, options)
|
192
|
+
end
|
193
|
+
else
|
194
|
+
Tickethub::Collection.new(@endpoint[key], klass, params, options).tap do |collection|
|
195
|
+
collection.instance_eval &block if block
|
196
|
+
end
|
191
197
|
end
|
192
198
|
end
|
193
199
|
end
|
@@ -10,12 +10,11 @@ module Tickethub
|
|
10
10
|
require_relative 'partner'
|
11
11
|
|
12
12
|
association :partner, Supplier::Partner
|
13
|
-
|
14
13
|
association :context, -> (endpoint, attributes) {
|
15
14
|
case attributes['object']
|
16
|
-
when '
|
17
|
-
when '
|
18
|
-
when '
|
15
|
+
when 'Refund' then Supplier::Refund.call(endpoint, attributes)
|
16
|
+
when 'Payment' then Supplier::Payment.call(endpoint, attributes)
|
17
|
+
when 'Adjustment' then Supplier::Adjustment.call(endpoint, attributes)
|
19
18
|
end
|
20
19
|
}
|
21
20
|
|
@@ -15,10 +15,10 @@ module Tickethub
|
|
15
15
|
|
16
16
|
association :context, -> (endpoint, attributes, options = {}, params = {}) {
|
17
17
|
case attributes['object']
|
18
|
-
when '
|
19
|
-
when '
|
20
|
-
when '
|
21
|
-
when '
|
18
|
+
when 'Booking' then Supplier::Booking.call(endpoint, attributes, options, params)
|
19
|
+
when 'Customer' then Supplier::Customer.call(endpoint, attributes, options, params)
|
20
|
+
when 'Order' then Supplier::Order.call(endpoint, attributes, options, params)
|
21
|
+
when 'Reseller' then Supplier::Reseller.call(endpoint, attributes, options, params)
|
22
22
|
end
|
23
23
|
}
|
24
24
|
|
@@ -11,7 +11,6 @@ module Tickethub
|
|
11
11
|
require_relative 'reseller'
|
12
12
|
require_relative 'customer'
|
13
13
|
|
14
|
-
require_relative 'app'
|
15
14
|
require_relative 'user'
|
16
15
|
require_relative 'answer'
|
17
16
|
require_relative 'message'
|
@@ -32,7 +31,6 @@ module Tickethub
|
|
32
31
|
association :reseller, Supplier::Reseller
|
33
32
|
association :customer, Supplier::Customer
|
34
33
|
|
35
|
-
association :app, Supplier::App
|
36
34
|
association :user, Supplier::User
|
37
35
|
association :session, Supplier::Session
|
38
36
|
association :address, Tickethub::Address
|
@@ -4,7 +4,6 @@ module Tickethub
|
|
4
4
|
class Supplier::Reseller < Resource
|
5
5
|
path '/supplier/resellers'
|
6
6
|
|
7
|
-
require_relative 'user'
|
8
7
|
require_relative 'invoice'
|
9
8
|
require_relative 'product'
|
10
9
|
require_relative 'message'
|
@@ -22,7 +21,6 @@ module Tickethub
|
|
22
21
|
collection :products, Supplier::Product
|
23
22
|
collection :messages, Supplier::Message
|
24
23
|
collection :rates, Supplier::Rate
|
25
|
-
collection :users, Supplier::User, shallow: false
|
26
24
|
|
27
25
|
association :contact, Tickethub::Contact
|
28
26
|
association :address, Tickethub::Address
|
data/lib/tickethub/supplier.rb
CHANGED
@@ -10,7 +10,6 @@ module Tickethub
|
|
10
10
|
require_relative 'supplier/ticket'
|
11
11
|
require_relative 'supplier/extra'
|
12
12
|
require_relative 'supplier/product'
|
13
|
-
require_relative 'supplier/subscription'
|
14
13
|
require_relative 'supplier/season'
|
15
14
|
require_relative 'supplier/option'
|
16
15
|
require_relative 'supplier/variant'
|
@@ -45,7 +44,6 @@ module Tickethub
|
|
45
44
|
collection :tickets, Ticket
|
46
45
|
collection :extras, Extra
|
47
46
|
collection :products, Product
|
48
|
-
collection :subscriptions, Subscription
|
49
47
|
collection :seasons, Season
|
50
48
|
collection :options, Option
|
51
49
|
collection :variants, Variant
|
data/lib/tickethub/user.rb
CHANGED
@@ -2,12 +2,8 @@ module Tickethub
|
|
2
2
|
class User < Resource
|
3
3
|
path '/user', singleton: true
|
4
4
|
|
5
|
-
require_relative 'user/app'
|
6
|
-
require_relative 'user/reseller'
|
7
5
|
require_relative 'user/supplier'
|
8
6
|
|
9
|
-
collection :apps, User::App
|
10
|
-
collection :resellers, User::Reseller
|
11
7
|
collection :suppliers, User::Supplier
|
12
8
|
|
13
9
|
association :token, Tickethub::Token
|
data/lib/tickethub/version.rb
CHANGED
data/lib/tickethub.rb
CHANGED
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.
|
4
|
+
version: 0.3.68
|
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-
|
11
|
+
date: 2015-12-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -92,9 +92,6 @@ files:
|
|
92
92
|
- lib/tickethub.rb
|
93
93
|
- lib/tickethub/address.rb
|
94
94
|
- lib/tickethub/aggregate.rb
|
95
|
-
- lib/tickethub/app.rb
|
96
|
-
- lib/tickethub/app/category.rb
|
97
|
-
- lib/tickethub/app/subscription.rb
|
98
95
|
- lib/tickethub/channel.rb
|
99
96
|
- lib/tickethub/channel/answer.rb
|
100
97
|
- lib/tickethub/channel/booking.rb
|
@@ -129,48 +126,16 @@ files:
|
|
129
126
|
- lib/tickethub/formats/json_format.rb
|
130
127
|
- lib/tickethub/helpers.rb
|
131
128
|
- lib/tickethub/request.rb
|
132
|
-
- lib/tickethub/reseller.rb
|
133
|
-
- lib/tickethub/reseller/answer.rb
|
134
|
-
- lib/tickethub/reseller/booking.rb
|
135
|
-
- lib/tickethub/reseller/channel.rb
|
136
|
-
- lib/tickethub/reseller/customer.rb
|
137
|
-
- lib/tickethub/reseller/discount.rb
|
138
|
-
- lib/tickethub/reseller/extra.rb
|
139
|
-
- lib/tickethub/reseller/fee.rb
|
140
|
-
- lib/tickethub/reseller/invoice.rb
|
141
|
-
- lib/tickethub/reseller/option.rb
|
142
|
-
- lib/tickethub/reseller/order.rb
|
143
|
-
- lib/tickethub/reseller/payment.rb
|
144
|
-
- lib/tickethub/reseller/payment/credit.rb
|
145
|
-
- lib/tickethub/reseller/payment/stripe.rb
|
146
|
-
- lib/tickethub/reseller/product.rb
|
147
|
-
- lib/tickethub/reseller/purchase.rb
|
148
|
-
- lib/tickethub/reseller/question.rb
|
149
|
-
- lib/tickethub/reseller/refund.rb
|
150
|
-
- lib/tickethub/reseller/scan.rb
|
151
|
-
- lib/tickethub/reseller/source.rb
|
152
|
-
- lib/tickethub/reseller/source/alipay.rb
|
153
|
-
- lib/tickethub/reseller/source/bitcoin.rb
|
154
|
-
- lib/tickethub/reseller/source/card.rb
|
155
|
-
- lib/tickethub/reseller/supplier.rb
|
156
|
-
- lib/tickethub/reseller/tax.rb
|
157
|
-
- lib/tickethub/reseller/ticket.rb
|
158
|
-
- lib/tickethub/reseller/tier.rb
|
159
|
-
- lib/tickethub/reseller/user.rb
|
160
|
-
- lib/tickethub/reseller/variant.rb
|
161
129
|
- lib/tickethub/resource.rb
|
162
130
|
- lib/tickethub/response.rb
|
163
131
|
- lib/tickethub/response/headers.rb
|
164
132
|
- lib/tickethub/supplier.rb
|
165
133
|
- lib/tickethub/supplier/adjustment.rb
|
166
134
|
- lib/tickethub/supplier/answer.rb
|
167
|
-
- lib/tickethub/supplier/app.rb
|
168
135
|
- lib/tickethub/supplier/booking.rb
|
169
136
|
- lib/tickethub/supplier/broadcast.rb
|
170
137
|
- lib/tickethub/supplier/channel.rb
|
171
138
|
- lib/tickethub/supplier/charge.rb
|
172
|
-
- lib/tickethub/supplier/charge/gateway.rb
|
173
|
-
- lib/tickethub/supplier/charge/service.rb
|
174
139
|
- lib/tickethub/supplier/coupon.rb
|
175
140
|
- lib/tickethub/supplier/customer.rb
|
176
141
|
- lib/tickethub/supplier/discount.rb
|
@@ -188,7 +153,6 @@ files:
|
|
188
153
|
- lib/tickethub/supplier/partner.rb
|
189
154
|
- lib/tickethub/supplier/payment.rb
|
190
155
|
- lib/tickethub/supplier/payment/cash.rb
|
191
|
-
- lib/tickethub/supplier/payment/complimentary.rb
|
192
156
|
- lib/tickethub/supplier/payment/credit.rb
|
193
157
|
- lib/tickethub/supplier/payment/direct.rb
|
194
158
|
- lib/tickethub/supplier/payment/handpoint.rb
|
@@ -208,7 +172,6 @@ files:
|
|
208
172
|
- lib/tickethub/supplier/source/alipay.rb
|
209
173
|
- lib/tickethub/supplier/source/bitcoin.rb
|
210
174
|
- lib/tickethub/supplier/source/card.rb
|
211
|
-
- lib/tickethub/supplier/subscription.rb
|
212
175
|
- lib/tickethub/supplier/tax.rb
|
213
176
|
- lib/tickethub/supplier/ticket.rb
|
214
177
|
- lib/tickethub/supplier/tier.rb
|
@@ -217,8 +180,6 @@ files:
|
|
217
180
|
- lib/tickethub/supplier/variant.rb
|
218
181
|
- lib/tickethub/token.rb
|
219
182
|
- lib/tickethub/user.rb
|
220
|
-
- lib/tickethub/user/app.rb
|
221
|
-
- lib/tickethub/user/reseller.rb
|
222
183
|
- lib/tickethub/user/supplier.rb
|
223
184
|
- lib/tickethub/version.rb
|
224
185
|
- tickethub.gemspec
|
data/lib/tickethub/app.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
module Tickethub
|
2
|
-
class App < Resource
|
3
|
-
path '/apps'
|
4
|
-
|
5
|
-
require_relative 'contact'
|
6
|
-
require_relative 'app/category'
|
7
|
-
require_relative 'app/subscription'
|
8
|
-
|
9
|
-
association :contact, Tickethub::Contact
|
10
|
-
association :token, Tickethub::Token
|
11
|
-
|
12
|
-
association :category, App::Category
|
13
|
-
collection :subscriptions, App::Subscription
|
14
|
-
|
15
|
-
attribute :currency, type: :currency
|
16
|
-
|
17
|
-
def self.[](attributes)
|
18
|
-
token = attributes[:token].is_a?(String) ? attributes[:token]
|
19
|
-
: attributes[:token][:access_token]
|
20
|
-
self.new Tickethub.endpoint(auth_type: :bearer, password: token)['/app']
|
21
|
-
end
|
22
|
-
|
23
|
-
def initialize(endpoint, attributes = nil)
|
24
|
-
attributes ||= endpoint.get
|
25
|
-
|
26
|
-
if attributes['token']
|
27
|
-
endpoint = Tickethub.endpoint(auth_type: :bearer,
|
28
|
-
password: attributes['token']['access_token'])[self.class.path]
|
29
|
-
end
|
30
|
-
|
31
|
-
super(endpoint, attributes)
|
32
|
-
end
|
33
|
-
end
|
34
|
-
end
|
@@ -1,40 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Booking < Resource
|
5
|
-
path '/reseller/bookings'
|
6
|
-
|
7
|
-
require_relative 'order'
|
8
|
-
require_relative 'answer'
|
9
|
-
require_relative 'product'
|
10
|
-
require_relative 'variant'
|
11
|
-
require_relative 'purchase'
|
12
|
-
require_relative 'discount'
|
13
|
-
require_relative 'fee'
|
14
|
-
require_relative 'tier'
|
15
|
-
require_relative 'ticket'
|
16
|
-
|
17
|
-
collection :answers, Reseller::Answer
|
18
|
-
collection :purchases, Reseller::Purchase
|
19
|
-
collection :fees, Reseller::Fee
|
20
|
-
collection :tiers, Reseller::Tier
|
21
|
-
collection :tickets, Reseller::Ticket
|
22
|
-
collection :discounts, Reseller::Discount
|
23
|
-
|
24
|
-
association :order, Reseller::Order
|
25
|
-
association :product, Reseller::Product
|
26
|
-
association :variant, Reseller::Variant
|
27
|
-
|
28
|
-
attribute :expires_on, type: :date
|
29
|
-
attribute :valid_from, type: :datetime
|
30
|
-
|
31
|
-
attribute :amount, type: :money
|
32
|
-
attribute :discount, type: :money
|
33
|
-
attribute :tax, type: :money
|
34
|
-
attribute :total, type: :money
|
35
|
-
|
36
|
-
attribute :created_at, type: :datetime
|
37
|
-
attribute :updated_at, type: :datetime
|
38
|
-
attribute :cancelled_at, type: :datetime
|
39
|
-
end
|
40
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Channel < Resource
|
5
|
-
path '/reseller/channels'
|
6
|
-
|
7
|
-
require_relative 'product'
|
8
|
-
require_relative '../token'
|
9
|
-
|
10
|
-
association :product, Reseller::Product
|
11
|
-
|
12
|
-
attribute :updated_at, type: :datetime
|
13
|
-
attribute :created_at, type: :datetime
|
14
|
-
end
|
15
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Fee < Resource
|
5
|
-
path '/reseller/fees'
|
6
|
-
|
7
|
-
require_relative 'tax'
|
8
|
-
require_relative 'booking'
|
9
|
-
|
10
|
-
association :tax, Reseller::Tax
|
11
|
-
association :booking, Reseller::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 Reseller::Option < Resource
|
5
|
-
path '/reseller/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 Reseller::Order < Resource
|
5
|
-
path '/reseller/orders'
|
6
|
-
|
7
|
-
require_relative 'customer'
|
8
|
-
require_relative 'booking'
|
9
|
-
require_relative 'payment'
|
10
|
-
|
11
|
-
require_relative 'customer'
|
12
|
-
require_relative 'user'
|
13
|
-
|
14
|
-
require_relative 'answer'
|
15
|
-
require_relative '../address'
|
16
|
-
|
17
|
-
collection :bookings, Reseller::Booking
|
18
|
-
collection :payments, Reseller::Payment
|
19
|
-
collection :answers, Reseller::Answer
|
20
|
-
|
21
|
-
association :customer, Reseller::Customer
|
22
|
-
association :user, Reseller::User
|
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,29 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Payment < Resource
|
5
|
-
path '/reseller/payments'
|
6
|
-
|
7
|
-
require_relative 'refund'
|
8
|
-
|
9
|
-
require_relative 'payment/credit'
|
10
|
-
require_relative 'payment/stripe'
|
11
|
-
|
12
|
-
require_relative 'order'
|
13
|
-
require_relative 'user'
|
14
|
-
|
15
|
-
association :order, Reseller::Order
|
16
|
-
association :user, Reseller::User
|
17
|
-
|
18
|
-
collection :refunds, Reseller::Refund
|
19
|
-
|
20
|
-
attribute :amount, type: :money
|
21
|
-
attribute :refunded, type: :money
|
22
|
-
attribute :balance, type: :money
|
23
|
-
attribute :refunded_at, type: :datetime
|
24
|
-
attribute :confirmed_at, type: :datetime
|
25
|
-
|
26
|
-
attribute :created_at, type: :datetime
|
27
|
-
attribute :updated_at, type: :datetime
|
28
|
-
end
|
29
|
-
end
|
@@ -1,35 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Product < Resource
|
5
|
-
path '/reseller/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, Reseller::Booking
|
22
|
-
collection :extras, Reseller::Extra
|
23
|
-
collection :options, Reseller::Option
|
24
|
-
collection :tiers, Reseller::Tier
|
25
|
-
collection :variants, Reseller::Variant
|
26
|
-
collection :questions, Reseller::Question
|
27
|
-
collection :taxes, Reseller::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 Reseller::Purchase < Resource
|
5
|
-
path '/reseller/purchases'
|
6
|
-
|
7
|
-
require_relative 'booking'
|
8
|
-
require_relative 'extra'
|
9
|
-
|
10
|
-
association :booking, Reseller::Booking
|
11
|
-
association :extra, Reseller::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,16 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Refund < Resource
|
5
|
-
path '/reseller/refunds'
|
6
|
-
|
7
|
-
require_relative 'payment'
|
8
|
-
|
9
|
-
association :payment, Reseller::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,15 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Scan < Resource
|
5
|
-
path '/reseller/scans'
|
6
|
-
|
7
|
-
require_relative 'ticket'
|
8
|
-
|
9
|
-
collection :tickets, Reseller::Ticket
|
10
|
-
|
11
|
-
attribute :at, type: :datetime
|
12
|
-
attribute :updated_at, type: :datetime
|
13
|
-
attribute :created_at, type: :datetime
|
14
|
-
end
|
15
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Supplier < Resource
|
5
|
-
path '/reseller/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,16 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Tax < Resource
|
5
|
-
path '/reseller/taxes'
|
6
|
-
|
7
|
-
require_relative 'fee'
|
8
|
-
require_relative 'product'
|
9
|
-
|
10
|
-
association :product, Reseller::Product
|
11
|
-
collection :fees, Reseller::Fee
|
12
|
-
|
13
|
-
attribute :updated_at, type: :datetime
|
14
|
-
attribute :created_at, type: :datetime
|
15
|
-
end
|
16
|
-
end
|
@@ -1,24 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Ticket < Resource
|
5
|
-
path '/reseller/tickets'
|
6
|
-
|
7
|
-
require_relative 'booking'
|
8
|
-
require_relative 'tier'
|
9
|
-
require_relative 'scan'
|
10
|
-
|
11
|
-
association :booking, Reseller::Booking
|
12
|
-
association :tier, Reseller::Tier
|
13
|
-
|
14
|
-
collection :scans, Reseller::Scan
|
15
|
-
|
16
|
-
attribute :price, type: :money
|
17
|
-
attribute :interval, type: :duration
|
18
|
-
|
19
|
-
attribute :last_scan_at, type: :datetime
|
20
|
-
attribute :expires_at, type: :datetime
|
21
|
-
attribute :updated_at, type: :datetime
|
22
|
-
attribute :created_at, type: :datetime
|
23
|
-
end
|
24
|
-
end
|
@@ -1,19 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Reseller::Tier < Resource
|
5
|
-
path '/reseller/tiers'
|
6
|
-
|
7
|
-
require_relative 'product'
|
8
|
-
|
9
|
-
association :product, Reseller::Product
|
10
|
-
|
11
|
-
attribute :price, type: :money
|
12
|
-
|
13
|
-
attribute :notice, type: :duration
|
14
|
-
attribute :period, type: :duration
|
15
|
-
|
16
|
-
attribute :interval, type: :duration
|
17
|
-
attribute :duration, type: :duration
|
18
|
-
end
|
19
|
-
end
|
data/lib/tickethub/reseller.rb
DELETED
@@ -1,82 +0,0 @@
|
|
1
|
-
module Tickethub
|
2
|
-
class Reseller < Resource
|
3
|
-
path '/resellers'
|
4
|
-
|
5
|
-
require_relative 'reseller/customer'
|
6
|
-
require_relative 'reseller/order'
|
7
|
-
require_relative 'reseller/booking'
|
8
|
-
require_relative 'reseller/ticket'
|
9
|
-
require_relative 'reseller/extra'
|
10
|
-
require_relative 'reseller/product'
|
11
|
-
require_relative 'reseller/option'
|
12
|
-
require_relative 'reseller/variant'
|
13
|
-
require_relative 'reseller/tier'
|
14
|
-
|
15
|
-
require_relative 'reseller/invoice'
|
16
|
-
require_relative 'reseller/payment'
|
17
|
-
require_relative 'reseller/user'
|
18
|
-
require_relative 'reseller/question'
|
19
|
-
require_relative 'reseller/answer'
|
20
|
-
require_relative 'reseller/tax'
|
21
|
-
require_relative 'reseller/fee'
|
22
|
-
require_relative 'reseller/source'
|
23
|
-
require_relative 'reseller/discount'
|
24
|
-
|
25
|
-
require_relative 'contact'
|
26
|
-
require_relative 'address'
|
27
|
-
require_relative 'token'
|
28
|
-
require_relative 'supplier'
|
29
|
-
|
30
|
-
collection :customers, Customer
|
31
|
-
collection :orders, Order
|
32
|
-
collection :bookings, Booking
|
33
|
-
collection :tickets, Ticket
|
34
|
-
collection :extras, Extra
|
35
|
-
collection :products, Product
|
36
|
-
collection :options, Option
|
37
|
-
collection :variants, Variant
|
38
|
-
collection :tiers, Tier
|
39
|
-
collection :invoices, Invoice
|
40
|
-
collection :payments, Payment
|
41
|
-
collection :users, User
|
42
|
-
collection :questions, Question
|
43
|
-
collection :answers, Answer
|
44
|
-
collection :taxes, Tax
|
45
|
-
collection :fees, Fee
|
46
|
-
collection :sources, Source
|
47
|
-
collection :discount, Discount
|
48
|
-
|
49
|
-
association :contact, Tickethub::Contact
|
50
|
-
association :address, Tickethub::Address
|
51
|
-
association :supplier, Tickethub::Supplier
|
52
|
-
association :token, Tickethub::Token
|
53
|
-
|
54
|
-
attribute :period, type: :duration
|
55
|
-
attribute :notice, type: :duration
|
56
|
-
attribute :currency, type: :currency
|
57
|
-
|
58
|
-
attribute :limit, type: :money
|
59
|
-
attribute :balance, type: :money
|
60
|
-
attribute :overdue, type: :money
|
61
|
-
|
62
|
-
attribute :next_invoice_date, type: :date
|
63
|
-
attribute :first_invoice_date, type: :date
|
64
|
-
|
65
|
-
def self.[](attributes)
|
66
|
-
token = attributes[:token].is_a?(String) ? attributes[:token]
|
67
|
-
: attributes[:token][:access_token]
|
68
|
-
self.new Tickethub.endpoint(auth_type: :bearer, password: token)['/reseller']
|
69
|
-
end
|
70
|
-
|
71
|
-
def initialize(endpoint, attributes = nil)
|
72
|
-
attributes ||= endpoint.get
|
73
|
-
|
74
|
-
if attributes['token']
|
75
|
-
endpoint = Tickethub.endpoint(auth_type: :bearer,
|
76
|
-
password: attributes['token']['access_token'])[self.class.path]
|
77
|
-
end
|
78
|
-
|
79
|
-
super(endpoint, attributes)
|
80
|
-
end
|
81
|
-
end
|
82
|
-
end
|
@@ -1,13 +0,0 @@
|
|
1
|
-
require_relative '../resource'
|
2
|
-
|
3
|
-
module Tickethub
|
4
|
-
class Supplier::Subscription < Resource
|
5
|
-
path '/supplier/subscriptions'
|
6
|
-
|
7
|
-
require_relative 'app'
|
8
|
-
require_relative '../token'
|
9
|
-
|
10
|
-
association :app, Supplier::App
|
11
|
-
association :token, Token
|
12
|
-
end
|
13
|
-
end
|
data/lib/tickethub/user/app.rb
DELETED