gotransverse-tract-api 0.5.0 → 0.5.1
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.rb +11 -1
- data/lib/gotransverse-tract-api/api_data.rb +16 -13
- data/lib/gotransverse-tract-api/billing_account/payment.rb +18 -17
- data/lib/gotransverse-tract-api/billing_account/recurring_payment.rb +1 -1
- data/lib/gotransverse-tract-api/order/agreement.rb +8 -0
- data/lib/gotransverse-tract-api/order/agreement_configuration.rb +24 -0
- data/lib/gotransverse-tract-api/order/discount_configuration.rb +28 -0
- data/lib/gotransverse-tract-api/order/inventory_item.rb +22 -0
- data/lib/gotransverse-tract-api/order/order_item.rb +43 -0
- data/lib/gotransverse-tract-api/order/order_item_usage_rule.rb +65 -0
- data/lib/gotransverse-tract-api/order/price_range.rb +29 -0
- data/lib/gotransverse-tract-api/order/product_usage_rule.rb +40 -0
- data/lib/gotransverse-tract-api/order/recurring_product_price.rb +48 -0
- data/lib/gotransverse-tract-api/order/sales_order.rb +3 -39
- data/lib/gotransverse-tract-api/order/scheduled_charge.rb +26 -0
- data/lib/gotransverse-tract-api/order/usage_rate.rb +31 -0
- data/lib/gotransverse-tract-api/product/discount_category.rb +1 -1
- data/lib/gotransverse-tract-api/product/price_list.rb +10 -1
- data/lib/gotransverse-tract-api/product/product.rb +46 -0
- data/lib/gotransverse-tract-api/product/product_category.rb +9 -0
- data/lib/gotransverse-tract-api/product/service_resource_category.rb +20 -0
- data/lib/gotransverse-tract-api/service/service_resource.rb +29 -3
- data/lib/gotransverse-tract-api/version.rb +1 -1
- data/spec/gotransverse-tract-api/billing_account/billing_account_spec.rb +49 -138
- data/spec/gotransverse-tract-api/billing_account/payment_spec.rb +26 -25
- data/spec/gotransverse-tract-api/billing_account/recurring_payment_spec.rb +16 -0
- data/spec/gotransverse-tract-api/order/order_item_usage_rule_spec.rb +24 -0
- data/spec/gotransverse-tract-api/order/sales_order_spec.rb +4 -106
- data/spec/gotransverse-tract-api/service/service_resource_spec.rb +7 -0
- metadata +16 -2
@@ -31,16 +31,16 @@ module GoTransverseTractApi
|
|
31
31
|
context ".apply_refund" do
|
32
32
|
it "applies a refund to the payment account" do
|
33
33
|
data = {
|
34
|
-
:
|
34
|
+
payment: {
|
35
35
|
eid: '123'
|
36
36
|
},
|
37
|
-
:
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
37
|
+
refund: {
|
38
|
+
amount: '47.00',
|
39
|
+
description: 'Refund Create',
|
40
|
+
original_payment: {
|
41
41
|
eid: '456'
|
42
42
|
},
|
43
|
-
:
|
43
|
+
refund_reason: {
|
44
44
|
eid: '4'
|
45
45
|
}
|
46
46
|
}
|
@@ -96,28 +96,29 @@ module GoTransverseTractApi
|
|
96
96
|
context ".create_payment" do
|
97
97
|
it "creates a payment" do
|
98
98
|
data = {
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
102
|
-
|
99
|
+
use_recurring_payment: 'true',
|
100
|
+
amount: '20.00',
|
101
|
+
description: 'Credit Card Payment',
|
102
|
+
billing_account: {
|
103
|
+
eid: '146'
|
103
104
|
},
|
104
|
-
:
|
105
|
-
:
|
106
|
-
:
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
105
|
+
credit_card_payment: {
|
106
|
+
card_type: 'VISA',
|
107
|
+
card_holder_first_name: 'Mary',
|
108
|
+
card_holder_last_name: 'Smith',
|
109
|
+
card_identifier_number: '4111111111111111111',
|
110
|
+
card_expiration: '12/2016'
|
110
111
|
},
|
111
|
-
:
|
112
|
-
:
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
112
|
+
phone_number: {
|
113
|
+
country_code: '1',
|
114
|
+
area_code: '512',
|
115
|
+
number: '00000',
|
116
|
+
extension: '123',
|
117
|
+
purpose: 'PAYMENT'
|
117
118
|
},
|
118
|
-
:
|
119
|
-
:
|
120
|
-
:
|
119
|
+
email_address: {
|
120
|
+
email: 'test@test.com',
|
121
|
+
purpose: 'PAYMENT'
|
121
122
|
}
|
122
123
|
}
|
123
124
|
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
module GoTransverseTractApi
|
3
|
+
|
4
|
+
RSpec.describe BillingAccount::RecurringPayment do
|
5
|
+
before(:each) { http_auth }
|
6
|
+
|
7
|
+
context ".find_by_account_num" do
|
8
|
+
it "returns account details for a given account number" do
|
9
|
+
actual_response = described_class.find_by_account_num(8)
|
10
|
+
expect(actual_response).to_not be_nil
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
@@ -0,0 +1,24 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
module GoTransverseTractApi
|
4
|
+
|
5
|
+
RSpec.describe Order::OrderItemUsageRule do
|
6
|
+
before(:each) { http_auth }
|
7
|
+
|
8
|
+
context ".find_by_eid" do
|
9
|
+
it "gets order item usage rules for the given eid" do
|
10
|
+
#actual_response = described_class.find_by_eid('81')
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
context ".find_by_order_item_eid" do
|
15
|
+
it "gets order item usage rules for the given eid" do
|
16
|
+
actual_response = described_class.find_by_order_item_eid('274')
|
17
|
+
expect(actual_response[:matchAllOrderItemUsageRule][:eid]).to_not be_nil
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
|
@@ -5,11 +5,11 @@ module GoTransverseTractApi
|
|
5
5
|
RSpec.describe Order::SalesOrder do
|
6
6
|
before(:each) { http_auth }
|
7
7
|
|
8
|
+
let(:eid) { '48406'}
|
8
9
|
let(:response) { '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' }
|
9
10
|
|
10
11
|
context ".add_custom_field_value" do
|
11
12
|
it "adds custom field value for the sales order" do
|
12
|
-
eid = '48406'
|
13
13
|
data = { :value => 'yes' }
|
14
14
|
|
15
15
|
allow(subject).to receive(:add_custom_field_value).with(eid, data).and_return(response)
|
@@ -19,112 +19,10 @@ module GoTransverseTractApi
|
|
19
19
|
|
20
20
|
context ".confirm" do
|
21
21
|
it "confirms the sales order" do
|
22
|
-
eid
|
22
|
+
described_class.confirm(eid)
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
:referral => 'Order Item',
|
27
|
-
:order_date => '2015-07-09',
|
28
|
-
:order_status => '0.00',
|
29
|
-
eid: '48406',
|
30
|
-
:order_items => {
|
31
|
-
:page_number => '1',
|
32
|
-
:page_size => '50',
|
33
|
-
:total_elements => '0',
|
34
|
-
:element_count => '0',
|
35
|
-
:total_pages => '0',
|
36
|
-
:order_item => {
|
37
|
-
:quantity => '1',
|
38
|
-
:product => [{
|
39
|
-
:name => 'sdfsdfsvs',
|
40
|
-
:description => 'dsfsgegebdbb',
|
41
|
-
:short_description => 'asfgerdbdb',
|
42
|
-
:product_type_code => 'udygciww',
|
43
|
-
:product_state => 'afwfwss',
|
44
|
-
:requires_agreement => 'true',
|
45
|
-
:serialized => 'false',
|
46
|
-
:taxable => 'false',
|
47
|
-
:trial => 'asda',
|
48
|
-
:default_quantity => '10',
|
49
|
-
:min_service_resources => '0',
|
50
|
-
:max_service_resources => '0',
|
51
|
-
:trial_override => 'false',
|
52
|
-
eid: '234',
|
53
|
-
:product_prices => {
|
54
|
-
:page_number => '1',
|
55
|
-
:page_size => '50',
|
56
|
-
:total_elements => '1',
|
57
|
-
:element_count => '1',
|
58
|
-
:total_pages => '1',
|
59
|
-
:product_price => {
|
60
|
-
:from_date => '2013-02-10T01:00:00',
|
61
|
-
:price_override => 'true',
|
62
|
-
:type => 'Recurring',
|
63
|
-
:recurring_payment_required => 'false',
|
64
|
-
eid: '12345',
|
65
|
-
:price_ranges => {
|
66
|
-
:page_number => '1',
|
67
|
-
:page_size => '50',
|
68
|
-
:total_elements => '1',
|
69
|
-
:element_count => '1',
|
70
|
-
:total_pages => '1',
|
71
|
-
:price_range => {
|
72
|
-
:quantity_begin_range => '0.00',
|
73
|
-
:price => '10.00',
|
74
|
-
:level => '1',
|
75
|
-
eid: '812'
|
76
|
-
}
|
77
|
-
}
|
78
|
-
}
|
79
|
-
},
|
80
|
-
:product_category => {
|
81
|
-
:name => 'sdfsdfs',
|
82
|
-
:description => 'wrggdgd',
|
83
|
-
:status => 'Active',
|
84
|
-
eid: '234'
|
85
|
-
},
|
86
|
-
:actions => {
|
87
|
-
:page_number => '1',
|
88
|
-
:page_size => '50',
|
89
|
-
:total_elements => '1',
|
90
|
-
:element_count => '1',
|
91
|
-
:total_pages => '1',
|
92
|
-
},
|
93
|
-
:product_usage_rules => {
|
94
|
-
:page_number => '1',
|
95
|
-
:page_size => '50',
|
96
|
-
:total_elements => '1',
|
97
|
-
:element_count => '1',
|
98
|
-
:total_pages => '1'
|
99
|
-
}
|
100
|
-
}]
|
101
|
-
}
|
102
|
-
},
|
103
|
-
:billing_account => {
|
104
|
-
:automatic_recurring_payment => 'false',
|
105
|
-
eid: '2535'
|
106
|
-
}
|
107
|
-
},
|
108
|
-
:payment => {
|
109
|
-
:amount => '100',
|
110
|
-
:description => 'sdgegegeg',
|
111
|
-
:billing_account => {
|
112
|
-
:automatic_recurring_payment => 'false',
|
113
|
-
eid: '2535'
|
114
|
-
},
|
115
|
-
:credit_card_payment => {
|
116
|
-
:card_type => 'visa',
|
117
|
-
:card_holder_first_name => 'sgdfvdv',
|
118
|
-
:card_holder_middle_name => 'sgdfvdv',
|
119
|
-
:card_holder_last_name => 'sgdfvdv',
|
120
|
-
:card_identifier_number => '2353643423412354754',
|
121
|
-
:card_expiration => "12/20"
|
122
|
-
}
|
123
|
-
}
|
124
|
-
}
|
125
|
-
|
126
|
-
allow(subject).to receive(:confirm).with(eid, data).and_return(response)
|
127
|
-
expect(subject.confirm(eid, data)).to eq(response)
|
24
|
+
#allow(subject).to receive(:confirm).with(eid).and_return(response)
|
25
|
+
#expect(subject.confirm(eid)).to eq(response)
|
128
26
|
end
|
129
27
|
end
|
130
28
|
|
@@ -14,6 +14,13 @@ module GoTransverseTractApi
|
|
14
14
|
}
|
15
15
|
}
|
16
16
|
|
17
|
+
context ".find_by_eid" do
|
18
|
+
it "returns a service resource for a given eid" do
|
19
|
+
data = described_class.find_by_eid(82)
|
20
|
+
expect(data).to_not be_nil
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
17
24
|
context ".create_service_resource" do
|
18
25
|
it "creates a service resource" do
|
19
26
|
data = {
|
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.5.
|
4
|
+
version: 0.5.1
|
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: 2016-01-
|
12
|
+
date: 2016-01-26 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|
@@ -151,17 +151,26 @@ files:
|
|
151
151
|
- lib/gotransverse-tract-api/hash.rb
|
152
152
|
- lib/gotransverse-tract-api/order/adjustment_category.rb
|
153
153
|
- lib/gotransverse-tract-api/order/agreement.rb
|
154
|
+
- lib/gotransverse-tract-api/order/agreement_configuration.rb
|
154
155
|
- lib/gotransverse-tract-api/order/bill_cycle.rb
|
155
156
|
- lib/gotransverse-tract-api/order/billing_account_category.rb
|
157
|
+
- lib/gotransverse-tract-api/order/discount_configuration.rb
|
158
|
+
- lib/gotransverse-tract-api/order/inventory_item.rb
|
156
159
|
- lib/gotransverse-tract-api/order/order_item.rb
|
157
160
|
- lib/gotransverse-tract-api/order/order_item_charge.rb
|
161
|
+
- lib/gotransverse-tract-api/order/order_item_usage_rule.rb
|
158
162
|
- lib/gotransverse-tract-api/order/organization.rb
|
159
163
|
- lib/gotransverse-tract-api/order/party_category.rb
|
160
164
|
- lib/gotransverse-tract-api/order/payment_term.rb
|
161
165
|
- lib/gotransverse-tract-api/order/people.rb
|
166
|
+
- lib/gotransverse-tract-api/order/price_range.rb
|
162
167
|
- lib/gotransverse-tract-api/order/product_relation.rb
|
168
|
+
- lib/gotransverse-tract-api/order/product_usage_rule.rb
|
169
|
+
- lib/gotransverse-tract-api/order/recurring_product_price.rb
|
163
170
|
- lib/gotransverse-tract-api/order/renewal_order.rb
|
164
171
|
- lib/gotransverse-tract-api/order/sales_order.rb
|
172
|
+
- lib/gotransverse-tract-api/order/scheduled_charge.rb
|
173
|
+
- lib/gotransverse-tract-api/order/usage_rate.rb
|
165
174
|
- lib/gotransverse-tract-api/product/action.rb
|
166
175
|
- lib/gotransverse-tract-api/product/billing_account_segment.rb
|
167
176
|
- lib/gotransverse-tract-api/product/billing_account_segment_field.rb
|
@@ -180,6 +189,7 @@ files:
|
|
180
189
|
- lib/gotransverse-tract-api/product/product_price_range.rb
|
181
190
|
- lib/gotransverse-tract-api/product/product_tag.rb
|
182
191
|
- lib/gotransverse-tract-api/product/recurring_product_price.rb
|
192
|
+
- lib/gotransverse-tract-api/product/service_resource_category.rb
|
183
193
|
- lib/gotransverse-tract-api/product/usage_rule.rb
|
184
194
|
- lib/gotransverse-tract-api/service/service.rb
|
185
195
|
- lib/gotransverse-tract-api/service/service_device_inventory_item.rb
|
@@ -207,10 +217,12 @@ files:
|
|
207
217
|
- spec/gotransverse-tract-api/billing_account/counter_spec.rb
|
208
218
|
- spec/gotransverse-tract-api/billing_account/invoice_spec.rb
|
209
219
|
- spec/gotransverse-tract-api/billing_account/payment_spec.rb
|
220
|
+
- spec/gotransverse-tract-api/billing_account/recurring_payment_spec.rb
|
210
221
|
- spec/gotransverse-tract-api/billing_account/refund_spec.rb
|
211
222
|
- spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
|
212
223
|
- spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
|
213
224
|
- spec/gotransverse-tract-api/order/order_item_spec.rb
|
225
|
+
- spec/gotransverse-tract-api/order/order_item_usage_rule_spec.rb
|
214
226
|
- spec/gotransverse-tract-api/order/organization_spec.rb
|
215
227
|
- spec/gotransverse-tract-api/order/people_spec.rb
|
216
228
|
- spec/gotransverse-tract-api/order/sales_order_spec.rb
|
@@ -252,10 +264,12 @@ test_files:
|
|
252
264
|
- spec/gotransverse-tract-api/billing_account/counter_spec.rb
|
253
265
|
- spec/gotransverse-tract-api/billing_account/invoice_spec.rb
|
254
266
|
- spec/gotransverse-tract-api/billing_account/payment_spec.rb
|
267
|
+
- spec/gotransverse-tract-api/billing_account/recurring_payment_spec.rb
|
255
268
|
- spec/gotransverse-tract-api/billing_account/refund_spec.rb
|
256
269
|
- spec/gotransverse-tract-api/general_ledger/gl_aggregate_batch_spec.rb
|
257
270
|
- spec/gotransverse-tract-api/general_ledger/gl_transaction_batch_spec.rb
|
258
271
|
- spec/gotransverse-tract-api/order/order_item_spec.rb
|
272
|
+
- spec/gotransverse-tract-api/order/order_item_usage_rule_spec.rb
|
259
273
|
- spec/gotransverse-tract-api/order/organization_spec.rb
|
260
274
|
- spec/gotransverse-tract-api/order/people_spec.rb
|
261
275
|
- spec/gotransverse-tract-api/order/sales_order_spec.rb
|