public static Messages.Response EpaymentProcess(Messages.Request request) { float amount = request.Parameters.Value <float>("amount"); string device = request.Parameters.Value <string>("device"); string protocol = request.Parameters.Value <string>("protocol"); string port = request.Parameters.Value <string>("port"); string data = request.Parameters.Value <string>("data"); int pos = request.Parameters.Value <int>("pos"); PaymentRequest paymentRequest = new PaymentRequest(amount); ConcertProtocol concertProtocol = ConcertProtocol.find(protocol); concertProtocol.Terminal = new SerialTerminal(port); Issue issue = concertProtocol.SendPaymentRequest(paymentRequest); if (issue.Type == Issue.SUCCESS) { return(request.Success(issue.Response)); } else { return(request.Failure("", issue.Message)); } }
public static Messages.Response EpaymentPing(Messages.Request request) { string device = request.Parameters.Value <string>("device"); string port = request.Parameters.Value <string>("port"); string protocol = request.Parameters.Value <string>("protocol"); ConcertProtocol concertProtocol = ConcertProtocol.find(protocol); concertProtocol.Terminal = new SerialTerminal(port); concertProtocol.SendTest(); return(request.Success(true)); }