gotransverse-tract-api 0.4.3 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/gotransverse-tract-api/billing_account/billing_account.rb +71 -59
- data/lib/gotransverse-tract-api/billing_account/counter.rb +37 -2
- data/lib/gotransverse-tract-api/general_ledger/gl_aggregate_batch.rb +9 -1
- data/lib/gotransverse-tract-api/general_ledger/gl_transaction_batch.rb +6 -1
- data/lib/gotransverse-tract-api/order/people.rb +10 -1
- data/lib/gotransverse-tract-api/service/service.rb +143 -135
- data/lib/gotransverse-tract-api/service/service_resource.rb +39 -30
- data/lib/gotransverse-tract-api/usage/usage_event.rb +28 -14
- data/lib/gotransverse-tract-api/version.rb +1 -1
- data/lib/gotransverse-tract-api.rb +4 -3
- data/spec/gotransverse-tract-api/billing_account/billing_account_spec.rb +50 -34
- data/spec/gotransverse-tract-api/billing_account/counter_spec.rb +21 -0
- data/spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb +21 -0
- data/spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb +21 -0
- data/spec/gotransverse-tract-api/order/people_spec.rb +12 -0
- data/spec/gotransverse-tract-api/product/product_price_spec.rb +23 -0
- data/spec/gotransverse-tract-api/product/product_spec.rb +3 -3
- data/spec/gotransverse-tract-api/service/service_resource_spec.rb +9 -0
- data/spec/gotransverse-tract-api/service/service_spec.rb +10 -1
- data/spec/gotransverse-tract-api/usage/usage_event_spec.rb +2 -2
- metadata +10 -2
@@ -9,8 +9,8 @@ module GoTransverseTractApi
|
|
9
9
|
let(:eid) { '48406' }
|
10
10
|
let(:addresses) { {
|
11
11
|
:email_address => {
|
12
|
-
:purpose => '
|
13
|
-
:email => 'test@
|
12
|
+
:purpose => 'PRIMARY',
|
13
|
+
:email => 'test@gotransverse.com'
|
14
14
|
},
|
15
15
|
:postal_address => {
|
16
16
|
:purpose => 'BILLING',
|
@@ -95,6 +95,8 @@ module GoTransverseTractApi
|
|
95
95
|
|
96
96
|
context ".add_recurring_payment" do
|
97
97
|
it "adds a recurring payment to the billing account" do
|
98
|
+
eid = '29'
|
99
|
+
|
98
100
|
data = {
|
99
101
|
:billing_account => {eid: eid},
|
100
102
|
:recurring_payment => {
|
@@ -102,7 +104,7 @@ module GoTransverseTractApi
|
|
102
104
|
:card_type => 'VISA',
|
103
105
|
:card_holder_first_name => 'Mary',
|
104
106
|
:card_holder_last_name => 'Smith',
|
105
|
-
:card_identifier_number => '
|
107
|
+
:card_identifier_number => '4111111111111111',
|
106
108
|
:card_expiration => '12/2016'
|
107
109
|
}
|
108
110
|
}
|
@@ -180,13 +182,13 @@ module GoTransverseTractApi
|
|
180
182
|
it "creates a billing account" do
|
181
183
|
data = {
|
182
184
|
:bill_type => 'EMAIL',
|
183
|
-
:daily_bill_cycle => { eid: '
|
185
|
+
:daily_bill_cycle => { eid: '29' },
|
184
186
|
:organization => {
|
185
|
-
:name => '
|
187
|
+
:name => 'LMH Services',
|
186
188
|
:addresses => addresses
|
187
189
|
},
|
188
190
|
:billing_account_category => {
|
189
|
-
eid: '
|
191
|
+
eid: '6'
|
190
192
|
}
|
191
193
|
}
|
192
194
|
|
@@ -229,8 +231,8 @@ module GoTransverseTractApi
|
|
229
231
|
|
230
232
|
data = {
|
231
233
|
:sales_order => {
|
232
|
-
:referral => '
|
233
|
-
:order_date => '2015-07-
|
234
|
+
:referral => 'Unit Test Referral',
|
235
|
+
:order_date => '2015-07-09T17:22:13',
|
234
236
|
:order_status => 'DRAFT',
|
235
237
|
:order_items => {
|
236
238
|
:page_number => '1',
|
@@ -241,20 +243,20 @@ module GoTransverseTractApi
|
|
241
243
|
:order_item => {
|
242
244
|
:quantity => '1',
|
243
245
|
:products => [{
|
244
|
-
:name => '
|
246
|
+
:name => 'Simple Subscription',
|
245
247
|
:description => 'dsfsgegebdbb',
|
246
248
|
:short_description => 'asfgerdbdb',
|
247
|
-
:product_type_code => '
|
248
|
-
:product_state => '
|
249
|
-
:requires_agreement => '
|
250
|
-
:serialized => '
|
249
|
+
:product_type_code => 'SUBSCRIPTION',
|
250
|
+
:product_state => 'PRODUCT_AVAILABLE',
|
251
|
+
:requires_agreement => 'false',
|
252
|
+
:serialized => 'true',
|
251
253
|
:taxable => 'false',
|
252
|
-
:trial => '
|
253
|
-
:default_quantity => '
|
254
|
+
:trial => 'false',
|
255
|
+
:default_quantity => '1',
|
254
256
|
:min_service_resources => '0',
|
255
257
|
:max_service_resources => '0',
|
256
258
|
:trial_override => 'false',
|
257
|
-
eid
|
259
|
+
:eid => '51',
|
258
260
|
:product_prices => {
|
259
261
|
:page_number => '1',
|
260
262
|
:page_size => '50',
|
@@ -266,7 +268,7 @@ module GoTransverseTractApi
|
|
266
268
|
:price_override => 'true',
|
267
269
|
:type => 'OneTime',
|
268
270
|
:recurring_payment_required => 'false',
|
269
|
-
eid
|
271
|
+
:eid => '82',
|
270
272
|
:price_ranges => {
|
271
273
|
:page_number => '1',
|
272
274
|
:page_size => '50',
|
@@ -277,7 +279,7 @@ module GoTransverseTractApi
|
|
277
279
|
:quantity_begin_range => '0.00',
|
278
280
|
:price => '100.00',
|
279
281
|
:level => '1',
|
280
|
-
eid
|
282
|
+
:eid => '103'
|
281
283
|
}]
|
282
284
|
}
|
283
285
|
},
|
@@ -286,7 +288,7 @@ module GoTransverseTractApi
|
|
286
288
|
:price_override => 'true',
|
287
289
|
:type => 'Recurring',
|
288
290
|
:recurring_payment_required => 'false',
|
289
|
-
eid
|
291
|
+
:eid => '82',
|
290
292
|
:price_ranges => {
|
291
293
|
:page_number => '1',
|
292
294
|
:page_size => '50',
|
@@ -297,16 +299,16 @@ module GoTransverseTractApi
|
|
297
299
|
:quantity_begin_range => '0.00',
|
298
300
|
:price => '10.00',
|
299
301
|
:level => '1',
|
300
|
-
eid
|
302
|
+
:eid => '103'
|
301
303
|
}]
|
302
304
|
}
|
303
305
|
}]
|
304
306
|
},
|
305
307
|
:product_category => {
|
306
|
-
:name => '
|
307
|
-
:description => '
|
308
|
-
:status => '
|
309
|
-
eid
|
308
|
+
:name => 'Default',
|
309
|
+
:description => 'Default Product Category',
|
310
|
+
:status => 'ACTIVE',
|
311
|
+
:eid => '8'
|
310
312
|
},
|
311
313
|
:actions => {
|
312
314
|
:page_number => '1',
|
@@ -326,15 +328,15 @@ module GoTransverseTractApi
|
|
326
328
|
}
|
327
329
|
},
|
328
330
|
:billing_account => {
|
329
|
-
:account_num => '
|
331
|
+
:account_num => '8',
|
330
332
|
:bill_type => 'EMAIL',
|
331
333
|
:automatic_recurring_payment => 'false',
|
332
|
-
:status => '
|
334
|
+
:status => 'ACTIVE',
|
333
335
|
:pending_charges_total => '0.00',
|
334
336
|
:balance => '-10.00',
|
335
337
|
:start_date => '2014-11-11T10:00:00',
|
336
338
|
:tax_exempt => 'false',
|
337
|
-
eid
|
339
|
+
:eid => '29',
|
338
340
|
:daily_bill_cycle => {
|
339
341
|
:name => 'daily 10 to 3',
|
340
342
|
:start_date => '2014-11-11T10:00:00',
|
@@ -342,26 +344,26 @@ module GoTransverseTractApi
|
|
342
344
|
:bill_cycle_type => 'Daily',
|
343
345
|
:auto_bill => 'true',
|
344
346
|
:status => 'ACTIVE',
|
345
|
-
eid
|
347
|
+
:eid => '25'
|
346
348
|
},
|
347
349
|
:person => {
|
348
350
|
:first_name => 'John',
|
349
351
|
:last_name => 'Smith',
|
350
352
|
:middle_name => 'S',
|
351
|
-
eid
|
353
|
+
:eid => '133',
|
352
354
|
:addresses => addresses
|
353
355
|
},
|
354
356
|
:billing_account_category => {
|
355
|
-
:type => 'All',
|
356
|
-
:description => '
|
357
|
-
:status => '
|
358
|
-
eid
|
357
|
+
:type => 'All Accounts',
|
358
|
+
:description => 'Default billing account category',
|
359
|
+
:status => 'BA_CATEGORY_ACTIVE',
|
360
|
+
:eid => '6'
|
359
361
|
},
|
360
362
|
:payment_term => {
|
361
363
|
:name => 'Immediate',
|
362
364
|
:term_days => '0',
|
363
365
|
:grace_days => '0',
|
364
|
-
eid
|
366
|
+
:eid => '8'
|
365
367
|
}
|
366
368
|
}
|
367
369
|
}
|
@@ -376,5 +378,19 @@ module GoTransverseTractApi
|
|
376
378
|
end
|
377
379
|
end
|
378
380
|
|
381
|
+
context ".update" do
|
382
|
+
it "updates a billing account" do
|
383
|
+
data = {
|
384
|
+
eid: eid,
|
385
|
+
bill_type: 'one time',
|
386
|
+
automatic_recurring_payment: 'true',
|
387
|
+
billing_account_category: { eid: '3453' }
|
388
|
+
}
|
389
|
+
|
390
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
391
|
+
expect(subject.update(eid, data)).to eq(response)
|
392
|
+
end
|
393
|
+
end
|
394
|
+
|
379
395
|
end
|
380
396
|
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module GoTransverseTractApi
|
4
|
+
|
5
|
+
RSpec.describe BillingAccount::Counter do
|
6
|
+
before(:each) { http_auth }
|
7
|
+
|
8
|
+
let(:eid) { '4096' }
|
9
|
+
let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
|
10
|
+
|
11
|
+
context ".update_usage_charge" do
|
12
|
+
it "updates a usage event" do
|
13
|
+
data = { eid: '4', charge: '77735' }
|
14
|
+
allow(subject).to receive(:update_usage_charge).with(eid, data).and_return(response)
|
15
|
+
expect(subject.update_usage_charge(eid, data)).to eq(response)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module GoTransverseTractApi
|
4
|
+
|
5
|
+
RSpec.describe GeneralLedger::GLAggregateBatch do
|
6
|
+
before(:each) { http_auth }
|
7
|
+
|
8
|
+
let(:eid) { '4096' }
|
9
|
+
let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
|
10
|
+
|
11
|
+
context ".update" do
|
12
|
+
it "updates an aggregate batch" do
|
13
|
+
data = { eid: eid, exported: 'true' }
|
14
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
15
|
+
expect(subject.update(eid, data)).to eq(response)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module GoTransverseTractApi
|
4
|
+
|
5
|
+
RSpec.describe GeneralLedger::GLTransactionBatch do
|
6
|
+
before(:each) { http_auth }
|
7
|
+
|
8
|
+
let(:eid) { '4096' }
|
9
|
+
let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
|
10
|
+
|
11
|
+
context ".update" do
|
12
|
+
it "updates a transaction" do
|
13
|
+
data = { eid: eid, exported: 'true' }
|
14
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
15
|
+
expect(subject.update(eid, data)).to eq(response)
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
@@ -5,6 +5,9 @@ module GoTransverseTractApi
|
|
5
5
|
RSpec.describe Order::People do
|
6
6
|
before(:each) { http_auth }
|
7
7
|
|
8
|
+
let(:eid) { '4096' }
|
9
|
+
let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
|
10
|
+
|
8
11
|
context ".add_address" do
|
9
12
|
it "adds address for the customer" do
|
10
13
|
eid = '48406'
|
@@ -27,6 +30,15 @@ module GoTransverseTractApi
|
|
27
30
|
end
|
28
31
|
end
|
29
32
|
|
33
|
+
context ".update" do
|
34
|
+
it "updates a person details" do
|
35
|
+
data = { eid: eid, name: 'John Smith', tax_id_number: '124224242' }
|
36
|
+
|
37
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
38
|
+
expect(subject.update(eid, data)).to eq(response)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
30
42
|
end
|
31
43
|
end
|
32
44
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module GoTransverseTractApi
|
4
|
+
|
5
|
+
RSpec.describe Product::ProductPrice do
|
6
|
+
before(:each) { http_auth }
|
7
|
+
|
8
|
+
context ".find_by_eid" do
|
9
|
+
it "returns a product price for a given eid" do
|
10
|
+
data = described_class.find_by_eid(82)
|
11
|
+
expect(data).to_not be_nil
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
context ".find_by_product_eid" do
|
16
|
+
it "returns a product price for a given product eid" do
|
17
|
+
data = described_class.find_by_product_eid(51)
|
18
|
+
expect(data).to_not be_nil
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
@@ -8,14 +8,14 @@ module GoTransverseTractApi
|
|
8
8
|
context ".find_all" do
|
9
9
|
it "returns all products" do
|
10
10
|
data = described_class.find_all
|
11
|
-
expect(data.count).to be
|
11
|
+
expect(data.count).to be >= 0
|
12
12
|
end
|
13
13
|
end
|
14
14
|
|
15
15
|
context ".find_by_eid" do
|
16
16
|
it "returns a product for the given eid" do
|
17
|
-
data = described_class.find_by_eid(
|
18
|
-
expect(data['eid']).to
|
17
|
+
data = described_class.find_by_eid(0)
|
18
|
+
expect(data['eid']).to be_nil
|
19
19
|
end
|
20
20
|
end
|
21
21
|
end
|
@@ -79,5 +79,14 @@ module GoTransverseTractApi
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
context ".update" do
|
83
|
+
it "updates a service resource" do
|
84
|
+
data = { eid: eid, identifier: '2342', description: 'testing' }
|
85
|
+
|
86
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
87
|
+
expect(subject.update(eid, data)).to eq(response)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
82
91
|
end
|
83
92
|
end
|
@@ -189,6 +189,15 @@ module GoTransverseTractApi
|
|
189
189
|
expect(subject.remove_service_usage_rule_from_service(eid, data)).to eq(response)
|
190
190
|
end
|
191
191
|
end
|
192
|
-
|
192
|
+
|
193
|
+
context ".update" do
|
194
|
+
it "updates a service" do
|
195
|
+
data = { eid: eid, description: 'testing' }
|
196
|
+
|
197
|
+
allow(subject).to receive(:update).with(eid, data).and_return(response)
|
198
|
+
expect(subject.update(eid, data)).to eq(response)
|
199
|
+
end
|
200
|
+
end
|
201
|
+
|
193
202
|
end
|
194
203
|
end
|
@@ -9,7 +9,7 @@ module GoTransverseTractApi
|
|
9
9
|
let(:event) {
|
10
10
|
{
|
11
11
|
:start_time => '20151125T10:10:10',
|
12
|
-
:service_resource_id => '
|
12
|
+
:service_resource_id => 'LAP',
|
13
13
|
:usage_uom => 'EVENT',
|
14
14
|
:usage_amount => '1200.00',
|
15
15
|
:description => 'Testing',
|
@@ -19,7 +19,7 @@ module GoTransverseTractApi
|
|
19
19
|
|
20
20
|
context ".create_usage_event" do
|
21
21
|
it "creates a usage event" do
|
22
|
-
elem = { :
|
22
|
+
elem = { number01: '90', text01: 'LAP' }
|
23
23
|
|
24
24
|
data = event.delete_if do|k,v|
|
25
25
|
k.to_s == 'description'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gotransverse-tract-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.5.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julien DeFrance
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2016-01-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -204,13 +204,17 @@ files:
|
|
204
204
|
- spec/auth_helper.rb
|
205
205
|
- spec/gotransverse-tract-api/billing_account/adjustment_spec.rb
|
206
206
|
- spec/gotransverse-tract-api/billing_account/billing_account_spec.rb
|
207
|
+
- spec/gotransverse-tract-api/billing_account/counter_spec.rb
|
207
208
|
- spec/gotransverse-tract-api/billing_account/invoice_spec.rb
|
208
209
|
- spec/gotransverse-tract-api/billing_account/payment_spec.rb
|
209
210
|
- spec/gotransverse-tract-api/billing_account/refund_spec.rb
|
211
|
+
- spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
|
212
|
+
- spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
|
210
213
|
- spec/gotransverse-tract-api/order/order_item_spec.rb
|
211
214
|
- spec/gotransverse-tract-api/order/organization_spec.rb
|
212
215
|
- spec/gotransverse-tract-api/order/people_spec.rb
|
213
216
|
- spec/gotransverse-tract-api/order/sales_order_spec.rb
|
217
|
+
- spec/gotransverse-tract-api/product/product_price_spec.rb
|
214
218
|
- spec/gotransverse-tract-api/product/product_spec.rb
|
215
219
|
- spec/gotransverse-tract-api/service/service_resource_spec.rb
|
216
220
|
- spec/gotransverse-tract-api/service/service_spec.rb
|
@@ -245,13 +249,17 @@ test_files:
|
|
245
249
|
- spec/auth_helper.rb
|
246
250
|
- spec/gotransverse-tract-api/billing_account/adjustment_spec.rb
|
247
251
|
- spec/gotransverse-tract-api/billing_account/billing_account_spec.rb
|
252
|
+
- spec/gotransverse-tract-api/billing_account/counter_spec.rb
|
248
253
|
- spec/gotransverse-tract-api/billing_account/invoice_spec.rb
|
249
254
|
- spec/gotransverse-tract-api/billing_account/payment_spec.rb
|
250
255
|
- spec/gotransverse-tract-api/billing_account/refund_spec.rb
|
256
|
+
- spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
|
257
|
+
- spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
|
251
258
|
- spec/gotransverse-tract-api/order/order_item_spec.rb
|
252
259
|
- spec/gotransverse-tract-api/order/organization_spec.rb
|
253
260
|
- spec/gotransverse-tract-api/order/people_spec.rb
|
254
261
|
- spec/gotransverse-tract-api/order/sales_order_spec.rb
|
262
|
+
- spec/gotransverse-tract-api/product/product_price_spec.rb
|
255
263
|
- spec/gotransverse-tract-api/product/product_spec.rb
|
256
264
|
- spec/gotransverse-tract-api/service/service_resource_spec.rb
|
257
265
|
- spec/gotransverse-tract-api/service/service_spec.rb
|