i want create payment by my custom EFTPOS device
and this my api code for sending amount and received result
private void SEND()
{
try
{
if (terminalSerialPort.IsOpen)
{
terminalSerialPort.Close();
}
terminalSerialPort.PortName = cmbSerialPortNames.SelectedValue.ToString();
terminalSerialPort.BaudRate = 115200;
terminalSerialPort.Open();
terminalSerialPort.DataReceived = new SerialDataReceivedEventHandler(DataReceivedHandler);
//terminalSerialPort.WriteLine("\x02GETCONFIG0\x03");
// terminalSerialPort.WriteLine("\x02" textBox1.Text "\x03");
System.Globalization.CultureInfo info = System.Threading.Thread.CurrentThread.CurrentCulture;
string s = Decimal.Parse(textBox1.Text).ToString("0000000000.00", info).Replace(info.NumberFormat.NumberDecimalSeparator, String.Empty);
byte[] bytes = System.Text.Encoding.ASCII.GetBytes("0005" s);
terminalSerialPort.Write(STX, 0, 1);
terminalSerialPort.Write(bytes, 0, bytes.Length);
terminalSerialPort.Write(ETX, 0, 1);
}
catch (Exception ex)
{
MessageBox.Show(ex.Message, "ERROR", MessageBoxButtons.OK, MessageBoxIcon.Error);
return;
}
}
so i've started worked on PaymentDeviceSample and i'm new in D365 development
where i must include or call my API code in PaymentDeviceSample ?

Report
All responses (
Answers (