authorizenet 1.9.4 → 1.9.5
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app/helpers/authorize_net_helper.rb +2 -3
- data/lib/authorize_net.rb +5 -5
- data/lib/authorize_net/addresses/address.rb +15 -19
- data/lib/authorize_net/addresses/shipping_address.rb +12 -16
- data/lib/authorize_net/aim/response.rb +27 -38
- data/lib/authorize_net/aim/transaction.rb +46 -65
- data/lib/authorize_net/api/api_transaction.rb +85 -90
- data/lib/authorize_net/api/constants.yml +1 -1
- data/lib/authorize_net/api/schema.rb +968 -936
- data/lib/authorize_net/api/transaction.rb +100 -102
- data/lib/authorize_net/arb/fields.rb +21 -21
- data/lib/authorize_net/arb/paging.rb +7 -11
- data/lib/authorize_net/arb/response.rb +7 -15
- data/lib/authorize_net/arb/sorting.rb +6 -10
- data/lib/authorize_net/arb/subscription.rb +27 -31
- data/lib/authorize_net/arb/subscription_detail.rb +1 -5
- data/lib/authorize_net/arb/subscription_list_response.rb +13 -20
- data/lib/authorize_net/arb/transaction.rb +50 -56
- data/lib/authorize_net/authorize_net.rb +20 -27
- data/lib/authorize_net/cim/customer_profile.rb +4 -8
- data/lib/authorize_net/cim/payment_profile.rb +10 -12
- data/lib/authorize_net/cim/response.rb +19 -24
- data/lib/authorize_net/cim/transaction.rb +168 -174
- data/lib/authorize_net/customer.rb +11 -14
- data/lib/authorize_net/email_receipt.rb +8 -12
- data/lib/authorize_net/fields.rb +483 -502
- data/lib/authorize_net/key_value_response.rb +54 -62
- data/lib/authorize_net/key_value_transaction.rb +87 -97
- data/lib/authorize_net/line_item.rb +10 -14
- data/lib/authorize_net/order.rb +21 -25
- data/lib/authorize_net/payment_methods/credit_card.rb +6 -7
- data/lib/authorize_net/payment_methods/echeck.rb +29 -31
- data/lib/authorize_net/reporting/batch.rb +4 -7
- data/lib/authorize_net/reporting/batch_statistics.rb +2 -6
- data/lib/authorize_net/reporting/fds_filter.rb +2 -5
- data/lib/authorize_net/reporting/response.rb +54 -60
- data/lib/authorize_net/reporting/returned_item.rb +11 -12
- data/lib/authorize_net/reporting/transaction.rb +27 -29
- data/lib/authorize_net/reporting/transaction_details.rb +3 -6
- data/lib/authorize_net/response.rb +6 -10
- data/lib/authorize_net/sim/hosted_payment_form.rb +16 -20
- data/lib/authorize_net/sim/hosted_receipt_page.rb +18 -23
- data/lib/authorize_net/sim/response.rb +24 -33
- data/lib/authorize_net/sim/transaction.rb +33 -43
- data/lib/authorize_net/transaction.rb +15 -21
- data/lib/authorize_net/xml_response.rb +36 -54
- data/lib/authorize_net/xml_transaction.rb +115 -134
- data/lib/generators/authorize_net/direct_post/direct_post_generator.rb +5 -6
- data/lib/generators/authorize_net/sim/sim_generator.rb +6 -7
- data/lib/generators/generator_extensions.rb +23 -25
- metadata +127 -81
- 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
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
16
|
-
:
|
17
|
-
:
|
18
|
-
:
|
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 {|
|
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
|
-
:
|
13
|
-
:
|
14
|
-
:
|
15
|
-
:
|
10
|
+
header: @header,
|
11
|
+
footer: @footer,
|
12
|
+
merchant_email: @merchant_email,
|
13
|
+
email_customer: @email_customer
|
16
14
|
}
|
17
|
-
hash.delete_if {|
|
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
|
data/lib/authorize_net/fields.rb
CHANGED
@@ -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
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
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 = {:
|
172
|
-
{:
|
173
|
-
{:
|
174
|
-
{:
|
175
|
-
{:
|
176
|
-
{:
|
177
|
-
]},
|
178
|
-
{:
|
179
|
-
{:
|
180
|
-
{:
|
181
|
-
]},
|
182
|
-
{:
|
183
|
-
{:
|
184
|
-
{:
|
185
|
-
{:
|
186
|
-
{:
|
187
|
-
{:
|
188
|
-
{:
|
189
|
-
]},
|
190
|
-
{:
|
191
|
-
{:
|
192
|
-
{:
|
193
|
-
{:
|
194
|
-
{:
|
195
|
-
{:
|
196
|
-
{:
|
197
|
-
]}
|
198
|
-
]},
|
199
|
-
{:
|
200
|
-
{:
|
201
|
-
{:
|
202
|
-
]},
|
203
|
-
{:
|
204
|
-
{:
|
205
|
-
{:
|
206
|
-
{:
|
207
|
-
{:
|
208
|
-
]},
|
209
|
-
{:
|
210
|
-
{:
|
211
|
-
{:
|
212
|
-
{:
|
213
|
-
{:
|
214
|
-
{:
|
215
|
-
{:
|
216
|
-
{:
|
217
|
-
{:
|
218
|
-
]},
|
219
|
-
{:
|
220
|
-
{:
|
221
|
-
{:
|
222
|
-
{:
|
223
|
-
{:
|
224
|
-
{:
|
225
|
-
{:
|
226
|
-
{:
|
227
|
-
{:
|
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
|
-
{:
|
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
|
-
{:
|
240
|
-
{:
|
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
|
-
{:
|
247
|
-
{:
|
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
|
-
{:
|
253
|
-
{:
|
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
|
-
{:
|
259
|
-
{:
|
260
|
-
{:
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
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
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
{:
|
296
|
-
{:
|
297
|
-
{:
|
298
|
-
{:
|
299
|
-
{:
|
300
|
-
{:
|
301
|
-
{:
|
302
|
-
{:
|
303
|
-
{:
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
{:
|
309
|
-
{:
|
310
|
-
{:
|
311
|
-
{:
|
312
|
-
{:
|
313
|
-
{:
|
314
|
-
{:
|
315
|
-
{:
|
316
|
-
{:
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
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
|
-
{:
|
326
|
+
{ customerType: :cust_type },
|
336
327
|
BILL_TO_FIELDS,
|
337
|
-
{:
|
338
|
-
{:
|
339
|
-
{:
|
340
|
-
{:
|
341
|
-
{:
|
342
|
-
]},
|
343
|
-
{:
|
344
|
-
{:
|
345
|
-
{:
|
346
|
-
{:
|
347
|
-
{:
|
348
|
-
{:
|
349
|
-
{:
|
350
|
-
]}
|
351
|
-
]}
|
352
|
-
]
|
353
|
-
|
354
|
-
PROFILE_FIELDS = {:
|
355
|
-
{:
|
356
|
-
{:
|
357
|
-
{:
|
358
|
-
{:
|
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
|
-
{:
|
364
|
-
{:
|
365
|
-
{:
|
366
|
-
{:
|
367
|
-
{:
|
368
|
-
]},
|
369
|
-
{:
|
370
|
-
{:
|
371
|
-
{:
|
372
|
-
{:
|
373
|
-
]},
|
374
|
-
{:
|
375
|
-
{:
|
376
|
-
{:
|
377
|
-
{:
|
378
|
-
]},
|
379
|
-
{:
|
380
|
-
{:
|
381
|
-
{:
|
382
|
-
{:
|
383
|
-
{:
|
384
|
-
{:
|
385
|
-
{:
|
386
|
-
], :
|
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
|
-
{:
|
390
|
-
{:
|
391
|
-
{:
|
392
|
-
{:
|
393
|
-
{:
|
394
|
-
{:
|
395
|
-
{:
|
396
|
-
{:
|
397
|
-
]},
|
398
|
-
{:
|
399
|
-
{:
|
400
|
-
{:
|
401
|
-
{:
|
402
|
-
{:
|
403
|
-
{:
|
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
|
-
{:
|
408
|
-
]
|
409
|
-
|
398
|
+
{ profileTransAuthOnly: TRANSACTION_FIELDS }
|
399
|
+
].freeze
|
400
|
+
|
410
401
|
TRANSACTION_AUTH_CAPTURE_FIELDS = [
|
411
|
-
{:
|
412
|
-
]
|
413
|
-
|
402
|
+
{ profileTransAuthCapture: TRANSACTION_FIELDS }
|
403
|
+
].freeze
|
404
|
+
|
414
405
|
TRANSACTION_CAPTURE_FIELDS = [
|
415
|
-
{:
|
416
|
-
]
|
417
|
-
|
406
|
+
{ profileTransCaptureOnly: TRANSACTION_FIELDS }
|
407
|
+
].freeze
|
408
|
+
|
418
409
|
TRANSACTION_PRIOR_AUTH_CAPTURE_FIELDS = [
|
419
|
-
{:
|
420
|
-
]
|
421
|
-
|
410
|
+
{ profileTransPriorAuthCapture: TRANSACTION_FIELDS }
|
411
|
+
].freeze
|
412
|
+
|
422
413
|
TRANSACTION_REFUND_FIELDS = [
|
423
|
-
{:
|
424
|
-
]
|
425
|
-
|
414
|
+
{ profileTransRefund: TRANSACTION_FIELDS }
|
415
|
+
].freeze
|
416
|
+
|
426
417
|
TRANSACTION_VOID_FIELDS = [
|
427
|
-
{:
|
418
|
+
{ profileTransVoid: [
|
428
419
|
CUSTOMER_PROFILE_ID_FIELDS,
|
429
420
|
CUSTOMER_PAYMENT_PROFILE_ID_FIELDS,
|
430
|
-
{:
|
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
|
-
{:
|
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
|
-
{:
|
456
|
-
{:
|
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
|
-
{:
|
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
|
-
{:
|
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
|
-
{ :
|
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
|
-
{:
|
501
|
-
{:
|
502
|
-
{:
|
503
|
-
{:
|
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
|
-
{:
|
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
|
-
{:
|
519
|
-
{:
|
520
|
-
{:
|
521
|
-
{:
|
522
|
-
{:
|
523
|
-
{:
|
524
|
-
{:
|
525
|
-
{:
|
526
|
-
{:
|
527
|
-
{:
|
528
|
-
{:
|
529
|
-
{:
|
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
|
-
{:
|
535
|
-
{:
|
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
|
-
{:
|
542
|
-
{:
|
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
|
-
{:
|
569
|
-
{:
|
570
|
-
{:
|
571
|
-
{:
|
572
|
-
{:
|
573
|
-
{:
|
574
|
-
{:
|
575
|
-
{:
|
576
|
-
{:
|
577
|
-
{:
|
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
|
-
{:
|
585
|
-
{:
|
586
|
-
{:
|
587
|
-
{:
|
575
|
+
{ cardNumber: :card_num },
|
576
|
+
{ expirationDate: :exp_date },
|
577
|
+
{ cardCode: :card_code },
|
578
|
+
{ cardType: :card_type }
|
588
579
|
],
|
589
580
|
AuthorizeNet::CreditCard,
|
590
|
-
[
|
581
|
+
%i[card_num exp_date]
|
591
582
|
)
|
592
|
-
|
583
|
+
|
593
584
|
ECHECK_ENTITY_DESCRIPTION = EntityDescription.new(
|
594
585
|
[
|
595
|
-
{:
|
596
|
-
{:
|
597
|
-
{:
|
598
|
-
{:
|
599
|
-
{:
|
600
|
-
{:
|
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
|
-
[
|
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
|
-
{:
|
610
|
-
{:
|
611
|
-
{:
|
612
|
-
{:
|
613
|
-
{:
|
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
|
-
{:
|
622
|
-
{:
|
623
|
-
{:
|
612
|
+
{ merchantCustomerId: :id },
|
613
|
+
{ description: :description },
|
614
|
+
{ email: :email },
|
624
615
|
CUSTOMER_PROFILE_ID_FIELDS,
|
625
|
-
{:
|
626
|
-
{:
|
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
|
-
{:
|
638
|
-
{:
|
639
|
-
{:
|
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
|
-
{:
|
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
|
-
{:
|
651
|
-
]
|
652
|
-
|
640
|
+
{ transId: :transaction_id }
|
641
|
+
].freeze
|
642
|
+
|
653
643
|
BATCH_STATISTICS_ENTITY_DESCRIPTION = EntityDescription.new([
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
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
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
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
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
|
678
|
+
{ name: :name },
|
679
|
+
{ action: :action }
|
680
|
+
],
|
681
|
+
AuthorizeNet::Reporting::FDSFilter)
|
682
|
+
|
696
683
|
CUSTOMER_ENTITY_DESCRIPTION = EntityDescription.new([
|
697
|
-
|
698
|
-
|
699
|
-
|
700
|
-
|
701
|
-
|
702
|
-
|
684
|
+
{ id: :id },
|
685
|
+
{ email: :email }
|
686
|
+
],
|
687
|
+
AuthorizeNet::CIM::CustomerProfile)
|
688
|
+
|
703
689
|
ORDER_ENTITY_DESCRIPTION = EntityDescription.new([
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
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
|
-
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
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
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
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
|
-
|
736
|
-
|
737
|
-
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
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
|