PosController.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using SinochemCloudClient.Models;
  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. using System.Web.Http;
  9. using System.Windows.Forms;
  10. namespace CloudSimulator.Controllers
  11. {
  12. public class PosController : ApiController
  13. {
  14. CloudForm cloudForm = (CloudForm)Application.OpenForms["CloudForm"];
  15. [Route("pay/iotNotify")]
  16. [HttpPost]
  17. public TrxNotificationResponse PosNotify([FromBody] TrxNotificationRequest request)
  18. {
  19. cloudForm.AppendTextThreadSafe(Environment.NewLine + "Pos notify request:");
  20. cloudForm.AppendTextThreadSafe(request.ToString());
  21. TrxNotificationResponse response = new TrxNotificationResponse
  22. {
  23. status = TrxNotificationResponse.SuccessResponse
  24. };
  25. cloudForm.AppendTextThreadSafe(Environment.NewLine + "Pos notify response:");
  26. cloudForm.AppendTextThreadSafe(response.ToString());
  27. return response;
  28. }
  29. }
  30. }