AlipayTradePayContentBuilder.cs 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. using Com.Alipay.Model;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Web;
  5. // using System.Web.Script.Serialization;
  6. namespace Com.Alipay.Domain
  7. {
  8. /// <summary>
  9. /// AlipayTradePayContentBuilder 的摘要说明
  10. /// </summary>
  11. public class AlipayTradePayContentBuilder : JsonBuilder
  12. {
  13. public string out_trade_no {get;set;}
  14. public string seller_id {get;set;}
  15. public string total_amount { get; set; }
  16. public string discountable_amount { get; set; }
  17. public string undiscountable_amount { get; set; }
  18. public string subject { get; set; }
  19. public string body { get; set; }
  20. public List<GoodsInfo> goods_detail{get;set;}
  21. public string operator_id { get; set; }
  22. public string store_id { get; set; }
  23. public string terminal_id { get; set; }
  24. public ExtendParams extend_params;
  25. public string timeout_express { get; set; }
  26. public AlipayTradePayContentBuilder()
  27. {
  28. this.scene = "bar_code";
  29. }
  30. public string scene { get; set; }
  31. public string auth_code { get; set; }
  32. public override bool Validate()
  33. {
  34. if (String.IsNullOrEmpty(scene))
  35. {
  36. throw new NullReferenceException("scene should not be NULL!");
  37. }
  38. if (String.IsNullOrEmpty(auth_code))
  39. {
  40. throw new NullReferenceException("auth_code should not be NULL!");
  41. }
  42. return true;
  43. }
  44. }
  45. }