记录个示例,怕以后忘了又去找
正文接口
@ApiIgnore
@PostMapping(value = "/success", produces = MediaType.TEXT_PLAIN_VALUE)
@ResponseBody
@AppLog(title = "微信平台-支付成功回调通知", businessType = BusinessType.PAY, operatorType = OperatorType.APPLET)
public String successNotify(@RequestBody WxPayNotifyParam param) {
log.info("successNotify WxPayNotifyParam:{}", param);
return payOrderService.successNotify(param);
}
回调参数对象
@JacksonXmlRootElement(localName = "xml")
@Data
@NoArgsConstructor
@AllArgsConstructor
@ApiIgnore
public class WxPayNotifyParam {
private String appid;
private String attach;
private String bank_type;
private String fee_type;
private String is_subscribe;
private String mch_id;
private String nonce_str;
private String openid;
private Long tradeId;
private String out_trade_no;
private String result_code;
private String return_code;
private String sign;
private String time_end;
private String total_fee;
private String trade_type;
private String transaction_id;
private String cash_fee;
private String coupon_id;
private String coupon_fee;
private String coupon_count;
private String coupon_type;
}
依赖
com.fasterxml.jackson.dataformat
jackson-dataformat-xml



