gotransverse-tract-api 0.5.3 → 0.6.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/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
@@ -11,24 +11,24 @@ module GoTransverseTractApi
|
|
11
11
|
context ".apply_payment" do
|
12
12
|
it "applies a payment to the invoice" do
|
13
13
|
data = {
|
14
|
-
:
|
14
|
+
billing_account: {
|
15
15
|
eid: '123'
|
16
16
|
},
|
17
|
-
:
|
17
|
+
invoice: {
|
18
18
|
eid: '456'
|
19
19
|
},
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
25
|
-
:
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
20
|
+
payment: {
|
21
|
+
amount: '27',
|
22
|
+
use_recurring_payment: 'false',
|
23
|
+
credit_card_payment: {
|
24
|
+
card_type: 'VISA',
|
25
|
+
card_holder_first_name: 'Mary',
|
26
|
+
card_holder_last_name: 'Smith',
|
27
|
+
card_identifier_number: '4111111111111111111',
|
28
|
+
card_verification_number: '123',
|
29
|
+
card_expiration: '12/2016'
|
30
30
|
},
|
31
|
-
:
|
31
|
+
billing_account: {
|
32
32
|
eid: '123'
|
33
33
|
}
|
34
34
|
}
|
@@ -54,11 +54,11 @@ module GoTransverseTractApi
|
|
54
54
|
context ".cancel" do
|
55
55
|
it "cancels a payment" do
|
56
56
|
data = {
|
57
|
-
:
|
58
|
-
:
|
57
|
+
description: 'Test Cancel',
|
58
|
+
payment: {
|
59
59
|
eid: '123'
|
60
60
|
},
|
61
|
-
:
|
61
|
+
reason: {
|
62
62
|
eid: '123'
|
63
63
|
}
|
64
64
|
}
|
@@ -71,19 +71,19 @@ module GoTransverseTractApi
|
|
71
71
|
context ".reallocate" do
|
72
72
|
it "reallocates a payment" do
|
73
73
|
data = {
|
74
|
-
:
|
75
|
-
:
|
74
|
+
description: 'Test Reallocate',
|
75
|
+
payment: {
|
76
76
|
eid: '123'
|
77
77
|
},
|
78
|
-
:
|
78
|
+
reason: {
|
79
79
|
eid: '123'
|
80
80
|
},
|
81
|
-
:
|
82
|
-
:
|
81
|
+
invoices: [{
|
82
|
+
invoice: {
|
83
83
|
eid: '123'
|
84
84
|
}},
|
85
85
|
{
|
86
|
-
:
|
86
|
+
invoice: {
|
87
87
|
eid: '456'
|
88
88
|
}}]
|
89
89
|
}
|
@@ -11,12 +11,12 @@ module GoTransverseTractApi
|
|
11
11
|
context ".create_refund" do
|
12
12
|
it "creates a refund to the account" do
|
13
13
|
data = {
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
14
|
+
amount: '47.00',
|
15
|
+
description: 'Refund Create',
|
16
|
+
original_payment: {
|
17
17
|
eid: '123'
|
18
18
|
},
|
19
|
-
:
|
19
|
+
refund_reason: {
|
20
20
|
eid: '456'
|
21
21
|
}
|
22
22
|
}
|
@@ -12,149 +12,149 @@ module GoTransverseTractApi
|
|
12
12
|
eid = '48406'
|
13
13
|
|
14
14
|
data = {
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
22
|
-
:
|
23
|
-
:
|
24
|
-
:
|
15
|
+
approval_date: '2015-09-09',
|
16
|
+
type: 'Order Item',
|
17
|
+
awaiting_approval: 'true',
|
18
|
+
requested_effective_date: '2015-07-09',
|
19
|
+
unit_price: '0.00',
|
20
|
+
recurring_unit_price: '10.00',
|
21
|
+
quantity: '1',
|
22
|
+
sequence: '1',
|
23
|
+
date_approval: '2015-09-09',
|
24
|
+
description: 'sjkadfkak',
|
25
25
|
eid: '48406',
|
26
|
-
:
|
27
|
-
:
|
28
|
-
:
|
29
|
-
:
|
30
|
-
:
|
31
|
-
:
|
26
|
+
order_items: {
|
27
|
+
page_number: '1',
|
28
|
+
page_size: '50',
|
29
|
+
total_elements: '0',
|
30
|
+
element_count: '0',
|
31
|
+
total_pages: '0'
|
32
32
|
},
|
33
|
-
:
|
34
|
-
:
|
35
|
-
:
|
36
|
-
:
|
37
|
-
:
|
38
|
-
:
|
33
|
+
order_item_usage_rules: {
|
34
|
+
page_number: '1',
|
35
|
+
page_size: '50',
|
36
|
+
total_elements: '0',
|
37
|
+
element_count: '0',
|
38
|
+
total_pages: '0'
|
39
39
|
},
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
44
|
-
:
|
45
|
-
:
|
46
|
-
:
|
40
|
+
recurring_product_price: {
|
41
|
+
from_date: '2013-02-10T010000',
|
42
|
+
price_override: 'true',
|
43
|
+
type: 'Recurring',
|
44
|
+
payment_on_purchase_required: 'false',
|
45
|
+
recurring_payment_required: 'false',
|
46
|
+
recurrence_period: 'BILLCYCLE',
|
47
47
|
eid: '12345',
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
52
|
-
:
|
53
|
-
:
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
48
|
+
price_ranges: {
|
49
|
+
page_number: '1',
|
50
|
+
page_size: '50',
|
51
|
+
total_elements: '1',
|
52
|
+
element_count: '1',
|
53
|
+
total_pages: '1',
|
54
|
+
price_range: {
|
55
|
+
quantity_begin_range: '0.00',
|
56
|
+
price: '10.00',
|
57
|
+
level: '1',
|
58
58
|
eid: '812'
|
59
59
|
}
|
60
60
|
}
|
61
61
|
},
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
66
|
-
:
|
67
|
-
:
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
75
|
-
:
|
76
|
-
:
|
62
|
+
product: {
|
63
|
+
name: 'uvaciahcahoqho',
|
64
|
+
description: 'asccaihq gqidiqbckasciahci-cuaca',
|
65
|
+
short_description:'sdvsucihc',
|
66
|
+
product_type_code: 'SUBSCRIPTION',
|
67
|
+
product_state: 'aihaa',
|
68
|
+
requires_agreement: 'true',
|
69
|
+
serialized: 'false',
|
70
|
+
taxable: 'false',
|
71
|
+
trial: 'asda',
|
72
|
+
default_quantity: '10',
|
73
|
+
internal_name: 'ddsfs',
|
74
|
+
min_service_resources: '0',
|
75
|
+
max_service_resources: '0',
|
76
|
+
trial_override: 'false',
|
77
77
|
eid: '234',
|
78
|
-
:
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
84
|
-
:
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
78
|
+
product_prices: {
|
79
|
+
page_number: '1',
|
80
|
+
page_size: '50',
|
81
|
+
total_elements: '1',
|
82
|
+
element_count: '1',
|
83
|
+
total_pages: '1',
|
84
|
+
product_price: {
|
85
|
+
from_date: '2013-02-10T010000',
|
86
|
+
price_override: 'true',
|
87
|
+
type: 'Recurring',
|
88
|
+
payment_on_purchase_required: 'false',
|
89
|
+
recurring_payment_required: 'false',
|
90
|
+
recurrence_period: 'BILLCYCLE',
|
91
91
|
eid: '12345',
|
92
|
-
:
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
96
|
-
:
|
97
|
-
:
|
98
|
-
:
|
99
|
-
:
|
100
|
-
:
|
101
|
-
:
|
92
|
+
price_ranges: {
|
93
|
+
page_number: '1',
|
94
|
+
page_size: '50',
|
95
|
+
total_elements: '1',
|
96
|
+
element_count: '1',
|
97
|
+
total_pages: '1',
|
98
|
+
price_range: {
|
99
|
+
quantity_begin_range: '0.00',
|
100
|
+
price: '10.00',
|
101
|
+
level: '1',
|
102
102
|
eid: '812'
|
103
103
|
}
|
104
104
|
}
|
105
105
|
}
|
106
106
|
},
|
107
|
-
:
|
108
|
-
:
|
109
|
-
:
|
110
|
-
:
|
107
|
+
product_category: {
|
108
|
+
name: 'sdfsdfs',
|
109
|
+
description: 'wrggdgd',
|
110
|
+
status: 'Active',
|
111
111
|
eid: '234'
|
112
112
|
},
|
113
|
-
:
|
114
|
-
:
|
115
|
-
:
|
116
|
-
:
|
113
|
+
service_resource_category: {
|
114
|
+
name: 'sdgw',
|
115
|
+
type: 'A',
|
116
|
+
status: 'sdfsa',
|
117
117
|
eid: '345'
|
118
118
|
},
|
119
|
-
:
|
120
|
-
:
|
121
|
-
:
|
122
|
-
:
|
123
|
-
:
|
124
|
-
:
|
119
|
+
actions: {
|
120
|
+
page_number: '1',
|
121
|
+
page_size: '50',
|
122
|
+
total_elements: '1',
|
123
|
+
element_count: '1',
|
124
|
+
total_pages: '1',
|
125
125
|
},
|
126
|
-
:
|
127
|
-
:
|
128
|
-
:
|
129
|
-
:
|
130
|
-
:
|
131
|
-
:
|
126
|
+
product_usage_rules: {
|
127
|
+
page_number: '1',
|
128
|
+
page_size: '50',
|
129
|
+
total_elements: '1',
|
130
|
+
element_count: '1',
|
131
|
+
total_pages: '1'
|
132
132
|
}
|
133
133
|
},
|
134
|
-
:
|
135
|
-
:
|
134
|
+
price_list: {
|
135
|
+
name: 'sds',
|
136
136
|
eid: '564'
|
137
137
|
},
|
138
|
-
:
|
139
|
-
:
|
140
|
-
:
|
141
|
-
:
|
142
|
-
:
|
143
|
-
:
|
138
|
+
service_resources: {
|
139
|
+
page_number: '1',
|
140
|
+
page_size: '50',
|
141
|
+
total_elements: '1',
|
142
|
+
element_count: '1',
|
143
|
+
total_pages: '1'
|
144
144
|
},
|
145
|
-
:
|
146
|
-
:
|
147
|
-
:
|
148
|
-
:
|
149
|
-
:
|
150
|
-
:
|
145
|
+
operation_attributes: {
|
146
|
+
page_number: '1',
|
147
|
+
page_size: '50',
|
148
|
+
total_elements: '1',
|
149
|
+
element_count: '1',
|
150
|
+
total_pages: '1'
|
151
151
|
},
|
152
|
-
:
|
153
|
-
:
|
154
|
-
:
|
155
|
-
:
|
156
|
-
:
|
157
|
-
:
|
152
|
+
scheduled_charges: {
|
153
|
+
page_number: '1',
|
154
|
+
page_size: '50',
|
155
|
+
total_elements: '1',
|
156
|
+
element_count: '1',
|
157
|
+
total_pages: '1'
|
158
158
|
}
|
159
159
|
}
|
160
160
|
|
@@ -12,12 +12,12 @@ module GoTransverseTractApi
|
|
12
12
|
eid = '48406'
|
13
13
|
|
14
14
|
data = {
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
15
|
+
city: 'fsfsfs',
|
16
|
+
country: 'USA',
|
17
|
+
line1: 'wefsvgg ggdgdgd',
|
18
|
+
postal_code: '232433',
|
19
|
+
purpose: 'Billing',
|
20
|
+
region_or_state: 'CA'
|
21
21
|
}
|
22
22
|
|
23
23
|
allow(subject).to receive(:add_address).with(eid, data).and_return(response)
|
@@ -13,12 +13,12 @@ module GoTransverseTractApi
|
|
13
13
|
eid = '48406'
|
14
14
|
|
15
15
|
data = {
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
19
|
-
:
|
20
|
-
:
|
21
|
-
:
|
16
|
+
city: 'fsfsfs',
|
17
|
+
country: 'USA',
|
18
|
+
line1: 'wefsvgg ggdgdgd',
|
19
|
+
postal_code: '232433',
|
20
|
+
purpose: 'Billing',
|
21
|
+
region_or_state: 'CA'
|
22
22
|
}
|
23
23
|
|
24
24
|
allow(subject).to receive(:add_address).with(eid, data).and_return(response)
|
@@ -17,7 +17,7 @@ module GoTransverseTractApi
|
|
17
17
|
|
18
18
|
context ".add_custom_field_value" do
|
19
19
|
it "adds custom field value for the sales order" do
|
20
|
-
data = { :
|
20
|
+
data = { value: 'yes' }
|
21
21
|
|
22
22
|
allow(subject).to receive(:add_custom_field_value).with(eid, data).and_return(response)
|
23
23
|
expect(subject.add_custom_field_value(eid, data)).to eq(response)
|
@@ -35,68 +35,68 @@ module GoTransverseTractApi
|
|
35
35
|
it "creates a sales order" do
|
36
36
|
|
37
37
|
data = {
|
38
|
-
:
|
39
|
-
:
|
40
|
-
:
|
41
|
-
:
|
42
|
-
:
|
43
|
-
:
|
38
|
+
note: 'Order Item',
|
39
|
+
purchase_order_number: '2015-07-09',
|
40
|
+
order_items: {
|
41
|
+
order_item: {
|
42
|
+
quantity: '1',
|
43
|
+
product: [{
|
44
44
|
eid: '232353'
|
45
45
|
}]
|
46
46
|
}
|
47
47
|
},
|
48
|
-
:
|
49
|
-
:
|
50
|
-
:
|
51
|
-
:
|
48
|
+
billing_account: {
|
49
|
+
bill_type: 'EMAIL',
|
50
|
+
automatic_recurring_payment: 'true',
|
51
|
+
daily_bill_cycle: {
|
52
52
|
eid: '34535'
|
53
53
|
},
|
54
|
-
:
|
55
|
-
:
|
56
|
-
:
|
57
|
-
:
|
58
|
-
:
|
59
|
-
:
|
60
|
-
:
|
61
|
-
:
|
62
|
-
:
|
63
|
-
:
|
64
|
-
:
|
65
|
-
:
|
54
|
+
organization: {
|
55
|
+
name: 'eregedvdvd',
|
56
|
+
tax_id_number: '56-4575675',
|
57
|
+
addresses: {
|
58
|
+
postal_address: [{
|
59
|
+
purpose: 'SERVICE',
|
60
|
+
country: 'USA',
|
61
|
+
city: 'Fremont',
|
62
|
+
region_or_state: 'CA',
|
63
|
+
postal_code: '94538',
|
64
|
+
line1: 'sdgwg wfegfdg',
|
65
|
+
line2: 'wefergdvdg ergegdf'
|
66
66
|
},
|
67
67
|
{
|
68
|
-
:
|
69
|
-
:
|
70
|
-
:
|
71
|
-
:
|
72
|
-
:
|
73
|
-
:
|
74
|
-
:
|
68
|
+
purpose: 'BILLING',
|
69
|
+
country: 'USA',
|
70
|
+
city: 'Fremont',
|
71
|
+
region_or_state: 'CA',
|
72
|
+
postal_code: '94538',
|
73
|
+
line1: 'sdgwg wfegfdg',
|
74
|
+
line2: 'wefergdvdg ergegdf'
|
75
75
|
},
|
76
76
|
{
|
77
|
-
:
|
78
|
-
:
|
79
|
-
:
|
80
|
-
:
|
81
|
-
:
|
82
|
-
:
|
83
|
-
:
|
77
|
+
purpose: 'SHIPPING',
|
78
|
+
country: 'USA',
|
79
|
+
city: 'Fremont',
|
80
|
+
region_or_state: 'CA',
|
81
|
+
postal_code: '94538',
|
82
|
+
line1: 'sdgwg wfegfdg',
|
83
|
+
line2: 'wefergdvdg ergegdf'
|
84
84
|
}],
|
85
|
-
:
|
86
|
-
:
|
87
|
-
:
|
88
|
-
:
|
89
|
-
:
|
90
|
-
:
|
91
|
-
:
|
85
|
+
telecom_address: {
|
86
|
+
dialing_prefix: '9',
|
87
|
+
country_code: '1',
|
88
|
+
area_code: '510',
|
89
|
+
number: '234325',
|
90
|
+
extension: '24',
|
91
|
+
purpose: 'OFFICE'
|
92
92
|
},
|
93
|
-
:
|
94
|
-
:
|
95
|
-
:
|
93
|
+
email_address: {
|
94
|
+
email: 'sjdhfs@sdfgs.com',
|
95
|
+
purpose: 'PRIMARY'
|
96
96
|
}
|
97
97
|
}
|
98
98
|
},
|
99
|
-
:
|
99
|
+
billing_account_category: {
|
100
100
|
eid: '749'
|
101
101
|
}
|
102
102
|
}
|