added transaction-information and void-transaction endpoints
This commit is contained in:
@@ -320,10 +320,10 @@ namespace Creditcall.ChipDna.Client
|
||||
PerformConfirmTransaction("", out TransactionConfirmation confirmation);
|
||||
break;
|
||||
case "V":
|
||||
PerformVoidTransaction();
|
||||
PerformVoidTransaction("");
|
||||
break;
|
||||
case "I":
|
||||
PerformGetTransactionInformation();
|
||||
PerformGetTransactionInformation("");
|
||||
break;
|
||||
case "K":
|
||||
PerformReleaseCard();
|
||||
@@ -738,18 +738,13 @@ namespace Creditcall.ChipDna.Client
|
||||
}
|
||||
}
|
||||
|
||||
private void PerformVoidTransaction()
|
||||
public Dictionary<string, string> PerformVoidTransaction(string referenceValue)
|
||||
{
|
||||
var reference = GetReference(true, "");
|
||||
var voidReason = GetUserInput("\r\nPlease Enter Void Reason (Optional)");
|
||||
var transactionResult = new Dictionary<string, string>();
|
||||
var parameters = new ParameterSet();
|
||||
if (!string.IsNullOrEmpty(reference))
|
||||
if (!string.IsNullOrEmpty(referenceValue))
|
||||
{
|
||||
parameters.Add(ParameterKeys.Reference, reference);
|
||||
}
|
||||
if (!String.IsNullOrEmpty(voidReason))
|
||||
{
|
||||
parameters.Add(ParameterKeys.VoidReason, voidReason);
|
||||
parameters.Add(ParameterKeys.Reference, referenceValue);
|
||||
}
|
||||
|
||||
parameters.Add(GetExtraParams("VoidTransaction"));
|
||||
@@ -777,12 +772,18 @@ namespace Creditcall.ChipDna.Client
|
||||
{
|
||||
Console.WriteLine("ErrorDescription: {0}", errorDescription);
|
||||
}
|
||||
|
||||
var responseParameter = response.ToList();
|
||||
responseParameter.ForEach(parameter =>
|
||||
{
|
||||
transactionResult.Add(parameter.Key, parameter.Value);
|
||||
});
|
||||
return transactionResult;
|
||||
}
|
||||
|
||||
private void PerformGetTransactionInformation()
|
||||
public Dictionary<string, string> PerformGetTransactionInformation(string referenceValue)
|
||||
{
|
||||
var referenceValue = GetReference(true, "");
|
||||
|
||||
var result = new Dictionary<string, string>();
|
||||
var parameters = new ParameterSet();
|
||||
if (!string.IsNullOrEmpty(referenceValue))
|
||||
{
|
||||
@@ -793,18 +794,11 @@ namespace Creditcall.ChipDna.Client
|
||||
var response = chipDnaClientLib.GetTransactionInformation(parameters);
|
||||
|
||||
var responseParameter = response.ToList();
|
||||
|
||||
responseParameter.ForEach(parameter =>
|
||||
{
|
||||
if (parameter.Key == ParameterKeys.Errors)
|
||||
{
|
||||
Console.WriteLine(ErrorsString("GetTransactionInformation Errors", parameter.Value));
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("{0} {1}", parameter.Key, parameter.Value);
|
||||
}
|
||||
});
|
||||
result.Add(parameter.Key, parameter.Value);
|
||||
});
|
||||
return result;
|
||||
}
|
||||
|
||||
private static string GetUserInput(string prompt)
|
||||
|
||||
Reference in New Issue
Block a user