V2MerchantComplaintUpdateRefundprogressRequestDemo.cs 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. using System;
  2. using System.Collections.Generic;
  3. using BasePaySdk;
  4. using BasePaySdk.Request;
  5. using Newtonsoft.Json;
  6. using Newtonsoft.Json.Linq;
  7. namespace BasePayDemo
  8. {
  9. /**
  10. * 更新退款审批结果 - 示例
  11. *
  12. * @author sdk-generator
  13. * @Description
  14. */
  15. public class V2MerchantComplaintUpdateRefundprogressRequestDemo
  16. {
  17. public static void V2MerchantComplaintUpdateRefundprogressRequestDemoTest()
  18. {
  19. // 1. 数据初始化
  20. InitMerConfig.init();
  21. // 2.组装请求参数
  22. V2MerchantComplaintUpdateRefundprogressRequest request = new V2MerchantComplaintUpdateRefundprogressRequest();
  23. // 请求流水号
  24. request.setReqSeqId(DateTime.Now.ToString("yyy-MM-dd HH.mm.ss.fff"));
  25. // 请求时间
  26. request.setReqDate(DateTime.Now.ToString("yyyyMMdd"));
  27. // 投诉单号
  28. request.setComplaintId("200000020221020220032600930");
  29. // 审批动作
  30. request.setAction("APPROVE");
  31. // 微信商户号
  32. request.setMchId("1502074862");
  33. // 设置非必填字段
  34. Dictionary<string, object> extendInfoMap = getExtendInfos();
  35. request.setExtendInfo(extendInfoMap);
  36. try {
  37. // 3. 发起API调用
  38. // 调用接口,使用默认商户配置时可省略配置key
  39. Dictionary<string, Object> result = null;
  40. result = BasePayClient.postRequest(request,null);
  41. // 使用指定配置调用接口
  42. // result = BasePayClient.postRequest(request,null,"merchantKey2");
  43. Console.WriteLine(JsonConvert.SerializeObject(result));
  44. }
  45. catch (Exception ex) {
  46. Console.WriteLine(ex);
  47. }
  48. }
  49. /**
  50. * 非必填字段
  51. * @return
  52. */
  53. private static Dictionary<string, object> getExtendInfos() {
  54. // 设置非必填字段
  55. Dictionary<string, object> extendInfoMap = new Dictionary<string, object>();
  56. // 预计发起退款时间
  57. extendInfoMap.Add("launch_refund_day", "");
  58. // 拒绝退款原因
  59. extendInfoMap.Add("reject_reason", "");
  60. // 备注
  61. extendInfoMap.Add("remark", "我是备注1111101");
  62. // 文件列表
  63. extendInfoMap.Add("file_info", getFileInfo());
  64. return extendInfoMap;
  65. }
  66. private static string getFileInfo() {
  67. Dictionary<string, object> obj = new Dictionary<string, object>();
  68. // 拒绝退款的举证图片1
  69. obj.Add("reject_media_pic1", "a8a096a3-0dd4-3b0e-886c-9afb20d23b1a");
  70. // 拒绝退款的举证图片2
  71. obj.Add("reject_media_pic2", "a8a096a3-0dd4-3b0e-886c-9afb20d23b2a");
  72. // 拒绝退款的举证图片3
  73. obj.Add("reject_media_pic3", "a8a096a3-0dd4-3b0e-886c-9afb20d23b3a");
  74. // 拒绝退款的举证图片4
  75. obj.Add("reject_media_pic4", "a8a096a3-0dd4-3b0e-886c-9afb20d23b4a");
  76. return JsonConvert.SerializeObject(obj);
  77. }
  78. }
  79. }