TradePush.cs 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using WdtSdk;
  7. namespace TradePush
  8. {
  9. class TradePush
  10. {
  11. static void Main(string[] args)
  12. {
  13. WdtClient client = new WdtClient();
  14. client.sid = "";
  15. client.appkey = "";
  16. client.appsecret = "";
  17. client.gatewayUrl = "http://121.41.177.115/openapi2/trade_push.php";
  18. var trade_list = new[]
  19. {
  20. new
  21. {
  22. tid = "TestTid45235678987654",
  23. trade_status = "30",
  24. delivery_term = "1",
  25. trade_time = "0000-00-00 00:00:00",
  26. pay_time = "0000-00-00 00:00:00",
  27. buyer_nick = "ceshi",
  28. buyer_email = "123456234533@mail.com",
  29. receiver_mobile = "13233456110",
  30. receiver_telno = "1234563567",
  31. receiver_zip = "0000000",
  32. receiver_province= "北京",
  33. receiver_name = "亚历山大",
  34. receiver_city = "北京市",
  35. receiver_district= "海淀区",
  36. receiver_address = "乌鲁木齐市新疆乌鲁木齐市西山路82号009信箱",
  37. logistics_type = "4",
  38. invoice_type = "0",
  39. invoice_title = "",
  40. invoice_content = "发票内容+",
  41. buyer_message = "发最好&&&的+",
  42. remark = "测试专用",
  43. remark_flag = "1",
  44. paid = "399",
  45. post_amount = "0",
  46. cod_amount = "0",
  47. ext_cod_fee = "0",
  48. order_list = new[]
  49. {
  50. new{
  51. oid = "TestOid3456789876543",
  52. status = "30",
  53. refund_status = "0",
  54. goods_id = "E166D18BAAEA420CB132E105B3B6128A",
  55. spec_id = "567898765",
  56. goods_no = "",
  57. spec_no = "9787533951092",
  58. goods_name = "情商是什么?——关于生活智慧的44个故事",
  59. spec_name = "",
  60. num = "1",
  61. price = "399",
  62. adjust_amount = "0",
  63. discount = "0",
  64. share_discount = "0",
  65. cid = "13",
  66. remark = "ceshiceshiceshi"
  67. }
  68. }
  69. }
  70. };
  71. String json = trade_list.ToJsonString();
  72. client.putParams("trade_list", json);
  73. client.putParams("shop_no", "api_test");
  74. client.putParams("switch", "0");
  75. string result = client.wdtOpenapi();
  76. Console.WriteLine(result);
  77. Console.ReadKey();
  78. }
  79. }
  80. }