@@ -44,6 +44,36 @@ public function testGetTransactionList()
4444 $ this ->assertTrue ($ response ->isOk ());
4545 }
4646
47+ public function testGetTransactionListReturnedItems ()
48+ {
49+ $ request = new AuthorizeNetTD ;
50+ $ batchId = 0 ; // Set your $batchId here
51+ $ response = $ request ->getTransactionList ($ batchId );
52+ $ this ->assertTrue ($ response ->isOk ());
53+ $ transactions = $ response ->xpath ("transactions/transaction " );
54+ $ transId = $ transactions [0 ]->transId ;
55+
56+ $ details = new AuthorizeNetTD ;
57+ $ response = $ details ->getTransactionDetails ($ transId );
58+ $ this ->assertTrue ($ response ->isOk ());
59+ $ transaction = $ response ->xml ->transaction [0 ];
60+ $ this ->assertFalse (empty ($ transaction ->returnedItems ));
61+
62+ }
63+
64+
65+ public function testGetTransactionListSubscription ()
66+ {
67+ $ transId = 0 ; // Set your $transId here
68+
69+ $ details = new AuthorizeNetTD ;
70+ $ response = $ details ->getTransactionDetails ($ transId );
71+ $ this ->assertTrue ($ response ->isOk ());
72+ $ transaction = $ response ->xml ->transaction [0 ];
73+
74+ $ this ->assertFalse (empty ($ transaction ->subscription ));
75+ }
76+
4777 public function testGetTransactionDetails ()
4878 {
4979 $ sale = new AuthorizeNetAIM ;
@@ -63,6 +93,27 @@ public function testGetTransactionDetails()
6393
6494 }
6595
96+
97+ public function testGetTransactionDetailsWithSolutionId ()
98+ {
99+ $ sale = new AuthorizeNetAIM ;
100+ $ amount = rand (1 , 100 );
101+ $ sale ->setCustomField ('x_solution_id ' , 'A1000002 ' );
102+ $ response = $ sale ->authorizeAndCapture ($ amount , '4012888818888 ' , '04/17 ' );
103+ $ this ->assertTrue ($ response ->approved );
104+
105+ $ transId = $ response ->transaction_id ;
106+
107+ $ request = new AuthorizeNetTD ;
108+ $ response = $ request ->getTransactionDetails ($ transId );
109+ $ this ->assertTrue ($ response ->isOk ());
110+
111+ $ this ->assertEquals ($ transId , (string )$ response ->xml ->transaction ->transId );
112+ $ this ->assertEquals ($ amount , (string )$ response ->xml ->transaction ->authAmount );
113+ $ this ->assertEquals ("Visa " , (string )$ response ->xml ->transaction ->payment ->creditCard ->cardType );
114+ $ this ->assertEquals ("A1000002 " , (string )$ response ->xml ->transaction ->solution ->id );
115+ }
116+
66117 public function testGetUnsettledTransactionList ()
67118 {
68119 $ sale = new AuthorizeNetAIM ;
@@ -76,6 +127,23 @@ public function testGetUnsettledTransactionList()
76127 $ this ->assertTrue ($ response ->xml ->transactions ->count () >= 1 );
77128 }
78129
130+ public function testGetUnsettledTransactionListHasNoReturnedItems ()
131+ {
132+ $ request = new AuthorizeNetTD ;
133+ $ response = $ request ->getUnsettledTransactionList ();
134+ $ this ->assertTrue ($ response ->isOk ());
135+ $ this ->assertTrue ($ response ->xml ->transactions ->count () >= 1 );
136+
137+ foreach ($ response ->xml ->transactions ->transaction as $ transaction )
138+ {
139+ if ($ transaction ->hasReturnedItems )
140+ {
141+ $ this ->assertEquals ("false " , $ transaction ->hasReturnedItems );
142+ }
143+ }
144+ }
145+
146+
79147 public function testGetBatchStatistics ()
80148 {
81149 $ request = new AuthorizeNetTD ;
0 commit comments