WxRefundOrder.java 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  1. package com.cyksj.model.dto;
  2. import com.fasterxml.jackson.annotation.JsonProperty;
  3. import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlCData;
  4. import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
  5. import lombok.Getter;
  6. import lombok.Setter;
  7. /**
  8. * 微信H5支付 申请退款
  9. * https://pay.weixin.qq.com/wiki/doc/api/H5.php?chapter=9_4&index=4
  10. *
  11. * @author zzj
  12. * @date 2019/3/24 15:02
  13. */
  14. @Getter
  15. @Setter
  16. @JacksonXmlRootElement(localName = "xml")
  17. public class WxRefundOrder {
  18. /**
  19. * 公众号appid
  20. */
  21. @JacksonXmlCData
  22. private String appid;
  23. /**
  24. * 商户号
  25. */
  26. @JacksonXmlCData
  27. @JsonProperty("mch_id")
  28. private String mchId;
  29. /**
  30. * 随机字符串
  31. */
  32. @JacksonXmlCData
  33. @JsonProperty("nonce_str")
  34. private String nonceStr;
  35. /**
  36. * 签名
  37. */
  38. @JacksonXmlCData
  39. private String sign;
  40. /**
  41. * 微信订单号 在支付通知中有返回
  42. */
  43. @JacksonXmlCData
  44. @JsonProperty("transaction_id")
  45. private String transactionId;
  46. /**
  47. * 商户退款单号 同一退款单号多次请求只退一笔
  48. */
  49. @JacksonXmlCData
  50. @JsonProperty("out_refund_no")
  51. private String outRefundNo;
  52. /**
  53. * 订单总金额 单位为分
  54. */
  55. @JacksonXmlCData
  56. @JsonProperty("total_fee")
  57. private Integer totalFee;
  58. /**
  59. * 退款金额 单位为分 可以做部分退款
  60. */
  61. @JacksonXmlCData
  62. @JsonProperty("refund_fee")
  63. private Integer refundFee;
  64. /**
  65. * 退款原因
  66. */
  67. @JacksonXmlCData
  68. @JsonProperty("refund_desc")
  69. private String refundDesc;
  70. /**
  71. * 通知地址
  72. */
  73. @JacksonXmlCData
  74. @JsonProperty("notify_url")
  75. private String notifyUrl;
  76. public String println(String shopKey) {
  77. return "appid=" + this.appid +
  78. "&mch_id=" + this.mchId +
  79. "&nonce_str=" + this.nonceStr +
  80. "&notify_url=" + this.notifyUrl +
  81. "&out_refund_no=" + this.outRefundNo +
  82. "&refund_fee=" + this.refundFee +
  83. "&total_fee=" + this.totalFee +
  84. "&transaction_id=" + this.transactionId +
  85. "&key=" + shopKey;
  86. }
  87. }