SocialPay
Make transactions using the SocialPay app. There are 2 options: create QR and send invoice to customers phone number. Either can be used depending on the situation.
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 |
request.CardEntryMode | Card read type | Send 8 to generate QR and 9 to invoice by phone number. |
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 = "20000";
request.CurrencyCode = "496";
request.CardEntryMode = 8;
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.Amount);
}
else
{
Console.WriteLine("Transaction Failed");
Console.WriteLine("Error reason:" + response.TextResponse);
}
}
catch (Exception e)
{
Console.WriteLine("Exception during DualConnector: " + e.Message);
}
Console.ReadKey();
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 = "20000";
request.CurrencyCode = "496";
request.CardEntryMode = 9;
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.Amount);
}
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. |