gotransverse-tract-api 0.4.2 → 0.4.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 828bd0d78d18adf18c2266fde4e0ac5f57ee5379
4
- data.tar.gz: 35db65a807fd08a07c73da511c2f63506b115e72
3
+ metadata.gz: 991b917a0d5b0f35ea4a30f1072e490376c39215
4
+ data.tar.gz: ee0c6d6a5910f7d09487fb3f1e80576377a93369
5
5
  SHA512:
6
- metadata.gz: 69ca12fe32a9bdd6869a2a1d9c793e894dbc5d651ea644aba8124eda9b6e24f004d9dd8a94c22920d2cdadf764a6abbb13d2d9fb79b262a9d68e1754c606f080
7
- data.tar.gz: 7ac650deeff4534598c13601e2a21b132c1bbc4d6a397b9039e95d42dd92d158c94d8338d79cf6045321f15950e54335cad4f5852299386c3390f96b50a48228
6
+ metadata.gz: e813bc6870a93ea21159c93d3cadd72c3b75987346b0cb6134e1808eddf05f79d604f26f96f4aee022eb49ef72d511d5fc5005b5abdc77cf1c75db21b63dcbb4
7
+ data.tar.gz: 4abf7a83a59a66ebdf194238d6cf496d8d70ab59f79eb682925f8f0ff10f564fe53614c2848e06d57ab7a3ca8e52e479559e38fd4f001c7c2903bd560f22e469
@@ -54,9 +54,9 @@ module GoTransverseTractApi
54
54
  #
55
55
  def post eid, adjustment
56
56
  data = {
57
- :postAdjustment => {},
58
- :adjustment => {
59
- :attributes => {
57
+ postAdjustment: {},
58
+ adjustment: {
59
+ attributes: {
60
60
  eid: adjustment[:eid]
61
61
  }
62
62
  }
@@ -72,10 +72,10 @@ module GoTransverseTractApi
72
72
  #
73
73
  def reverse eid, adjustment
74
74
  data = {
75
- :reverseAdjustment => {
76
- :fullAmount => adjustment[:full_amount]
75
+ reverseAdjustment: {
76
+ fullAmount: adjustment[:full_amount]
77
77
  },
78
- :adjustment => make_adjustment(adjustment)
78
+ adjustment: make_adjustment(adjustment)
79
79
  }
80
80
 
81
81
  xml_data = GoTransverseTractApi.generateXML(data, 'reverseAdjustment')
@@ -91,14 +91,14 @@ module GoTransverseTractApi
91
91
  account_adjustment = make_adjustment(adjustment)
92
92
 
93
93
  data = {
94
- :addInvoiceApplicationToAdjustment => {},
95
- :adjustment => account_adjustment,
96
- :invoiceAdjustmentApplication => {
97
- :attributes => {
98
- :amount => adjustment[:invoice_adjustment_application][:amount]
94
+ addInvoiceApplicationToAdjustment: {},
95
+ adjustment: account_adjustment,
96
+ invoiceAdjustmentApplication: {
97
+ attributes: {
98
+ amount: adjustment[:invoice_adjustment_application][:amount]
99
99
  },
100
- :accountAdjustment => account_adjustment,
101
- :invoice => get_invoice(adjustment, account_adjustment)
100
+ accountAdjustment: account_adjustment,
101
+ invoice: get_invoice(adjustment, account_adjustment)
102
102
  }
103
103
  }
104
104
 
@@ -115,34 +115,34 @@ module GoTransverseTractApi
115
115
  account_adjustment = make_adjustment(adjustment)
116
116
 
117
117
  data = {
118
- :reverseInvoiceApplicationFromAdjustment => {},
119
- :adjustment => account_adjustment,
120
- :invoiceAdjustmentApplication => {
121
- :attributes => {
122
- :reversed => adjustment[:invoice_adjustment_application][:reversed],
123
- :appliedOn => adjustment[:invoice_adjustment_application][:applied_on],
124
- :amount => adjustment[:invoice_adjustment_application][:amount],
118
+ reverseInvoiceApplicationFromAdjustment: {},
119
+ adjustment: account_adjustment,
120
+ invoiceAdjustmentApplication: {
121
+ attributes: {
122
+ reversed: adjustment[:invoice_adjustment_application][:reversed],
123
+ appliedOn: adjustment[:invoice_adjustment_application][:applied_on],
124
+ amount: adjustment[:invoice_adjustment_application][:amount],
125
125
  eid: adjustment[:invoice_adjustment_application][:eid]
126
126
  },
127
- :accountAdjustment => {
128
- :attributes => {
129
- :occurredOn => adjustment[:occurred_on],
130
- :amount => adjustment[:amount],
131
- :description => adjustment[:description],
132
- :invoiced => adjustment[:invoice_adjustment_application][:account_adjustment][:invoiced],
133
- :credit => adjustment[:invoice_adjustment_application][:account_adjustment][:credit],
134
- :status => adjustment[:invoice_adjustment_application][:account_adjustment][:status],
135
- :type => adjustment[:type],
136
- :posted_on => adjustment[:invoice_adjustment_application][:account_adjustment][:posted_on],
137
- :posted_by => adjustment[:invoice_adjustment_application][:account_adjustment][:posted_by],
138
- :manualInvoiceApplication => adjustment[:manual_invoice_application],
127
+ accountAdjustment: {
128
+ attributes: {
129
+ occurredOn: adjustment[:occurred_on],
130
+ amount: adjustment[:amount],
131
+ description: adjustment[:description],
132
+ invoiced: adjustment[:invoice_adjustment_application][:account_adjustment][:invoiced],
133
+ credit: adjustment[:invoice_adjustment_application][:account_adjustment][:credit],
134
+ status: adjustment[:invoice_adjustment_application][:account_adjustment][:status],
135
+ type: adjustment[:type],
136
+ posted_on: adjustment[:invoice_adjustment_application][:account_adjustment][:posted_on],
137
+ posted_by: adjustment[:invoice_adjustment_application][:account_adjustment][:posted_by],
138
+ manualInvoiceApplication: adjustment[:manual_invoice_application],
139
139
  eid: adjustment[:eid]
140
140
  },
141
- :billingAccount => account_adjustment[:billingAccount],
142
- :reason => account_adjustment[:reason],
143
- :adjustmentApplications => account_adjustment[:billingAccount][:services]
141
+ billingAccount: account_adjustment[:billingAccount],
142
+ reason: account_adjustment[:reason],
143
+ adjustmentApplications: account_adjustment[:billingAccount][:services]
144
144
  },
145
- :invoice => get_invoice(adjustment, account_adjustment)
145
+ invoice: get_invoice(adjustment, account_adjustment)
146
146
  }
147
147
  }
148
148
 
@@ -156,18 +156,18 @@ module GoTransverseTractApi
156
156
  def create_adjustment adjustment
157
157
 
158
158
  data = {
159
- :adjustment => {
160
- :occurredOn => adjustment[:occurred_on],
161
- :amount => adjustment[:amount],
162
- :description => adjustment[:description],
163
- :type => adjustment[:type],
164
- :credit => adjustment[:credit],
165
- :posted => adjustment[:posted]
159
+ adjustment: {
160
+ occurredOn: adjustment[:occurred_on],
161
+ amount: adjustment[:amount],
162
+ description: adjustment[:description],
163
+ type: adjustment[:type],
164
+ credit: adjustment[:credit],
165
+ posted: adjustment[:posted]
166
166
  },
167
- :billingAccount => {
167
+ billingAccount: {
168
168
  eid: adjustment[:billing_account][:eid]
169
169
  },
170
- :reason => {
170
+ reason: {
171
171
  eid: adjustment[:reason][:eid]
172
172
  }
173
173
  }
@@ -180,108 +180,108 @@ module GoTransverseTractApi
180
180
 
181
181
  def get_invoice (adjustment, account_adjustment)
182
182
  {
183
- :attributes => {
184
- :invoiceNum => adjustment[:invoice_adjustment_application][:invoice][:invoice_num],
185
- :amount => adjustment[:invoice_adjustment_application][:invoice][:amount],
186
- :pdfPath => adjustment[:invoice_adjustment_application][:invoice][:pdf_path],
187
- :occurredOn => adjustment[:invoice_adjustment_application][:invoice][:occurred_on],
188
- :dueDate => adjustment[:invoice_adjustment_application][:invoice][:due_date],
189
- :amountToPay => adjustment[:invoice_adjustment_application][:invoice][:amount_to_pay],
190
- :lateFeeCharged => adjustment[:invoice_adjustment_application][:invoice][:late_fee_charged],
191
- :status => adjustment[:invoice_adjustment_application][:invoice][:status],
192
- :usageCsvPath => adjustment[:invoice_adjustment_application][:invoice][:usage_csv_path],
183
+ attributes: {
184
+ invoiceNum: adjustment[:invoice_adjustment_application][:invoice][:invoice_num],
185
+ amount: adjustment[:invoice_adjustment_application][:invoice][:amount],
186
+ pdfPath: adjustment[:invoice_adjustment_application][:invoice][:pdf_path],
187
+ occurredOn: adjustment[:invoice_adjustment_application][:invoice][:occurred_on],
188
+ dueDate: adjustment[:invoice_adjustment_application][:invoice][:due_date],
189
+ amountToPay: adjustment[:invoice_adjustment_application][:invoice][:amount_to_pay],
190
+ lateFeeCharged: adjustment[:invoice_adjustment_application][:invoice][:late_fee_charged],
191
+ status: adjustment[:invoice_adjustment_application][:invoice][:status],
192
+ usageCsvPath: adjustment[:invoice_adjustment_application][:invoice][:usage_csv_path],
193
193
  eid: adjustment[:invoice_adjustment_application][:invoice][:eid]
194
194
  },
195
- :billingAccount => account_adjustment[:billingAccount],
196
- :billCycle => account_adjustment[:billingAccount][:dailyBillCycle],
197
- :invoiceItems => account_adjustment[:billingAccount][:services]
195
+ billingAccount: account_adjustment[:billingAccount],
196
+ billCycle: account_adjustment[:billingAccount][:dailyBillCycle],
197
+ invoiceItems: account_adjustment[:billingAccount][:services]
198
198
  }
199
199
  end
200
200
 
201
201
  def make_adjustment adjustment
202
202
  adjustment = {
203
- :attributes => {
204
- :occurredOn => adjustment[:occurred_on],
205
- :amount => adjustment[:amount],
206
- :description => adjustment[:description],
207
- :invoiced => adjustment[:invoiced],
208
- :credit => adjustment[:credit],
209
- :status => adjustment[:status],
210
- :type => adjustment[:type],
211
- :manualInvoiceApplication => adjustment[:manual_invoice_application],
203
+ attributes: {
204
+ occurredOn: adjustment[:occurred_on],
205
+ amount: adjustment[:amount],
206
+ description: adjustment[:description],
207
+ invoiced: adjustment[:invoiced],
208
+ credit: adjustment[:credit],
209
+ status: adjustment[:status],
210
+ type: adjustment[:type],
211
+ manualInvoiceApplication: adjustment[:manual_invoice_application],
212
212
  eid: adjustment[:eid]
213
213
  },
214
- :billingAccount => {
215
- :attributes => {
216
- :accountNum => adjustment[:billing_account][:account_num],
217
- :billType => adjustment[:billing_account][:bill_type],
218
- :automaticRecurringPayment => adjustment[:billing_account][:automatic_recurring_payment],
219
- :status => adjustment[:billing_account][:status],
220
- :pendingChargesTotal => adjustment[:billing_account][:pending_charges_total],
221
- :balance => adjustment[:billing_account][:balance],
222
- :startDate => adjustment[:billing_account][:start_date],
223
- :taxExempt => adjustment[:billing_account][:tax_exempt],
214
+ billingAccount: {
215
+ attributes: {
216
+ accountNum: adjustment[:billing_account][:account_num],
217
+ billType: adjustment[:billing_account][:bill_type],
218
+ automaticRecurringPayment: adjustment[:billing_account][:automatic_recurring_payment],
219
+ status: adjustment[:billing_account][:status],
220
+ pendingChargesTotal: adjustment[:billing_account][:pending_charges_total],
221
+ balance: adjustment[:billing_account][:balance],
222
+ startDate: adjustment[:billing_account][:start_date],
223
+ taxExempt: adjustment[:billing_account][:tax_exempt],
224
224
  eid: adjustment[:billing_account][:eid]
225
225
  },
226
- :dailyBillCycle => {
227
- :name => adjustment[:billing_account][:daily_bill_cycle][:name],
228
- :startDate => adjustment[:billing_account][:daily_bill_cycle][:start_date],
229
- :endDate => adjustment[:billing_account][:daily_bill_cycle][:end_date],
230
- :billCycleType => adjustment[:billing_account][:daily_bill_cycle][:bill_cycle_type],
231
- :autoBill => adjustment[:billing_account][:daily_bill_cycle][:auto_bill],
232
- :usePaymentTerm => adjustment[:billing_account][:daily_bill_cycle][:use_payment_term],
233
- :status => adjustment[:billing_account][:daily_bill_cycle][:status],
226
+ dailyBillCycle: {
227
+ name: adjustment[:billing_account][:daily_bill_cycle][:name],
228
+ startDate: adjustment[:billing_account][:daily_bill_cycle][:start_date],
229
+ endDate: adjustment[:billing_account][:daily_bill_cycle][:end_date],
230
+ billCycleType: adjustment[:billing_account][:daily_bill_cycle][:bill_cycle_type],
231
+ autoBill: adjustment[:billing_account][:daily_bill_cycle][:auto_bill],
232
+ usePaymentTerm: adjustment[:billing_account][:daily_bill_cycle][:use_payment_term],
233
+ status: adjustment[:billing_account][:daily_bill_cycle][:status],
234
234
  eid: adjustment[:billing_account][:daily_bill_cycle][:eid]
235
235
  },
236
- :person => {
237
- :attributes => {
238
- :firstName => adjustment[:billing_account][:person][:first_name],
239
- :lastName => adjustment[:billing_account][:person][:last_name],
236
+ person: {
237
+ attributes: {
238
+ firstName: adjustment[:billing_account][:person][:first_name],
239
+ lastName: adjustment[:billing_account][:person][:last_name],
240
240
  eid: adjustment[:billing_account][:person][:eid]
241
241
  },
242
- :addresses => {
243
- :attributes => {},
244
- :postalAddress => {
245
- :purpose => adjustment[:billing_account][:person][:addresses][:postal_address][:purpose],
246
- :country => adjustment[:billing_account][:person][:addresses][:postal_address][:country],
247
- :city => adjustment[:billing_account][:person][:addresses][:postal_address][:city],
248
- :regionOrState => adjustment[:billing_account][:person][:addresses][:postal_address][:region_or_state],
249
- :postalCode => adjustment[:billing_account][:person][:addresses][:postal_address][:postal_code],
250
- :line1 => adjustment[:billing_account][:person][:addresses][:postal_address][:line1],
242
+ addresses: {
243
+ attributes: {},
244
+ postalAddress: {
245
+ purpose: adjustment[:billing_account][:person][:addresses][:postal_address][:purpose],
246
+ country: adjustment[:billing_account][:person][:addresses][:postal_address][:country],
247
+ city: adjustment[:billing_account][:person][:addresses][:postal_address][:city],
248
+ regionOrState: adjustment[:billing_account][:person][:addresses][:postal_address][:region_or_state],
249
+ postalCode: adjustment[:billing_account][:person][:addresses][:postal_address][:postal_code],
250
+ line1: adjustment[:billing_account][:person][:addresses][:postal_address][:line1],
251
251
  eid: adjustment[:billing_account][:person][:addresses][:postal_address][:eid]
252
252
  },
253
- :emailAddress => {
254
- :purpose => adjustment[:billing_account][:person][:addresses][:email_address][:purpose],
255
- :email => adjustment[:billing_account][:person][:addresses][:email_address][:email],
253
+ emailAddress: {
254
+ purpose: adjustment[:billing_account][:person][:addresses][:email_address][:purpose],
255
+ email: adjustment[:billing_account][:person][:addresses][:email_address][:email],
256
256
  eid: adjustment[:billing_account][:person][:addresses][:email_address][:eid]
257
257
  }
258
258
  }
259
259
  },
260
- :billingAccountCategory => {
261
- :type => adjustment[:billing_account][:billing_account_category][:type],
262
- :description => adjustment[:billing_account][:billing_account_category][:description],
263
- :status => adjustment[:billing_account][:billing_account_category][:status],
260
+ billingAccountCategory: {
261
+ type: adjustment[:billing_account][:billing_account_category][:type],
262
+ description: adjustment[:billing_account][:billing_account_category][:description],
263
+ status: adjustment[:billing_account][:billing_account_category][:status],
264
264
  eid: adjustment[:billing_account][:billing_account_category][:eid]
265
265
  },
266
- :services => {
267
- :pageNumber => adjustment[:billing_account][:services][:page_number],
268
- :pageSize => adjustment[:billing_account][:services][:page_size],
269
- :totalElements => adjustment[:billing_account][:services][:total_elements],
270
- :elementCount => adjustment[:billing_account][:services][:element_count],
271
- :totalPages => adjustment[:billing_account][:services][:total_pages]
266
+ services: {
267
+ pageNumber: adjustment[:billing_account][:services][:page_number],
268
+ pageSize: adjustment[:billing_account][:services][:page_size],
269
+ totalElements: adjustment[:billing_account][:services][:total_elements],
270
+ elementCount: adjustment[:billing_account][:services][:element_count],
271
+ totalPages: adjustment[:billing_account][:services][:total_pages]
272
272
  },
273
- :paymentTerm => {
274
- :name => adjustment[:billing_account][:payment_term][:name],
275
- :termDays => adjustment[:billing_account][:payment_term][:term_days],
276
- :graceDays => adjustment[:billing_account][:payment_term][:grace_days],
273
+ paymentTerm: {
274
+ name: adjustment[:billing_account][:payment_term][:name],
275
+ termDays: adjustment[:billing_account][:payment_term][:term_days],
276
+ graceDays: adjustment[:billing_account][:payment_term][:grace_days],
277
277
  eid: adjustment[:billing_account][:payment_term][:eid]
278
278
  }
279
279
  },
280
- :reason => {
281
- :name => adjustment[:reason][:name],
282
- :description => adjustment[:reason][:description],
283
- :status => adjustment[:reason][:status],
284
- :creditOnly => adjustment[:reason][:credit_only],
280
+ reason: {
281
+ name: adjustment[:reason][:name],
282
+ description: adjustment[:reason][:description],
283
+ status: adjustment[:reason][:status],
284
+ creditOnly: adjustment[:reason][:credit_only],
285
285
  eid: adjustment[:reason][:eid]
286
286
  }
287
287
  }
@@ -60,10 +60,10 @@ module GoTransverseTractApi
60
60
  #
61
61
  def self.referrer_token error_url, cancel_url, complete_url
62
62
  data = {
63
- :generatePaymentCollectionReferrerToken => {},
64
- :errorUrl => error_url,
65
- :completeUrl => complete_url,
66
- :cancelUrl => cancel_url
63
+ generatePaymentCollectionReferrerToken: {},
64
+ errorUrl: error_url,
65
+ completeUrl: complete_url,
66
+ cancelUrl: cancel_url
67
67
  }
68
68
  xml_data = GoTransverseTractApi.generateXML(data, 'generatePaymentCollectionReferrerToken' )
69
69
 
@@ -76,19 +76,19 @@ module GoTransverseTractApi
76
76
  #
77
77
  def self.apply_refund eid, payment
78
78
  data = {
79
- :applyRefund => {},
80
- :payment => {
79
+ applyRefund: {},
80
+ payment: {
81
81
  eid: payment[:payment][:eid]
82
82
  },
83
- :refund => {
84
- :attributes => {
85
- :amount => payment[:refund][:amount],
86
- :description => payment[:refund][:description]
83
+ refund: {
84
+ attributes: {
85
+ amount: payment[:refund][:amount],
86
+ description: payment[:refund][:description]
87
87
  },
88
- :originalPayment => {
88
+ originalPayment: {
89
89
  eid: payment[:refund][:original_payment][:eid]
90
90
  },
91
- :refundReason => {
91
+ refundReason: {
92
92
  eid: payment[:refund][:refund_reason][:eid]
93
93
  }
94
94
  }
@@ -104,13 +104,13 @@ module GoTransverseTractApi
104
104
  #
105
105
  def self.cancel eid, payment
106
106
  data = {
107
- :cancelPayment => {
108
- :description => payment[:description]
107
+ cancelPayment: {
108
+ description: payment[:description]
109
109
  },
110
- :payment => {
110
+ payment: {
111
111
  eid: payment[:payment][:eid]
112
112
  },
113
- :reason => {
113
+ reason: {
114
114
  eid: payment[:reason][:eid]
115
115
  }
116
116
  }
@@ -125,18 +125,18 @@ module GoTransverseTractApi
125
125
  #
126
126
  def self.reallocate eid, payment
127
127
  data = {
128
- :reallocatePayment => {
129
- :description => payment[:description]
128
+ reallocatePayment: {
129
+ description: payment[:description]
130
130
  },
131
- :payment => {
131
+ payment: {
132
132
  eid: payment[:payment][:eid]
133
133
  },
134
- :reason => {
134
+ reason: {
135
135
  eid: payment[:reason][:eid]
136
136
  },
137
- :invoices => {
138
- :attributes => {},
139
- :invoice => payment[:invoices]
137
+ invoices: {
138
+ attributes: {},
139
+ invoice: payment[:invoices]
140
140
  }
141
141
  }
142
142
 
@@ -149,30 +149,30 @@ module GoTransverseTractApi
149
149
  #
150
150
  def self.create_payment payment
151
151
  data = {
152
- :payment => {
153
- :amount => payment[:amount],
154
- :description => payment[:description]
152
+ payment: {
153
+ amount: payment[:amount],
154
+ description: payment[:description]
155
155
  },
156
- :billingAccount => {
156
+ billingAccount: {
157
157
  eid: payment[:billing_account][:eid]
158
158
  },
159
- :creditCardPayment => {
160
- :cardType => payment[:credit_card_payment][:card_type],
161
- :cardHolderFirstName => payment[:credit_card_payment][:card_holder_first_name],
162
- :cardHolderLastName => payment[:credit_card_payment][:card_holder_last_name],
163
- :cardIdentifierNumber => payment[:credit_card_payment][:card_identifier_number],
164
- :cardExpiration => payment[:credit_card_payment][:card_expiration]
159
+ creditCardPayment: {
160
+ cardType: payment[:credit_card_payment][:card_type],
161
+ cardHolderFirstName: payment[:credit_card_payment][:card_holder_first_name],
162
+ cardHolderLastName: payment[:credit_card_payment][:card_holder_last_name],
163
+ cardIdentifierNumber: payment[:credit_card_payment][:card_identifier_number],
164
+ cardExpiration: payment[:credit_card_payment][:card_expiration]
165
165
  },
166
- :phoneNumber => {
167
- :countryCode => payment[:phone_number][:country_code],
168
- :areaCode => payment[:phone_number][:area_code],
169
- :number => payment[:phone_number][:number],
170
- :extension => payment[:phone_number][:extension],
171
- :purpose => payment[:phone_number][:purpose]
166
+ phoneNumber: {
167
+ countryCode: payment[:phone_number][:country_code],
168
+ areaCode: payment[:phone_number][:area_code],
169
+ number: payment[:phone_number][:number],
170
+ extension: payment[:phone_number][:extension],
171
+ purpose: payment[:phone_number][:purpose]
172
172
  },
173
- :emailAddress => {
174
- :email => payment[:email_address][:email],
175
- :purpose => payment[:email_address][:purpose]
173
+ emailAddress: {
174
+ email: payment[:email_address][:email],
175
+ purpose: payment[:email_address][:purpose]
176
176
  }
177
177
  }
178
178
 
@@ -65,163 +65,110 @@ module GoTransverseTractApi
65
65
  # @param {Hash} order_item
66
66
  #
67
67
  def self.approve eid, order_item
68
+ api_data = GoTransverseTractApi::ApiData.new
69
+
68
70
  data = {
69
- :approveOrderItem => {
70
- :approvalDate => order_item[:approval_date],
71
+ approveOrderItem: {
72
+ approvalDate: order_item[:approval_date],
71
73
  },
72
- :orderItem => {
73
- :attributes => {
74
- :xsitype => order_item[:type],
75
- :awaitingApproval => order_item[:awaiting_approval],
76
- :requestedEffectiveDate => order_item[:requested_effective_date],
77
- :unitPrice => order_item[:unit_price],
78
- :recurringUnitPrice => order_item[:recurring_unit_price],
79
- :quantity => order_item[:quantity],
80
- :sequence => order_item[:sequence],
81
- :approvalDate => order_item[:date_approval],
82
- :description => order_item[:description],
74
+ orderItem: {
75
+ attributes: {
76
+ xsitype: order_item[:type],
77
+ awaitingApproval: order_item[:awaiting_approval],
78
+ requestedEffectiveDate: order_item[:requested_effective_date],
79
+ unitPrice: order_item[:unit_price],
80
+ recurringUnitPrice: order_item[:recurring_unit_price],
81
+ quantity: order_item[:quantity],
82
+ sequence: order_item[:sequence],
83
+ approvalDate: order_item[:date_approval],
84
+ description: order_item[:description],
83
85
  eid: eid
84
86
  },
85
- :orderItems => {
86
- :pageNumber => order_item[:order_items][:page_number],
87
- :pageSize => order_item[:order_items][:page_size],
88
- :totalElements => order_item[:order_items][:total_elements],
89
- :elementCount => order_item[:order_items][:element_count],
90
- :totalPages => order_item[:order_items][:total_pages]
91
- },
92
- :orderItemUsageRules => {
93
- :pageNumber => order_item[:order_item_usage_rules][:page_number],
94
- :totalElements => order_item[:order_item_usage_rules][:total_elements],
95
- :elementCount => order_item[:order_item_usage_rules][:element_count],
96
- :totalPages => order_item[:order_item_usage_rules][:total_pages]
97
- },
98
- :recurringProductPrice => {
99
- :attributes => {
100
- :fromDate => order_item[:recurring_product_price][:from_date],
101
- :priceOverride => order_item[:recurring_product_price][:price_override],
102
- :type => order_item[:recurring_product_price][:type],
103
- :paymentOnPurchaseRequired => order_item[:recurring_product_price][:payment_on_purchase_required],
104
- :recurringPaymentRequired => order_item[:recurring_product_price][:recurring_payment_required],
105
- :recurrencePeriod => order_item[:recurring_product_price][:recurrence_period],
87
+ orderItems: api_data.get_page_info(order_item[:order_items]),
88
+ orderItemUsageRules: api_data.get_page_info(order_item[:order_item_usage_rules]),
89
+ recurringProductPrice: {
90
+ attributes: {
91
+ fromDate: order_item[:recurring_product_price][:from_date],
92
+ priceOverride: order_item[:recurring_product_price][:price_override],
93
+ type: order_item[:recurring_product_price][:type],
94
+ paymentOnPurchaseRequired: order_item[:recurring_product_price][:payment_on_purchase_required],
95
+ recurringPaymentRequired: order_item[:recurring_product_price][:recurring_payment_required],
96
+ recurrencePeriod: order_item[:recurring_product_price][:recurrence_period],
106
97
  eid: order_item[:recurring_product_price][:eid]
107
98
  },
108
- :priceRanges => {
109
- :attributes => {
110
- :pageNumber => order_item[:recurring_product_price][:price_ranges][:page_number],
111
- :pageSize => order_item[:recurring_product_price][:price_ranges][:page_size],
112
- :totalElements => order_item[:recurring_product_price][:price_ranges][:total_elements],
113
- :elementCount => order_item[:recurring_product_price][:price_ranges][:element_count],
114
- :totalPages => order_item[:recurring_product_price][:price_ranges][:total_pages]
115
- },
116
- :priceRange => {
117
- :quantityBeginRange => order_item[:recurring_product_price][:price_ranges][:price_range][:quantity_begin_range],
118
- :price => order_item[:recurring_product_price][:price_ranges][:price_range][:price],
119
- :level => order_item[:recurring_product_price][:price_ranges][:price_range][:level],
99
+ priceRanges: {
100
+ attributes: api_data.get_page_info(order_item[:recurring_product_price][:price_ranges]),
101
+ priceRange: {
102
+ quantityBeginRange: order_item[:recurring_product_price][:price_ranges][:price_range][:quantity_begin_range],
103
+ price: order_item[:recurring_product_price][:price_ranges][:price_range][:price],
104
+ level: order_item[:recurring_product_price][:price_ranges][:price_range][:level],
120
105
  eid: order_item[:recurring_product_price][:price_ranges][:price_range][:eid]
121
106
  }
122
107
  }
123
108
  },
124
- :product => {
125
- :attributes => {
126
- :name => order_item[:product][:name],
127
- :description => order_item[:product][:description],
128
- :shortDescription => order_item[:product][:short_description],
129
- :productTypeCode => order_item[:product][:product_type_code],
130
- :productState => order_item[:product][:product_state],
131
- :requiresAgreement => order_item[:product][:requires_agreement],
132
- :serialized => order_item[:product][:serialized],
133
- :taxable => order_item[:product][:taxable],
134
- :trial => order_item[:product][:trial],
135
- :defaultQuantity => order_item[:product][:default_quantity],
136
- :internalName => order_item[:product][:internal_name],
137
- :minServiceResources => order_item[:product][:min_service_resources],
138
- :maxServiceResources => order_item[:product][:max_service_resources],
139
- :trialOverride => order_item[:product][:trial_override],
109
+ product: {
110
+ attributes: {
111
+ name: order_item[:product][:name],
112
+ description: order_item[:product][:description],
113
+ shortDescription: order_item[:product][:short_description],
114
+ productTypeCode: order_item[:product][:product_type_code],
115
+ productState: order_item[:product][:product_state],
116
+ requiresAgreement: order_item[:product][:requires_agreement],
117
+ serialized: order_item[:product][:serialized],
118
+ taxable: order_item[:product][:taxable],
119
+ trial: order_item[:product][:trial],
120
+ defaultQuantity: order_item[:product][:default_quantity],
121
+ internalName: order_item[:product][:internal_name],
122
+ minServiceResources: order_item[:product][:min_service_resources],
123
+ maxServiceResources: order_item[:product][:max_service_resources],
124
+ trialOverride: order_item[:product][:trial_override],
140
125
  eid: order_item[:product][:eid]
141
126
  },
142
- :productPrices => {
143
- :attributes => {
144
- :pageNumber => order_item[:product][:product_prices][:page_number],
145
- :pageSize => order_item[:product][:product_prices][:page_size],
146
- :totalElements => order_item[:product][:product_prices][:total_elements],
147
- :elementCount => order_item[:product][:product_prices][:element_count],
148
- :totalPages => order_item[:product][:product_prices][:total_pages]
149
- },
150
- :productPrice => {
151
- :attributes => {
152
- :fromDate => order_item[:product][:product_prices][:product_price][:from_date],
153
- :priceOverride => order_item[:product][:product_prices][:product_price][:price_override],
154
- :type => order_item[:product][:product_prices][:product_price][:type],
155
- :paymentOnPurchaseRequired => order_item[:product][:product_prices][:product_price][:payment_on_purchase_required],
156
- :recurringPaymentRequired => order_item[:product][:product_prices][:product_price][:recurring_payment_required],
157
- :recurrencePeriod => order_item[:product][:product_prices][:product_price][:recurrence_period],
127
+ productPrices: {
128
+ attributes: api_data.get_page_info(order_item[:product][:product_prices]),
129
+ productPrice: {
130
+ attributes: {
131
+ fromDate: order_item[:product][:product_prices][:product_price][:from_date],
132
+ priceOverride: order_item[:product][:product_prices][:product_price][:price_override],
133
+ type: order_item[:product][:product_prices][:product_price][:type],
134
+ paymentOnPurchaseRequired: order_item[:product][:product_prices][:product_price][:payment_on_purchase_required],
135
+ recurringPaymentRequired: order_item[:product][:product_prices][:product_price][:recurring_payment_required],
136
+ recurrencePeriod: order_item[:product][:product_prices][:product_price][:recurrence_period],
158
137
  eid: order_item[:product][:product_prices][:product_price][:eid]
159
138
  },
160
- :priceRanges => {
161
- :attributes => {
162
- :pageNumber => order_item[:product][:product_prices][:product_price][:price_ranges][:page_number],
163
- :pageSize => order_item[:product][:product_prices][:product_price][:price_ranges][:page_size],
164
- :totalElements => order_item[:product][:product_prices][:product_price][:price_ranges][:total_elements],
165
- :elementCount => order_item[:product][:product_prices][:product_price][:price_ranges][:element_count],
166
- :totalPages => order_item[:product][:product_prices][:product_price][:price_ranges][:total_pages]
167
- },
168
- :priceRange => {
169
- :quantityBeginRange => order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:quantity_begin_range],
170
- :price => order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:price],
171
- :level => order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:level],
139
+ priceRanges: {
140
+ attributes: api_data.get_page_info(order_item[:product][:product_prices][:product_price][:price_ranges]),
141
+ priceRange: {
142
+ quantityBeginRange: order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:quantity_begin_range],
143
+ price: order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:price],
144
+ level: order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:level],
172
145
  eid: order_item[:product][:product_prices][:product_price][:price_ranges][:price_range][:eid]
173
146
  }
174
147
  }
175
148
  }
176
149
  },
177
- :productCategory => {
178
- :name => order_item[:product][:product_category][:name],
179
- :description => order_item[:product][:product_category][:description],
180
- :status => order_item[:product][:product_category][:status],
150
+ productCategory: {
151
+ name: order_item[:product][:product_category][:name],
152
+ description: order_item[:product][:product_category][:description],
153
+ status: order_item[:product][:product_category][:status],
181
154
  eid: order_item[:product][:product_category][:eid]
182
155
  },
183
- :serviceResourceCategory => {
184
- :name => order_item[:product][:service_resource_category][:name],
185
- :type => order_item[:product][:service_resource_category][:type],
186
- :status => order_item[:product][:service_resource_category][:status],
156
+ serviceResourceCategory: {
157
+ name: order_item[:product][:service_resource_category][:name],
158
+ type: order_item[:product][:service_resource_category][:type],
159
+ status: order_item[:product][:service_resource_category][:status],
187
160
  eid: order_item[:product][:service_resource_category][:eid]
188
161
  },
189
- :actions => {
190
- :pageNumber => order_item[:product][:actions][:page_number],
191
- :pageSize => order_item[:product][:actions][:page_size],
192
- :totalElements => order_item[:product][:actions][:total_elements],
193
- :elementCount => order_item[:product][:actions][:element_count],
194
- :totalPages => order_item[:product][:actions][:total_pages]
195
- },
196
- :productUsageRules => {
197
- :pageNumber => order_item[:product][:product_usage_rules][:page_number],
198
- :totalElements => order_item[:product][:product_usage_rules][:total_elements],
199
- :elementCount => order_item[:product][:product_usage_rules][:element_count],
200
- :totalPages => order_item[:product][:product_usage_rules][:total_pages]
201
- }
162
+ actions: api_data.get_page_info(order_item[:product][:actions]),
163
+ productUsageRules: api_data.get_page_info(order_item[:product][:product_usage_rules])
202
164
  },
203
- :priceList => {
204
- :name => order_item[:price_list][:name],
165
+ priceList: {
166
+ name: order_item[:price_list][:name],
205
167
  eid: order_item[:price_list][:eid]
206
168
  },
207
- :serviceResources => {
208
- :pageNumber => order_item[:service_resources][:page_number],
209
- :totalElements => order_item[:service_resources][:total_elements],
210
- :elementCount => order_item[:service_resources][:element_count],
211
- :totalPages => order_item[:service_resources][:total_pages]
212
- },
213
- :operationAttributes => {
214
- :pageNumber => order_item[:operation_attributes][:page_number],
215
- :totalElements => order_item[:operation_attributes][:total_elements],
216
- :elementCount => order_item[:operation_attributes][:element_count],
217
- :totalPages => order_item[:operation_attributes][:total_pages]
218
- },
219
- :scheduledCharges => {
220
- :pageNumber => order_item[:scheduled_charges][:page_number],
221
- :totalElements => order_item[:scheduled_charges][:total_elements],
222
- :elementCount => order_item[:scheduled_charges][:element_count],
223
- :totalPages => order_item[:scheduled_charges][:total_pages]
224
- }
169
+ serviceResources: api_data.get_page_info(order_item[:service_resources]),
170
+ operationAttributes: api_data.get_page_info(order_item[:operation_attributes]),
171
+ scheduledCharges: api_data.get_page_info(order_item[:scheduled_charges])
225
172
  }
226
173
  }
227
174
 
@@ -235,8 +182,8 @@ module GoTransverseTractApi
235
182
  #
236
183
  def self.deny eid, orderitem
237
184
  data = {
238
- :denyOrderItem => {},
239
- :orderItem => {eid: eid}
185
+ denyOrderItem: {},
186
+ orderItem: {eid: eid}
240
187
  }
241
188
 
242
189
  xml_data = GoTransverseTractApi.generateXML(data, 'denyOrderItem')
@@ -35,15 +35,15 @@ module GoTransverseTractApi
35
35
  #
36
36
  def self.add_address eid, address
37
37
  data = {
38
- :addAddressToParty => {},
39
- :person => {eid: eid},
40
- :postalAddress => {
41
- :purpose => address[:purpose],
42
- :country => address[:country],
43
- :city => address[:city],
44
- :regionOrState => address[:region_or_state],
45
- :postalCode => address[:postal_code],
46
- :line1 => address[:line1]
38
+ addAddressToParty: {},
39
+ person: {eid: eid},
40
+ postalAddress: {
41
+ purpose: address[:purpose],
42
+ country: address[:country],
43
+ city: address[:city],
44
+ regionOrState: address[:region_or_state],
45
+ postalCode: address[:postal_code],
46
+ line1: address[:line1]
47
47
  }
48
48
  }
49
49
 
@@ -50,15 +50,15 @@ module GoTransverseTractApi
50
50
  #
51
51
  def self.add_address eid, address
52
52
  data = {
53
- :addAddressToParty => {},
54
- :person => {eid: eid},
55
- :postalAddress => {
56
- :purpose => address[:purpose],
57
- :country => address[:country],
58
- :city => address[:city],
59
- :regionOrState => address[:region_or_state],
60
- :postalCode => address[:postal_code],
61
- :line1 => address[:line1]
53
+ addAddressToParty: {},
54
+ person: {eid: eid},
55
+ postalAddress: {
56
+ purpose: address[:purpose],
57
+ country: address[:country],
58
+ city: address[:city],
59
+ regionOrState: address[:region_or_state],
60
+ postalCode: address[:postal_code],
61
+ line1: address[:line1]
62
62
  }
63
63
  }
64
64
 
@@ -109,39 +109,39 @@ module GoTransverseTractApi
109
109
  order_item_struct = prepare_products_struct(sales_order)
110
110
 
111
111
  data = {
112
- :confirmOrder => {},
113
- :salesOrder => {
114
- :attributes => {
115
- :referral => sales_order[:referral],
116
- :orderDate => sales_order[:order_date],
117
- :orderStatus => sales_order[:order_status],
112
+ confirmOrder: {},
113
+ salesOrder: {
114
+ attributes: {
115
+ referral: sales_order[:referral],
116
+ orderDate: sales_order[:order_date],
117
+ orderStatus: sales_order[:order_status],
118
118
  eid: eid
119
119
  },
120
- :orderItems => {
121
- :attributes => GoTransverseTractApi::ApiData.new.get_page_info(sales_order[:order_items]),
122
- :orderItem => order_item_struct
120
+ orderItems: {
121
+ attributes: GoTransverseTractApi::ApiData.new.get_page_info(sales_order[:order_items]),
122
+ orderItem: order_item_struct
123
123
  },
124
- :billingAccount => {
125
- :automaticRecurringPayment => sales_order[:billing_account][:automatic_recurring_payment],
124
+ billingAccount: {
125
+ automaticRecurringPayment: sales_order[:billing_account][:automatic_recurring_payment],
126
126
  eid: sales_order[:billing_account][:eid]
127
127
  }
128
128
  },
129
- :payment => {
130
- :attributes => {
131
- :amount => payment[:amount],
132
- :description => payment[:description]
129
+ payment: {
130
+ attributes: {
131
+ amount: payment[:amount],
132
+ description: payment[:description]
133
133
  },
134
- :billingAccount => {
135
- :automaticRecurringPayment => payment[:billing_account][:automatic_recurring_payment],
134
+ billingAccount: {
135
+ automaticRecurringPayment: payment[:billing_account][:automatic_recurring_payment],
136
136
  eid: payment[:billing_account][:eid]
137
137
  },
138
- :creditCardPayment => {
139
- :cardType => payment[:credit_card_payment][:card_type],
140
- :cardHolderFirstName => payment[:credit_card_payment][:card_holder_first_name],
141
- :cardHolderMiddleName => payment[:credit_card_payment][:card_holder_middle_name],
142
- :cardHolderLastName => payment[:credit_card_payment][:card_holder_last_name],
143
- :cardIdentifierNumber => payment[:credit_card_payment][:card_identifier_number],
144
- :cardExpiration => payment[:credit_card_payment][:card_expiration]
138
+ creditCardPayment: {
139
+ cardType: payment[:credit_card_payment][:card_type],
140
+ cardHolderFirstName: payment[:credit_card_payment][:card_holder_first_name],
141
+ cardHolderMiddleName: payment[:credit_card_payment][:card_holder_middle_name],
142
+ cardHolderLastName: payment[:credit_card_payment][:card_holder_last_name],
143
+ cardIdentifierNumber: payment[:credit_card_payment][:card_identifier_number],
144
+ cardExpiration: payment[:credit_card_payment][:card_expiration]
145
145
  }
146
146
  }
147
147
  }
@@ -158,9 +158,9 @@ module GoTransverseTractApi
158
158
  def add_custom_field_value(eid, sales_order)
159
159
  data =
160
160
  {
161
- :addCustomFieldValue => {},
162
- :order => { eid: eid },
163
- :customFieldValue => { :value => sales_order[:value] }
161
+ addCustomFieldValue: {},
162
+ order: { eid: eid },
163
+ customFieldValue: { value: sales_order[:value] }
164
164
  }
165
165
 
166
166
  xml_data = GoTransverseTractApi.generateXML(data,'addCustomFieldValue')
@@ -173,9 +173,9 @@ module GoTransverseTractApi
173
173
  #
174
174
  def remove_custom_field_value eid, sales_order
175
175
  data = {
176
- :removeCustomFieldValue => {},
177
- :order => { eid: eid },
178
- :customFieldValue => { eid: sales_order[:eid] }
176
+ removeCustomFieldValue: {},
177
+ order: { eid: eid },
178
+ customFieldValue: { eid: sales_order[:eid] }
179
179
  }
180
180
 
181
181
  xml_data = GoTransverseTractApi.generateXML(data,'removeCustomFieldValue')
@@ -187,52 +187,52 @@ module GoTransverseTractApi
187
187
  #
188
188
  def create_sales_order sales_order
189
189
  data = {
190
- :salesOrder => {
191
- :note => sales_order[:note],
192
- :purchaseOrderNumber => sales_order[:purchase_order_number]
190
+ salesOrder: {
191
+ note: sales_order[:note],
192
+ purchaseOrderNumber: sales_order[:purchase_order_number]
193
193
  },
194
- :orderItems => {
195
- :attributes => {},
196
- :orderItem => get_product_struct(sales_order)
194
+ orderItems: {
195
+ attributes: {},
196
+ orderItem: get_product_struct(sales_order)
197
197
  },
198
- :billingAccount => {
199
- :attributes => {
200
- :billType => sales_order[:billing_account][:bill_type],
201
- :automaticRecurringPayment => sales_order[:billing_account][:automatic_recurring_payment]
198
+ billingAccount: {
199
+ attributes: {
200
+ billType: sales_order[:billing_account][:bill_type],
201
+ automaticRecurringPayment: sales_order[:billing_account][:automatic_recurring_payment]
202
202
  },
203
- :dailyBillCycle => {
204
- :attributes => {
203
+ dailyBillCycle: {
204
+ attributes: {
205
205
  eid: sales_order[:billing_account][:daily_bill_cycle][:eid]
206
206
  }
207
207
  },
208
- :organization => {
209
- :attributes => {
210
- :name => sales_order[:billing_account][:organization][:name],
211
- :taxIdNumber => sales_order[:billing_account][:organization][:tax_id_number]
208
+ organization: {
209
+ attributes: {
210
+ name: sales_order[:billing_account][:organization][:name],
211
+ taxIdNumber: sales_order[:billing_account][:organization][:tax_id_number]
212
212
  },
213
- :addresses => {
214
- :attributes => {},
215
- :postalAddress => get_address_struct(sales_order),
216
- :telecomAddress => {
217
- :attributes => {
218
- :dialingPrefix => sales_order[:billing_account][:organization][:addresses][:telecom_address][:dialing_prefix],
219
- :countryCode => sales_order[:billing_account][:organization][:addresses][:telecom_address][:country_code],
220
- :areaCode => sales_order[:billing_account][:organization][:addresses][:telecom_address][:area_code],
221
- :number => sales_order[:billing_account][:organization][:addresses][:telecom_address][:number],
222
- :extension => sales_order[:billing_account][:organization][:addresses][:telecom_address][:extension],
223
- :purpose => sales_order[:billing_account][:organization][:addresses][:telecom_address][:purpose]
213
+ addresses: {
214
+ attributes: {},
215
+ postalAddress: get_address_struct(sales_order),
216
+ telecomAddress: {
217
+ attributes: {
218
+ dialingPrefix: sales_order[:billing_account][:organization][:addresses][:telecom_address][:dialing_prefix],
219
+ countryCode: sales_order[:billing_account][:organization][:addresses][:telecom_address][:country_code],
220
+ areaCode: sales_order[:billing_account][:organization][:addresses][:telecom_address][:area_code],
221
+ number: sales_order[:billing_account][:organization][:addresses][:telecom_address][:number],
222
+ extension: sales_order[:billing_account][:organization][:addresses][:telecom_address][:extension],
223
+ purpose: sales_order[:billing_account][:organization][:addresses][:telecom_address][:purpose]
224
224
  }
225
225
  },
226
- :emailAddress => {
227
- :attributes => {
228
- :email => sales_order[:billing_account][:organization][:addresses][:email_address][:email],
229
- :purpose => sales_order[:billing_account][:organization][:addresses][:email_address][:purpose]
226
+ emailAddress: {
227
+ attributes: {
228
+ email: sales_order[:billing_account][:organization][:addresses][:email_address][:email],
229
+ purpose: sales_order[:billing_account][:organization][:addresses][:email_address][:purpose]
230
230
  }
231
231
  }
232
232
  }
233
233
  },
234
- :billingAccountCategory => {
235
- :attributes => {
234
+ billingAccountCategory: {
235
+ attributes: {
236
236
  eid: sales_order[:billing_account][:billing_account_category][:eid]
237
237
  }
238
238
  }
@@ -256,18 +256,18 @@ module GoTransverseTractApi
256
256
  items = []
257
257
 
258
258
  order_item = {
259
- :attributes => {
260
- :quantity => sales_order[:order_items][:order_item][:quantity],
261
- :sequence => sales_order[:order_items][:order_item][:sequence],
262
- :description => sales_order[:order_items][:order_item][:description]
259
+ attributes: {
260
+ quantity: sales_order[:order_items][:order_item][:quantity],
261
+ sequence: sales_order[:order_items][:order_item][:sequence],
262
+ description: sales_order[:order_items][:order_item][:description]
263
263
  }
264
264
  }
265
265
 
266
266
  items = sales_order[:order_items][:order_item][:product]
267
267
  (0..items.size - 1).each do|i|
268
268
  products = {
269
- :product => {
270
- :attributes => {
269
+ product: {
270
+ attributes: {
271
271
  eid: items[i][:eid]
272
272
  }
273
273
  }
@@ -289,15 +289,15 @@ module GoTransverseTractApi
289
289
 
290
290
  (0..items.size - 1).each do|i|
291
291
  postal_addresses << {
292
- :postalAddress => {
293
- :attributes => {
294
- :purpose => items[i][:purpose],
295
- :country => items[i][:country],
296
- :city => items[i][:city],
297
- :regionOrState => items[i][:region_or_state],
298
- :postalCode => items[i][:postal_code],
299
- :line1 => items[i][:line1],
300
- :line2 => items[i][:line2]
292
+ postalAddress: {
293
+ attributes: {
294
+ purpose: items[i][:purpose],
295
+ country: items[i][:country],
296
+ city: items[i][:city],
297
+ regionOrState: items[i][:region_or_state],
298
+ postalCode: items[i][:postal_code],
299
+ line1: items[i][:line1],
300
+ line2: items[i][:line2]
301
301
  }
302
302
  }
303
303
  }
@@ -316,60 +316,60 @@ module GoTransverseTractApi
316
316
  items = []
317
317
 
318
318
  order_item = {
319
- :attributes => {
320
- :quantity => sales_order[:order_items][:order_item][:quantity]
319
+ attributes: {
320
+ quantity: sales_order[:order_items][:order_item][:quantity]
321
321
  }
322
322
  }
323
323
 
324
324
  items = sales_order[:order_items][:order_item][:product]
325
325
  (0..items.size - 1).each do|i|
326
326
  products = {
327
- :product => {
328
- :attributes => {
329
- :name => items[i][:name],
330
- :description => items[i][:description],
331
- :shortDescription => items[i][:short_description],
332
- :productTypeCode => items[i][:product_type_code],
333
- :productState => items[i][:product_state],
334
- :requiresAgreement => items[i][:requires_agreement],
335
- :serialized => items[i][:serialized],
336
- :taxable => items[i][:taxable],
337
- :trial => items[i][:trial],
338
- :defaultQuantity => items[i][:default_quantity],
339
- :minServiceResources => items[i][:min_service_resources],
340
- :maxServiceResources => items[i][:max_service_resources],
341
- :trialOverride => items[i][:trial_override],
327
+ product: {
328
+ attributes: {
329
+ name: items[i][:name],
330
+ description: items[i][:description],
331
+ shortDescription: items[i][:short_description],
332
+ productTypeCode: items[i][:product_type_code],
333
+ productState: items[i][:product_state],
334
+ requiresAgreement: items[i][:requires_agreement],
335
+ serialized: items[i][:serialized],
336
+ taxable: items[i][:taxable],
337
+ trial: items[i][:trial],
338
+ defaultQuantity: items[i][:default_quantity],
339
+ minServiceResources: items[i][:min_service_resources],
340
+ maxServiceResources: items[i][:max_service_resources],
341
+ trialOverride: items[i][:trial_override],
342
342
  eid: items[i][:eid]
343
343
  },
344
- :productPrices => {
345
- :attributes => GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_prices]),
346
- :productPrice => {
347
- :attributes => {
348
- :fromDate => items[i][:product_prices][:product_price][:from_date],
349
- :priceOverride => items[i][:product_prices][:product_price][:price_override],
350
- :type => items[i][:product_prices][:product_price][:type],
351
- :recurringPaymentRequired => items[i][:product_prices][:product_price][:recurring_payment_required],
344
+ productPrices: {
345
+ attributes: GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_prices]),
346
+ productPrice: {
347
+ attributes: {
348
+ fromDate: items[i][:product_prices][:product_price][:from_date],
349
+ priceOverride: items[i][:product_prices][:product_price][:price_override],
350
+ type: items[i][:product_prices][:product_price][:type],
351
+ recurringPaymentRequired: items[i][:product_prices][:product_price][:recurring_payment_required],
352
352
  eid: items[i][:product_prices][:product_price][:eid]
353
353
  },
354
- :priceRanges => {
355
- :attributes => GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_prices][:product_price][:price_ranges]),
356
- :priceRange => {
357
- :quantityBeginRange => items[i][:product_prices][:product_price][:price_ranges][:price_range][:quantity_begin_range],
358
- :price => items[i][:product_prices][:product_price][:price_ranges][:price_range][:price],
359
- :level => items[i][:product_prices][:product_price][:price_ranges][:price_range][:level],
354
+ priceRanges: {
355
+ attributes: GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_prices][:product_price][:price_ranges]),
356
+ priceRange: {
357
+ quantityBeginRange: items[i][:product_prices][:product_price][:price_ranges][:price_range][:quantity_begin_range],
358
+ price: items[i][:product_prices][:product_price][:price_ranges][:price_range][:price],
359
+ level: items[i][:product_prices][:product_price][:price_ranges][:price_range][:level],
360
360
  eid: items[i][:product_prices][:product_price][:price_ranges][:price_range][:eid]
361
361
  }
362
362
  }
363
363
  }
364
364
  },
365
- :productCategory => {
366
- :name => items[i][:product_category][:name],
367
- :description => items[i][:product_category][:description],
368
- :status => items[i][:product_category][:status],
365
+ productCategory: {
366
+ name: items[i][:product_category][:name],
367
+ description: items[i][:product_category][:description],
368
+ status: items[i][:product_category][:status],
369
369
  eid: items[i][:product_category][:eid]
370
370
  },
371
- :actions => GoTransverseTractApi::ApiData.new.get_page_info(items[i][:actions]),
372
- :productUsageRules => GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_usage_rules])
371
+ actions: GoTransverseTractApi::ApiData.new.get_page_info(items[i][:actions]),
372
+ productUsageRules: GoTransverseTractApi::ApiData.new.get_page_info(items[i][:product_usage_rules])
373
373
  }
374
374
  }
375
375
  end
@@ -1,6 +1,6 @@
1
1
  module GoTransverseTractApi
2
2
 
3
- VERSION = "0.4.2"
3
+ VERSION = "0.4.3"
4
4
  TARGET_API_VERSION = "1.28"
5
5
 
6
6
  end
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.4.2
4
+ version: 0.4.3
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: 2015-12-21 00:00:00.000000000 Z
12
+ date: 2015-12-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler