BaseResponse.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Newtonsoft.Json;
  2. using Newtonsoft.Json.Serialization;
  3. using PaySharp.Core.Request;
  4. using PaySharp.Core.Response;
  5. namespace PaySharp.Alipay.Response
  6. {
  7. [JsonObject(NamingStrategyType = typeof(SnakeCaseNamingStrategy))]
  8. public abstract class BaseResponse : IResponse
  9. {
  10. /// <summary>
  11. /// 网关返回码,详见文档
  12. /// https://docs.open.alipay.com/common/105806
  13. /// </summary>
  14. public string Code { get; set; }
  15. /// <summary>
  16. /// 网关返回码描述,详见文档
  17. /// https://docs.open.alipay.com/common/105806
  18. /// </summary>
  19. [JsonProperty("msg")]
  20. public string Message { get; set; }
  21. /// <summary>
  22. /// 网关返回码,详见文档
  23. /// https://docs.open.alipay.com/common/105806
  24. /// </summary>
  25. public string SubCode { get; set; }
  26. /// <summary>
  27. /// 网关返回码描述,详见文档
  28. /// https://docs.open.alipay.com/common/105806
  29. /// </summary>
  30. [JsonProperty("sub_msg")]
  31. public string SubMessage { get; set; }
  32. /// <summary>
  33. /// 签名
  34. /// </summary>
  35. public string Sign { get; set; }
  36. /// <summary>
  37. /// 原始值
  38. /// </summary>
  39. public string Raw { get; set; }
  40. internal abstract void Execute<TModel, TResponse>(Merchant merchant, Request<TModel, TResponse> request) where TResponse : IResponse;
  41. }
  42. }