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.
@@ -82,8 +82,8 @@ module GoTransverseTractApi
82
82
  #
83
83
  def resume eid, service
84
84
  data = {
85
- :resumeService => {},
86
- :service => {eid: eid}
85
+ resumeService: {},
86
+ service: {eid: eid}
87
87
  }
88
88
 
89
89
  xml_data = GoTransverseTractApi.generateXML(data, 'resumeService')
@@ -96,8 +96,8 @@ module GoTransverseTractApi
96
96
  #
97
97
  def suspend eid, service
98
98
  data = {
99
- :suspendService => {},
100
- :service => {eid: eid}
99
+ suspendService: {},
100
+ service: {eid: eid}
101
101
  }
102
102
 
103
103
  xml_data = GoTransverseTractApi.generateXML(data, 'suspendService')
@@ -110,13 +110,13 @@ module GoTransverseTractApi
110
110
  #
111
111
  def add_service_resource eid, service
112
112
  data = {
113
- :addServiceResourceToService => {},
114
- :service => {eid: eid},
115
- :serviceResource => {
116
- :attributes => {
117
- :identifier => service[:service_resource][:identifier]
113
+ addServiceResourceToService: {},
114
+ service: {eid: eid},
115
+ serviceResource: {
116
+ attributes: {
117
+ identifier: service[:service_resource][:identifier]
118
118
  },
119
- :category => {
119
+ category: {
120
120
  eid: :service[:service_resource][:category][:eid]
121
121
  }
122
122
  }
@@ -132,9 +132,9 @@ module GoTransverseTractApi
132
132
  #
133
133
  def remove_service_resource eid, service
134
134
  data = {
135
- :removeServiceResourceFromService => {},
136
- :service => {eid: eid},
137
- :serviceResource => {eid: service[:service_resource][:eid]}
135
+ removeServiceResourceFromService: {},
136
+ service: {eid: eid},
137
+ serviceResource: {eid: service[:service_resource][:eid]}
138
138
  }
139
139
 
140
140
  xml_data = GoTransverseTractApi.generateXML(data, 'removeServiceResourceFromService')
@@ -147,31 +147,31 @@ module GoTransverseTractApi
147
147
  #
148
148
  def add_service_usage_rule_to_service eid, service
149
149
  data = {
150
- :addServiceUsageRuleToService => {},
151
- :service => {eid: eid},
152
- :matchAllServiceUsageRule => {
153
- :attributes => {
154
- :limit => service[:match_all_service_usage_rule][:limit],
155
- :usageUom => service[:match_all_service_usage_rule][:usage_uom],
156
- :name => service[:match_all_service_usage_rule][:name],
157
- :order => service[:match_all_service_usage_rule][:order],
158
- :proratedOnOrder => service[:match_all_service_usage_rule][:prorated_on_order],
159
- :proratedOnCancel => service[:match_all_service_usage_rule][:prorated_on_cancel],
160
- :rollOverType => service[:match_all_service_usage_rule][:roll_over_type],
161
- :allowanceType => service[:match_all_service_usage_rule][:allowance_type],
162
- :validFrom => service[:match_all_service_usage_rule][:valid_from],
163
- :validTo => service[:match_all_service_usage_rule][:valid_to],
164
- :ruleType => service[:match_all_service_usage_rule][:rule_type],
165
- :status => service[:match_all_service_usage_rule][:status]
150
+ addServiceUsageRuleToService: {},
151
+ service: {eid: eid},
152
+ matchAllServiceUsageRule: {
153
+ attributes: {
154
+ limit: service[:match_all_service_usage_rule][:limit],
155
+ usageUom: service[:match_all_service_usage_rule][:usage_uom],
156
+ name: service[:match_all_service_usage_rule][:name],
157
+ order: service[:match_all_service_usage_rule][:order],
158
+ proratedOnOrder: service[:match_all_service_usage_rule][:prorated_on_order],
159
+ proratedOnCancel: service[:match_all_service_usage_rule][:prorated_on_cancel],
160
+ rollOverType: service[:match_all_service_usage_rule][:roll_over_type],
161
+ allowanceType: service[:match_all_service_usage_rule][:allowance_type],
162
+ validFrom: service[:match_all_service_usage_rule][:valid_from],
163
+ validTo: service[:match_all_service_usage_rule][:valid_to],
164
+ ruleType: service[:match_all_service_usage_rule][:rule_type],
165
+ status: service[:match_all_service_usage_rule][:status]
166
166
  },
167
- :chargeCategory => {
167
+ chargeCategory: {
168
168
  eid: service[:match_all_service_usage_rule][:charge_categroy][:eid]
169
169
  },
170
- :flatUsageRate => {
171
- :uom => service[:match_all_service_usage_rule][:flat_usage_rate][:uom],
172
- :validFrom => service[:match_all_service_usage_rule][:flat_usage_rate][:valid_from],
173
- :validTo => service[:match_all_service_usage_rule][:flat_usage_rate][:valid_to],
174
- :rate => service[:match_all_service_usage_rule][:flat_usage_rate][:rate]
170
+ flatUsageRate: {
171
+ uom: service[:match_all_service_usage_rule][:flat_usage_rate][:uom],
172
+ validFrom: service[:match_all_service_usage_rule][:flat_usage_rate][:valid_from],
173
+ validTo: service[:match_all_service_usage_rule][:flat_usage_rate][:valid_to],
174
+ rate: service[:match_all_service_usage_rule][:flat_usage_rate][:rate]
175
175
  }
176
176
  }
177
177
  }
@@ -186,9 +186,9 @@ module GoTransverseTractApi
186
186
  #
187
187
  def remove_service_usage_rule_from_service eid, service
188
188
  data = {
189
- :removeServiceUsageRuleFromService => {},
190
- :service => {eid: eid},
191
- :matchAllServiceUsageRule => {
189
+ removeServiceUsageRuleFromService: {},
190
+ service: {eid: eid},
191
+ matchAllServiceUsageRule: {
192
192
  eid: service[:match_all_service_usage_rule][:eid]
193
193
  }
194
194
  }
@@ -202,15 +202,15 @@ module GoTransverseTractApi
202
202
  #
203
203
  def add_agreement eid, service
204
204
  data = {
205
- :addAgreementToService => {},
206
- :service => {eid: eid},
207
- :agreementService=> {
208
- :attributes => {
209
- :endAction => service[:agreement_service][:end_action],
210
- :endDate => service[:agreement_service][:end_date],
211
- :startDate => service[:agreement_service][:start_date]
205
+ addAgreementToService: {},
206
+ service: {eid: eid},
207
+ agreementService: {
208
+ attributes: {
209
+ endAction: service[:agreement_service][:end_action],
210
+ endDate: service[:agreement_service][:end_date],
211
+ startDate: service[:agreement_service][:start_date]
212
212
  },
213
- :agreement => {
213
+ agreement: {
214
214
  eid: service[:agreement_service][:agreement][:eid]
215
215
  }
216
216
  }
@@ -226,18 +226,18 @@ module GoTransverseTractApi
226
226
  #
227
227
  def add_counter eid, service
228
228
  data = {
229
- :addCounterToService => {},
230
- :service => {eid: eid},
231
- :usageRuleCounter => {
232
- :attributes => {
233
- :name => service[:usage_rule_counter][:name],
234
- :description => service[:usage_rule_counter][:description],
235
- :status => service[:usage_rule_counter][:status],
236
- :entityRelationType => service[:usage_rule_counter][:entity_relation_type],
237
- :uom => service[:usage_rule_counter][:uom],
238
- :threshold => service[:usage_rule_counter][:threshold]
229
+ addCounterToService: {},
230
+ service: {eid: eid},
231
+ usageRuleCounter: {
232
+ attributes: {
233
+ name: service[:usage_rule_counter][:name],
234
+ description: service[:usage_rule_counter][:description],
235
+ status: service[:usage_rule_counter][:status],
236
+ entityRelationType: service[:usage_rule_counter][:entity_relation_type],
237
+ uom: service[:usage_rule_counter][:uom],
238
+ threshold: service[:usage_rule_counter][:threshold]
239
239
  },
240
- :servicePeriodCounterResetCriteria => {}
240
+ servicePeriodCounterResetCriteria: {}
241
241
  }
242
242
  }
243
243
 
@@ -251,13 +251,13 @@ module GoTransverseTractApi
251
251
  #
252
252
  def add_custom_field_value eid, service
253
253
  data = {
254
- :addCustomFieldValueToService => {},
255
- :service => {eid: eid},
256
- :customFieldValue => {
257
- :attributes => {
258
- :value => service[:custom_field_value][:value]
254
+ addCustomFieldValueToService: {},
255
+ service: {eid: eid},
256
+ customFieldValue: {
257
+ attributes: {
258
+ value: service[:custom_field_value][:value]
259
259
  },
260
- :customField => {
260
+ customField: {
261
261
  eid: service[:custom_field_value][:custom_field][:eid]
262
262
  }
263
263
  }
@@ -273,9 +273,9 @@ module GoTransverseTractApi
273
273
  #
274
274
  def remove_custom_field_value eid, service
275
275
  data = {
276
- :removeCustomFieldValueFromService => {},
277
- :service => {eid: eid},
278
- :customFieldValue => {
276
+ removeCustomFieldValueFromService: {},
277
+ service: {eid: eid},
278
+ customFieldValue: {
279
279
  eid: service[:custom_field_value][:eid]
280
280
  }
281
281
  }
@@ -292,44 +292,44 @@ module GoTransverseTractApi
292
292
  api_data = GoTransverseTractApi::ApiData.new
293
293
 
294
294
  data = {
295
- :addDiscountIdentifierToService => {},
296
- :service => {
297
- :attributes => {
298
- :amount => service[:amount],
299
- :startDate => service[:start_date],
300
- :status => service[:status],
301
- :description => service[:description],
302
- :renewalCount => service[:renewal_count],
295
+ addDiscountIdentifierToService: {},
296
+ service: {
297
+ attributes: {
298
+ amount: service[:amount],
299
+ startDate: service[:start_date],
300
+ status: service[:status],
301
+ description: service[:description],
302
+ renewalCount: service[:renewal_count],
303
303
  eid: service[:eid],
304
- :queryScope => service[:query_scope]
304
+ queryScope: service[:query_scope]
305
305
  },
306
- :billingAccount => {
306
+ billingAccount: {
307
307
  eid: service[:billing_account][:eid],
308
- :queryScope => service[:billing_account][:query_scope]
308
+ queryScope: service[:billing_account][:query_scope]
309
309
  },
310
- :serviceResources => GoTransverseTractApi::ApiData.new.get_page_info(service[:service_resources]),
311
- :product => {
310
+ serviceResources: GoTransverseTractApi::ApiData.new.get_page_info(service[:service_resources]),
311
+ product: {
312
312
  eid: service[:product][:eid],
313
- :queryScope => service[:product][:query_scope]
313
+ queryScope: service[:product][:query_scope]
314
314
  },
315
- :servicePeriods => api_data.get_page_info(service[:service_periods]),
316
- :servicePrices => api_data.get_page_info(service[:service_prices]),
317
- :serviceUsageRules => api_data.get_page_info(service[:service_usage_rules]),
318
- :counters => api_data.get_page_info(service[:counters]),
319
- :customFieldValues => api_data.get_page_info(service[:custom_field_values])
315
+ servicePeriods: api_data.get_page_info(service[:service_periods]),
316
+ servicePrices: api_data.get_page_info(service[:service_prices]),
317
+ serviceUsageRules: api_data.get_page_info(service[:service_usage_rules]),
318
+ counters: api_data.get_page_info(service[:counters]),
319
+ customFieldValues: api_data.get_page_info(service[:custom_field_values])
320
320
  },
321
- :discountIdentifier => {
322
- :attributes => {
323
- :status => service[:discount_identifier][:status],
324
- :unlimited => service[:discount_identifier][:unlimited],
325
- :uses => service[:discount_identifier][:uses],
326
- :identifier => service[:discount_identifier][:identifier],
321
+ discountIdentifier: {
322
+ attributes: {
323
+ status: service[:discount_identifier][:status],
324
+ unlimited: service[:discount_identifier][:unlimited],
325
+ uses: service[:discount_identifier][:uses],
326
+ identifier: service[:discount_identifier][:identifier],
327
327
  eid: service[:discount_identifier][:eid],
328
- :queryScope => service[:discount_identifier][:query_scope]
328
+ queryScope: service[:discount_identifier][:query_scope]
329
329
  },
330
- :category => {
330
+ category: {
331
331
  eid: service[:discount_identifier][:category][:eid],
332
- :queryScope => service[:discount_identifier][:category][:query_scope]
332
+ queryScope: service[:discount_identifier][:category][:query_scope]
333
333
  }
334
334
  }
335
335
  }
@@ -344,11 +344,11 @@ module GoTransverseTractApi
344
344
  #
345
345
  def change_price eid, service
346
346
  data = {
347
- :changeServicePrice => {
348
- :attributes => {
349
- :newRecurringUnitPrice => service[:new_recurring_unit_price]
347
+ changeServicePrice: {
348
+ attributes: {
349
+ newRecurringUnitPrice: service[:new_recurring_unit_price]
350
350
  },
351
- :service => {eid: eid}
351
+ service: {eid: eid}
352
352
  }
353
353
  }
354
354
 
@@ -362,12 +362,12 @@ module GoTransverseTractApi
362
362
  #
363
363
  def change_quantity eid, service
364
364
  data = {
365
- :changeServiceQuantity => {
366
- :attributes => {
367
- :newQuantity => service[:new_quantity],
368
- :effectiveDate => service[:effective_date]
365
+ changeServiceQuantity: {
366
+ attributes: {
367
+ newQuantity: service[:new_quantity],
368
+ effectiveDate: service[:effective_date]
369
369
  },
370
- :service => {eid: eid}
370
+ service: {eid: eid}
371
371
  }
372
372
  }
373
373
 
@@ -381,46 +381,46 @@ module GoTransverseTractApi
381
381
  #
382
382
  def renew eid, service
383
383
  data = {
384
- :renewService => {},
385
- :service => {
386
- :attributes => {eid: eid},
387
- :billingAccount => {
384
+ renewService: {},
385
+ service: {
386
+ attributes: {eid: eid},
387
+ billingAccount: {
388
388
  eid: service[:billing_account][:eid]
389
389
  }
390
390
  },
391
- :order => {
392
- :attributes => {},
393
- :orderItems => {
394
- :attributes => {},
395
- :orderItem => {
396
- :attributes => {
397
- :quantity => service[:order][:order_items][:order_item][:quantity],
398
- :sequence => service[:order][:order_items][:order_item][:sequence]
391
+ order: {
392
+ attributes: {},
393
+ orderItems: {
394
+ attributes: {},
395
+ orderItem: {
396
+ attributes: {
397
+ quantity: service[:order][:order_items][:order_item][:quantity],
398
+ sequence: service[:order][:order_items][:order_item][:sequence]
399
399
  },
400
- :product => {
400
+ product: {
401
401
  eid: service[:order][:order_items][:order_item][:product][:eid]
402
402
  },
403
- :selectedAgreement => {
403
+ selectedAgreement: {
404
404
  eid: service[:order][:order_items][:order_item][:selected_agreement][:eid]
405
405
  }
406
406
  }
407
407
  },
408
- :billingAccount => { eid: service[:order][:billing_account][:eid] },
409
- :payments => {
410
- :attributes => {},
411
- :payment => {
412
- :attributes => {
413
- :amount => service[:order][:payments][:payment][:amount],
414
- :description => service[:order][:payments][:payment][:description]
408
+ billingAccount: { eid: service[:order][:billing_account][:eid] },
409
+ payments: {
410
+ attributes: {},
411
+ payment: {
412
+ attributes: {
413
+ amount: service[:order][:payments][:payment][:amount],
414
+ description: service[:order][:payments][:payment][:description]
415
415
  },
416
- :billingAccount => { eid: service[:order][:payments][:payment][:billing_account][:eid] },
417
- :creditCardPayment => {
418
- :cardType => service[:order][:payments][:payment][:credit_card_payment][:card_type],
419
- :cardHolderFirstName => service[:order][:payments][:payment][:credit_card_payment][:card_holder_first_name],
420
- :cardHolderMiddleName => service[:order][:payments][:payment][:credit_card_payment][:card_holder_middle_name],
421
- :cardHolderLastName => service[:order][:payments][:payment][:credit_card_payment][:card_holder_last_name],
422
- :cardIdentifierNumber => service[:order][:payments][:payment][:credit_card_payment][:card_identifier_number],
423
- :cardExpiration => service[:order][:payments][:payment][:credit_card_payment][:card_expiration]
416
+ billingAccount: { eid: service[:order][:payments][:payment][:billing_account][:eid] },
417
+ creditCardPayment: {
418
+ cardType: service[:order][:payments][:payment][:credit_card_payment][:card_type],
419
+ cardHolderFirstName: service[:order][:payments][:payment][:credit_card_payment][:card_holder_first_name],
420
+ cardHolderMiddleName: service[:order][:payments][:payment][:credit_card_payment][:card_holder_middle_name],
421
+ cardHolderLastName: service[:order][:payments][:payment][:credit_card_payment][:card_holder_last_name],
422
+ cardIdentifierNumber: service[:order][:payments][:payment][:credit_card_payment][:card_identifier_number],
423
+ cardExpiration: service[:order][:payments][:payment][:credit_card_payment][:card_expiration]
424
424
  }
425
425
  }
426
426
  }
@@ -437,8 +437,8 @@ module GoTransverseTractApi
437
437
  #
438
438
  def deactivate eid, service
439
439
  data = {
440
- :deactivateService => {},
441
- :service => {eid: eid}
440
+ deactivateService: {},
441
+ service: {eid: eid}
442
442
  }
443
443
 
444
444
  xml_data = GoTransverseTractApi.generateXML(data, 'deactivateService')
@@ -450,7 +450,15 @@ module GoTransverseTractApi
450
450
  # @param {Hash} service
451
451
  #
452
452
  def update eid, service
453
- GoTransverseTractApi.put_request_for(self, {eid: eid}, service)
453
+ data = {
454
+ service: {
455
+ eid: eid,
456
+ description: service[:description]
457
+ }
458
+ }
459
+
460
+ xml_data = GoTransverseTractApi.generateXML(data, 'service')
461
+ GoTransverseTractApi.put_request_for(self, {eid: eid}, xml_data)
454
462
  end
455
463
 
456
464
  end
@@ -60,12 +60,12 @@ module GoTransverseTractApi
60
60
  #
61
61
  def request service_resource
62
62
  data = {
63
- :requestServiceResource => {
64
- :identifier => service_resource[:identifier],
65
- :status => service_resource[:status],
66
- :description => service_resource[:description]
63
+ requestServiceResource: {
64
+ identifier: service_resource[:identifier],
65
+ status: service_resource[:status],
66
+ description: service_resource[:description]
67
67
  },
68
- :serviceResourceCategory => {eid: service_resource[:service_resource_category][:eid]}
68
+ serviceResourceCategory: {eid: service_resource[:service_resource_category][:eid]}
69
69
  }
70
70
  xml_data = GoTransverseTractApi.generateXML(data, 'requestServiceResource')
71
71
  GoTransverseTractApi.post_request_for(self, {}, xml_data, "request")
@@ -77,15 +77,15 @@ module GoTransverseTractApi
77
77
  #
78
78
  def change eid, service_resource
79
79
  data = {
80
- :changeServiceResource => {},
81
- :serviceResource => {eid: eid},
82
- :changeToServiceResource => {
83
- :attributes => {
84
- :identifier => service_resource[:change_to_service_resource][:identifier],
85
- :status => service_resource[:change_to_service_resource][:status],
86
- :description => service_resource[:change_to_service_resource][:description]
80
+ changeServiceResource: {},
81
+ serviceResource: {eid: eid},
82
+ changeToServiceResource: {
83
+ attributes: {
84
+ identifier: service_resource[:change_to_service_resource][:identifier],
85
+ status: service_resource[:change_to_service_resource][:status],
86
+ description: service_resource[:change_to_service_resource][:description]
87
87
  },
88
- :category => {eid: service_resource[:category][:eid]}
88
+ category: {eid: service_resource[:category][:eid]}
89
89
  }
90
90
  }
91
91
 
@@ -99,8 +99,8 @@ module GoTransverseTractApi
99
99
  #
100
100
  def deactivate eid, service_resource
101
101
  data = {
102
- :deactivateServiceResource => {},
103
- :serviceResource => {eid: eid}
102
+ deactivateServiceResource: {},
103
+ serviceResource: {eid: eid}
104
104
  }
105
105
 
106
106
  xml_data = GoTransverseTractApi.generateXML(data, 'deactivateServiceResource')
@@ -112,12 +112,12 @@ module GoTransverseTractApi
112
112
  #
113
113
  def create_service_resource service_resource
114
114
  data = {
115
- :serviceResource => {
116
- :identifier => service_resource[:identifier],
117
- :status => service_resource[:status],
118
- :description => service_resource[:description]
115
+ serviceResource: {
116
+ identifier: service_resource[:identifier],
117
+ status: service_resource[:status],
118
+ description: service_resource[:description]
119
119
  },
120
- :category => {eid: service_resource[:category][:eid]}
120
+ category: {eid: service_resource[:category][:eid]}
121
121
  }
122
122
 
123
123
  xml_data = GoTransverseTractApi.generateXML(data, 'serviceResource')
@@ -129,7 +129,16 @@ module GoTransverseTractApi
129
129
  # @param {Hash} service_resource
130
130
  #
131
131
  def update eid, service_resource
132
- GoTransverseTractApi.put_response_for(self, {eid: eid}, service_resource)
132
+ data = {
133
+ serviceResource: {
134
+ eid: eid,
135
+ identifier: service_resource[:identifier],
136
+ description: service_resource[:description]
137
+ }
138
+ }
139
+
140
+ xml_data = GoTransverseTractApi.generateXML(data, 'serviceResource')
141
+ GoTransverseTractApi.put_request_for(self, {eid: eid}, xml_data)
133
142
  end
134
143
 
135
144
  #
@@ -138,13 +147,13 @@ module GoTransverseTractApi
138
147
  #
139
148
  def add_service_resource eid, service_resource
140
149
  data = {
141
- :addServiceResourceToService => {},
142
- :service => {eid: eid},
143
- :serviceResource => {
144
- :attributes => {
145
- :identifier => service_resource[:identifier]
150
+ addServiceResourceToService: {},
151
+ service: {eid: eid},
152
+ serviceResource: {
153
+ attributes: {
154
+ identifier: service_resource[:identifier]
146
155
  },
147
- :category => {eid: service_resource[:category][:eid]}
156
+ category: {eid: service_resource[:category][:eid]}
148
157
  }
149
158
  }
150
159
 
@@ -158,9 +167,9 @@ module GoTransverseTractApi
158
167
  #
159
168
  def self.remove_service_resource eid, service_resource
160
169
  data = {
161
- :removeServiceResourceFromService => {},
162
- :service => {eid: eid},
163
- :serviceResource => {eid: service_resource[:eid]}
170
+ removeServiceResourceFromService: {},
171
+ service: {eid: eid},
172
+ serviceResource: {eid: service_resource[:eid]}
164
173
  }
165
174
 
166
175
  xml_data = GoTransverseTractApi.generateXML(data, 'removeServiceResourceFromService')
@@ -70,13 +70,7 @@ module GoTransverseTractApi
70
70
  #
71
71
  def create_usage_event usage_event
72
72
  data = {
73
- usageEvent: {
74
- startTime: usage_event[:start_time],
75
- serviceResourceId: usage_event[:service_resource_id],
76
- usageUom: usage_event[:usage_uom],
77
- usageAmount: usage_event[:usage_amount],
78
- number01: usage_event[:number01]
79
- },
73
+ usageEvent: get_usage_event(usage_event),
80
74
  serviceResourceType: usage_event[:service_resource_type]
81
75
  }
82
76
 
@@ -126,13 +120,7 @@ module GoTransverseTractApi
126
120
  usage_event.each do|event|
127
121
  events << {
128
122
  usageEvent: {
129
- attributes: {
130
- startTime: event[:start_time],
131
- serviceResourceId: event[:service_resource_id],
132
- usageUom: event[:usage_uom],
133
- usageAmount: event[:usage_amount],
134
- description: event[:description]
135
- },
123
+ attributes: get_usage_event(event),
136
124
  serviceResourceType: event[:service_resource_type]
137
125
  }
138
126
  }
@@ -141,6 +129,32 @@ module GoTransverseTractApi
141
129
  events
142
130
  end
143
131
 
132
+ #
133
+ # params: Usage Event
134
+ #
135
+ # Returns A single usage event for XML
136
+ #
137
+ def get_usage_event(event)
138
+ udfs = {}
139
+
140
+ (1..5).each do|i|
141
+ udfs["text0#{i}".to_sym] = event["text0#{i}".to_sym]
142
+ udfs["number0#{i}".to_sym] = event["number0#{i}".to_sym]
143
+ udfs["date0#{i}".to_sym] = event["date0#{i}".to_sym]
144
+ end
145
+
146
+ ({
147
+ description: event[:description],
148
+ startTime: event[:start_time],
149
+ endTime: event[:end_time],
150
+ serviceResourceId: event[:service_resource_id],
151
+ usageUom: event[:usage_uom],
152
+ usageAmount: event[:usage_amount],
153
+ referenceId: event[:reference_id],
154
+ sequenceId: event[:sequence_id]
155
+ }.merge udfs).delete_if{|k,v| v.nil?}
156
+ end
157
+
144
158
  end
145
159
 
146
160
  end
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.4.3"
3
+ VERSION = "0.5.0"
4
4
  TARGET_API_VERSION = "1.28"
5
5
 
6
6
  end
@@ -186,7 +186,7 @@ module GoTransverseTractApi
186
186
 
187
187
  def self.generateXML(data, root_elem)
188
188
  tract_api_ver = GoTransverseTractApi::TARGET_API_VERSION
189
- data[root_elem.to_sym][:xmlns] = "http://www.tractbilling.com/billing/#{tract_api_ver}/domain"
189
+ data[root_elem.to_sym][:xmlns] = "http://www.tractbilling.com/billing/" + tract_api_ver.tr('.','_') + "/domain"
190
190
 
191
191
  builder = Nokogiri::XML::Builder.new do|xml|
192
192
  xml.send(root_elem,Hash[data[root_elem.to_sym]]) do
@@ -196,7 +196,8 @@ module GoTransverseTractApi
196
196
  end
197
197
  end
198
198
 
199
- builder.doc.root.to_xml
199
+ xml_str = builder.doc.root.to_xml
200
+ xml_str.tr!('"', "'")
200
201
  end
201
202
 
202
203
  private
@@ -249,7 +250,7 @@ module GoTransverseTractApi
249
250
  hsh = Hash.from_xml(xml_response.to_s).recursive_symbolize_keys!
250
251
 
251
252
  if method == :get
252
- hsh = hsh[klass.pluralize.camelize(:lower).to_sym][klass.camelize(:lower).to_sym] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower).to_sym]
253
+ hsh = hsh[klass.pluralize.camelize(:lower).to_sym] rescue Hash.from_xml(xml_response.to_s)[klass.camelize(:lower).to_sym]
253
254
  end
254
255
 
255
256
  return hsh