gotransverse-tract-api 0.5.3 → 0.6.0
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 +4 -4
- data/lib/gotransverse-tract-api/order/sales_order.rb +0 -1
- data/lib/gotransverse-tract-api/product/discount_identifier.rb +4 -0
- data/lib/gotransverse-tract-api/version.rb +1 -1
- data/spec/gotransverse-tract-api/billing_account/adjustment_spec.rb +97 -97
- data/spec/gotransverse-tract-api/billing_account/billing_account_spec.rb +72 -72
- data/spec/gotransverse-tract-api/billing_account/invoice_spec.rb +13 -13
- data/spec/gotransverse-tract-api/billing_account/payment_spec.rb +9 -9
- data/spec/gotransverse-tract-api/billing_account/refund_spec.rb +4 -4
- data/spec/gotransverse-tract-api/order/order_item_spec.rb +117 -117
- data/spec/gotransverse-tract-api/order/organization_spec.rb +6 -6
- data/spec/gotransverse-tract-api/order/people_spec.rb +6 -6
- data/spec/gotransverse-tract-api/order/sales_order_spec.rb +48 -48
- data/spec/gotransverse-tract-api/product/discount_identifier_spec.rb +21 -0
- data/spec/gotransverse-tract-api/service/service_resource_spec.rb +7 -7
- data/spec/gotransverse-tract-api/service/service_spec.rb +81 -81
- data/spec/gotransverse-tract-api/usage/usage_event_spec.rb +6 -6
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38d5e395cc109d63df1a383e4da880936c48c88f
|
4
|
+
data.tar.gz: 3d000026b4e4891b3ec8843f590f973df4c3e3d5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a3afd99c0d101375ed395c93b06908668ef7634679edb1eedb495509042b12e2f248f06c7d5f07e4fda14016f81c94c20d9da42e6a25022fa90e9d8e8164540
|
7
|
+
data.tar.gz: fd350d19fbc19edc9e396a54b7c3c9aed55a20527c83dddbc08138f14bcbe751df8b2dbfb23184d6c13776f49a6d1e238d1f80520bbfdccd4da64f45bd099b0c
|
@@ -8,82 +8,82 @@ module GoTransverseTractApi
|
|
8
8
|
let(:response) { {a: 'b', c: 'd'} }
|
9
9
|
let(:eid) { '48406' }
|
10
10
|
let(:data) { {
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
11
|
+
full_amount: 'true',
|
12
|
+
occurred_on: '2014-10-01T000000',
|
13
|
+
amount: '1.00',
|
14
|
+
description: 'dsfsfsdfsdfsd sdsdsdvss',
|
15
|
+
invoiced: 'false',
|
16
|
+
credit: 'true',
|
17
|
+
status: 'pending',
|
18
|
+
type: 'MANUAL',
|
19
|
+
manual_invoice_application: 'true',
|
20
20
|
eid: '124343',
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
21
|
+
billing_account: {
|
22
|
+
account_num: '5635',
|
23
|
+
bill_type: 'EMAIL',
|
24
|
+
automatic_recurring_payment: 'false',
|
25
|
+
status: 'Active',
|
26
|
+
pending_charges_total: '0.00',
|
27
|
+
balance: '-10.00',
|
28
|
+
start_date: '2014-11-11T100000',
|
29
|
+
tax_exempt: 'false',
|
30
30
|
eid: '3663',
|
31
|
-
:
|
32
|
-
:
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
31
|
+
daily_bill_cycle: {
|
32
|
+
name: 'daily 10 to 3',
|
33
|
+
start_date: '2014-11-11T100000',
|
34
|
+
end_date: '2014-11-12T100000',
|
35
|
+
bill_cycle_type: 'Daily',
|
36
|
+
auto_bill: 'true',
|
37
|
+
use_payment_term: 'true',
|
38
|
+
status: 'ACTIVE',
|
39
39
|
eid: '223'
|
40
40
|
},
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
41
|
+
person: {
|
42
|
+
first_name: 'John',
|
43
|
+
last_name: 'Smith',
|
44
44
|
eid: '3305',
|
45
|
-
:
|
46
|
-
:
|
47
|
-
:
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
45
|
+
addresses: {
|
46
|
+
postal_address: {
|
47
|
+
purpose: 'BILLING',
|
48
|
+
country: 'USA',
|
49
|
+
city: 'Dallas',
|
50
|
+
region_or_state: 'TX',
|
51
|
+
postal_code: '78665',
|
52
|
+
line1: '123 Main St',
|
53
53
|
eid: '3453'
|
54
54
|
},
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
55
|
+
email_address: {
|
56
|
+
purpose: 'PRIMARY',
|
57
|
+
email: 'john@smith.com',
|
58
58
|
eid: '3453'
|
59
59
|
}
|
60
60
|
}
|
61
61
|
},
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
62
|
+
billing_account_category: {
|
63
|
+
type: 'All',
|
64
|
+
description: 'dsdgdg dhretsdfdg eggdg',
|
65
|
+
status: 'ACTIVE',
|
66
66
|
eid: '45354'
|
67
67
|
},
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
68
|
+
services: {
|
69
|
+
page_number: '1',
|
70
|
+
page_size: '50',
|
71
|
+
total_elements: '1',
|
72
|
+
element_count: '0',
|
73
|
+
total_pages: '1'
|
74
74
|
},
|
75
|
-
:
|
76
|
-
:
|
77
|
-
:
|
78
|
-
:
|
75
|
+
payment_term: {
|
76
|
+
name: 'Immediate',
|
77
|
+
term_days: '0',
|
78
|
+
grace_days: '0',
|
79
79
|
eid: '353'
|
80
80
|
}
|
81
81
|
},
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
82
|
+
reason: {
|
83
|
+
name: 'Default Credit Adjustment',
|
84
|
+
description: 'sefwgsvd dhgrgsfree ergreg',
|
85
|
+
status: 'Active',
|
86
|
+
credit_only: 'true',
|
87
87
|
eid: '99'
|
88
88
|
}
|
89
89
|
} }
|
@@ -109,17 +109,17 @@ module GoTransverseTractApi
|
|
109
109
|
context ".add_invoice_application" do
|
110
110
|
it "adds invoice application to adjustment" do
|
111
111
|
data[:invoice_adjustment_application] = {
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
117
|
-
:
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
:
|
112
|
+
amount: '1.0',
|
113
|
+
invoice: {
|
114
|
+
invoice_num: '23',
|
115
|
+
amount: '10.00',
|
116
|
+
pdf_path: 'https//my.tractbilling.com/t/s/r/1.28/invoices/2914/pdf',
|
117
|
+
occurred_on: '2014-10-10T000000',
|
118
|
+
due_date: '2014-10-10T000000',
|
119
|
+
amount_to_pay: '4.00',
|
120
|
+
late_fee_charged: 'false',
|
121
|
+
status: 'open',
|
122
|
+
usage_csv_path: 'https//my.tractbilling.com/t/s/r/1.28/invoices/2914/csv',
|
123
123
|
eid: '2342'
|
124
124
|
}
|
125
125
|
}
|
@@ -133,27 +133,27 @@ module GoTransverseTractApi
|
|
133
133
|
it "reverses invoice application from adjustment" do
|
134
134
|
|
135
135
|
data[:invoice_adjustment_application] = {
|
136
|
-
:
|
137
|
-
:
|
138
|
-
:
|
136
|
+
reversed: 'false',
|
137
|
+
applied_on: '2014-10-10T101010',
|
138
|
+
amount: '1.0',
|
139
139
|
eid: '197',
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
144
|
-
:
|
145
|
-
:
|
140
|
+
account_adjustment: {
|
141
|
+
invoiced: 'true',
|
142
|
+
credit: 'true',
|
143
|
+
status: 'POSTED',
|
144
|
+
posted_on: '2014-01-01T100000',
|
145
|
+
posted_by: 'Admin'
|
146
146
|
},
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
151
|
-
:
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
147
|
+
invoice: {
|
148
|
+
invoice_num: '23',
|
149
|
+
amount: '10.00',
|
150
|
+
pdf_path: 'https//my.tractbilling.com/t/s/r/1.28/invoices/2914/pdf',
|
151
|
+
occurred_on: '2014-10-10T000000',
|
152
|
+
due_date: '2014-10-10T000000',
|
153
|
+
amount_to_pay: '4.00',
|
154
|
+
late_fee_charged: 'false',
|
155
|
+
status: 'open',
|
156
|
+
usage_csv_path: 'https//my.tractbilling.com/t/s/r/1.28/invoices/2914/csv',
|
157
157
|
eid: '2342'
|
158
158
|
}
|
159
159
|
}
|
@@ -166,16 +166,16 @@ module GoTransverseTractApi
|
|
166
166
|
context ".create_adjustment" do
|
167
167
|
it "creates an adjustment" do
|
168
168
|
data = {
|
169
|
-
:
|
170
|
-
:
|
171
|
-
:
|
172
|
-
:
|
173
|
-
:
|
174
|
-
:
|
175
|
-
:
|
169
|
+
occurred_on: '2013-11-11T110000',
|
170
|
+
amount: '10.00',
|
171
|
+
description: 'some thing fishy',
|
172
|
+
type: 'MANUAL',
|
173
|
+
credit: 'true',
|
174
|
+
posted: 'false',
|
175
|
+
billing_account: {
|
176
176
|
eid: '322'
|
177
177
|
},
|
178
|
-
:
|
178
|
+
reason: {
|
179
179
|
eid: '6456'
|
180
180
|
}
|
181
181
|
}
|
@@ -8,26 +8,26 @@ module GoTransverseTractApi
|
|
8
8
|
let(:response) { {a: 'b', c: 'd'} }
|
9
9
|
let(:eid) { '165' }
|
10
10
|
let(:addresses) { {
|
11
|
-
:
|
12
|
-
:
|
13
|
-
:
|
11
|
+
email_address: {
|
12
|
+
purpose: 'PRIMARY',
|
13
|
+
email: 'test@gotransverse.com'
|
14
14
|
},
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
15
|
+
postal_address: {
|
16
|
+
purpose: 'BILLING',
|
17
|
+
country: 'USA',
|
18
|
+
city: 'Pleasanton',
|
19
|
+
region_or_state: 'CA',
|
20
|
+
attention: 'John Simth',
|
21
|
+
postal_code: '94588',
|
22
|
+
line1: '3423 something st.'
|
23
23
|
},
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
24
|
+
telecom_address: {
|
25
|
+
purpose: 'OFFICE',
|
26
|
+
dialing_prefix: '9',
|
27
|
+
country_code: '1',
|
28
|
+
area_code: '925',
|
29
|
+
number: '2341212',
|
30
|
+
extension: '21'
|
31
31
|
}
|
32
32
|
} }
|
33
33
|
|
@@ -41,25 +41,25 @@ module GoTransverseTractApi
|
|
41
41
|
context ".apply_payment" do
|
42
42
|
it "applies a payment to the invoice" do
|
43
43
|
data = {
|
44
|
-
:
|
44
|
+
billing_account: {
|
45
45
|
eid: '123'
|
46
46
|
},
|
47
|
-
:
|
47
|
+
invoice: {
|
48
48
|
eid: '456'
|
49
49
|
},
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
50
|
+
payment: {
|
51
|
+
amount: '27',
|
52
|
+
use_recurring_payment: 'false',
|
53
|
+
credit_card_payment: {
|
54
|
+
card_type: 'VISA',
|
55
|
+
card_holder_first_name: 'Mary',
|
56
|
+
card_holder_last_name: 'Smith',
|
57
|
+
card_identifier_number: '4111111111111111111',
|
58
|
+
card_verification_number: '123',
|
59
|
+
card_expiration: '12/2016',
|
60
|
+
description: 'Test Desc'
|
61
61
|
},
|
62
|
-
:
|
62
|
+
billing_account: {
|
63
63
|
eid: '123'
|
64
64
|
}
|
65
65
|
}
|
@@ -73,10 +73,10 @@ module GoTransverseTractApi
|
|
73
73
|
context ".suspend" do
|
74
74
|
it "suspends a billing account" do
|
75
75
|
data = {
|
76
|
-
:
|
76
|
+
billing_account: {
|
77
77
|
eid: '123'
|
78
78
|
},
|
79
|
-
:
|
79
|
+
reason: {
|
80
80
|
eid: '456'
|
81
81
|
}
|
82
82
|
}
|
@@ -89,9 +89,9 @@ module GoTransverseTractApi
|
|
89
89
|
context ".resume" do
|
90
90
|
it "resumes a billing account" do
|
91
91
|
data = {
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
92
|
+
billing_account: {eid: eid},
|
93
|
+
start_date: '2014-11-11T100000',
|
94
|
+
notes: 'Test notes here'
|
95
95
|
}
|
96
96
|
|
97
97
|
allow(subject).to receive(:resume).with(eid, data).and_return(response)
|
@@ -104,14 +104,14 @@ module GoTransverseTractApi
|
|
104
104
|
eid = '165'
|
105
105
|
|
106
106
|
data = {
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
107
|
+
billing_account: {eid: eid},
|
108
|
+
recurring_payment: {
|
109
|
+
credit_card_payment_method: {
|
110
|
+
card_type: 'MASTERCARD',
|
111
|
+
card_holder_first_name: 'Mary',
|
112
|
+
card_holder_last_name: 'Smith',
|
113
|
+
card_identifier_number: '5454545454545454',
|
114
|
+
card_expiration: '12/2016'
|
115
115
|
}
|
116
116
|
}
|
117
117
|
}
|
@@ -124,14 +124,14 @@ module GoTransverseTractApi
|
|
124
124
|
context ".change_service" do
|
125
125
|
it "changes service on a billing account" do
|
126
126
|
data = {
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
132
|
-
:
|
133
|
-
:
|
134
|
-
:
|
127
|
+
service: {eid: '136'},
|
128
|
+
order: {
|
129
|
+
note: 'Simple note',
|
130
|
+
order_items: {
|
131
|
+
order_item: {
|
132
|
+
quantity: 2,
|
133
|
+
description: 'change service',
|
134
|
+
products: [{
|
135
135
|
eid: '1234'
|
136
136
|
},
|
137
137
|
{
|
@@ -139,7 +139,7 @@ module GoTransverseTractApi
|
|
139
139
|
}]
|
140
140
|
}
|
141
141
|
},
|
142
|
-
:
|
142
|
+
billing_account: {eid: eid}
|
143
143
|
}
|
144
144
|
}
|
145
145
|
|
@@ -151,8 +151,8 @@ module GoTransverseTractApi
|
|
151
151
|
context ".add_custom_field_value" do
|
152
152
|
it "adds custom field value to the billing account" do
|
153
153
|
data = {
|
154
|
-
:
|
155
|
-
:
|
154
|
+
billing_account: { eid: eid },
|
155
|
+
custom_field_value: { value: 'yes' }
|
156
156
|
}
|
157
157
|
|
158
158
|
allow(subject).to receive(:add_custom_field_value).with(eid, data).and_return(response)
|
@@ -163,8 +163,8 @@ module GoTransverseTractApi
|
|
163
163
|
context ".remove_custom_field_value" do
|
164
164
|
it "removes custom field value from the billing account" do
|
165
165
|
data = {
|
166
|
-
:
|
167
|
-
:
|
166
|
+
billing_account: { eid: eid },
|
167
|
+
custom_field_value: { eid: '486' }
|
168
168
|
}
|
169
169
|
|
170
170
|
allow(subject).to receive(:remove_custom_field_value).with(eid, data).and_return(response)
|
@@ -175,8 +175,8 @@ module GoTransverseTractApi
|
|
175
175
|
context ".deactivate" do
|
176
176
|
it "deactivates a billing account" do
|
177
177
|
data = {
|
178
|
-
:
|
179
|
-
:
|
178
|
+
billing_account: { eid: '123' },
|
179
|
+
reason: { eid: '456' }
|
180
180
|
}
|
181
181
|
|
182
182
|
allow(subject).to receive(:deactivate).with(eid, data).and_return(response)
|
@@ -188,7 +188,7 @@ module GoTransverseTractApi
|
|
188
188
|
it "creates a billing account" do
|
189
189
|
data = {
|
190
190
|
bill_type: 'NONE',
|
191
|
-
daily_bill_cycle: { eid:
|
191
|
+
daily_bill_cycle: { eid:'38' },
|
192
192
|
organization: {
|
193
193
|
name: 'LMH Services',
|
194
194
|
addresses: addresses.delete_if{|k,v| k == :telecom_address}
|
@@ -210,12 +210,12 @@ module GoTransverseTractApi
|
|
210
210
|
context ".add_person" do
|
211
211
|
it "adds a person to the billing account" do
|
212
212
|
data = {
|
213
|
-
:
|
214
|
-
:
|
215
|
-
:
|
216
|
-
:
|
217
|
-
:
|
218
|
-
:
|
213
|
+
billing_account: { eid: eid },
|
214
|
+
person: {
|
215
|
+
first_name: 'Tim',
|
216
|
+
last_name: 'John',
|
217
|
+
middle_name: 'R',
|
218
|
+
addresses: addresses
|
219
219
|
}
|
220
220
|
}
|
221
221
|
|
@@ -227,8 +227,8 @@ module GoTransverseTractApi
|
|
227
227
|
context ".remove_billing_account" do
|
228
228
|
it "removes a person from the billing account" do
|
229
229
|
data = {
|
230
|
-
:
|
231
|
-
:
|
230
|
+
billing_account: { eid: eid },
|
231
|
+
person: { eid: '123' }
|
232
232
|
}
|
233
233
|
|
234
234
|
allow(subject).to receive(:remove_billing_account).with(eid, data).and_return(response)
|
@@ -241,7 +241,7 @@ module GoTransverseTractApi
|
|
241
241
|
{
|
242
242
|
sales_order: {
|
243
243
|
referral: 'Unit Test Referral',
|
244
|
-
order_date: '2016-01-
|
244
|
+
order_date: '2016-01-28T172213',
|
245
245
|
order_status: 'DRAFT',
|
246
246
|
custom_field_values: {
|
247
247
|
custom_field_value: {
|
@@ -310,7 +310,7 @@ module GoTransverseTractApi
|
|
310
310
|
promo_code = {
|
311
311
|
discount_configurations: {
|
312
312
|
discount_configuration: {
|
313
|
-
discount_identifier: { eid:
|
313
|
+
discount_identifier: { eid:'35' }
|
314
314
|
}
|
315
315
|
}
|
316
316
|
}
|
@@ -327,7 +327,7 @@ module GoTransverseTractApi
|
|
327
327
|
eid: eid,
|
328
328
|
bill_type: 'one time',
|
329
329
|
automatic_recurring_payment: 'true',
|
330
|
-
billing_account_category: { eid:
|
330
|
+
billing_account_category: { eid:'3453' }
|
331
331
|
}
|
332
332
|
|
333
333
|
allow(subject).to receive(:update).with(eid, data).and_return(response)
|