CardCreateInfo.cs 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. #region Apache License Version 2.0
  2. /*----------------------------------------------------------------
  3. Copyright 2019 Jeffrey Su & Suzhou Senparc Network Technology Co.,Ltd.
  4. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file
  5. except in compliance with the License. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software distributed under the
  8. License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
  9. either express or implied. See the License for the specific language governing permissions
  10. and limitations under the License.
  11. Detail: https://github.com/JeffreySu/WeiXinMPSDK/blob/master/license.md
  12. ----------------------------------------------------------------*/
  13. #endregion Apache License Version 2.0
  14. /*----------------------------------------------------------------
  15. Copyright (C) 2019 Senparc
  16. 文件名:CardCreateInfo.cs
  17. 文件功能描述:创建卡券数据
  18. 创建标识:Senparc - 20150211
  19. 修改标识:Senparc - 20150303
  20. 修改描述:整理接口
  21. ----------------------------------------------------------------*/
  22. namespace Senparc.Weixin.MP.AdvancedAPIs.Card
  23. {
  24. /// <summary>
  25. /// 创建卡券数据
  26. /// </summary>
  27. public class CardCreateInfo
  28. {
  29. #region JSON示例
  30. /*
  31. { "card": {
  32. "card_type": "GROUPON",
  33. "groupon": {
  34. "base_info": {
  35. "logo_url":"http:\/\/www.supadmin.cn\/uploads\/allimg\/120216\/1_120216214725_1.jpg",
  36. "brand_name":"海底捞",
  37. "code_type":"CODE_TYPE_TEXT",
  38. "title": "132 元双人火锅套餐",
  39. "sub_title": "",
  40. "color": "Color010",
  41. "notice": "使用时向服务员出示此券",
  42. "service_phone": "020-88888888",
  43. "description": "不可与其他优惠同享\n 如需团购券发票,请在消费时向商户提出\n 店内均可
  44. 使用,仅限堂食\n 餐前不可打包,餐后未吃完,可打包\n 本团购券不限人数,建议2 人使用,超过建议人
  45. 数须另收酱料费5 元/位\n 本单谢绝自带酒水饮料",
  46. "date_info": {
  47. "type": 1,
  48. "begin_timestamp": 1397577600 ,
  49. "end_timestamp": 1422724261
  50. },
  51. "sku": {
  52. "quantity": 50000000
  53. },
  54. "get_limit": 3,
  55. "use_custom_code": false,
  56. "bind_openid": false,
  57. "can_share": true,
  58. "can_give_friend": true,
  59. "location_id_list" : [123, 12321, 345345],
  60. "url_name_type": "URL_NAME_TYPE_RESERVATION",
  61. "custom_url": "http://www.qq.com",
  62. "source": "大众点评"
  63. },
  64. "deal_detail": "以下锅底2 选1(有菌王锅、麻辣锅、大骨锅、番茄锅、清补凉锅、酸菜鱼锅可
  65. 选):\n 大锅1 份12 元\n 小锅2 份16 元\n 以下菜品2 选1\n 特级肥牛1 份30 元\n 洞庭鮰鱼卷1 份
  66. 20 元\n 其他\n 鲜菇猪肉滑1 份18 元\n 金针菇1 份16 元\n 黑木耳1 份9 元\n 娃娃菜1 份8 元\n 冬
  67. 瓜1 份6 元\n 火锅面2 个6 元\n 欢乐畅饮2 位12 元\n 自助酱料2 位10 元"
  68. }
  69. }
  70. }
  71. 2017年9月27日从文档(https://mp.weixin.qq.com/wiki?action=doc&id=mp1451025292&t=0.17126486297633403#1.7)更新:
  72. 多了sub_merchant_info这个参数
  73. {
  74. "card": {
  75. "card_type": "GROUPON",
  76. "groupon": {
  77. "base_info": {
  78. "sub_merchant_info": {
  79. "merchant_id": 123456
  80. },
  81. "logo_url": "http://mmbiz.qpic.cn/mmbiz/iaL1LJM1mF9aRKPZJkmG8xXhiaHqkKSVMMWeN3hLut7X7hicFNjakmxibMLGWpXrEXB33367o7zHN0CwngnQY7zb7g/0",
  82. "brand_name": "海底捞",
  83. "code_type": "CODE_TYPE_TEXT",
  84. "title": "132元双人火锅套餐",
  85. "sub_title": "周末狂欢必备",
  86. "color": "Color010",
  87. "notice": "使用时向服务员出示此券",
  88. "service_phone": "020-88888888",
  89. "description": "不可与其他优惠同享\n如需团购券发票,请在消费时向商户提出\n店内均可使用,仅限堂食",
  90. "date_info": {
  91. "type": "DATE_TYPE_FIX_TIME_RANGE",
  92. "begin_timestamp": 1397577600,
  93. "end_timestamp": 1422724261
  94. },
  95. "sku": {
  96. "quantity": 500000
  97. },
  98. "get_limit": 3,
  99. "use_custom_code": false,
  100. "bind_openid": false,
  101. "can_share": true,
  102. "can_give_friend": true,
  103. "location_id_list": [
  104. 123,
  105. 12321,
  106. 345345
  107. ],
  108. "custom_url_name": "立即使用",
  109. "custom_url": "http://www.qq.com",
  110. "custom_url_sub_title": "6个汉字tips",
  111. "promotion_url_name": "更多优惠",
  112. "promotion_url": "http://www.qq.com",
  113. "source": "大众点评"
  114. },
  115. "deal_detail": "以下锅底2选1(有菌王锅、麻辣锅、大骨锅、番茄锅、清补凉锅、酸菜鱼锅可选):\n大锅1份 12元\n小锅2份 16元 "
  116. }
  117. }
  118. }
  119. */
  120. #endregion
  121. /// <summary>
  122. /// 卡券信息部分
  123. /// </summary>
  124. public CardCreateInfo_Card card { get; set; }
  125. }
  126. }