@@ -115,7 +115,10 @@ AuthorizeNet.prototype.authCaptureTransaction = function authCaptureTransaction(
115
115
assert ( expirationYear , 'expirationYear is required' ) ;
116
116
assert ( expirationMonth , 'expirationMonth is required' ) ;
117
117
118
- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
118
+ var creditCard = {
119
+ cardNumber : cardNumber ,
120
+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
121
+ } ;
119
122
var transactionRequest = {
120
123
transactionRequest : {
121
124
amount : amount ,
@@ -162,7 +165,10 @@ AuthorizeNet.prototype.authOnlyTransaction = function authOnlyTransaction(amount
162
165
assert ( expirationYear , 'expirationYear is required' ) ;
163
166
assert ( expirationMonth , 'expirationMonth is required' ) ;
164
167
165
- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
168
+ var creditCard = {
169
+ cardNumber : cardNumber ,
170
+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
171
+ } ;
166
172
var transactionRequest = {
167
173
merchantAuthentication : self . merchantInfo ,
168
174
transactionRequest : {
@@ -221,6 +227,16 @@ AuthorizeNet.prototype.priorAuthCaptureTransaction = function captureOnlyTransac
221
227
} ) ;
222
228
} ;
223
229
230
+ /**
231
+ * Refund an already settled transaction
232
+ * @param refTransId - a reference to the transaction to refund
233
+ * @param amount - the amount to refund
234
+ * @param cardNumber - the card number used to process the transaction
235
+ * @param expirationYear - the expiration year of the card used to process the transaction
236
+ * @param expirationMonth - the expiration month of the transaction card used to process the transaction
237
+ * @param other - some other fields to merge with the request
238
+ * @returns {Promise }
239
+ */
224
240
AuthorizeNet . prototype . refundTransaction = function refundTransaction ( refTransId , amount , cardNumber , expirationYear , expirationMonth , other ) {
225
241
var self = this ;
226
242
@@ -232,7 +248,10 @@ AuthorizeNet.prototype.refundTransaction = function refundTransaction(refTransId
232
248
assert ( expirationYear , 'expirationYear is required' ) ;
233
249
assert ( expirationMonth , 'expirationMonth is required' ) ;
234
250
235
- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
251
+ var creditCard = {
252
+ cardNumber : cardNumber ,
253
+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
254
+ } ;
236
255
var transactionRequest = {
237
256
merchantAuthentication : self . merchantInfo ,
238
257
transactionRequest : {
@@ -427,4 +446,20 @@ AuthorizeNet.prototype.getBatchStatistics = function getBatchStatistics(batchId)
427
446
} ) ;
428
447
} ;
429
448
449
+ AuthorizeNet . prototype . getTransactionList = function ( batchId ) {
450
+ var self = this ;
451
+
452
+ return new Promise ( function ( resolve , reject ) {
453
+
454
+ assert ( batchId , 'batchId is mandatory' ) ;
455
+
456
+ var batchRequest = {
457
+ merchantAuthentication : self . merchantInfo ,
458
+ batchId : batchId
459
+ } ;
460
+
461
+ request . post ( generateRequestConfiguration ( self , batchRequest , 'getTransactionListRequest' ) , requestCallBack ( resolve , reject , 'getTransactionListResponse' ) ) ;
462
+ } )
463
+ } ;
464
+
430
465
module . exports = AuthorizeNet ;
0 commit comments