authorizenet 1.9.4 → 1.9.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. data/lib/app/helpers/authorize_net_helper.rb +2 -3
  2. data/lib/authorize_net.rb +5 -5
  3. data/lib/authorize_net/addresses/address.rb +15 -19
  4. data/lib/authorize_net/addresses/shipping_address.rb +12 -16
  5. data/lib/authorize_net/aim/response.rb +27 -38
  6. data/lib/authorize_net/aim/transaction.rb +46 -65
  7. data/lib/authorize_net/api/api_transaction.rb +85 -90
  8. data/lib/authorize_net/api/constants.yml +1 -1
  9. data/lib/authorize_net/api/schema.rb +968 -936
  10. data/lib/authorize_net/api/transaction.rb +100 -102
  11. data/lib/authorize_net/arb/fields.rb +21 -21
  12. data/lib/authorize_net/arb/paging.rb +7 -11
  13. data/lib/authorize_net/arb/response.rb +7 -15
  14. data/lib/authorize_net/arb/sorting.rb +6 -10
  15. data/lib/authorize_net/arb/subscription.rb +27 -31
  16. data/lib/authorize_net/arb/subscription_detail.rb +1 -5
  17. data/lib/authorize_net/arb/subscription_list_response.rb +13 -20
  18. data/lib/authorize_net/arb/transaction.rb +50 -56
  19. data/lib/authorize_net/authorize_net.rb +20 -27
  20. data/lib/authorize_net/cim/customer_profile.rb +4 -8
  21. data/lib/authorize_net/cim/payment_profile.rb +10 -12
  22. data/lib/authorize_net/cim/response.rb +19 -24
  23. data/lib/authorize_net/cim/transaction.rb +168 -174
  24. data/lib/authorize_net/customer.rb +11 -14
  25. data/lib/authorize_net/email_receipt.rb +8 -12
  26. data/lib/authorize_net/fields.rb +483 -502
  27. data/lib/authorize_net/key_value_response.rb +54 -62
  28. data/lib/authorize_net/key_value_transaction.rb +87 -97
  29. data/lib/authorize_net/line_item.rb +10 -14
  30. data/lib/authorize_net/order.rb +21 -25
  31. data/lib/authorize_net/payment_methods/credit_card.rb +6 -7
  32. data/lib/authorize_net/payment_methods/echeck.rb +29 -31
  33. data/lib/authorize_net/reporting/batch.rb +4 -7
  34. data/lib/authorize_net/reporting/batch_statistics.rb +2 -6
  35. data/lib/authorize_net/reporting/fds_filter.rb +2 -5
  36. data/lib/authorize_net/reporting/response.rb +54 -60
  37. data/lib/authorize_net/reporting/returned_item.rb +11 -12
  38. data/lib/authorize_net/reporting/transaction.rb +27 -29
  39. data/lib/authorize_net/reporting/transaction_details.rb +3 -6
  40. data/lib/authorize_net/response.rb +6 -10
  41. data/lib/authorize_net/sim/hosted_payment_form.rb +16 -20
  42. data/lib/authorize_net/sim/hosted_receipt_page.rb +18 -23
  43. data/lib/authorize_net/sim/response.rb +24 -33
  44. data/lib/authorize_net/sim/transaction.rb +33 -43
  45. data/lib/authorize_net/transaction.rb +15 -21
  46. data/lib/authorize_net/xml_response.rb +36 -54
  47. data/lib/authorize_net/xml_transaction.rb +115 -134
  48. data/lib/generators/authorize_net/direct_post/direct_post_generator.rb +5 -6
  49. data/lib/generators/authorize_net/sim/sim_generator.rb +6 -7
  50. data/lib/generators/generator_extensions.rb +23 -25
  51. metadata +127 -81
  52. checksums.yaml +0 -7
@@ -1,27 +1,24 @@
1
1
  module AuthorizeNet
2
-
3
2
  # Models a customer.
4
3
  class Customer
5
4
  attr_accessor
6
5
  include AuthorizeNet::Model
7
-
6
+
8
7
  attr_accessor :phone, :fax, :email, :id, :ip, :address, :description
9
-
8
+
10
9
  def to_hash
11
10
  hash = {
12
- :phone => @phone,
13
- :fax => @fax,
14
- :email => @email,
15
- :cust_id => @id,
16
- :customer_ip => @ip,
17
- :description => @description,
18
- :customer_profile_id => @customer_profile_id
11
+ phone: @phone,
12
+ fax: @fax,
13
+ email: @email,
14
+ cust_id: @id,
15
+ customer_ip: @ip,
16
+ description: @description,
17
+ customer_profile_id: @customer_profile_id
19
18
  }
20
- hash.delete_if {|k, v| v.nil?}
19
+ hash.delete_if { |_k, v| v.nil? }
21
20
  hash.merge!(@address.to_hash) unless @address.nil?
22
21
  hash
23
22
  end
24
-
25
23
  end
26
-
27
- end
24
+ end
@@ -1,24 +1,20 @@
1
1
  module AuthorizeNet
2
-
3
2
  # Models an email receipt.
4
3
  class EmailReceipt
5
-
6
4
  include AuthorizeNet::Model
7
-
5
+
8
6
  attr_accessor :header, :footer, :merchant_email, :email_customer
9
-
7
+
10
8
  def to_hash
11
9
  hash = {
12
- :header => @header,
13
- :footer => @footer,
14
- :merchant_email => @merchant_email,
15
- :email_customer => @email_customer
10
+ header: @header,
11
+ footer: @footer,
12
+ merchant_email: @merchant_email,
13
+ email_customer: @email_customer
16
14
  }
17
- hash.delete_if {|k, v| v.nil?}
15
+ hash.delete_if { |_k, v| v.nil? }
18
16
  hash.merge(@address.to_hash) unless @address.nil?
19
17
  hash
20
18
  end
21
-
22
19
  end
23
-
24
- end
20
+ end
@@ -1,11 +1,9 @@
1
1
  module AuthorizeNet
2
-
3
2
  EntityDescription = Struct.new(:node_structure, :entity_class, :arg_mapping)
4
-
3
+
5
4
  module AIM
6
5
  # Contains the various lists of fields needed by the AIM API.
7
6
  module Fields
8
-
9
7
  # Enumeration of the fields found in the AIM response. The index
10
8
  # of the field name corresponds to its position (+ 1) in the AIM response.
11
9
  FIELDS = [
@@ -59,7 +57,6 @@ module AuthorizeNet
59
57
  nil,
60
58
  nil,
61
59
  nil,
62
- nil,
63
60
  :account_number,
64
61
  :card_type,
65
62
  :split_tender_id,
@@ -78,8 +75,8 @@ module AuthorizeNet
78
75
  nil,
79
76
  nil,
80
77
  nil # Merchant defined fields come after this field (68)
81
- ]
82
-
78
+ ].freeze
79
+
83
80
  # Enumeration of the fields found in the card present AIM response. The index
84
81
  # of the field name corresponds to its position (+ 1) in the card present AIM response.
85
82
  CP_FIELDS = [
@@ -109,440 +106,434 @@ module AuthorizeNet
109
106
  :requested,
110
107
  :approved_amount,
111
108
  :balance_on_card
112
- ]
109
+ ].freeze
113
110
  end
114
111
  end
115
-
112
+
116
113
  module SIM
117
114
  # Contains the various lists of fields needed by the SIM API.
118
115
  module Fields
119
116
  # List of the fields found in a SIM response. Any field not in this list
120
117
  # is treated as a Merchant Defined Field.
121
- FIELDS = [
122
- :x_response_code,
123
- :x_response_subcode,
124
- :x_response_reason_code,
125
- :x_response_reason_text,
126
- :x_auth_code,
127
- :x_avs_code,
128
- :x_trans_id,
129
- :x_invoice_num,
130
- :x_description,
131
- :x_amount,
132
- :x_method,
133
- :x_type,
134
- :x_cust_id,
135
- :x_first_name,
136
- :x_last_name,
137
- :x_company,
138
- :x_address,
139
- :x_city,
140
- :x_state,
141
- :x_zip,
142
- :x_country,
143
- :x_phone,
144
- :x_fax,
145
- :x_email,
146
- :x_ship_to_first_name,
147
- :x_ship_to_last_name,
148
- :x_ship_to_company,
149
- :x_ship_to_address,
150
- :x_ship_to_city,
151
- :x_ship_to_state,
152
- :x_ship_to_zip,
153
- :x_ship_to_country,
154
- :x_tax,
155
- :x_duty,
156
- :x_freight,
157
- :x_tax_exempt,
158
- :x_po_num,
159
- :x_MD5_Hash,
160
- :x_cvv2_resp_code,
161
- :x_cavv_response
162
- ]
118
+ FIELDS = %i[
119
+ x_response_code
120
+ x_response_subcode
121
+ x_response_reason_code
122
+ x_response_reason_text
123
+ x_auth_code
124
+ x_avs_code
125
+ x_trans_id
126
+ x_invoice_num
127
+ x_description
128
+ x_amount
129
+ x_method
130
+ x_type
131
+ x_cust_id
132
+ x_first_name
133
+ x_last_name
134
+ x_company
135
+ x_address
136
+ x_city
137
+ x_state
138
+ x_zip
139
+ x_country
140
+ x_phone
141
+ x_fax
142
+ x_email
143
+ x_ship_to_first_name
144
+ x_ship_to_last_name
145
+ x_ship_to_company
146
+ x_ship_to_address
147
+ x_ship_to_city
148
+ x_ship_to_state
149
+ x_ship_to_zip
150
+ x_ship_to_country
151
+ x_tax
152
+ x_duty
153
+ x_freight
154
+ x_tax_exempt
155
+ x_po_num
156
+ x_MD5_Hash
157
+ x_cvv2_resp_code
158
+ x_cavv_response
159
+ ].freeze
163
160
  end
164
161
  end
165
-
162
+
166
163
  module ARB
167
164
  # Contains the various lists of fields needed by the ARB API.
168
165
  module Fields
169
-
170
166
  # Describes the order and nesting of fields in the ARB Subscription XML.
171
- SUBSCRIPTION_FIELDS = {:subscription => [
172
- {:name => :subscription_name},
173
- {:paymentSchedule => [
174
- {:interval => [
175
- {:length => :subscription_length},
176
- {:unit => :subscription_unit}
177
- ]},
178
- {:startDate => :subscription_start_date},
179
- {:totalOccurrences => :subscription_total_occurrences},
180
- {:trialOccurrences => :subscription_trial_occurrences}
181
- ]},
182
- {:amount => :subscription_amount},
183
- {:trialAmount => :subscription_trial_amount},
184
- {:payment => [
185
- {:creditCard => [
186
- {:cardNumber => :card_num},
187
- {:expirationDate => :exp_date},
188
- {:cardCode => :card_code}
189
- ]},
190
- {:bankAccount => [
191
- {:accountType => :bank_acct_type},
192
- {:routingNumber => :bank_aba_code},
193
- {:accountNumber => :bank_acct_num},
194
- {:nameOnAccount => :bank_acct_name},
195
- {:echeckType => :echeck_type},
196
- {:bankName => :bank_name}
197
- ]}
198
- ]},
199
- {:order => [
200
- {:invoiceNumber => :invoice_num},
201
- {:description => :description}
202
- ]},
203
- {:customer => [
204
- {:id_ => :cust_id},
205
- {:email => :email},
206
- {:phoneNumber => :phone},
207
- {:faxNumber => :fax}
208
- ]},
209
- {:billTo => [
210
- {:firstName => :first_name},
211
- {:lastName => :last_name},
212
- {:company => :company},
213
- {:address => :address},
214
- {:city => :city},
215
- {:state => :state},
216
- {:zip => :zip},
217
- {:country => :country}
218
- ]},
219
- {:shipTo => [
220
- {:firstName => :ship_to_first_name},
221
- {:lastName => :ship_to_last_name},
222
- {:company => :ship_to_company},
223
- {:address => :ship_to_address},
224
- {:city => :ship_to_city},
225
- {:state => :ship_to_state},
226
- {:zip => :ship_to_zip},
227
- {:country => :ship_to_country}
228
- ]}
229
- ]}
230
-
167
+ SUBSCRIPTION_FIELDS = { subscription: [
168
+ { name: :subscription_name },
169
+ { paymentSchedule: [
170
+ { interval: [
171
+ { length: :subscription_length },
172
+ { unit: :subscription_unit }
173
+ ] },
174
+ { startDate: :subscription_start_date },
175
+ { totalOccurrences: :subscription_total_occurrences },
176
+ { trialOccurrences: :subscription_trial_occurrences }
177
+ ] },
178
+ { amount: :subscription_amount },
179
+ { trialAmount: :subscription_trial_amount },
180
+ { payment: [
181
+ { creditCard: [
182
+ { cardNumber: :card_num },
183
+ { expirationDate: :exp_date },
184
+ { cardCode: :card_code }
185
+ ] },
186
+ { bankAccount: [
187
+ { accountType: :bank_acct_type },
188
+ { routingNumber: :bank_aba_code },
189
+ { accountNumber: :bank_acct_num },
190
+ { nameOnAccount: :bank_acct_name },
191
+ { echeckType: :echeck_type },
192
+ { bankName: :bank_name }
193
+ ] }
194
+ ] },
195
+ { order: [
196
+ { invoiceNumber: :invoice_num },
197
+ { description: :description }
198
+ ] },
199
+ { customer: [
200
+ { id_: :cust_id },
201
+ { email: :email },
202
+ { phoneNumber: :phone },
203
+ { faxNumber: :fax }
204
+ ] },
205
+ { billTo: [
206
+ { firstName: :first_name },
207
+ { lastName: :last_name },
208
+ { company: :company },
209
+ { address: :address },
210
+ { city: :city },
211
+ { state: :state },
212
+ { zip: :zip },
213
+ { country: :country }
214
+ ] },
215
+ { shipTo: [
216
+ { firstName: :ship_to_first_name },
217
+ { lastName: :ship_to_last_name },
218
+ { company: :ship_to_company },
219
+ { address: :ship_to_address },
220
+ { city: :ship_to_city },
221
+ { state: :ship_to_state },
222
+ { zip: :ship_to_zip },
223
+ { country: :ship_to_country }
224
+ ] }
225
+ ] }.freeze
226
+
231
227
  # Describes the order and nesting of fields in the ARB ARBCreateSubscriptionRequest XML.
232
228
  CREATE_FIELDS = [
233
- {:refId => :reference_id},
229
+ { refId: :reference_id },
234
230
  SUBSCRIPTION_FIELDS
235
- ]
236
-
231
+ ].freeze
232
+
237
233
  # Describes the order and nesting of fields in the ARB ARBUpdateSubscriptionRequest XML.
238
234
  UPDATE_FIELDS = [
239
- {:refId => :reference_id},
240
- {:subscriptionId => :subscription_id},
235
+ { refId: :reference_id },
236
+ { subscriptionId: :subscription_id },
241
237
  SUBSCRIPTION_FIELDS
242
- ]
243
-
238
+ ].freeze
239
+
244
240
  # Describes the order and nesting of fields in the ARB ARBGetSubscriptionStatusRequest XML.
245
241
  GET_STATUS_FIELDS = [
246
- {:refId => :reference_id},
247
- {:subscriptionId => :subscription_id}
248
- ]
249
-
242
+ { refId: :reference_id },
243
+ { subscriptionId: :subscription_id }
244
+ ].freeze
245
+
250
246
  # Describes the order and nesting of fields in the ARB ARBCancelSubscriptionRequest XML.
251
247
  CANCEL_FIELDS = [
252
- {:refId => :reference_id},
253
- {:subscriptionId => :subscription_id}
254
- ]
248
+ { refId: :reference_id },
249
+ { subscriptionId: :subscription_id }
250
+ ].freeze
255
251
 
256
252
  # Describes the order and nesting of fields in the ARB ARBGetSubscriptionListRequest XML.
257
253
  GET_SUBSCRIPTION_LIST_FIELDS = [
258
- {:refId => :reference_id},
259
- {:searchType => :search_type},
260
- {:sorting => [
261
- {:orderBy => :order_by},
262
- {:orderDescending => :order_descending}
263
- ]
264
- },
265
- {:paging => [
266
- {:limit => :limit},
267
- {:offset => :offset}
268
- ]
269
- }
270
- ]
271
-
254
+ { refId: :reference_id },
255
+ { searchType: :search_type },
256
+ { sorting: [
257
+ { orderBy: :order_by },
258
+ { orderDescending: :order_descending }
259
+ ] },
260
+ { paging: [
261
+ { limit: :limit },
262
+ { offset: :offset }
263
+ ] }
264
+ ].freeze
265
+
272
266
  FIELDS = {
273
267
  AuthorizeNet::XmlTransaction::Type::ARB_CREATE => CREATE_FIELDS,
274
268
  AuthorizeNet::XmlTransaction::Type::ARB_UPDATE => UPDATE_FIELDS,
275
269
  AuthorizeNet::XmlTransaction::Type::ARB_GET_STATUS => GET_STATUS_FIELDS,
276
270
  AuthorizeNet::XmlTransaction::Type::ARB_CANCEL => CANCEL_FIELDS,
277
271
  AuthorizeNet::XmlTransaction::Type::ARB_GET_SUBSCRIPTION_LIST => GET_SUBSCRIPTION_LIST_FIELDS
278
- }
279
-
272
+ }.freeze
280
273
  end
281
274
  end
282
-
275
+
283
276
  module CIM
284
277
  module Fields
285
-
286
- REFID_FIELDS = {:refId => :reference_id}
287
-
288
- VALIDATION_MODE_FIELDS = {:validationMode => :validation_mode}
289
-
290
- CUSTOMER_PROFILE_ID_FIELDS = {:customerProfileId => :customer_profile_id}
291
-
292
- CUSTOMER_PAYMENT_PROFILE_ID_FIELDS = {:customerPaymentProfileId => :customer_payment_profile_id}
293
-
294
- BILL_TO_FIELDS = {:billTo => [
295
- {:firstName => :first_name},
296
- {:lastName => :last_name},
297
- {:company => :company},
298
- {:address => :address},
299
- {:city => :city},
300
- {:state => :state},
301
- {:zip => :zip},
302
- {:country => :country},
303
- {:phoneNumber => :phone},
304
- {:faxNumber => :fax}
305
- ]}
306
-
307
- SHIP_TO_FIELDS = {:shipTo => [
308
- {:firstName => :ship_to_first_name},
309
- {:lastName => :ship_to_last_name},
310
- {:company => :ship_to_company},
311
- {:address => :ship_to_address},
312
- {:city => :ship_to_city},
313
- {:state => :ship_to_state},
314
- {:zip => :ship_to_zip},
315
- {:country => :ship_to_country},
316
- {:phoneNumber => :ship_to_phone},
317
- {:faxNumber => :ship_to_fax}
318
- ], :_multivalue => :addresses}
319
-
320
- ADDRESS_FIELDS = {:address => [
321
- {:firstName => :first_name},
322
- {:lastName => :last_name},
323
- {:company => :company},
324
- {:address => :address},
325
- {:city => :city},
326
- {:state => :state},
327
- {:zip => :zip},
328
- {:country => :country},
329
- {:phoneNumber => :phone},
330
- {:faxNumber => :fax}
331
- ]
332
- }
333
-
278
+ REFID_FIELDS = { refId: :reference_id }.freeze
279
+
280
+ VALIDATION_MODE_FIELDS = { validationMode: :validation_mode }.freeze
281
+
282
+ CUSTOMER_PROFILE_ID_FIELDS = { customerProfileId: :customer_profile_id }.freeze
283
+
284
+ CUSTOMER_PAYMENT_PROFILE_ID_FIELDS = { customerPaymentProfileId: :customer_payment_profile_id }.freeze
285
+
286
+ BILL_TO_FIELDS = { billTo: [
287
+ { firstName: :first_name },
288
+ { lastName: :last_name },
289
+ { company: :company },
290
+ { address: :address },
291
+ { city: :city },
292
+ { state: :state },
293
+ { zip: :zip },
294
+ { country: :country },
295
+ { phoneNumber: :phone },
296
+ { faxNumber: :fax }
297
+ ] }.freeze
298
+
299
+ SHIP_TO_FIELDS = { shipTo: [
300
+ { firstName: :ship_to_first_name },
301
+ { lastName: :ship_to_last_name },
302
+ { company: :ship_to_company },
303
+ { address: :ship_to_address },
304
+ { city: :ship_to_city },
305
+ { state: :ship_to_state },
306
+ { zip: :ship_to_zip },
307
+ { country: :ship_to_country },
308
+ { phoneNumber: :ship_to_phone },
309
+ { faxNumber: :ship_to_fax }
310
+ ], _multivalue: :addresses }.freeze
311
+
312
+ ADDRESS_FIELDS = { address: [
313
+ { firstName: :first_name },
314
+ { lastName: :last_name },
315
+ { company: :company },
316
+ { address: :address },
317
+ { city: :city },
318
+ { state: :state },
319
+ { zip: :zip },
320
+ { country: :country },
321
+ { phoneNumber: :phone },
322
+ { faxNumber: :fax }
323
+ ] }.freeze
324
+
334
325
  PAYMENT_PROFILE_FIELDS = [
335
- {:customerType => :cust_type},
326
+ { customerType: :cust_type },
336
327
  BILL_TO_FIELDS,
337
- {:payment => [
338
- {:creditCard => [
339
- {:cardNumber => :card_num},
340
- {:expirationDate => :exp_date},
341
- {:cardCode => :card_code}
342
- ]},
343
- {:bankAccount => [
344
- {:accountType => :bank_acct_type},
345
- {:routingNumber => :bank_aba_code},
346
- {:accountNumber => :bank_acct_num},
347
- {:nameOnAccount => :bank_acct_name},
348
- {:echeckType => :echeck_type},
349
- {:bankName => :bank_name}
350
- ]}
351
- ]}
352
- ]
353
-
354
- PROFILE_FIELDS = {:profile => [
355
- {:merchantCustomerId => :cust_id},
356
- {:description => :description},
357
- {:email => :email},
358
- {:paymentProfiles => PAYMENT_PROFILE_FIELDS, :_multivalue => :payment_profiles},
328
+ { payment: [
329
+ { creditCard: [
330
+ { cardNumber: :card_num },
331
+ { expirationDate: :exp_date },
332
+ { cardCode: :card_code }
333
+ ] },
334
+ { bankAccount: [
335
+ { accountType: :bank_acct_type },
336
+ { routingNumber: :bank_aba_code },
337
+ { accountNumber: :bank_acct_num },
338
+ { nameOnAccount: :bank_acct_name },
339
+ { echeckType: :echeck_type },
340
+ { bankName: :bank_name }
341
+ ] }
342
+ ] }
343
+ ].freeze
344
+
345
+ PROFILE_FIELDS = { profile: [
346
+ { merchantCustomerId: :cust_id },
347
+ { description: :description },
348
+ { email: :email },
349
+ { paymentProfiles: PAYMENT_PROFILE_FIELDS, _multivalue: :payment_profiles },
359
350
  SHIP_TO_FIELDS
360
- ]}
361
-
351
+ ] }.freeze
352
+
362
353
  TRANSACTION_FIELDS = [
363
- {:amount => :amount},
364
- {:tax => [
365
- {:amount => :tax},
366
- {:name => :tax_name},
367
- {:description => :tax_description}
368
- ]},
369
- {:shipping => [
370
- {:amount => :freight},
371
- {:name => :freight_name},
372
- {:description => :freight_description}
373
- ]},
374
- {:duty => [
375
- {:amount => :duty},
376
- {:name => :duty_name},
377
- {:description => :duty_description}
378
- ]},
379
- {:lineItems => [
380
- {:itemId => :line_item_id},
381
- {:name => :line_item_name},
382
- {:description => :line_item_description},
383
- {:quantity => :line_item_quantity},
384
- {:unitPrice => :line_item_unit_price},
385
- {:taxable => :line_item_taxable}
386
- ], :_multivalue => :line_items},
354
+ { amount: :amount },
355
+ { tax: [
356
+ { amount: :tax },
357
+ { name: :tax_name },
358
+ { description: :tax_description }
359
+ ] },
360
+ { shipping: [
361
+ { amount: :freight },
362
+ { name: :freight_name },
363
+ { description: :freight_description }
364
+ ] },
365
+ { duty: [
366
+ { amount: :duty },
367
+ { name: :duty_name },
368
+ { description: :duty_description }
369
+ ] },
370
+ { lineItems: [
371
+ { itemId: :line_item_id },
372
+ { name: :line_item_name },
373
+ { description: :line_item_description },
374
+ { quantity: :line_item_quantity },
375
+ { unitPrice: :line_item_unit_price },
376
+ { taxable: :line_item_taxable }
377
+ ], _multivalue: :line_items },
387
378
  CUSTOMER_PROFILE_ID_FIELDS,
388
379
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS,
389
- {:customerShippingAddressId => :customer_address_id},
390
- {:creditCardNumberMasked => :card_num_masked},
391
- {:bankRoutingNumberMasked => :bank_aba_code_masked},
392
- {:bankAccountNumberMasked => :bank_acct_num_masked},
393
- {:order => [
394
- {:invoiceNumber => :invoice_num},
395
- {:description => :description},
396
- {:purchaseOrderNumber => :po_num}
397
- ]},
398
- {:taxExempt => :tax_exempt},
399
- {:recurringBilling => :recurring_billing},
400
- {:cardCode => :card_code},
401
- {:splitTenderId => :split_tender_id},
402
- {:approvalCode => :auth_code},
403
- {:transId => :trans_id}
404
- ]
405
-
380
+ { customerShippingAddressId: :customer_address_id },
381
+ { creditCardNumberMasked: :card_num_masked },
382
+ { bankRoutingNumberMasked: :bank_aba_code_masked },
383
+ { bankAccountNumberMasked: :bank_acct_num_masked },
384
+ { order: [
385
+ { invoiceNumber: :invoice_num },
386
+ { description: :description },
387
+ { purchaseOrderNumber: :po_num }
388
+ ] },
389
+ { taxExempt: :tax_exempt },
390
+ { recurringBilling: :recurring_billing },
391
+ { cardCode: :card_code },
392
+ { splitTenderId: :split_tender_id },
393
+ { approvalCode: :auth_code },
394
+ { transId: :trans_id }
395
+ ].freeze
396
+
406
397
  TRANSACTION_AUTH_FIELDS = [
407
- {:profileTransAuthOnly => TRANSACTION_FIELDS}
408
- ]
409
-
398
+ { profileTransAuthOnly: TRANSACTION_FIELDS }
399
+ ].freeze
400
+
410
401
  TRANSACTION_AUTH_CAPTURE_FIELDS = [
411
- {:profileTransAuthCapture => TRANSACTION_FIELDS}
412
- ]
413
-
402
+ { profileTransAuthCapture: TRANSACTION_FIELDS }
403
+ ].freeze
404
+
414
405
  TRANSACTION_CAPTURE_FIELDS = [
415
- {:profileTransCaptureOnly => TRANSACTION_FIELDS}
416
- ]
417
-
406
+ { profileTransCaptureOnly: TRANSACTION_FIELDS }
407
+ ].freeze
408
+
418
409
  TRANSACTION_PRIOR_AUTH_CAPTURE_FIELDS = [
419
- {:profileTransPriorAuthCapture => TRANSACTION_FIELDS}
420
- ]
421
-
410
+ { profileTransPriorAuthCapture: TRANSACTION_FIELDS }
411
+ ].freeze
412
+
422
413
  TRANSACTION_REFUND_FIELDS = [
423
- {:profileTransRefund => TRANSACTION_FIELDS}
424
- ]
425
-
414
+ { profileTransRefund: TRANSACTION_FIELDS }
415
+ ].freeze
416
+
426
417
  TRANSACTION_VOID_FIELDS = [
427
- {:profileTransVoid => [
418
+ { profileTransVoid: [
428
419
  CUSTOMER_PROFILE_ID_FIELDS,
429
420
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS,
430
- {:transId => :trans_id}
431
- ]}
432
- ]
433
-
421
+ { transId: :trans_id }
422
+ ] }
423
+ ].freeze
424
+
434
425
  CREATE_PROFILE_FIELDS = [
435
426
  REFID_FIELDS,
436
427
  PROFILE_FIELDS,
437
428
  VALIDATION_MODE_FIELDS
438
- ]
439
-
429
+ ].freeze
430
+
440
431
  CREATE_PAYMENT_FIELDS = [
441
432
  REFID_FIELDS,
442
433
  CUSTOMER_PROFILE_ID_FIELDS,
443
- {:paymentProfile => PAYMENT_PROFILE_FIELDS},
434
+ { paymentProfile: PAYMENT_PROFILE_FIELDS },
444
435
  VALIDATION_MODE_FIELDS
445
- ]
446
-
436
+ ].freeze
437
+
447
438
  CREATE_ADDRESS_FIELDS = [
448
439
  REFID_FIELDS,
449
440
  CUSTOMER_PROFILE_ID_FIELDS,
450
441
  ADDRESS_FIELDS
451
- ]
452
-
442
+ ].freeze
443
+
453
444
  CREATE_TRANSACTION_FIELDS = [
454
445
  REFID_FIELDS,
455
- {:transaction => [], :_conditional => :select_transaction_type_fields},
456
- {:extraOptions => :extra_options}
457
- ]
458
-
446
+ { transaction: [], _conditional: :select_transaction_type_fields },
447
+ { extraOptions: :extra_options }
448
+ ].freeze
449
+
459
450
  DELETE_PROFILE_FIELDS = [
460
451
  REFID_FIELDS,
461
452
  CUSTOMER_PROFILE_ID_FIELDS
462
- ]
463
-
453
+ ].freeze
454
+
464
455
  DELETE_PAYMENT_FIELDS = [
465
456
  REFID_FIELDS,
466
457
  CUSTOMER_PROFILE_ID_FIELDS,
467
458
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS
468
- ]
469
-
459
+ ].freeze
460
+
470
461
  DELETE_ADDRESS_FIELDS = [
471
462
  REFID_FIELDS,
472
463
  CUSTOMER_PROFILE_ID_FIELDS,
473
- {:customerAddressId => :customer_address_id}
474
- ]
475
-
476
- GET_PROFILE_IDS_FIELDS = []
477
-
464
+ { customerAddressId: :customer_address_id }
465
+ ].freeze
466
+
467
+ GET_PROFILE_IDS_FIELDS = [].freeze
468
+
478
469
  GET_PROFILE_FIELDS = [
479
470
  CUSTOMER_PROFILE_ID_FIELDS
480
- ]
481
-
471
+ ].freeze
472
+
482
473
  GET_PAYMENT_FIELDS = [
483
474
  CUSTOMER_PROFILE_ID_FIELDS,
484
475
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS
485
- ]
486
-
476
+ ].freeze
477
+
487
478
  GET_ADDRESS_FIELDS = [
488
479
  CUSTOMER_PROFILE_ID_FIELDS,
489
- {:customerAddressId => :customer_address_id}
490
- ]
480
+ { customerAddressId: :customer_address_id }
481
+ ].freeze
491
482
 
492
483
  GET_HOSTED_PROFILE_FIELDS = [
493
484
  REFID_FIELDS,
494
485
  CUSTOMER_PROFILE_ID_FIELDS,
495
- { :hostedProfileSettings => [ { :setting => [ { :settingName => :setting_name }, { :settingValue => :setting_value } ], :_multivalue => :hosted_settings } ] }
496
- ]
497
-
486
+ { hostedProfileSettings: [{ setting: [{ settingName: :setting_name }, { settingValue: :setting_value }], _multivalue: :hosted_settings }] }
487
+ ].freeze
488
+
498
489
  UPDATE_PROFILE_FIELDS = [
499
490
  REFID_FIELDS,
500
- {:profile => [
501
- {:merchantCustomerId => :cust_id},
502
- {:description => :description},
503
- {:email => :email},
491
+ { profile: [
492
+ { merchantCustomerId: :cust_id },
493
+ { description: :description },
494
+ { email: :email },
504
495
  CUSTOMER_PROFILE_ID_FIELDS
505
- ]}
506
- ]
507
-
496
+ ] }
497
+ ].freeze
498
+
508
499
  UPDATE_PAYMENT_FIELDS = [
509
500
  REFID_FIELDS,
510
501
  CUSTOMER_PROFILE_ID_FIELDS,
511
- {:paymentProfile => PAYMENT_PROFILE_FIELDS + [CUSTOMER_PAYMENT_PROFILE_ID_FIELDS]},
502
+ { paymentProfile: PAYMENT_PROFILE_FIELDS + [CUSTOMER_PAYMENT_PROFILE_ID_FIELDS] },
512
503
  VALIDATION_MODE_FIELDS
513
- ]
514
-
504
+ ].freeze
505
+
515
506
  UPDATE_ADDRESS_FIELDS = [
516
507
  REFID_FIELDS,
517
508
  CUSTOMER_PROFILE_ID_FIELDS,
518
- {:address => [
519
- {:firstName => :first_name},
520
- {:lastName => :last_name},
521
- {:company => :company},
522
- {:address => :address},
523
- {:city => :city},
524
- {:state => :state},
525
- {:zip => :zip},
526
- {:country => :country},
527
- {:phoneNumber => :phone},
528
- {:faxNumber => :fax},
529
- {:customerAddressId => :customer_address_id}
530
- ]}
531
- ]
532
-
509
+ { address: [
510
+ { firstName: :first_name },
511
+ { lastName: :last_name },
512
+ { company: :company },
513
+ { address: :address },
514
+ { city: :city },
515
+ { state: :state },
516
+ { zip: :zip },
517
+ { country: :country },
518
+ { phoneNumber: :phone },
519
+ { faxNumber: :fax },
520
+ { customerAddressId: :customer_address_id }
521
+ ] }
522
+ ].freeze
523
+
533
524
  UPDATE_SPLIT_FIELDS = [
534
- {:splitTenderId => :split_tender_id},
535
- {:splitTenderStatus => :split_tender_status}
536
- ]
537
-
525
+ { splitTenderId: :split_tender_id },
526
+ { splitTenderStatus: :split_tender_status }
527
+ ].freeze
528
+
538
529
  VALIDATE_PAYMENT_FIELDS = [
539
530
  CUSTOMER_PROFILE_ID_FIELDS,
540
531
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS,
541
- {:customerShippingAddressId => :customer_address_id},
542
- {:cardCode => :card_code},
532
+ { customerShippingAddressId: :customer_address_id },
533
+ { cardCode: :card_code },
543
534
  VALIDATION_MODE_FIELDS
544
- ]
545
-
535
+ ].freeze
536
+
546
537
  FIELDS = {
547
538
  AuthorizeNet::XmlTransaction::Type::CIM_CREATE_PROFILE => CREATE_PROFILE_FIELDS,
548
539
  AuthorizeNet::XmlTransaction::Type::CIM_CREATE_PAYMENT => CREATE_PAYMENT_FIELDS,
@@ -561,219 +552,209 @@ module AuthorizeNet
561
552
  AuthorizeNet::XmlTransaction::Type::CIM_UPDATE_ADDRESS => UPDATE_ADDRESS_FIELDS,
562
553
  AuthorizeNet::XmlTransaction::Type::CIM_UPDATE_SPLIT => UPDATE_SPLIT_FIELDS,
563
554
  AuthorizeNet::XmlTransaction::Type::CIM_VALIDATE_PAYMENT => VALIDATE_PAYMENT_FIELDS
564
- }
565
-
555
+ }.freeze
556
+
566
557
  ADDRESS_ENTITY_DESCRIPTION = EntityDescription.new(
567
558
  [
568
- {:firstName => :first_name},
569
- {:lastName => :last_name},
570
- {:company => :company},
571
- {:address => :street_address},
572
- {:city => :city},
573
- {:state => :state},
574
- {:zip => :zip},
575
- {:country => :country},
576
- {:phoneNumber => :phone},
577
- {:faxNumber => :fax}
559
+ { firstName: :first_name },
560
+ { lastName: :last_name },
561
+ { company: :company },
562
+ { address: :street_address },
563
+ { city: :city },
564
+ { state: :state },
565
+ { zip: :zip },
566
+ { country: :country },
567
+ { phoneNumber: :phone },
568
+ { faxNumber: :fax }
578
569
  ],
579
570
  AuthorizeNet::Address
580
571
  )
581
-
572
+
582
573
  CREDIT_CARD_ENTITY_DESCRIPTION = EntityDescription.new(
583
574
  [
584
- {:cardNumber => :card_num},
585
- {:expirationDate => :exp_date},
586
- {:cardCode => :card_code},
587
- {:cardType => :card_type}
575
+ { cardNumber: :card_num },
576
+ { expirationDate: :exp_date },
577
+ { cardCode: :card_code },
578
+ { cardType: :card_type }
588
579
  ],
589
580
  AuthorizeNet::CreditCard,
590
- [:card_num, :exp_date]
581
+ %i[card_num exp_date]
591
582
  )
592
-
583
+
593
584
  ECHECK_ENTITY_DESCRIPTION = EntityDescription.new(
594
585
  [
595
- {:accountType => :account_type},
596
- {:routingNumber => :routing_number},
597
- {:accountNumber => :account_number},
598
- {:nameOnAccount => :account_holder_name},
599
- {:echeckType => :echeck_type},
600
- {:bankName => :bank_name}
586
+ { accountType: :account_type },
587
+ { routingNumber: :routing_number },
588
+ { accountNumber: :account_number },
589
+ { nameOnAccount: :account_holder_name },
590
+ { echeckType: :echeck_type },
591
+ { bankName: :bank_name }
601
592
  ],
602
593
  AuthorizeNet::ECheck,
603
- [:routing_number, :account_number, :bank_name, :account_holder_name]
594
+ %i[routing_number account_number bank_name account_holder_name]
604
595
  )
605
-
596
+
606
597
  PAYMENT_PROFILE_ENTITY_DESCRIPTION = EntityDescription.new(
607
598
  [
608
599
  CUSTOMER_PAYMENT_PROFILE_ID_FIELDS,
609
- {:customerType => :cust_type},
610
- {:billTo => ADDRESS_ENTITY_DESCRIPTION, :_value => :billing_address},
611
- {:payment => [
612
- {:creditCard => CREDIT_CARD_ENTITY_DESCRIPTION, :_value => :payment_method},
613
- {:bankAccount => ECHECK_ENTITY_DESCRIPTION, :_value => :payment_method}
614
- ]}
600
+ { customerType: :cust_type },
601
+ { billTo: ADDRESS_ENTITY_DESCRIPTION, _value: :billing_address },
602
+ { payment: [
603
+ { creditCard: CREDIT_CARD_ENTITY_DESCRIPTION, _value: :payment_method },
604
+ { bankAccount: ECHECK_ENTITY_DESCRIPTION, _value: :payment_method }
605
+ ] }
615
606
  ],
616
607
  AuthorizeNet::CIM::PaymentProfile
617
608
  )
618
-
609
+
619
610
  PROFILE_ENTITY_DESCRIPTION = EntityDescription.new(
620
611
  [
621
- {:merchantCustomerId => :id},
622
- {:description => :description},
623
- {:email => :email},
612
+ { merchantCustomerId: :id },
613
+ { description: :description },
614
+ { email: :email },
624
615
  CUSTOMER_PROFILE_ID_FIELDS,
625
- {:paymentProfiles => PAYMENT_PROFILE_ENTITY_DESCRIPTION, :_multivalue => :payment_profiles},
626
- {:shipTo => ADDRESS_ENTITY_DESCRIPTION, :_multivalue => :addresses}
616
+ { paymentProfiles: PAYMENT_PROFILE_ENTITY_DESCRIPTION, _multivalue: :payment_profiles },
617
+ { shipTo: ADDRESS_ENTITY_DESCRIPTION, _multivalue: :addresses }
627
618
  ],
628
619
  AuthorizeNet::CIM::CustomerProfile
629
620
  )
630
621
  end
631
622
  end
632
-
623
+
633
624
  module Reporting
634
625
  module Fields
635
-
636
626
  GET_BATCH_LIST = [
637
- {:includeStatistics => :include_statistics},
638
- {:firstSettlementDate => :first_settlement_date},
639
- {:lastSettlementDate => :last_settlement_date}
640
- ]
641
-
627
+ { includeStatistics: :include_statistics },
628
+ { firstSettlementDate: :first_settlement_date },
629
+ { lastSettlementDate: :last_settlement_date }
630
+ ].freeze
631
+
642
632
  GET_TRANSACTION_LIST = [
643
- {:batchId => :batch_id}
644
- ]
645
-
633
+ { batchId: :batch_id }
634
+ ].freeze
635
+
646
636
  GET_UNSETTLED_TRANSACTION_LIST = [
647
- ]
648
-
637
+ ].freeze
638
+
649
639
  GET_TRANSACTION_DETAILS = [
650
- {:transId => :transaction_id}
651
- ]
652
-
640
+ { transId: :transaction_id }
641
+ ].freeze
642
+
653
643
  BATCH_STATISTICS_ENTITY_DESCRIPTION = EntityDescription.new([
654
- {:accountType => :account_type},
655
- {:chargeAmount => :charge_amount, :_converter => :value_to_decimal},
656
- {:chargeCount => :charge_count, :_converter => :value_to_integer},
657
- {:refundAmount => :refund_amount, :_converter => :value_to_decimal},
658
- {:refundCount => :refund_count, :_converter => :value_to_integer},
659
- {:voidCount => :void_count, :_converter => :value_to_integer},
660
- {:declineCount => :decline_count, :_converter => :value_to_integer},
661
- {:errorCount => :error_count, :_converter => :value_to_integer},
662
- {:returnedItemAmount => :returned_item_amount, :_converter => :value_to_decimal},
663
- {:returnedItemCount => :returned_item_count, :_converter => :value_to_integer},
664
- {:chargebackAmount => :chargeback_amount, :_converter => :value_to_decimal},
665
- {:chargebackCount => :chargeback_count, :_converter => :value_to_integer},
666
- {:correctionNoticeCount => :correction_notice_count, :_converter => :value_to_integer},
667
- {:chargeChargeBackAmount => :charge_chargeback_amount, :_converter => :value_to_decimal},
668
- {:chargeChargeBackCount => :charge_chargeback_count, :_converter => :value_to_integer},
669
- {:refundChargeBackAmount => :refund_chargeback_amount, :_converter => :value_to_decimal},
670
- {:refundChargeBackCount => :refund_chargeback_count, :_converter => :value_to_integer},
671
- {:chargeReturnedItemsAmount => :charge_returned_items_amount, :_converter => :value_to_decimal},
672
- {:chargeReturnedItemsCount => :charge_returned_items_count, :_converter => :value_to_integer},
673
- {:refundReturnedItemsAmount => :refund_returned_items_amount, :_converter => :value_to_decimal},
674
- {:refundReturnedItemsCount => :refund_returned_items_count, :_converter => :value_to_integer}
675
- ],
676
- AuthorizeNet::Reporting::BatchStatistics
677
- )
678
-
644
+ { accountType: :account_type },
645
+ { chargeAmount: :charge_amount, _converter: :value_to_decimal },
646
+ { chargeCount: :charge_count, _converter: :value_to_integer },
647
+ { refundAmount: :refund_amount, _converter: :value_to_decimal },
648
+ { refundCount: :refund_count, _converter: :value_to_integer },
649
+ { voidCount: :void_count, _converter: :value_to_integer },
650
+ { declineCount: :decline_count, _converter: :value_to_integer },
651
+ { errorCount: :error_count, _converter: :value_to_integer },
652
+ { returnedItemAmount: :returned_item_amount, _converter: :value_to_decimal },
653
+ { returnedItemCount: :returned_item_count, _converter: :value_to_integer },
654
+ { chargebackAmount: :chargeback_amount, _converter: :value_to_decimal },
655
+ { chargebackCount: :chargeback_count, _converter: :value_to_integer },
656
+ { correctionNoticeCount: :correction_notice_count, _converter: :value_to_integer },
657
+ { chargeChargeBackAmount: :charge_chargeback_amount, _converter: :value_to_decimal },
658
+ { chargeChargeBackCount: :charge_chargeback_count, _converter: :value_to_integer },
659
+ { refundChargeBackAmount: :refund_chargeback_amount, _converter: :value_to_decimal },
660
+ { refundChargeBackCount: :refund_chargeback_count, _converter: :value_to_integer },
661
+ { chargeReturnedItemsAmount: :charge_returned_items_amount, _converter: :value_to_decimal },
662
+ { chargeReturnedItemsCount: :charge_returned_items_count, _converter: :value_to_integer },
663
+ { refundReturnedItemsAmount: :refund_returned_items_amount, _converter: :value_to_decimal },
664
+ { refundReturnedItemsCount: :refund_returned_items_count, _converter: :value_to_integer }
665
+ ],
666
+ AuthorizeNet::Reporting::BatchStatistics)
667
+
679
668
  BATCH_ENTITY_DESCRIPTION = EntityDescription.new([
680
- {:batchId => :id},
681
- {:settlementTimeUTC => :settled_at, :_converter => :value_to_datetime},
682
- {:settlementState => :state},
683
- {:paymentMethod => :payment_method},
684
- {:statistics => [{:statistic => BATCH_STATISTICS_ENTITY_DESCRIPTION, :_multivalue => :statistics}]}
685
- ],
686
- AuthorizeNet::Reporting::Batch
687
- )
688
-
669
+ { batchId: :id },
670
+ { settlementTimeUTC: :settled_at, _converter: :value_to_datetime },
671
+ { settlementState: :state },
672
+ { paymentMethod: :payment_method },
673
+ { statistics: [{ statistic: BATCH_STATISTICS_ENTITY_DESCRIPTION, _multivalue: :statistics }] }
674
+ ],
675
+ AuthorizeNet::Reporting::Batch)
676
+
689
677
  FDSFILTER_ENTITY_DESCRIPTION = EntityDescription.new([
690
- {:name => :name},
691
- {:action => :action}
692
- ],
693
- AuthorizeNet::Reporting::FDSFilter
694
- )
695
-
678
+ { name: :name },
679
+ { action: :action }
680
+ ],
681
+ AuthorizeNet::Reporting::FDSFilter)
682
+
696
683
  CUSTOMER_ENTITY_DESCRIPTION = EntityDescription.new([
697
- {:id => :id},
698
- {:email => :email}
699
- ],
700
- AuthorizeNet::CIM::CustomerProfile
701
- )
702
-
684
+ { id: :id },
685
+ { email: :email }
686
+ ],
687
+ AuthorizeNet::CIM::CustomerProfile)
688
+
703
689
  ORDER_ENTITY_DESCRIPTION = EntityDescription.new([
704
- {:invoice_number => :invoice_num},
705
- {:description => :description},
706
- {:purchaseOrderNumber => :po_num}
707
- ],
708
- AuthorizeNet::Order
709
- )
710
-
690
+ { invoice_number: :invoice_num },
691
+ { description: :description },
692
+ { purchaseOrderNumber: :po_num }
693
+ ],
694
+ AuthorizeNet::Order)
695
+
711
696
  LINE_ITEM_ENTITY_DESCRIPTION = EntityDescription.new([
712
- {:itemId => :id},
713
- {:name => :name},
714
- {:description => :description},
715
- {:quantity => :quantity, :_convert => :value_to_integer},
716
- {:unityPrice => :price, :_convert => :value_to_decimal},
717
- {:taxable => :taxable, :_convert => :value_to_boolean}
718
- ],
719
- AuthorizeNet::LineItem
720
- )
697
+ { itemId: :id },
698
+ { name: :name },
699
+ { description: :description },
700
+ { quantity: :quantity, _convert: :value_to_integer },
701
+ { unityPrice: :price, _convert: :value_to_decimal },
702
+ { taxable: :taxable, _convert: :value_to_boolean }
703
+ ],
704
+ AuthorizeNet::LineItem)
721
705
 
722
706
  attr_accessor :id, :date_utc, :date_local, :code, :description
723
707
  RETURNED_ITEM_ENTITY_DESCRIPTION = EntityDescription.new([
724
- {:id => :id},
725
- {:dateUTC => :date_utc},
726
- {:dateLocal => :date_local},
727
- {:code => :code},
728
- {:description => :description}
729
- ],
730
- AuthorizeNet::Reporting::ReturnedItem
731
- )
708
+ { id: :id },
709
+ { dateUTC: :date_utc },
710
+ { dateLocal: :date_local },
711
+ { code: :code },
712
+ { description: :description }
713
+ ],
714
+ AuthorizeNet::Reporting::ReturnedItem)
732
715
 
733
-
734
716
  TRANSACTION_DETAILS_ENTITY_DESCRIPTION = EntityDescription.new([
735
- {:transId => :id},
736
- {:refTransId => :reference_id},
737
- {:splitTenderId => :split_tender_id},
738
- {:transactionType => :type},
739
- {:responseCode => :response_code},
740
- {:responseReasonCode => :response_reason_code},
741
- {:authCode => :auth_code},
742
- {:AVSResponse => :avs_response},
743
- {:cardCodeResponse => :card_code_response},
744
- {:CAVVResponse => :cavv_response},
745
- {:FDSFilterAction => :fds_filter_action},
746
- {:FDSFilters => [{:FDSFilter => FDSFILTER_ENTITY_DESCRIPTION, :_multivalue => :fds_filters}]},
747
- {:batch => BATCH_ENTITY_DESCRIPTION, :_value => :batch},
748
- {:responseReasonDescription => :response_reason_description},
749
- {:submitTimeUTC => :submitted_at, :_converter => :value_to_datetime},
750
- {:transactionStatus => :status},
751
- {:accountType => :account_type},
752
- {:accountNumber => :account_number},
753
- {:order => ORDER_ENTITY_DESCRIPTION, :_value => :order},
754
- {:requestedAmount => :requested_amount, :_converter => :value_to_decimal},
755
- {:authAmount => :auth_amount, :_converter => :value_to_decimal},
756
- {:settleAmount => :settle_amount, :_converter => :value_to_decimal},
757
- {:prepaidBalanceRemaining => :prepaid_balance_remaining, :_converter => :value_to_decimal},
758
- {:payment => [
759
- {:creditCard => AuthorizeNet::CIM::Fields::CREDIT_CARD_ENTITY_DESCRIPTION, :_value => :payment_method},
760
- {:bankAccount => AuthorizeNet::CIM::Fields::ECHECK_ENTITY_DESCRIPTION, :_value => :payment_method}
761
- ]},
762
- {:customer => CUSTOMER_ENTITY_DESCRIPTION, :_value => :customer},
763
- {:billTo => AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, :_value => :bill_to},
764
- {:shipTo => AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, :_value => :ship_to},
765
- {:recurringBilling => :recurring_billing, :_convert => :value_to_boolean},
766
- {:hasReturnedItems => :returns, :_convert => :value_to_boolean}
767
- ],
768
- AuthorizeNet::Reporting::TransactionDetails
769
- )
770
-
717
+ { transId: :id },
718
+ { refTransId: :reference_id },
719
+ { splitTenderId: :split_tender_id },
720
+ { transactionType: :type },
721
+ { responseCode: :response_code },
722
+ { responseReasonCode: :response_reason_code },
723
+ { authCode: :auth_code },
724
+ { AVSResponse: :avs_response },
725
+ { cardCodeResponse: :card_code_response },
726
+ { CAVVResponse: :cavv_response },
727
+ { FDSFilterAction: :fds_filter_action },
728
+ { FDSFilters: [{ FDSFilter: FDSFILTER_ENTITY_DESCRIPTION, _multivalue: :fds_filters }] },
729
+ { batch: BATCH_ENTITY_DESCRIPTION, _value: :batch },
730
+ { responseReasonDescription: :response_reason_description },
731
+ { submitTimeUTC: :submitted_at, _converter: :value_to_datetime },
732
+ { transactionStatus: :status },
733
+ { accountType: :account_type },
734
+ { accountNumber: :account_number },
735
+ { order: ORDER_ENTITY_DESCRIPTION, _value: :order },
736
+ { requestedAmount: :requested_amount, _converter: :value_to_decimal },
737
+ { authAmount: :auth_amount, _converter: :value_to_decimal },
738
+ { settleAmount: :settle_amount, _converter: :value_to_decimal },
739
+ { prepaidBalanceRemaining: :prepaid_balance_remaining, _converter: :value_to_decimal },
740
+ { payment: [
741
+ { creditCard: AuthorizeNet::CIM::Fields::CREDIT_CARD_ENTITY_DESCRIPTION, _value: :payment_method },
742
+ { bankAccount: AuthorizeNet::CIM::Fields::ECHECK_ENTITY_DESCRIPTION, _value: :payment_method }
743
+ ] },
744
+ { customer: CUSTOMER_ENTITY_DESCRIPTION, _value: :customer },
745
+ { billTo: AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, _value: :bill_to },
746
+ { shipTo: AuthorizeNet::CIM::Fields::ADDRESS_ENTITY_DESCRIPTION, _value: :ship_to },
747
+ { recurringBilling: :recurring_billing, _convert: :value_to_boolean },
748
+ { hasReturnedItems: :returns, _convert: :value_to_boolean }
749
+ ],
750
+ AuthorizeNet::Reporting::TransactionDetails)
751
+
771
752
  FIELDS = {
772
753
  AuthorizeNet::XmlTransaction::Type::REPORT_GET_BATCH_LIST => GET_BATCH_LIST,
773
754
  AuthorizeNet::XmlTransaction::Type::REPORT_GET_TRANSACTION_LIST => GET_TRANSACTION_LIST,
774
755
  AuthorizeNet::XmlTransaction::Type::REPORT_GET_UNSETTLED_TRANSACTION_LIST => GET_UNSETTLED_TRANSACTION_LIST,
775
756
  AuthorizeNet::XmlTransaction::Type::REPORT_GET_TRANSACTION_DETAILS => GET_TRANSACTION_DETAILS
776
- }
757
+ }.freeze
777
758
  end
778
759
  end
779
760
  end