mirror of
https://gitee.com/binary/weixin-java-tools.git
synced 2026-03-10 00:13:40 +08:00
🎨 #2985【企业微信】增加会话存档常量类型支持
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
package com.github.binarywang.wxpay.bean.notify;
|
||||
|
||||
import com.google.gson.Gson;
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Builder;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
import me.chanjar.weixin.common.util.json.WxGsonBuilder;
|
||||
|
||||
/**
|
||||
* 微信支付订单和退款的异步通知,V3版本共用的响应类.
|
||||
@@ -33,7 +33,7 @@ public class WxPayNotifyV3Response {
|
||||
*/
|
||||
public static String success(String msg) {
|
||||
WxPayNotifyV3Response response = new WxPayNotifyV3Response(SUCCESS, msg);
|
||||
return new Gson().toJson(response);
|
||||
return WxGsonBuilder.create().toJson(response);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -44,7 +44,7 @@ public class WxPayNotifyV3Response {
|
||||
*/
|
||||
public static String fail(String msg) {
|
||||
WxPayNotifyV3Response response = new WxPayNotifyV3Response(FAIL, msg);
|
||||
return new Gson().toJson(response);
|
||||
return WxGsonBuilder.create().toJson(response);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -157,6 +157,13 @@ public abstract class BaseWxPayRequest implements Serializable {
|
||||
return yuan.multiply(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP).intValue();
|
||||
}
|
||||
|
||||
/**
|
||||
* 分转元
|
||||
*/
|
||||
public static BigDecimal fen2Yuan(BigDecimal fen) {
|
||||
return fen.divide(BigDecimal.valueOf(100)).setScale(2, BigDecimal.ROUND_HALF_UP);
|
||||
}
|
||||
|
||||
/**
|
||||
* 检查请求参数内容,包括必填参数以及特殊约束.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user