TestNormalCases.cs 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using SinochemPosClient;
  2. using SinochemPosClient.Models;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. namespace TestSinochemPosClient
  9. {
  10. public class TestNormalCases
  11. {
  12. private const string UrlPrefix = "http://10.26.5.59:8082/self_terminal_fj";
  13. private const string TrxNotifyApi = "/pay/iotNotify";
  14. public static void TestTrxNotificationToPos()
  15. {
  16. PosCommunicator<TrxNotificationRequest, TrxNotificationResponse> communicator =
  17. new PosCommunicator<TrxNotificationRequest, TrxNotificationResponse>(UrlPrefix + TrxNotifyApi);
  18. TrxNotificationRequest request = new TrxNotificationRequest
  19. {
  20. ticketId = "1234567890",
  21. person = "pump",
  22. cardNo = "88881180010002895352",
  23. cardType = "1",
  24. oilName = "92#",
  25. units = 12.22,
  26. price = 6.43,
  27. totalAmount = 100.00,
  28. amount = 90,
  29. oilLiuShuiNo = "2018040307",
  30. gunNum = "4",
  31. oilTime = "22:30:21",
  32. cardDiscount = 10.00,
  33. promDiscount = 0.00,
  34. payMethod = "01",
  35. transId = "110000453687"
  36. };
  37. Console.WriteLine("before send " + request.GetType().ToString());
  38. communicator.SendRequest(request);
  39. Console.WriteLine("got response messasge code: " + communicator.Response.status);
  40. }
  41. }
  42. }