File tree Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Expand file tree Collapse file tree 2 files changed +27
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,22 @@ void CheckForErrors(ANetApiResponse response) {
99
99
if ( response . GetType ( ) == typeof ( createCustomerProfileTransactionResponse ) ) {
100
100
//there's a directResponse we need to find...
101
101
var thingy = ( createCustomerProfileTransactionResponse ) response ;
102
- thingy . directResponse = _xmlDoc . ChildNodes [ 1 ] . ChildNodes [ 1 ] . InnerText ;
102
+ thingy . directResponse = null ;
103
+ for ( var i = 0 ; i <= 1 ; i ++ )
104
+ {
105
+ if ( null != _xmlDoc && null != _xmlDoc . ChildNodes [ i ] )
106
+ {
107
+ for ( var j = 0 ; j <= 1 ; j ++ )
108
+ {
109
+ if ( null != _xmlDoc . ChildNodes [ i ] . ChildNodes [ j ] )
110
+ {
111
+ thingy . directResponse = _xmlDoc . ChildNodes [ i ] . ChildNodes [ j ] . InnerText ;
112
+ }
113
+ if ( null != thingy . directResponse ) { break ; }
114
+ }
115
+ }
116
+ if ( null != thingy . directResponse ) { break ; }
117
+ }
103
118
response = thingy ;
104
119
} else {
105
120
Original file line number Diff line number Diff line change @@ -982,5 +982,16 @@ public void SendTest_AuthOnly_ExtraOptions()
982
982
Assert . IsTrue ( actual . TransactionID . Trim ( ) . Length > 0 ) ;
983
983
Assert . IsTrue ( long . Parse ( actual . TransactionID ) > 0 ) ;
984
984
}
985
+
986
+ [ Test ]
987
+ public void TestCheckForErrorscreateCustomerProfileTransactionResponse ( )
988
+ {
989
+ const string profileId = "24231938" ;
990
+ const string paymentProfileId = "22219473" ;
991
+ var gateway = new CustomerGateway ( ApiLogin , TransactionKey ) ;
992
+ var order = new Order ( profileId , paymentProfileId , "" ) { Amount = ( decimal ) 25.10 } ;
993
+ var response = gateway . AuthorizeAndCapture ( order ) ;
994
+ Assert . IsNotNull ( response ) ;
995
+ }
985
996
}
986
997
}
You can’t perform that action at this time.
0 commit comments