Transaction
Make a purchase or transaction from the customer's card.
Description of Response object
Request object | Purpose | Description |
---|---|---|
request.operationCode | Operation number | Will send constant 1 |
request.TerminalID | Terminal ID | IPPOS terminal ID given by the bank. Each cash register has a different terminal ID. |
request.Amount | Transaction amount | Transaction amount. The last 2 digits are fractions. |
request.CurrencyCode | Currency | Will send constant 496. |
C# Sample code
DualConnector.DCLink dclink = new DualConnector.DCLink();
DualConnector.ISAPacket request = new DualConnector.SAPacket();
DualConnector.ISAPacket response = new DualConnector.SAPacket();
request.OperationCode = 1;
request.TerminalID = "13133707";
request.Amount = "10000";
request.CurrencyCode = "496";
try
{
int res = dclink.InitResources();
if (res != 0)
{
Console.WriteLine("Exception during InitResource: " + dclink.ErrorDescription);
}
else
{
res = dclink.Exchange(ref request, ref response, 5000000);
if (res != 0)
{
Console.WriteLine("Exception during DCExchange: " + dclink.ErrorDescription);
}
}
dclink.FreeResources();
if (response.Status == 1)
{
Console.WriteLine("Transaction Successful");
Console.WriteLine("Картын дугаар: " + response.PAN +
"\nЗөвшөөрлийн код: " + response.AuthorizationCode +
"\nТерминал дугаар: " + response.TerminalID +
"\nМерчант дугаар: " + response.MerchantID +
"\nГүйлгээний дүн: " + response.Amount +
"\nХаргалзах дугаар: " + response.ReferenceNumber);
}
else
{
Console.WriteLine("Transaction Failed");
Console.WriteLine("Error reason:" + response.TextResponse);
}
}
catch (Exception e)
{
Console.WriteLine("Exception during DualConnector: " + e.Message);
}
Console.ReadKey();
Description of the Response object
Response object | Purpose | Description |
---|---|---|
response.status | Transaction status | Response code of 1 is considered transaction is successful. If the response code is anything else, the transaction is considered unsuccessful. |
response.TextResponse | Error description | Contains an error description when the operation fails. |
response.Pan | Card Number | Print on transaction receipt. |
response.AuthorizationCode | Approval code | Print on transaction receipt. |
response.TerminalID | Terminal ID | Print on transaction receipt. |
response.MerchantID | Merchant ID | Print on transaction receipt. |
response.Amount | Transaction ID | Print on transaction receipt. |
response.ReferenceNumber | Reference number | Print on transaction receipt. |