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.
@@ -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
- :billing_account => {
14
+ billing_account: {
15
15
  eid: '123'
16
16
  },
17
- :invoice => {
17
+ invoice: {
18
18
  eid: '456'
19
19
  },
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'
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
- :billing_account => {
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
- :description => 'Test Cancel',
58
- :payment => {
57
+ description: 'Test Cancel',
58
+ payment: {
59
59
  eid: '123'
60
60
  },
61
- :reason => {
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
- :description => 'Test Reallocate',
75
- :payment => {
74
+ description: 'Test Reallocate',
75
+ payment: {
76
76
  eid: '123'
77
77
  },
78
- :reason => {
78
+ reason: {
79
79
  eid: '123'
80
80
  },
81
- :invoices => [{
82
- :invoice => {
81
+ invoices: [{
82
+ invoice: {
83
83
  eid: '123'
84
84
  }},
85
85
  {
86
- :invoice => {
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
- :amount => '47.00',
15
- :description => 'Refund Create',
16
- :original_payment => {
14
+ amount: '47.00',
15
+ description: 'Refund Create',
16
+ original_payment: {
17
17
  eid: '123'
18
18
  },
19
- :refund_reason => {
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
- :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',
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
- :order_items => {
27
- :page_number => '1',
28
- :page_size => '50',
29
- :total_elements => '0',
30
- :element_count => '0',
31
- :total_pages => '0'
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
- :order_item_usage_rules => {
34
- :page_number => '1',
35
- :page_size => '50',
36
- :total_elements => '0',
37
- :element_count => '0',
38
- :total_pages => '0'
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
- :recurring_product_price => {
41
- :from_date => '2013-02-10T01:00:00',
42
- :price_override => 'true',
43
- :type => 'Recurring',
44
- :payment_on_purchase_required => 'false',
45
- :recurring_payment_required => 'false',
46
- :recurrence_period => 'BILLCYCLE',
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
- :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',
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
- :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',
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
- :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-10T01:00:00',
86
- :price_override => 'true',
87
- :type => 'Recurring',
88
- :payment_on_purchase_required => 'false',
89
- :recurring_payment_required => 'false',
90
- :recurrence_period => 'BILLCYCLE',
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
- :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',
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
- :product_category => {
108
- :name => 'sdfsdfs',
109
- :description => 'wrggdgd',
110
- :status => 'Active',
107
+ product_category: {
108
+ name: 'sdfsdfs',
109
+ description: 'wrggdgd',
110
+ status: 'Active',
111
111
  eid: '234'
112
112
  },
113
- :service_resource_category => {
114
- :name => 'sdgw',
115
- :type => 'A',
116
- :status => 'sdfsa',
113
+ service_resource_category: {
114
+ name: 'sdgw',
115
+ type: 'A',
116
+ status: 'sdfsa',
117
117
  eid: '345'
118
118
  },
119
- :actions => {
120
- :page_number => '1',
121
- :page_size => '50',
122
- :total_elements => '1',
123
- :element_count => '1',
124
- :total_pages => '1',
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
- :product_usage_rules => {
127
- :page_number => '1',
128
- :page_size => '50',
129
- :total_elements => '1',
130
- :element_count => '1',
131
- :total_pages => '1'
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
- :price_list => {
135
- :name => 'sds',
134
+ price_list: {
135
+ name: 'sds',
136
136
  eid: '564'
137
137
  },
138
- :service_resources => {
139
- :page_number => '1',
140
- :page_size => '50',
141
- :total_elements => '1',
142
- :element_count => '1',
143
- :total_pages => '1'
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
- :operation_attributes => {
146
- :page_number => '1',
147
- :page_size => '50',
148
- :total_elements => '1',
149
- :element_count => '1',
150
- :total_pages => '1'
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
- :scheduled_charges => {
153
- :page_number => '1',
154
- :page_size => '50',
155
- :total_elements => '1',
156
- :element_count => '1',
157
- :total_pages => '1'
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
- :city => 'fsfsfs',
16
- :country => 'USA',
17
- :line1 => 'wefsvgg ggdgdgd',
18
- :postal_code => '232433',
19
- :purpose => 'Billing',
20
- :region_or_state => 'CA'
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
- :city => 'fsfsfs',
17
- :country => 'USA',
18
- :line1 => 'wefsvgg ggdgdgd',
19
- :postal_code => '232433',
20
- :purpose => 'Billing',
21
- :region_or_state => 'CA'
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 = { :value => 'yes' }
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
- :note => 'Order Item',
39
- :purchase_order_number => '2015-07-09',
40
- :order_items => {
41
- :order_item => {
42
- :quantity => '1',
43
- :product => [{
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
- :billing_account => {
49
- :bill_type => 'EMAIL',
50
- :automatic_recurring_payment => 'true',
51
- :daily_bill_cycle => {
48
+ billing_account: {
49
+ bill_type: 'EMAIL',
50
+ automatic_recurring_payment: 'true',
51
+ daily_bill_cycle: {
52
52
  eid: '34535'
53
53
  },
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'
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
- :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'
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
- :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'
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
- :telecom_address => {
86
- :dialing_prefix => '9',
87
- :country_code => '1',
88
- :area_code => '510',
89
- :number => '234325',
90
- :extension => '24',
91
- :purpose => 'OFFICE'
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
- :email_address => {
94
- :email => 'sjdhfs@sdfgs.com',
95
- :purpose => 'PRIMARY'
93
+ email_address: {
94
+ email: 'sjdhfs@sdfgs.com',
95
+ purpose: 'PRIMARY'
96
96
  }
97
97
  }
98
98
  },
99
- :billing_account_category => {
99
+ billing_account_category: {
100
100
  eid: '749'
101
101
  }
102
102
  }