File tree Expand file tree Collapse file tree 5 files changed +43
-2
lines changed Expand file tree Collapse file tree 5 files changed +43
-2
lines changed Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ public string ResponseCode {
78
78
return ParseResponse ( 0 ) ;
79
79
}
80
80
}
81
- public string ReasonResponseCode
81
+ public string ResponseReasonCode
82
82
{
83
83
get
84
84
{
Original file line number Diff line number Diff line change @@ -9,5 +9,7 @@ public interface IGatewayResponse {
9
9
string ResponseCode { get ; }
10
10
string Message { get ; }
11
11
string TransactionID { get ; }
12
+ string ResponseReasonCode { get ; }
13
+ string GetValueByIndex ( int position ) ;
12
14
}
13
15
}
Original file line number Diff line number Diff line change @@ -36,6 +36,12 @@ public string ResponseCode {
36
36
return FindKey ( "x_response_code" ) ;
37
37
}
38
38
}
39
+
40
+ public string ResponseReasonCode
41
+ {
42
+ get { throw new NotImplementedException ( ) ; }
43
+ }
44
+
39
45
public string Message {
40
46
get {
41
47
return FindKey ( "x_response_reason_text" ) ;
@@ -101,6 +107,21 @@ string FindKey(string key) {
101
107
return result ;
102
108
}
103
109
110
+ public string GetValueByIndex ( int position )
111
+ {
112
+ return ParseResponse ( position ) ;
113
+ }
114
+
115
+ internal string ParseResponse ( int index )
116
+ {
117
+ var result = "" ;
118
+ if ( _post . AllKeys . Count ( ) > index )
119
+ {
120
+ result = _post [ index ] ;
121
+ }
122
+ return result ;
123
+ }
124
+
104
125
public override string ToString ( ) {
105
126
var sb = new StringBuilder ( ) ;
106
127
sb . AppendFormat ( "<li>Code = {0}" , this . ResponseCode ) ;
Original file line number Diff line number Diff line change @@ -158,6 +158,14 @@ public string ResponseCode {
158
158
get { return ParseResponse ( 1 ) ; }
159
159
}
160
160
161
+ /// <summary>
162
+ /// Gets the response reason code.
163
+ /// </summary>
164
+ /// <value>The response reason code.</value>
165
+ public string ResponseReasonCode {
166
+ get { return ParseResponse ( 2 ) ; }
167
+ }
168
+
161
169
/// <summary>
162
170
/// Gets the message.
163
171
/// </summary>
@@ -174,6 +182,16 @@ public string TransactionID {
174
182
get { return ParseResponse ( 7 ) ; }
175
183
}
176
184
185
+ /// <summary>
186
+ /// Gets the value by index
187
+ /// </summary>
188
+ /// <param name="position">position of the response to be returned</param>
189
+ /// <returns>Returns index value.</returns>
190
+ public string GetValueByIndex ( int position )
191
+ {
192
+ return ParseResponse ( position ) ;
193
+ }
194
+
177
195
#endregion
178
196
}
179
197
}
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ public void SendTest_FailedCredit_ReasonResponseCode()
217
217
Assert . AreEqual ( expected . Approved , actual . Approved ) ;
218
218
Assert . AreEqual ( expected . Message , actual . Message ) ;
219
219
Assert . AreEqual ( expected . ResponseCode , actual . ResponseCode ) ;
220
- Assert . AreEqual ( ( ( GatewayResponse ) expected ) . ReasonResponseCode , ( ( GatewayResponse ) expected ) . ReasonResponseCode ) ;
220
+ Assert . AreEqual ( ( ( GatewayResponse ) expected ) . ResponseReasonCode , ( ( GatewayResponse ) expected ) . ResponseReasonCode ) ;
221
221
222
222
Assert . IsTrue ( actual . TransactionID . Trim ( ) . Length > 0 ) ;
223
223
Assert . AreEqual ( expected . TransactionID , actual . TransactionID ) ;
You can’t perform that action at this time.
0 commit comments