@@ -115,7 +115,10 @@ AuthorizeNet.prototype.authCaptureTransaction = function authCaptureTransaction(
115115 assert ( expirationYear , 'expirationYear is required' ) ;
116116 assert ( expirationMonth , 'expirationMonth is required' ) ;
117117
118- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
118+ var creditCard = {
119+ cardNumber : cardNumber ,
120+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
121+ } ;
119122 var transactionRequest = {
120123 transactionRequest : {
121124 amount : amount ,
@@ -162,7 +165,10 @@ AuthorizeNet.prototype.authOnlyTransaction = function authOnlyTransaction(amount
162165 assert ( expirationYear , 'expirationYear is required' ) ;
163166 assert ( expirationMonth , 'expirationMonth is required' ) ;
164167
165- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
168+ var creditCard = {
169+ cardNumber : cardNumber ,
170+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
171+ } ;
166172 var transactionRequest = {
167173 merchantAuthentication : self . merchantInfo ,
168174 transactionRequest : {
@@ -221,6 +227,16 @@ AuthorizeNet.prototype.priorAuthCaptureTransaction = function captureOnlyTransac
221227 } ) ;
222228} ;
223229
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+ */
224240AuthorizeNet . prototype . refundTransaction = function refundTransaction ( refTransId , amount , cardNumber , expirationYear , expirationMonth , other ) {
225241 var self = this ;
226242
@@ -232,7 +248,10 @@ AuthorizeNet.prototype.refundTransaction = function refundTransaction(refTransId
232248 assert ( expirationYear , 'expirationYear is required' ) ;
233249 assert ( expirationMonth , 'expirationMonth is required' ) ;
234250
235- var creditCard = { cardNumber : cardNumber , expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( ) } ;
251+ var creditCard = {
252+ cardNumber : cardNumber ,
253+ expirationDate : expirationYear . toString ( ) + '-' + expirationMonth . toString ( )
254+ } ;
236255 var transactionRequest = {
237256 merchantAuthentication : self . merchantInfo ,
238257 transactionRequest : {
@@ -427,4 +446,20 @@ AuthorizeNet.prototype.getBatchStatistics = function getBatchStatistics(batchId)
427446 } ) ;
428447} ;
429448
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+
430465module . exports = AuthorizeNet ;
0 commit comments