Попытка отправки строковой команды = "SALE,100.00"; // Команда продажи за 100 долларов США
string command = $"
SALE{amount:F2}{referenceNumber}";
Но из них отображается ошибка
"\0\fPOS0110E/003"
public async Task ProcessSale(decimal amount, string referenceNumber)
{
string command = "SALE,100.00"; // Sale command for $100
//string command = $"SALE{amount:F2}{referenceNumber}";
return await terminal.SendCommandAsync(command);
}
var manager = new PaxTerminalManager("172.16.10.212", 8888);
bool success = await manager.PerformSale(50.00m, "INV001");
if (success)
{
Console.WriteLine("Sale transaction completed successfully.");
}
else
{
Console.WriteLine("Sale transaction failed.");
}
async Task ProcessPayment()
{
var terminal = new PaxTerminal("172.16.10.212", 8888);
await terminal.ConnectAsync();
var transactions = new PaxTransactions(terminal);
try
{
string result = await transactions.ProcessSale(50.00m, "INV001");
var response = PaxResponseHandler.ParseResponse(result);
if (response.IsError)
{
Console.WriteLine($"Error occurred: {response.GetErrorMessage()}");
}
else
{
Console.WriteLine("Transaction successful");
}
// Parse the result here. The exact format will depend on your PAX terminal's configuration.
}
catch (Exception ex)
{
Console.WriteLine($"Error processing transaction: {ex.Message}");
}
finally
{
terminal.Disconnect();
}
}
PaxTerminalManager.cs
public class PaxTerminalManager
{
private PaxTerminal terminal;
private PaxTransactions transactions;
public PaxTerminalManager(string ipAddress, int port)
{
terminal = new PaxTerminal(ipAddress, port);
transactions = new PaxTransactions(terminal);
}
public async Task PerformSale(decimal amount, string referenceNumber)
{
int maxRetries = 3;
for (int attempt = 1; attempt Status == "E";
public string GetErrorMessage()
{
switch (ErrorCode)
{
case "001":
return "Invalid transaction type";
case "002":
return "Invalid amount";
case "003":
return "Communication error";
// Add more error codes as needed
default:
return "Unknown error";
}
}
}
Подробнее здесь: https://stackoverflow.com/questions/790 ... p-protocol
Попытка интегрировать Pax A-80 с .Net с использованием протокола TCPIP. ⇐ C#
Место общения программистов C#
1727268275
Anonymous
Попытка отправки строковой команды = "SALE,100.00"; // Команда продажи за 100 долларов США
string command = $"
SALE{amount:F2}{referenceNumber}";
Но из них отображается ошибка
"\0\fPOS0110E/003"
public async Task ProcessSale(decimal amount, string referenceNumber)
{
string command = "SALE,100.00"; // Sale command for $100
//string command = $"SALE{amount:F2}{referenceNumber}";
return await terminal.SendCommandAsync(command);
}
var manager = new PaxTerminalManager("172.16.10.212", 8888);
bool success = await manager.PerformSale(50.00m, "INV001");
if (success)
{
Console.WriteLine("Sale transaction completed successfully.");
}
else
{
Console.WriteLine("Sale transaction failed.");
}
async Task ProcessPayment()
{
var terminal = new PaxTerminal("172.16.10.212", 8888);
await terminal.ConnectAsync();
var transactions = new PaxTransactions(terminal);
try
{
string result = await transactions.ProcessSale(50.00m, "INV001");
var response = PaxResponseHandler.ParseResponse(result);
if (response.IsError)
{
Console.WriteLine($"Error occurred: {response.GetErrorMessage()}");
}
else
{
Console.WriteLine("Transaction successful");
}
// Parse the result here. The exact format will depend on your PAX terminal's configuration.
}
catch (Exception ex)
{
Console.WriteLine($"Error processing transaction: {ex.Message}");
}
finally
{
terminal.Disconnect();
}
}
PaxTerminalManager.cs
public class PaxTerminalManager
{
private PaxTerminal terminal;
private PaxTransactions transactions;
public PaxTerminalManager(string ipAddress, int port)
{
terminal = new PaxTerminal(ipAddress, port);
transactions = new PaxTransactions(terminal);
}
public async Task PerformSale(decimal amount, string referenceNumber)
{
int maxRetries = 3;
for (int attempt = 1; attempt Status == "E";
public string GetErrorMessage()
{
switch (ErrorCode)
{
case "001":
return "Invalid transaction type";
case "002":
return "Invalid amount";
case "003":
return "Communication error";
// Add more error codes as needed
default:
return "Unknown error";
}
}
}
Подробнее здесь: [url]https://stackoverflow.com/questions/79022735/trying-to-integrate-pax-a-80-with-net-using-tcpip-protocol[/url]
Ответить
1 сообщение
• Страница 1 из 1
Перейти
- Кемерово-IT
- ↳ Javascript
- ↳ C#
- ↳ JAVA
- ↳ Elasticsearch aggregation
- ↳ Python
- ↳ Php
- ↳ Android
- ↳ Html
- ↳ Jquery
- ↳ C++
- ↳ IOS
- ↳ CSS
- ↳ Excel
- ↳ Linux
- ↳ Apache
- ↳ MySql
- Детский мир
- Для души
- ↳ Музыкальные инструменты даром
- ↳ Печатная продукция даром
- Внешняя красота и здоровье
- ↳ Одежда и обувь для взрослых даром
- ↳ Товары для здоровья
- ↳ Физкультура и спорт
- Техника - даром!
- ↳ Автомобилистам
- ↳ Компьютерная техника
- ↳ Плиты: газовые и электрические
- ↳ Холодильники
- ↳ Стиральные машины
- ↳ Телевизоры
- ↳ Телефоны, смартфоны, плашеты
- ↳ Швейные машинки
- ↳ Прочая электроника и техника
- ↳ Фототехника
- Ремонт и интерьер
- ↳ Стройматериалы, инструмент
- ↳ Мебель и предметы интерьера даром
- ↳ Cантехника
- Другие темы
- ↳ Разное даром
- ↳ Давай меняться!
- ↳ Отдам\возьму за копеечку
- ↳ Работа и подработка в Кемерове
- ↳ Давай с тобой поговорим...
Мобильная версия